zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alffmpeg.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <assert.h>
#include "AL/al.h"
#include "AL/alc.h"
#include "AL/alext.h"
#include "alhelpers.h"
#include "alffmpeg.h"

Go to the source code of this file.

Functions

void clearAVAudioData (StreamPtr stream)
 
void closeAVFile (FilePtr file)
 
voiddecodeAVAudioStream (StreamPtr stream, size_t *length)
 
uint8_tgetAVAudioData (StreamPtr stream, size_t *length)
 
int getAVAudioInfo (StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *type)
 
StreamPtr getAVAudioStream (FilePtr file, int streamnum)
 
int getAVFileInfo (FilePtr file, int *numaudiostreams)
 
static int getNextPacket (FilePtr file, int streamidx)
 
static int MemData_read (void *opaque, uint8_t *buf, int buf_size)
 
static int64_t MemData_seek (void *opaque, int64_t offset, int whence)
 
static int MemData_write (void *opaque, uint8_t *buf, int buf_size)
 
static size_t NextPowerOf2 (size_t value)
 
FilePtr openAVCustom (const char *name, void *user_data, int(*read_packet)(void *user_data, uint8_t *buf, int buf_size), int(*write_packet)(void *user_data, uint8_t *buf, int buf_size), int64_t(*seek)(void *user_data, int64_t offset, int whence))
 
FilePtr openAVData (const char *name, char *buffer, size_t buffer_len)
 
FilePtr openAVFile (const char *fname)
 
size_t readAVAudioData (StreamPtr stream, void *data, size_t length)
 

Variables

static int done_init = 0
 

Function Documentation

void clearAVAudioData ( StreamPtr  stream)

Definition at line 256 of file alffmpeg.c.

void closeAVFile ( FilePtr  file)

Definition at line 271 of file alffmpeg.c.

References free, and i.

Referenced by ClosePlayerFile(), LoadSound(), and OpenPlayerFile().

void* decodeAVAudioStream ( StreamPtr  stream,
size_t length 
)

Definition at line 611 of file alffmpeg.c.

References getAVAudioData(), memcpy, NextPowerOf2(), NULL, and realloc.

Referenced by LoadSound().

uint8_t* getAVAudioData ( StreamPtr  stream,
size_t length 
)

Definition at line 503 of file alffmpeg.c.

References getNextPacket(), memmove, memset, and NULL.

Referenced by decodeAVAudioStream(), and readAVAudioData().

int getAVAudioInfo ( StreamPtr  stream,
ALuint rate,
ALenum channels,
ALenum type 
)
StreamPtr getAVAudioStream ( FilePtr  file,
int  streamnum 
)

Definition at line 318 of file alffmpeg.c.

References calloc, file, free, i, j, NULL, and realloc.

Referenced by LoadSound(), and OpenPlayerFile().

int getAVFileInfo ( FilePtr  file,
int numaudiostreams 
)

Definition at line 303 of file alffmpeg.c.

References i.

static int getNextPacket ( FilePtr  file,
int  streamidx 
)
static

Definition at line 460 of file alffmpeg.c.

References NULL.

Referenced by getAVAudioData().

static int MemData_read ( void opaque,
uint8_t buf,
int  buf_size 
)
static

Definition at line 65 of file alffmpeg.c.

References memcpy.

Referenced by openAVData().

static int64_t MemData_seek ( void opaque,
int64_t  offset,
int  whence 
)
static

Definition at line 93 of file alffmpeg.c.

References SEEK_CUR, SEEK_END, and SEEK_SET.

Referenced by openAVData().

static int MemData_write ( void opaque,
uint8_t buf,
int  buf_size 
)
static

Definition at line 79 of file alffmpeg.c.

References memcpy.

Referenced by openAVData().

static size_t NextPowerOf2 ( size_t  value)
static

Definition at line 42 of file alffmpeg.c.

Referenced by CalcLineLength(), decodeAVAudioStream(), and EchoDeviceUpdate().

FilePtr openAVCustom ( const char *  name,
void user_data,
int(*)(void *user_data, uint8_t *buf, int buf_size)  read_packet,
int(*)(void *user_data, uint8_t *buf, int buf_size)  write_packet,
int64_t(*)(void *user_data, int64_t offset, int whence)  seek 
)

Definition at line 221 of file alffmpeg.c.

References calloc, done_init, file, free, and NULL.

FilePtr openAVData ( const char *  name,
char *  buffer,
size_t  buffer_len 
)

Definition at line 185 of file alffmpeg.c.

References calloc, done_init, file, free, MemData_read(), MemData_seek(), MemData_write(), and NULL.

FilePtr openAVFile ( const char *  fname)

Definition at line 161 of file alffmpeg.c.

References calloc, done_init, file, free, and NULL.

Referenced by LoadSound(), and OpenPlayerFile().

size_t readAVAudioData ( StreamPtr  stream,
void data,
size_t  length 
)

Definition at line 567 of file alffmpeg.c.

References getAVAudioData(), memcpy, and NULL.

Referenced by StartPlayer(), and UpdatePlayer().

Variable Documentation

int done_init = 0
static

Definition at line 159 of file alffmpeg.c.

Referenced by openAVCustom(), openAVData(), and openAVFile().