00001 00025 #ifndef FFMPEG_OGGDEC_H 00026 #define FFMPEG_OGGDEC_H 00027 00028 #include "avformat.h" 00029 00030 typedef struct ogg_codec { 00031 const int8_t *magic; 00032 uint8_t magicsize; 00033 const int8_t *name; 00034 int (*header)(AVFormatContext *, int); 00035 int (*packet)(AVFormatContext *, int); 00036 uint64_t (*gptopts)(AVFormatContext *, int, uint64_t); 00037 } ogg_codec_t; 00038 00039 typedef struct ogg_stream { 00040 uint8_t *buf; 00041 unsigned int bufsize; 00042 unsigned int bufpos; 00043 unsigned int pstart; 00044 unsigned int psize; 00045 unsigned int pflags; 00046 uint32_t serial; 00047 uint32_t seq; 00048 uint64_t granule, lastgp; 00049 int flags; 00050 ogg_codec_t *codec; 00051 int header; 00052 int nsegs, segp; 00053 uint8_t segments[255]; 00054 void *private; 00055 } ogg_stream_t; 00056 00057 typedef struct ogg_state { 00058 uint64_t pos; 00059 int curidx; 00060 struct ogg_state *next; 00061 int nstreams; 00062 ogg_stream_t streams[1]; 00063 } ogg_state_t; 00064 00065 typedef struct ogg { 00066 ogg_stream_t *streams; 00067 int nstreams; 00068 int headers; 00069 int curidx; 00070 uint64_t size; 00071 ogg_state_t *state; 00072 } ogg_t; 00073 00074 #define OGG_FLAG_CONT 1 00075 #define OGG_FLAG_BOS 2 00076 #define OGG_FLAG_EOS 4 00077 00078 extern ogg_codec_t flac_codec; 00079 extern ogg_codec_t ogm_audio_codec; 00080 extern ogg_codec_t ogm_old_codec; 00081 extern ogg_codec_t ogm_text_codec; 00082 extern ogg_codec_t ogm_video_codec; 00083 extern ogg_codec_t old_flac_codec; 00084 extern ogg_codec_t theora_codec; 00085 extern ogg_codec_t vorbis_codec; 00086 00087 extern int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size); 00088 00089 #endif /* FFMPEG_OGGDEC_H */