doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vorbisfile.h
Go to the documentation of this file.
1 /********************************************************************
2  * *
3  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7  * *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9  * by the XIPHOPHORUS Company http://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function: stdio-based convenience library for opening/seeking/decoding
14  last mod: $Id: vorbisfile.h,v 1.20 2003/08/18 05:34:01 xiphmont Exp $
15 
16  ********************************************************************/
17 
18 #ifndef _OV_FILE_H_
19 #define _OV_FILE_H_
20 
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif /* __cplusplus */
25 
26 #include <stdio.h>
27 #include "codec.h"
28 
29 /* The function prototypes for the callbacks are basically the same as for
30  * the stdio functions fread, fseek, fclose, ftell.
31  * The one difference is that the FILE * arguments have been replaced with
32  * a void * - this is to be used as a pointer to whatever internal data these
33  * functions might need. In the stdio case, it's just a FILE * cast to a void *
34  *
35  * If you use other functions, check the docs for these functions and return
36  * the right values. For seek_func(), you *MUST* return -1 if the stream is
37  * unseekable
38  */
39 typedef struct {
40  size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
41  int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
42  int (*close_func) (void *datasource);
43  long (*tell_func) (void *datasource);
44 } ov_callbacks;
45 
46 #define NOTOPEN 0
47 #define PARTOPEN 1
48 #define OPENED 2
49 #define STREAMSET 3
50 #define INITSET 4
51 
52 typedef struct OggVorbis_File {
53  void *datasource; /* Pointer to a FILE *, etc. */
54  int seekable;
58 
59  /* If the FILE handle isn't seekable (eg, a pipe), only the current
60  stream appears */
61  int links;
64  long *serialnos;
65  ogg_int64_t *pcmlengths; /* overloaded to maintain binary
66  compatability; x2 size, stores both
67  beginning and end values */
70 
71  /* Decoding working state local storage */
76 
77  double bittrack;
78  double samptrack;
79 
80  ogg_stream_state os; /* take physical pages, weld into a logical
81  stream of packets */
82  vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
83  vorbis_block vb; /* local working space for packet->PCM decode */
84 
86 
87  int stream;
89 
90 extern int ov_clear(OggVorbis_File *vf);
91 extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
92 extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
93  char *initial, long ibytes, ov_callbacks callbacks);
94 
95 extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
96 extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
97  char *initial, long ibytes, ov_callbacks callbacks);
98 extern int ov_test_open(OggVorbis_File *vf);
99 
100 extern long ov_bitrate(OggVorbis_File *vf,int i);
101 extern long ov_bitrate_instant(OggVorbis_File *vf);
102 extern long ov_streams(OggVorbis_File *vf);
103 extern long ov_seekable(OggVorbis_File *vf);
104 extern long ov_serialnumber(OggVorbis_File *vf,int i);
105 
106 extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
107 extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
108 extern double ov_TIME_Total(OggVorbis_File *vf,int i);
109 
110 extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
111 extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
112 extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
113 extern int ov_time_seek(OggVorbis_File *vf,double pos);
114 extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
115 
116 extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
117 extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
119 extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
120 extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
121 
124 extern double ov_TIME_Tell(OggVorbis_File *vf);
125 
126 extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
127 extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
128 
129 extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
130  int *bitstream);
131 extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
132  int bigendianp,int word,int sgned,int *bitstream);
133 extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
134 
135 extern int ov_halfrate(OggVorbis_File *vf,int flag);
136 extern int ov_halfrate_p(OggVorbis_File *vf);
137 
138 #ifdef __cplusplus
139 }
140 #endif /* __cplusplus */
141 
142 #endif
143 
144 
ogg_int64_t pcm_offset
Definition: vorbisfile.h:72
ogg_int64_t ov_pcm_tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1419
int ov_time_seek_lap(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1975
vorbis_comment * vc
Definition: vorbisfile.h:69
ov_callbacks callbacks
Definition: vorbisfile.h:85
ogg_int64_t end
Definition: vorbisfile.h:56
double ov_TIME_Tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1425
int ov_test_open(OggVorbis_File *vf)
Definition: vorbisfile.c:797
int ov_test_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks)
Definition: vorbisfile.c:780
case const int
Definition: Callbacks.cpp:52
int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks)
Definition: vorbisfile.c:729
int ov_test(FILE *f, OggVorbis_File *vf, char *initial, long ibytes)
Definition: vorbisfile.c:786
ogg_int64_t offset
Definition: vorbisfile.h:55
ogg_stream_state os
Definition: vorbisfile.h:80
long ov_seekable(OggVorbis_File *vf)
Definition: vorbisfile.c:808
vorbis_dsp_state vd
Definition: vorbisfile.h:82
int ov_clear(OggVorbis_File *vf)
Definition: vorbisfile.c:692
vorbis_block vb
Definition: vorbisfile.h:83
double ov_TIME_Total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:928
int i
Definition: process.py:33
GLintptr offset
Definition: glext.h:3113
ogg_int64_t * pcmlengths
Definition: vorbisfile.h:65
ogg_int64_t ov_pcm_total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:909
int ov_pcm_seek_page(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1094
int ov_halfrate_p(OggVorbis_File *vf)
Definition: vorbisfile.c:770
double bittrack
Definition: vorbisfile.h:77
int ov_raw_seek(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:949
int ov_halfrate(OggVorbis_File *vf, int flag)
Definition: vorbisfile.c:750
long ov_bitrate(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:821
long * serialnos
Definition: vorbisfile.h:64
vorbis_info * ov_info(OggVorbis_File *vf, int link)
Definition: vorbisfile.c:1454
ogg_int64_t ov_raw_total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:890
ogg_int64_t * offsets
Definition: vorbisfile.h:62
GLuint buffer
Definition: glext.h:3108
long ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream)
Definition: vorbisfile.c:1527
int ov_pcm_seek_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1918
long ov_bitrate_instant(OggVorbis_File *vf)
Definition: vorbisfile.c:863
long current_serialno
Definition: vorbisfile.h:74
double samptrack
Definition: vorbisfile.h:78
int ov_raw_seek_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1914
ogg_int64_t * dataoffsets
Definition: vorbisfile.h:63
struct OggVorbis_File OggVorbis_File
tuple f
Definition: idal.py:89
unsigned short word
Definition: Lib.h:76
vorbis_comment * ov_comment(OggVorbis_File *vf, int link)
Definition: vorbisfile.c:1472
GLsizeiptr size
Definition: glext.h:3112
ogg_sync_state oy
Definition: vorbisfile.h:57
GLsizei const GLcharARB const GLint * length
Definition: glext.h:3599
long ov_read_float(OggVorbis_File *vf, float ***pcm_channels, int samples, int *bitstream)
Definition: vorbisfile.c:1672
int ov_time_seek_page_lap(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1979
int ov_open(FILE *f, OggVorbis_File *vf, char *initial, long ibytes)
Definition: vorbisfile.c:736
int ov_pcm_seek_page_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1922
int ov_crosslap(OggVorbis_File *vf1, OggVorbis_File *vf2)
Definition: vorbisfile.c:1815
vorbis_info * vi
Definition: vorbisfile.h:68
ogg_int64_t ov_raw_tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1413
int ov_time_seek(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1359
int64_t ogg_int64_t
Definition: os_types.h:140
long ov_streams(OggVorbis_File *vf)
Definition: vorbisfile.c:803
int ov_pcm_seek(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1265
long ov_serialnumber(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:875
void * datasource
Definition: vorbisfile.h:53
int ov_time_seek_page(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1386