zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vorbisfile.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
#include "os.h"
#include "misc.h"

Go to the source code of this file.

Macros

#define CHUNKSIZE   65536 /* greater-than-page-size granularity seeking */
 
#define OV_EXCLUDE_STATIC_CALLBACKS
 
#define READSIZE   2048 /* a smaller read size is needed for low-rate streaming. */
 

Functions

static void _add_serialno (ogg_page *og, long **serialno_list, int *n)
 
static int _bisect_forward_serialno (OggVorbis_File *vf, ogg_int64_t begin, ogg_int64_t searched, ogg_int64_t end, ogg_int64_t endgran, int endserial, long *currentno_list, int currentnos, long m)
 
static void _decode_clear (OggVorbis_File *vf)
 
static int _fetch_and_process_packet (OggVorbis_File *vf, ogg_packet *op_in, int readp, int spanp)
 
static int _fetch_headers (OggVorbis_File *vf, vorbis_info *vi, vorbis_comment *vc, long **serialno_list, int *serialno_n, ogg_page *og_ptr)
 
static int _fseek64_wrap (FILE *f, ogg_int64_t off, int whence)
 
static long _get_data (OggVorbis_File *vf)
 
static ogg_int64_t _get_next_page (OggVorbis_File *vf, ogg_page *og, ogg_int64_t boundary)
 
static ogg_int64_t _get_prev_page (OggVorbis_File *vf, ogg_page *og)
 
static ogg_int64_t _get_prev_page_serial (OggVorbis_File *vf, long *serial_list, int serial_n, int *serialno, ogg_int64_t *granpos)
 
static ogg_int64_t _initial_pcmoffset (OggVorbis_File *vf, vorbis_info *vi)
 
static int _lookup_page_serialno (ogg_page *og, long *serialno_list, int n)
 
static int _lookup_serialno (long s, long *serialno_list, int n)
 
static int _make_decode_ready (OggVorbis_File *vf)
 
static int _open_seekable2 (OggVorbis_File *vf)
 
static int _ov_64_seek_lap (OggVorbis_File *vf, ogg_int64_t pos, int(*localseek)(OggVorbis_File *, ogg_int64_t))
 
static int _ov_d_seek_lap (OggVorbis_File *vf, double pos, int(*localseek)(OggVorbis_File *, double))
 
static void _ov_getlap (OggVorbis_File *vf, vorbis_info *vi, vorbis_dsp_state *vd, float **lappcm, int lapsize)
 
static int _ov_initprime (OggVorbis_File *vf)
 
static int _ov_initset (OggVorbis_File *vf)
 
static int _ov_open1 (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
 
static int _ov_open2 (OggVorbis_File *vf)
 
static void _ov_splice (float **pcm, float **lappcm, int n1, int n2, int ch1, int ch2, float *w1, float *w2)
 
static int _seek_helper (OggVorbis_File *vf, ogg_int64_t offset)
 
static int host_is_big_endian ()
 
long ov_bitrate (OggVorbis_File *vf, int i)
 
long ov_bitrate_instant (OggVorbis_File *vf)
 
int ov_clear (OggVorbis_File *vf)
 
vorbis_commentov_comment (OggVorbis_File *vf, int link)
 
int ov_crosslap (OggVorbis_File *vf1, OggVorbis_File *vf2)
 
int ov_fopen (const char *path, OggVorbis_File *vf)
 
int ov_halfrate (OggVorbis_File *vf, int flag)
 
int ov_halfrate_p (OggVorbis_File *vf)
 
vorbis_infoov_info (OggVorbis_File *vf, int link)
 
int ov_open (FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
 
int ov_open_callbacks (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
 
int ov_pcm_seek (OggVorbis_File *vf, ogg_int64_t pos)
 
int ov_pcm_seek_lap (OggVorbis_File *vf, ogg_int64_t pos)
 
int ov_pcm_seek_page (OggVorbis_File *vf, ogg_int64_t pos)
 
int ov_pcm_seek_page_lap (OggVorbis_File *vf, ogg_int64_t pos)
 
ogg_int64_t ov_pcm_tell (OggVorbis_File *vf)
 
ogg_int64_t ov_pcm_total (OggVorbis_File *vf, int i)
 
int ov_raw_seek (OggVorbis_File *vf, ogg_int64_t pos)
 
int ov_raw_seek_lap (OggVorbis_File *vf, ogg_int64_t pos)
 
ogg_int64_t ov_raw_tell (OggVorbis_File *vf)
 
ogg_int64_t ov_raw_total (OggVorbis_File *vf, int i)
 
long ov_read (OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream)
 
long ov_read_filter (OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream, void(*filter)(float **pcm, long channels, long samples, void *filter_param), void *filter_param)
 
long ov_read_float (OggVorbis_File *vf, float ***pcm_channels, int length, int *bitstream)
 
long ov_seekable (OggVorbis_File *vf)
 
long ov_serialnumber (OggVorbis_File *vf, int i)
 
long ov_streams (OggVorbis_File *vf)
 
int ov_test (FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
 
int ov_test_callbacks (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
 
int ov_test_open (OggVorbis_File *vf)
 
int ov_time_seek (OggVorbis_File *vf, double seconds)
 
int ov_time_seek_lap (OggVorbis_File *vf, double pos)
 
int ov_time_seek_page (OggVorbis_File *vf, double seconds)
 
int ov_time_seek_page_lap (OggVorbis_File *vf, double pos)
 
double ov_time_tell (OggVorbis_File *vf)
 
double ov_time_total (OggVorbis_File *vf, int i)
 
float * vorbis_window (vorbis_dsp_state *v, int W)
 

Macro Definition Documentation

#define CHUNKSIZE   65536 /* greater-than-page-size granularity seeking */
#define OV_EXCLUDE_STATIC_CALLBACKS

Definition at line 27 of file vorbisfile.c.

#define READSIZE   2048 /* a smaller read size is needed for low-rate streaming. */

Definition at line 65 of file vorbisfile.c.

Referenced by _get_data().

Function Documentation

static void _add_serialno ( ogg_page og,
long **  serialno_list,
int n 
)
static

Definition at line 188 of file vorbisfile.c.

References _ogg_malloc, _ogg_realloc, and ogg_page_serialno().

Referenced by _fetch_headers().

static int _fseek64_wrap ( FILE *  f,
ogg_int64_t  off,
int  whence 
)
static

Definition at line 873 of file vorbisfile.c.

References NULL.

Referenced by ov_open(), and ov_test().

static ogg_int64_t _get_prev_page ( OggVorbis_File vf,
ogg_page og 
)
static
static ogg_int64_t _get_prev_page_serial ( OggVorbis_File vf,
long *  serial_list,
int  serial_n,
int serialno,
ogg_int64_t granpos 
)
static
static int _lookup_page_serialno ( ogg_page og,
long *  serialno_list,
int  n 
)
static

Definition at line 212 of file vorbisfile.c.

References _lookup_serialno(), and ogg_page_serialno().

Referenced by _bisect_forward_serialno(), and _fetch_headers().

static int _lookup_serialno ( long  s,
long *  serialno_list,
int  n 
)
static
static int _ov_initset ( OggVorbis_File vf)
static
static void _ov_splice ( float **  pcm,
float **  lappcm,
int  n1,
int  n2,
int  ch1,
int  ch2,
float *  w1,
float *  w2 
)
static

Definition at line 2059 of file vorbisfile.c.

References d, i, and j.

Referenced by _ov_64_seek_lap(), _ov_d_seek_lap(), and ov_crosslap().

static int host_is_big_endian ( )
static

Definition at line 1826 of file vorbisfile.c.

Referenced by ov_read_filter().

int ov_fopen ( const char *  path,
OggVorbis_File vf 
)

Definition at line 1011 of file vorbisfile.c.

References NULL, ov_open(), and ret.

Referenced by Zeni::Sound_Buffer::load_ogg_vorbis(), and Zeni::Sound_Stream_AL::Sound_Stream_AL().

int ov_halfrate_p ( OggVorbis_File vf)
int ov_open ( FILE *  f,
OggVorbis_File vf,
const char *  initial,
long  ibytes 
)

Definition at line 1000 of file vorbisfile.c.

References _fseek64_wrap(), int, and ov_open_callbacks().

Referenced by ov_fopen().

int ov_open_callbacks ( void f,
OggVorbis_File vf,
const char *  initial,
long  ibytes,
ov_callbacks  callbacks 
)

Definition at line 993 of file vorbisfile.c.

References _ov_open1(), _ov_open2(), and ret.

Referenced by ov_open().

int ov_pcm_seek_lap ( OggVorbis_File vf,
ogg_int64_t  pos 
)

Definition at line 2274 of file vorbisfile.c.

References _ov_64_seek_lap(), and ov_pcm_seek().

int ov_pcm_seek_page_lap ( OggVorbis_File vf,
ogg_int64_t  pos 
)

Definition at line 2278 of file vorbisfile.c.

References _ov_64_seek_lap(), and ov_pcm_seek_page().

ogg_int64_t ov_pcm_tell ( OggVorbis_File vf)
int ov_raw_seek_lap ( OggVorbis_File vf,
ogg_int64_t  pos 
)

Definition at line 2270 of file vorbisfile.c.

References _ov_64_seek_lap(), and ov_raw_seek().

ogg_int64_t ov_raw_tell ( OggVorbis_File vf)

Definition at line 1750 of file vorbisfile.c.

References OggVorbis_File::offset, OPENED, OV_EINVAL, and OggVorbis_File::ready_state.

long ov_read ( OggVorbis_File vf,
char *  buffer,
int  length,
int  bigendianp,
int  word,
int  sgned,
int bitstream 
)

Definition at line 2007 of file vorbisfile.c.

References NULL, and ov_read_filter().

Referenced by Zeni::Sound_Buffer::load_ogg_vorbis().

long ov_read_filter ( OggVorbis_File vf,
char *  buffer,
int  length,
int  bigendianp,
int  word,
int  sgned,
int bitstream,
void(*)(float **pcm, long channels, long samples, void *filter_param)  filter,
void filter_param 
)
long ov_seekable ( OggVorbis_File vf)

Definition at line 1088 of file vorbisfile.c.

References OggVorbis_File::seekable.

long ov_serialnumber ( OggVorbis_File vf,
int  i 
)
long ov_streams ( OggVorbis_File vf)

Definition at line 1083 of file vorbisfile.c.

References OggVorbis_File::links.

int ov_test ( FILE *  f,
OggVorbis_File vf,
const char *  initial,
long  ibytes 
)

Definition at line 1066 of file vorbisfile.c.

References _fseek64_wrap(), int, and ov_test_callbacks().

int ov_test_callbacks ( void f,
OggVorbis_File vf,
const char *  initial,
long  ibytes,
ov_callbacks  callbacks 
)

Definition at line 1060 of file vorbisfile.c.

References _ov_open1().

Referenced by ov_test().

int ov_test_open ( OggVorbis_File vf)

Definition at line 1077 of file vorbisfile.c.

References _ov_open2(), OV_EINVAL, PARTOPEN, and OggVorbis_File::ready_state.

int ov_time_seek_lap ( OggVorbis_File vf,
double  pos 
)

Definition at line 2331 of file vorbisfile.c.

References _ov_d_seek_lap(), and ov_time_seek().

int ov_time_seek_page_lap ( OggVorbis_File vf,
double  pos 
)

Definition at line 2335 of file vorbisfile.c.

References _ov_d_seek_lap(), and ov_time_seek_page().