zenilib: zenilib/jni/external/libogg/include/ogg/ogg.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
ogg.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: toplevel libogg include
14 last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $
15
16 ********************************************************************/
17 #ifndef _OGG_H
18 #define _OGG_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include <stddef.h>
25 #include <ogg/os_types.h>
26
27 typedef struct {
28 void *iov_base;
29 size_t iov_len;
30 } ogg_iovec_t;
31
32 typedef struct {
33 long endbyte;
34 int endbit;
35
36 unsigned char *buffer;
37 unsigned char *ptr;
38 long storage;
39 } oggpack_buffer;
40
41 /* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
42
43 typedef struct {
44 unsigned char *header;
45 long header_len;
46 unsigned char *body;
47 long body_len;
48 } ogg_page;
49
50 /* ogg_stream_state contains the current encode/decode state of a logical
51 Ogg bitstream **********************************************************/
52
53 typedef struct {
54 unsigned char *body_data; /* bytes from packet bodies */
55 long body_storage; /* storage elements allocated */
56 long body_fill; /* elements stored; fill mark */
57 long body_returned; /* elements of fill returned */
58
59
60 int *lacing_vals; /* The values that will go to the segment table */
61 ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
62 this way, but it is simple coupled to the
63 lacing fifo */
64 long lacing_storage;
65 long lacing_fill;
66 long lacing_packet;
67 long lacing_returned;
68
69 unsigned char header[282]; /* working space for header encode */
70 int header_fill;
71
72 int e_o_s; /* set when we have buffered the last packet in the
73 logical bitstream */
74 int b_o_s; /* set after we've written the initial page
75 of a logical bitstream */
76 long serialno;
77 long pageno;
78 ogg_int64_t packetno; /* sequence number for decode; the framing
79 knows where there's a hole in the data,
80 but we need coupling so that the codec
81 (which is in a separate abstraction
82 layer) also knows about the gap */
83 ogg_int64_t granulepos;
84
85 } ogg_stream_state;
86
87 /* ogg_packet is used to encapsulate the data and metadata belonging
88 to a single raw Ogg/Vorbis packet *************************************/
89
90 typedef struct {
91 unsigned char *packet;
92 long bytes;
93 long b_o_s;
94 long e_o_s;
95
96 ogg_int64_t granulepos;
97
98 ogg_int64_t packetno; /* sequence number for decode; the framing
99 knows where there's a hole in the data,
100 but we need coupling so that the codec
101 (which is in a separate abstraction
102 layer) also knows about the gap */
103 } ogg_packet;
104
105 typedef struct {
106 unsigned char *data;
107 int storage;
108 int fill;
109 int returned;
110
111 int unsynced;
112 int headerbytes;
113 int bodybytes;
114 } ogg_sync_state;
115
116 /* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
117
118 OGG_DLL extern void oggpack_writeinit(oggpack_buffer *b);
119 OGG_DLL extern int oggpack_writecheck(oggpack_buffer *b);
120 OGG_DLL extern void oggpack_writetrunc(oggpack_buffer *b,long bits);
121 OGG_DLL extern void oggpack_writealign(oggpack_buffer *b);
122 OGG_DLL extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
123 OGG_DLL extern void oggpack_reset(oggpack_buffer *b);
124 OGG_DLL extern void oggpack_writeclear(oggpack_buffer *b);
125 OGG_DLL extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
126 OGG_DLL extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
127 OGG_DLL extern long oggpack_look(oggpack_buffer *b,int bits);
128 OGG_DLL extern long oggpack_look1(oggpack_buffer *b);
129 OGG_DLL extern void oggpack_adv(oggpack_buffer *b,int bits);
130 OGG_DLL extern void oggpack_adv1(oggpack_buffer *b);
131 OGG_DLL extern long oggpack_read(oggpack_buffer *b,int bits);
132 OGG_DLL extern long oggpack_read1(oggpack_buffer *b);
133 OGG_DLL extern long oggpack_bytes(oggpack_buffer *b);
134 OGG_DLL extern long oggpack_bits(oggpack_buffer *b);
135 OGG_DLL extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
136
137 OGG_DLL extern void oggpackB_writeinit(oggpack_buffer *b);
138 OGG_DLL extern int oggpackB_writecheck(oggpack_buffer *b);
139 OGG_DLL extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);
140 OGG_DLL extern void oggpackB_writealign(oggpack_buffer *b);
141 OGG_DLL extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
142 OGG_DLL extern void oggpackB_reset(oggpack_buffer *b);
143 OGG_DLL extern void oggpackB_writeclear(oggpack_buffer *b);
144 OGG_DLL extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
145 OGG_DLL extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
146 OGG_DLL extern long oggpackB_look(oggpack_buffer *b,int bits);
147 OGG_DLL extern long oggpackB_look1(oggpack_buffer *b);
148 OGG_DLL extern void oggpackB_adv(oggpack_buffer *b,int bits);
149 OGG_DLL extern void oggpackB_adv1(oggpack_buffer *b);
150 OGG_DLL extern long oggpackB_read(oggpack_buffer *b,int bits);
151 OGG_DLL extern long oggpackB_read1(oggpack_buffer *b);
152 OGG_DLL extern long oggpackB_bytes(oggpack_buffer *b);
153 OGG_DLL extern long oggpackB_bits(oggpack_buffer *b);
154 OGG_DLL extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
155
156 /* Ogg BITSTREAM PRIMITIVES: encoding **************************/
157
158 OGG_DLL extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
159 OGG_DLL extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
160 int count, long e_o_s, ogg_int64_t granulepos);
161 OGG_DLL extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
162 OGG_DLL extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
163 OGG_DLL extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
164 OGG_DLL extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
165
166 /* Ogg BITSTREAM PRIMITIVES: decoding **************************/
167
168 OGG_DLL extern int ogg_sync_init(ogg_sync_state *oy);
169 OGG_DLL extern int ogg_sync_clear(ogg_sync_state *oy);
170 OGG_DLL extern int ogg_sync_reset(ogg_sync_state *oy);
171 OGG_DLL extern int ogg_sync_destroy(ogg_sync_state *oy);
172 OGG_DLL extern int ogg_sync_check(ogg_sync_state *oy);
173
174 OGG_DLL extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
175 OGG_DLL extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
176 OGG_DLL extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
177 OGG_DLL extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
178 OGG_DLL extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
179 OGG_DLL extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
180 OGG_DLL extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
181
182 /* Ogg BITSTREAM PRIMITIVES: general ***************************/
183
184 OGG_DLL extern int ogg_stream_init(ogg_stream_state *os,int serialno);
185 OGG_DLL extern int ogg_stream_clear(ogg_stream_state *os);
186 OGG_DLL extern int ogg_stream_reset(ogg_stream_state *os);
187 OGG_DLL extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
188 OGG_DLL extern int ogg_stream_destroy(ogg_stream_state *os);
189 OGG_DLL extern int ogg_stream_check(ogg_stream_state *os);
190 OGG_DLL extern int ogg_stream_eos(ogg_stream_state *os);
191
192 OGG_DLL extern void ogg_page_checksum_set(ogg_page *og);
193
194 OGG_DLL extern int ogg_page_version(const ogg_page *og);
195 OGG_DLL extern int ogg_page_continued(const ogg_page *og);
196 OGG_DLL extern int ogg_page_bos(const ogg_page *og);
197 OGG_DLL extern int ogg_page_eos(const ogg_page *og);
198 OGG_DLL extern ogg_int64_t ogg_page_granulepos(const ogg_page *og);
199 OGG_DLL extern int ogg_page_serialno(const ogg_page *og);
200 OGG_DLL extern long ogg_page_pageno(const ogg_page *og);
201 OGG_DLL extern int ogg_page_packets(const ogg_page *og);
202
203 OGG_DLL extern void ogg_packet_clear(ogg_packet *op);
204
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210 #endif /* _OGG_H */
ogg_iovec_t::iov_len
size_t iov_len
Definition: ogg.h:29
ogg_page_eos
int ogg_page_eos(const ogg_page *og)
Definition: framing.c:41
oggpack_buffer::ptr
unsigned char * ptr
Definition: ogg.h:37
ogg_stream_state::lacing_storage
long lacing_storage
Definition: ogg.h:64
ogg_stream_state::b_o_s
int b_o_s
Definition: ogg.h:74
ogg_sync_state::fill
int fill
Definition: ogg.h:108
oggpackB_bits
long oggpackB_bits(oggpack_buffer *b)
Definition: bitwise.c:511
header
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid character code cannot render this glyph format invalid composite glyph invalid pixel size invalid library handle invalid face handle invalid glyph slot handle invalid cache manager handle too many modules out of memory cannot open stream invalid stream skip invalid stream operation nested frame access raster uninitialized raster overflow too many registered caches too few arguments code overflow division by zero found debug opcode nested DEFS execution context too long too many instruction definitions horizontal header(hhea) table missing" ) FT_ERRORDEF_( Locations_Missing
ogg_page
Definition: ogg.h:43
ogg_stream_flush
int ogg_stream_flush(ogg_stream_state *os, ogg_page *og)
Definition: framing.c:517
ogg_stream_check
int ogg_stream_check(ogg_stream_state *os)
Definition: framing.c:211
ogg_page::body
unsigned char * body
Definition: ogg.h:46
oggpack_bits
long oggpack_bits(oggpack_buffer *b)
Definition: bitwise.c:503
oggpack_look
long oggpack_look(oggpack_buffer *b, int bits)
Definition: bitwise.c:266
ogg_stream_state::body_fill
long body_fill
Definition: ogg.h:56
oggpackB_writeclear
void oggpackB_writeclear(oggpack_buffer *b)
Definition: bitwise.c:251
oggpackB_get_buffer
unsigned char * oggpackB_get_buffer(oggpack_buffer *b)
Definition: bitwise.c:519
ogg_stream_state::lacing_fill
long lacing_fill
Definition: ogg.h:65
ogg_packet
Definition: ogg.h:90
ogg_sync_state::data
unsigned char * data
Definition: ogg.h:106
oggpack_buffer::storage
long storage
Definition: ogg.h:38
ogg_stream_state::body_data
unsigned char * body_data
Definition: ogg.h:54
oggpackB_read
long oggpackB_read(oggpack_buffer *b, int bits)
Definition: bitwise.c:415
oggpackB_writecopy
void oggpackB_writecopy(oggpack_buffer *b, void *source, long bits)
Definition: bitwise.c:231
ogg_stream_flush_fill
int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill)
Definition: framing.c:525
ogg_page::header_len
long header_len
Definition: ogg.h:45
ogg_stream_state::body_returned
long body_returned
Definition: ogg.h:57
oggpack_write
void oggpack_write(oggpack_buffer *b, unsigned long value, int bits)
Definition: bitwise.c:83
oggpackB_writecheck
int oggpackB_writecheck(oggpack_buffer *b)
Definition: bitwise.c:56
oggpackB_bytes
long oggpackB_bytes(oggpack_buffer *b)
Definition: bitwise.c:507
ogg_sync_wrote
int ogg_sync_wrote(ogg_sync_state *oy, long bytes)
Definition: framing.c:642
oggpack_look1
long oggpack_look1(oggpack_buffer *b)
Definition: bitwise.c:328
ogg_sync_state::bodybytes
int bodybytes
Definition: ogg.h:113
ogg_stream_pageout_fill
int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill)
Definition: framing.c:548
oggpackB_adv1
void oggpackB_adv1(oggpack_buffer *b)
Definition: bitwise.c:366
ogg_sync_state::unsynced
int unsynced
Definition: ogg.h:111
ogg_stream_eos
int ogg_stream_eos(ogg_stream_state *os)
Definition: framing.c:559
ogg_stream_state::granule_vals
ogg_int64_t * granule_vals
Definition: ogg.h:61
oggpack_writetrunc
void oggpack_writetrunc(oggpack_buffer *b, long bits)
Definition: bitwise.c:60
oggpack_writecopy
void oggpack_writecopy(oggpack_buffer *b, void *source, long bits)
Definition: bitwise.c:227
ogg_sync_pageout
int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og)
Definition: framing.c:757
ogg_stream_state::serialno
long serialno
Definition: ogg.h:76
oggpackB_reset
void oggpackB_reset(oggpack_buffer *b)
Definition: bitwise.c:242
oggpackB_write
void oggpackB_write(oggpack_buffer *b, unsigned long value, int bits)
Definition: bitwise.c:126
oggpack_adv
void oggpack_adv(oggpack_buffer *b, int bits)
Definition: bitwise.c:338
oggpack_buffer::endbit
int endbit
Definition: ogg.h:34
ogg_sync_buffer
char * ogg_sync_buffer(ogg_sync_state *oy, long size)
Definition: framing.c:610
ogg_sync_reset
int ogg_sync_reset(ogg_sync_state *oy)
Definition: framing.c:919
ogg_page_continued
int ogg_page_continued(const ogg_page *og)
Definition: framing.c:33
oggpackB_writetrunc
void oggpackB_writetrunc(oggpack_buffer *b, long bits)
Definition: bitwise.c:71
oggpackB_look
long oggpackB_look(oggpack_buffer *b, int bits)
Definition: bitwise.c:298
ogg_stream_state::pageno
long pageno
Definition: ogg.h:77
ogg_sync_state::storage
int storage
Definition: ogg.h:107
ogg_packet::bytes
long bytes
Definition: ogg.h:92
oggpackB_adv
void oggpackB_adv(oggpack_buffer *b, int bits)
Definition: bitwise.c:354
ogg_stream_state::lacing_vals
int * lacing_vals
Definition: ogg.h:60
oggpackB_look1
long oggpackB_look1(oggpack_buffer *b)
Definition: bitwise.c:333
ogg_stream_packetpeek
int ogg_stream_packetpeek(ogg_stream_state *os, ogg_packet *op)
Definition: framing.c:1017
ogg_stream_packetin
int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op)
Definition: framing.c:362
count
GLint GLsizei count
Definition: gl2ext.h:1011
ogg_stream_pagein
int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og)
Definition: framing.c:790
bits
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: SDL_opengl.h:10449
ogg_iovec_t
Definition: ogg.h:27
ogg_packet::packet
unsigned char * packet
Definition: ogg.h:91
ogg_page_bos
int ogg_page_bos(const ogg_page *og)
Definition: framing.c:37
ogg_packet_clear
void ogg_packet_clear(ogg_packet *op)
Definition: framing.c:1022
ogg_page_checksum_set
void ogg_page_checksum_set(ogg_page *og)
Definition: framing.c:280
oggpackB_read1
long oggpackB_read1(oggpack_buffer *b)
Definition: bitwise.c:478
ogg_sync_check
int ogg_sync_check(ogg_sync_state *oy)
Definition: framing.c:605
oggpack_adv1
void oggpack_adv1(oggpack_buffer *b)
Definition: bitwise.c:358
ogg_stream_pageout
int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og)
Definition: framing.c:533
oggpack_buffer
Definition: ogg.h:32
oggpack_readinit
void oggpack_readinit(oggpack_buffer *b, unsigned char *buf, int bytes)
Definition: bitwise.c:255
ogg_sync_clear
int ogg_sync_clear(ogg_sync_state *oy)
Definition: framing.c:589
oggpack_buffer::endbyte
long endbyte
Definition: ogg.h:33
ogg_sync_destroy
int ogg_sync_destroy(ogg_sync_state *oy)
Definition: framing.c:597
ogg_page::header
unsigned char * header
Definition: ogg.h:44
ogg_packet::b_o_s
long b_o_s
Definition: ogg.h:93
ogg_page_pageno
long ogg_page_pageno(const ogg_page *og)
Definition: framing.c:65
ogg_stream_clear
int ogg_stream_clear(ogg_stream_state *os)
Definition: framing.c:217
ogg_stream_iovecin
int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, int count, long e_o_s, ogg_int64_t granulepos)
Definition: framing.c:304
ogg_stream_state::lacing_returned
long lacing_returned
Definition: ogg.h:67
os_types.h
value
EGLSurface EGLint void ** value
Definition: eglext.h:301
ogg_page_packets
int ogg_page_packets(const ogg_page *og)
Definition: framing.c:91
ogg_sync_pageseek
long ogg_sync_pageseek(ogg_sync_state *oy, ogg_page *og)
Definition: framing.c:659
ogg_sync_state
Definition: ogg.h:105
ogg_stream_state::packetno
ogg_int64_t packetno
Definition: ogg.h:78
buf
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2539
ogg_stream_destroy
int ogg_stream_destroy(ogg_stream_state *os)
Definition: framing.c:228
oggpack_writecheck
int oggpack_writecheck(oggpack_buffer *b)
Definition: bitwise.c:51
oggpack_writeinit
void oggpack_writeinit(oggpack_buffer *b)
Definition: bitwise.c:40
oggpack_bytes
long oggpack_bytes(oggpack_buffer *b)
Definition: bitwise.c:499
ogg_packet::granulepos
ogg_int64_t granulepos
Definition: ogg.h:96
ogg_stream_packetout
int ogg_stream_packetout(ogg_stream_state *os, ogg_packet *op)
Definition: framing.c:1012
oggpack_reset
void oggpack_reset(oggpack_buffer *b)
Definition: bitwise.c:235
b
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
oggpack_get_buffer
unsigned char * oggpack_get_buffer(oggpack_buffer *b)
Definition: bitwise.c:515
ogg_stream_state
Definition: ogg.h:53
ogg_stream_reset
int ogg_stream_reset(ogg_stream_state *os)
Definition: framing.c:930
ogg_sync_init
int ogg_sync_init(ogg_sync_state *oy)
Definition: framing.c:580
ogg_stream_state::e_o_s
int e_o_s
Definition: ogg.h:72
ogg_sync_state::returned
int returned
Definition: ogg.h:109
ogg_stream_state::header_fill
int header_fill
Definition: ogg.h:70
oggpackB_writeinit
void oggpackB_writeinit(oggpack_buffer *b)
Definition: bitwise.c:47
ogg_stream_reset_serialno
int ogg_stream_reset_serialno(ogg_stream_state *os, int serialno)
Definition: framing.c:951
oggpack_writealign
void oggpack_writealign(oggpack_buffer *b)
Definition: bitwise.c:168
ogg_page_serialno
int ogg_page_serialno(const ogg_page *og)
Definition: framing.c:58
ogg_page::body_len
long body_len
Definition: ogg.h:47
oggpack_writeclear
void oggpack_writeclear(oggpack_buffer *b)
Definition: bitwise.c:246
oggpack_read
long oggpack_read(oggpack_buffer *b, int bits)
Definition: bitwise.c:371
ogg_iovec_t::iov_base
void * iov_base
Definition: ogg.h:28
ogg_stream_state::lacing_packet
long lacing_packet
Definition: ogg.h:66
source
GLsizei GLsizei GLchar * source
Definition: gl2ext.h:994
ogg_packet::e_o_s
long e_o_s
Definition: ogg.h:94
ogg_sync_state::headerbytes
int headerbytes
Definition: ogg.h:112
ogg_stream_state::granulepos
ogg_int64_t granulepos
Definition: ogg.h:83
oggpack_read1
long oggpack_read1(oggpack_buffer *b)
Definition: bitwise.c:457
oggpack_buffer::buffer
unsigned char * buffer
Definition: ogg.h:36
ogg_int64_t
long ogg_int64_t
Definition: config_types.h:23
ogg_page_granulepos
ogg_int64_t ogg_page_granulepos(const ogg_page *og)
Definition: framing.c:45
ogg_stream_init
int ogg_stream_init(ogg_stream_state *os, int serialno)
Definition: framing.c:188
ogg_packet::packetno
ogg_int64_t packetno
Definition: ogg.h:98
ogg_stream_state::body_storage
long body_storage
Definition: ogg.h:55
ogg_page_version
int ogg_page_version(const ogg_page *og)
Definition: framing.c:29
size
GLsizei size
Definition: gl2ext.h:1467
oggpackB_readinit
void oggpackB_readinit(oggpack_buffer *b, unsigned char *buf, int bytes)
Definition: bitwise.c:261
oggpackB_writealign
void oggpackB_writealign(oggpack_buffer *b)
Definition: bitwise.c:174