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