diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-11-10 15:29:20 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-11-10 15:29:20 +0000 |
commit | 8424cf505c2b7bb6f26addcc3fe1e8dbfa17df1d (patch) | |
tree | 3dc0d632e883db70935931248cfe3c8a3caf56f8 /libavcodec/avcodec.h | |
parent | 962d6ae6c5a15a801f5df6e869fc0c01aeb8f963 (diff) | |
download | ffmpeg-8424cf505c2b7bb6f26addcc3fe1e8dbfa17df1d.tar.gz |
new audio/video parser API
Originally committed as revision 2492 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 0a698bd054..6bcb3111da 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -16,7 +16,7 @@ extern "C" { #define FFMPEG_VERSION_INT 0x000408 #define FFMPEG_VERSION "0.4.8" -#define LIBAVCODEC_BUILD 4691 +#define LIBAVCODEC_BUILD 4692 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION FFMPEG_VERSION @@ -1839,6 +1839,50 @@ typedef enum { */ int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout); +/* frame parsing */ +typedef struct AVCodecParserContext { + void *priv_data; + struct AVCodecParser *parser; + int64_t frame_offset; /* offset of the current frame */ + int64_t cur_offset; /* current offset + (incremented by each av_parser_parse()) */ + int64_t last_frame_offset; /* offset of the last frame */ + /* video info */ + int pict_type; /* XXX: put it back in AVCodecContext */ + int repeat_pict; /* XXX: put it back in AVCodecContext */ + int64_t pts; /* in us, if given by the codec (used by raw mpeg4) */ + int64_t dts; /* in us, if given by the codec (used by raw mpeg4) */ +} AVCodecParserContext; + +typedef struct AVCodecParser { + int codec_ids[3]; /* several codec IDs are permitted */ + int priv_data_size; + int (*parser_init)(AVCodecParserContext *s); + int (*parser_parse)(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size); + void (*parser_close)(AVCodecParserContext *s); + struct AVCodecParser *next; +} AVCodecParser; + +extern AVCodecParser *av_first_parser; + +void av_register_codec_parser(AVCodecParser *parser); +AVCodecParserContext *av_parser_init(int codec_id); +int av_parser_parse(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size); +void av_parser_close(AVCodecParserContext *s); + +extern AVCodecParser mpegvideo_parser; +extern AVCodecParser mpeg4video_parser; +extern AVCodecParser h263_parser; +extern AVCodecParser h264_parser; +extern AVCodecParser mpegaudio_parser; +extern AVCodecParser ac3_parser; + /* memory */ void *av_malloc(unsigned int size); void *av_mallocz(unsigned int size); |