00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _OGG_H
00018 #define _OGG_H
00019
00020 #ifndef __SYMBIAN32__
00021 # define IMPORT_C extern
00022 # define EXPORT_C
00023 #else
00024 # ifndef __cplusplus
00025 #ifndef __X86GCC__
00026 # undef IMPORT_C
00027 # define IMPORT_C __declspec(dllexport)
00028 # define EXPORT_C __declspec(dllexport)
00029 #endif
00030 # endif
00031 #endif
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #include "ogg/os_types.h"
00038
00039 typedef struct {
00040 long endbyte;
00041 int endbit;
00042
00043 unsigned char *buffer;
00044 unsigned char *ptr;
00045 long storage;
00046 } oggpack_buffer;
00047
00048
00049
00050 typedef struct {
00051 unsigned char *header;
00052 long header_len;
00053 unsigned char *body;
00054 long body_len;
00055 } ogg_page;
00056
00057
00058
00059
00060 typedef struct {
00061 unsigned char *body_data;
00062 long body_storage;
00063 long body_fill;
00064 long body_returned;
00065
00066
00067 int *lacing_vals;
00068 ogg_int64_t *granule_vals;
00069
00070
00071 long lacing_storage;
00072 long lacing_fill;
00073 long lacing_packet;
00074 long lacing_returned;
00075
00076 unsigned char header[282];
00077 int header_fill;
00078
00079 int e_o_s;
00080
00081 int b_o_s;
00082
00083 long serialno;
00084 long pageno;
00085 ogg_int64_t packetno;
00086
00087
00088
00089
00090 ogg_int64_t granulepos;
00091
00092 } ogg_stream_state;
00093
00094
00095
00096
00097 typedef struct {
00098 unsigned char *packet;
00099 long bytes;
00100 long b_o_s;
00101 long e_o_s;
00102
00103 ogg_int64_t granulepos;
00104
00105 ogg_int64_t packetno;
00106
00107
00108
00109
00110 } ogg_packet;
00111
00112 typedef struct {
00113 unsigned char *data;
00114 int storage;
00115 int fill;
00116 int returned;
00117
00118 int unsynced;
00119 int headerbytes;
00120 int bodybytes;
00121 } ogg_sync_state;
00122
00123
00124
00125 IMPORT_C void oggpack_writeinit(oggpack_buffer *b);
00126 IMPORT_C void oggpack_writetrunc(oggpack_buffer *b,long bits);
00127 IMPORT_C void oggpack_writealign(oggpack_buffer *b);
00128 IMPORT_C void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
00129 IMPORT_C void oggpack_reset(oggpack_buffer *b);
00130 IMPORT_C void oggpack_writeclear(oggpack_buffer *b);
00131 IMPORT_C void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
00132 IMPORT_C void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
00133 IMPORT_C long oggpack_look(oggpack_buffer *b,int bits);
00134 IMPORT_C long oggpack_look1(oggpack_buffer *b);
00135 IMPORT_C void oggpack_adv(oggpack_buffer *b,int bits);
00136 IMPORT_C void oggpack_adv1(oggpack_buffer *b);
00137 IMPORT_C long oggpack_read(oggpack_buffer *b,int bits);
00138 IMPORT_C long oggpack_read1(oggpack_buffer *b);
00139 IMPORT_C long oggpack_bytes(oggpack_buffer *b);
00140 IMPORT_C long oggpack_bits(oggpack_buffer *b);
00141 IMPORT_C unsigned char *oggpack_get_buffer(oggpack_buffer *b);
00142
00143 IMPORT_C void oggpackB_writeinit(oggpack_buffer *b);
00144 IMPORT_C void oggpackB_writetrunc(oggpack_buffer *b,long bits);
00145 IMPORT_C void oggpackB_writealign(oggpack_buffer *b);
00146 IMPORT_C void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
00147 IMPORT_C void oggpackB_reset(oggpack_buffer *b);
00148 IMPORT_C void oggpackB_writeclear(oggpack_buffer *b);
00149 IMPORT_C void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
00150 IMPORT_C void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
00151 IMPORT_C long oggpackB_look(oggpack_buffer *b,int bits);
00152 IMPORT_C long oggpackB_look1(oggpack_buffer *b);
00153 IMPORT_C void oggpackB_adv(oggpack_buffer *b,int bits);
00154 IMPORT_C void oggpackB_adv1(oggpack_buffer *b);
00155 IMPORT_C long oggpackB_read(oggpack_buffer *b,int bits);
00156 IMPORT_C long oggpackB_read1(oggpack_buffer *b);
00157 IMPORT_C long oggpackB_bytes(oggpack_buffer *b);
00158 IMPORT_C long oggpackB_bits(oggpack_buffer *b);
00159 IMPORT_C unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
00160
00161
00162
00163 IMPORT_C int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
00164 IMPORT_C int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
00165 IMPORT_C int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
00166
00167
00168
00169 IMPORT_C int ogg_sync_init(ogg_sync_state *oy);
00170 IMPORT_C int ogg_sync_clear(ogg_sync_state *oy);
00171 IMPORT_C int ogg_sync_reset(ogg_sync_state *oy);
00172 IMPORT_C int ogg_sync_destroy(ogg_sync_state *oy);
00173
00174 IMPORT_C char *ogg_sync_buffer(ogg_sync_state *oy, long size);
00175 IMPORT_C int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
00176 IMPORT_C long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
00177 IMPORT_C int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
00178 IMPORT_C int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
00179 IMPORT_C int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
00180 IMPORT_C int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
00181
00182
00183
00184 IMPORT_C int ogg_stream_init(ogg_stream_state *os,int serialno);
00185 IMPORT_C int ogg_stream_clear(ogg_stream_state *os);
00186 IMPORT_C int ogg_stream_reset(ogg_stream_state *os);
00187 IMPORT_C int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
00188 IMPORT_C int ogg_stream_destroy(ogg_stream_state *os);
00189 IMPORT_C int ogg_stream_eos(ogg_stream_state *os);
00190
00191 IMPORT_C void ogg_page_checksum_set(ogg_page *og);
00192
00193 IMPORT_C int ogg_page_version(ogg_page *og);
00194 IMPORT_C int ogg_page_continued(ogg_page *og);
00195 IMPORT_C int ogg_page_bos(ogg_page *og);
00196 IMPORT_C int ogg_page_eos(ogg_page *og);
00197 IMPORT_C ogg_int64_t ogg_page_granulepos(ogg_page *og);
00198 IMPORT_C int ogg_page_serialno(ogg_page *og);
00199 IMPORT_C long ogg_page_pageno(ogg_page *og);
00200 IMPORT_C int ogg_page_packets(ogg_page *og);
00201
00202 IMPORT_C void ogg_packet_clear(ogg_packet *op);
00203
00204
00205 #ifdef __cplusplus
00206 }
00207 #endif
00208
00209 #endif
00210
00211
00212
00213
00214
00215