comparison parser.c @ 3395:adccbf4a1040 libavcodec

CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
author michael
date Mon, 03 Jul 2006 00:16:45 +0000
parents f9d739057d6c
children b7826511f7b6
comparison
equal deleted inserted replaced
3394:2b5283c15310 3395:adccbf4a1040
526 return buf_size; 526 return buf_size;
527 } 527 }
528 } 528 }
529 av_mpeg4_decode_header(s, avctx, buf, buf_size); 529 av_mpeg4_decode_header(s, avctx, buf, buf_size);
530 530
531 *poutbuf = (uint8_t *)buf;
532 *poutbuf_size = buf_size;
533 return next;
534 }
535
536 static int cavsvideo_parse(AVCodecParserContext *s,
537 AVCodecContext *avctx,
538 uint8_t **poutbuf, int *poutbuf_size,
539 const uint8_t *buf, int buf_size)
540 {
541 ParseContext *pc = s->priv_data;
542 int next;
543
544 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
545 next= buf_size;
546 }else{
547 next= ff_cavs_find_frame_end(pc, buf, buf_size);
548
549 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
550 *poutbuf = NULL;
551 *poutbuf_size = 0;
552 return buf_size;
553 }
554 }
531 *poutbuf = (uint8_t *)buf; 555 *poutbuf = (uint8_t *)buf;
532 *poutbuf_size = buf_size; 556 *poutbuf_size = buf_size;
533 return next; 557 return next;
534 } 558 }
535 559
985 mpeg4video_parse, 1009 mpeg4video_parse,
986 parse1_close, 1010 parse1_close,
987 mpeg4video_split, 1011 mpeg4video_split,
988 }; 1012 };
989 1013
1014 AVCodecParser cavsvideo_parser = {
1015 { CODEC_ID_CAVS },
1016 sizeof(ParseContext1),
1017 NULL,
1018 cavsvideo_parse,
1019 parse1_close,
1020 mpeg4video_split,
1021 };
1022
990 AVCodecParser mpegaudio_parser = { 1023 AVCodecParser mpegaudio_parser = {
991 { CODEC_ID_MP2, CODEC_ID_MP3 }, 1024 { CODEC_ID_MP2, CODEC_ID_MP3 },
992 sizeof(MpegAudioParseContext), 1025 sizeof(MpegAudioParseContext),
993 mpegaudio_parse_init, 1026 mpegaudio_parse_init,
994 mpegaudio_parse, 1027 mpegaudio_parse,