zenilib: zenilib/jni/external/libvorbis/include/vorbis/vorbisfile.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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-2007 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
10 * *
11 ********************************************************************
12
13 function: stdio-based convenience library for opening/seeking/decoding
14 last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $
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 #ifndef OV_EXCLUDE_STATIC_CALLBACKS
47
48 /* a few sets of convenient callbacks, especially for use under
49 * Windows where ov_open_callbacks() should always be used instead of
50 * ov_open() to avoid problems with incompatible crt.o version linking
51 * issues. */
52
53 static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
54 if(f==NULL)return(-1);
55
56 #ifdef __MINGW32__
57 return fseeko64(f,off,whence);
58 #elif defined (_WIN32)
59 return _fseeki64(f,off,whence);
60 #else
61 return fseek(f,off,whence);
62 #endif
63 }
64
65 /* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
66 * static data. That means that every file which includes this header
67 * will get its own copy of these structs whether it uses them or
68 * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS.
69 * These static symbols are essential on platforms such as Windows on
70 * which several different versions of stdio support may be linked to
71 * by different DLLs, and we need to be certain we know which one
72 * we're using (the same one as the main application).
73 */
74
75 static ov_callbacks OV_CALLBACKS_DEFAULT = {
76 (size_t (*)(void *, size_t, size_t, void *)) fread,
77 (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
78 (int (*)(void *)) fclose,
79 (long (*)(void *)) ftell
80 };
81
82 static ov_callbacks OV_CALLBACKS_NOCLOSE = {
83 (size_t (*)(void *, size_t, size_t, void *)) fread,
84 (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
85 (int (*)(void *)) NULL,
86 (long (*)(void *)) ftell
87 };
88
89 static ov_callbacks OV_CALLBACKS_STREAMONLY = {
90 (size_t (*)(void *, size_t, size_t, void *)) fread,
91 (int (*)(void *, ogg_int64_t, int)) NULL,
92 (int (*)(void *)) fclose,
93 (long (*)(void *)) NULL
94 };
95
96 static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
97 (size_t (*)(void *, size_t, size_t, void *)) fread,
98 (int (*)(void *, ogg_int64_t, int)) NULL,
99 (int (*)(void *)) NULL,
100 (long (*)(void *)) NULL
101 };
102
103 #endif
104
105 #define NOTOPEN 0
106 #define PARTOPEN 1
107 #define OPENED 2
108 #define STREAMSET 3
109 #define INITSET 4
110
111 typedef struct OggVorbis_File {
112 void *datasource; /* Pointer to a FILE *, etc. */
113 int seekable;
114 ogg_int64_t offset;
115 ogg_int64_t end;
116 ogg_sync_state oy;
117
118 /* If the FILE handle isn't seekable (eg, a pipe), only the current
119 stream appears */
120 int links;
121 ogg_int64_t *offsets;
122 ogg_int64_t *dataoffsets;
123 long *serialnos;
124 ogg_int64_t *pcmlengths; /* overloaded to maintain binary
125 compatibility; x2 size, stores both
126 beginning and end values */
127 vorbis_info *vi;
128 vorbis_comment *vc;
129
130 /* Decoding working state local storage */
131 ogg_int64_t pcm_offset;
132 int ready_state;
133 long current_serialno;
134 int current_link;
135
136 double bittrack;
137 double samptrack;
138
139 ogg_stream_state os; /* take physical pages, weld into a logical
140 stream of packets */
141 vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
142 vorbis_block vb; /* local working space for packet->PCM decode */
143
144 ov_callbacks callbacks;
145
146 } OggVorbis_File;
147
148
149 VORBISFILE_DLL int ov_clear(OggVorbis_File *vf);
150 VORBISFILE_DLL int ov_fopen(const char *path,OggVorbis_File *vf);
151 VORBISFILE_DLL int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
152 VORBISFILE_DLL int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
153 const char *initial, long ibytes, ov_callbacks callbacks);
154
155 VORBISFILE_DLL int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
156 VORBISFILE_DLL int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
157 const char *initial, long ibytes, ov_callbacks callbacks);
158 VORBISFILE_DLL int ov_test_open(OggVorbis_File *vf);
159
160 VORBISFILE_DLL long ov_bitrate(OggVorbis_File *vf,int i);
161 VORBISFILE_DLL long ov_bitrate_instant(OggVorbis_File *vf);
162 VORBISFILE_DLL long ov_streams(OggVorbis_File *vf);
163 VORBISFILE_DLL long ov_seekable(OggVorbis_File *vf);
164 VORBISFILE_DLL long ov_serialnumber(OggVorbis_File *vf,int i);
165
166 VORBISFILE_DLL ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
167 VORBISFILE_DLL ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
168 VORBISFILE_DLL double ov_time_total(OggVorbis_File *vf,int i);
169
170 VORBISFILE_DLL int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
171 VORBISFILE_DLL int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
172 VORBISFILE_DLL int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
173 VORBISFILE_DLL int ov_time_seek(OggVorbis_File *vf,double pos);
174 VORBISFILE_DLL int ov_time_seek_page(OggVorbis_File *vf,double pos);
175
176 VORBISFILE_DLL int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
177 VORBISFILE_DLL int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
178 VORBISFILE_DLL int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
179 VORBISFILE_DLL int ov_time_seek_lap(OggVorbis_File *vf,double pos);
180 VORBISFILE_DLL int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
181
182 VORBISFILE_DLL ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
183 VORBISFILE_DLL ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
184 VORBISFILE_DLL double ov_time_tell(OggVorbis_File *vf);
185
186 VORBISFILE_DLL vorbis_info *ov_info(OggVorbis_File *vf,int link);
187 VORBISFILE_DLL vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
188
189 VORBISFILE_DLL long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
190 int *bitstream);
191 VORBISFILE_DLL long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
192 int bigendianp,int word,int sgned,int *bitstream,
193 void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
194 VORBISFILE_DLL long ov_read(OggVorbis_File *vf,char *buffer,int length,
195 int bigendianp,int word,int sgned,int *bitstream);
196 VORBISFILE_DLL int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
197
198 VORBISFILE_DLL int ov_halfrate(OggVorbis_File *vf,int flag);
199 VORBISFILE_DLL int ov_halfrate_p(OggVorbis_File *vf);
200
201 #ifdef __cplusplus
202 }
203 #endif /* __cplusplus */
204
205 #endif
206
OggVorbis_File::pcm_offset
ogg_int64_t pcm_offset
Definition: vorbisfile.h:131
ov_pcm_tell
ogg_int64_t ov_pcm_tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1756
ov_open_callbacks
int ov_open_callbacks(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
Definition: vorbisfile.c:993
ov_time_seek_lap
int ov_time_seek_lap(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:2331
OggVorbis_File::vc
vorbis_comment * vc
Definition: vorbisfile.h:128
filter
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: gl2ext.h:961
ov_test
int ov_test(FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
Definition: vorbisfile.c:1066
NULL
#define NULL
Definition: ftobjs.h:61
OggVorbis_File::callbacks
ov_callbacks callbacks
Definition: vorbisfile.h:144
OggVorbis_File::end
ogg_int64_t end
Definition: vorbisfile.h:115
f
GLclampf f
Definition: glew.h:3390
vorbis_comment
Definition: codec.h:140
ov_test_open
int ov_test_open(OggVorbis_File *vf)
Definition: vorbisfile.c:1077
ov_time_total
double ov_time_total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:1208
OggVorbis_File::offset
ogg_int64_t offset
Definition: vorbisfile.h:114
OggVorbis_File::os
ogg_stream_state os
Definition: vorbisfile.h:139
ov_seekable
long ov_seekable(OggVorbis_File *vf)
Definition: vorbisfile.c:1088
OggVorbis_File::vd
vorbis_dsp_state vd
Definition: vorbisfile.h:141
codec.h
ov_clear
int ov_clear(OggVorbis_File *vf)
Definition: vorbisfile.c:955
OggVorbis_File::links
int links
Definition: vorbisfile.h:120
OggVorbis_File::vb
vorbis_block vb
Definition: vorbisfile.h:142
OggVorbis_File::pcmlengths
ogg_int64_t * pcmlengths
Definition: vorbisfile.h:124
ov_fopen
int ov_fopen(const char *path, OggVorbis_File *vf)
Definition: vorbisfile.c:1011
path
GLsizei const GLchar *const * path
Definition: glew.h:5828
OV_CALLBACKS_STREAMONLY
static ov_callbacks OV_CALLBACKS_STREAMONLY
Definition: vorbisfile.h:89
ov_open
int ov_open(FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
Definition: vorbisfile.c:1000
ov_test_callbacks
int ov_test_callbacks(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
Definition: vorbisfile.c:1060
ov_pcm_total
ogg_int64_t ov_pcm_total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:1189
ov_pcm_seek_page
int ov_pcm_seek_page(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1404
ov_time_tell
double ov_time_tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1762
ov_halfrate_p
int ov_halfrate_p(OggVorbis_File *vf)
Definition: vorbisfile.c:1050
OggVorbis_File::bittrack
double bittrack
Definition: vorbisfile.h:136
buffer
EGLContext EGLenum EGLClientBuffer buffer
Definition: eglext.h:87
ov_raw_seek
int ov_raw_seek(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1229
ov_halfrate
int ov_halfrate(OggVorbis_File *vf, int flag)
Definition: vorbisfile.c:1025
OV_CALLBACKS_NOCLOSE
static ov_callbacks OV_CALLBACKS_NOCLOSE
Definition: vorbisfile.h:82
ov_bitrate
long ov_bitrate(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:1101
int
int
Definition: SDL_systhread.c:37
length
GLsizei GLsizei * length
Definition: gl2ext.h:792
OggVorbis_File::serialnos
long * serialnos
Definition: vorbisfile.h:123
ov_info
vorbis_info * ov_info(OggVorbis_File *vf, int link)
Definition: vorbisfile.c:1791
ov_raw_total
ogg_int64_t ov_raw_total(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:1170
OggVorbis_File::offsets
ogg_int64_t * offsets
Definition: vorbisfile.h:121
OggVorbis_File
Definition: vorbisfile.h:111
OggVorbis_File::current_link
int current_link
Definition: vorbisfile.h:134
samples
GLsizei samples
Definition: gl2ext.h:970
vorbis_block
Definition: codec.h:88
ov_read
long ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream)
Definition: vorbisfile.c:2007
ov_pcm_seek_lap
int ov_pcm_seek_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:2274
ov_bitrate_instant
long ov_bitrate_instant(OggVorbis_File *vf)
Definition: vorbisfile.c:1143
OggVorbis_File::current_serialno
long current_serialno
Definition: vorbisfile.h:133
OggVorbis_File::samptrack
double samptrack
Definition: vorbisfile.h:137
ov_raw_seek_lap
int ov_raw_seek_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:2270
OggVorbis_File::dataoffsets
ogg_int64_t * dataoffsets
Definition: vorbisfile.h:122
OggVorbis_File
struct OggVorbis_File OggVorbis_File
offset
GLintptr offset
Definition: glew.h:1668
ogg_sync_state
Definition: ogg.h:105
OV_CALLBACKS_STREAMONLY_NOCLOSE
static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE
Definition: vorbisfile.h:96
ov_callbacks
Definition: vorbisfile.h:39
ov_comment
vorbis_comment * ov_comment(OggVorbis_File *vf, int link)
Definition: vorbisfile.c:1809
OggVorbis_File::seekable
int seekable
Definition: vorbisfile.h:113
OggVorbis_File::ready_state
int ready_state
Definition: vorbisfile.h:132
OggVorbis_File::oy
ogg_sync_state oy
Definition: vorbisfile.h:116
ov_read_float
long ov_read_float(OggVorbis_File *vf, float ***pcm_channels, int samples, int *bitstream)
Definition: vorbisfile.c:2026
ov_time_seek_page_lap
int ov_time_seek_page_lap(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:2335
ogg_stream_state
Definition: ogg.h:53
ov_pcm_seek_page_lap
int ov_pcm_seek_page_lap(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:2278
ov_crosslap
int ov_crosslap(OggVorbis_File *vf1, OggVorbis_File *vf2)
Definition: vorbisfile.c:2168
OggVorbis_File::vi
vorbis_info * vi
Definition: vorbisfile.h:127
i
int i
Definition: pngrutil.c:1377
ov_raw_tell
ogg_int64_t ov_raw_tell(OggVorbis_File *vf)
Definition: vorbisfile.c:1750
ov_time_seek
int ov_time_seek(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1690
_ov_header_fseek_wrap
static int _ov_header_fseek_wrap(FILE *f, ogg_int64_t off, int whence)
Definition: vorbisfile.h:53
ov_read_filter
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)
Definition: vorbisfile.c:1869
ov_streams
long ov_streams(OggVorbis_File *vf)
Definition: vorbisfile.c:1083
OV_CALLBACKS_DEFAULT
static ov_callbacks OV_CALLBACKS_DEFAULT
Definition: vorbisfile.h:75
ov_pcm_seek
int ov_pcm_seek(OggVorbis_File *vf, ogg_int64_t pos)
Definition: vorbisfile.c:1590
ov_serialnumber
long ov_serialnumber(OggVorbis_File *vf, int i)
Definition: vorbisfile.c:1155
ogg_int64_t
long ogg_int64_t
Definition: config_types.h:23
vorbis_info
Definition: codec.h:28
OggVorbis_File::datasource
void * datasource
Definition: vorbisfile.h:112
size_t
unsigned int size_t
Definition: SDL_config_windows.h:67
vorbis_dsp_state
Definition: codec.h:59
size
GLsizei size
Definition: gl2ext.h:1467
ov_time_seek_page
int ov_time_seek_page(OggVorbis_File *vf, double pos)
Definition: vorbisfile.c:1720