diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-07-03 00:16:45 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-07-03 00:16:45 +0000 |
commit | b482e2d12fdc380b48a3aa55334c698b9a36b82d (patch) | |
tree | 23b9cebd82163344f9e5adda7e985933a203f8e7 /libavcodec/parser.c | |
parent | 3f8674a9029435cb8102d683f9c896b874228622 (diff) | |
download | ffmpeg-b482e2d12fdc380b48a3aa55334c698b9a36b82d.tar.gz |
CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
Originally committed as revision 5590 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r-- | libavcodec/parser.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 7281516628..1977dd4943 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -533,6 +533,30 @@ static int mpeg4video_parse(AVCodecParserContext *s, return next; } +static int cavsvideo_parse(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + ParseContext *pc = s->priv_data; + int next; + + if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ + next= buf_size; + }else{ + next= ff_cavs_find_frame_end(pc, buf, buf_size); + + if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + } + *poutbuf = (uint8_t *)buf; + *poutbuf_size = buf_size; + return next; +} + static int mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { @@ -987,6 +1011,15 @@ AVCodecParser mpeg4video_parser = { mpeg4video_split, }; +AVCodecParser cavsvideo_parser = { + { CODEC_ID_CAVS }, + sizeof(ParseContext1), + NULL, + cavsvideo_parse, + parse1_close, + mpeg4video_split, +}; + AVCodecParser mpegaudio_parser = { { CODEC_ID_MP2, CODEC_ID_MP3 }, sizeof(MpegAudioParseContext), |