comparison parser.c @ 4177:127d84a4c8e0 libavcodec

move all cavs-parsing to cavs.c This should help building parser without decoder
author stefang
date Sun, 12 Nov 2006 20:18:07 +0000
parents b3328ed50a5e
children a0c0c7bebd64
comparison
equal deleted inserted replaced
4176:23da44e8fd05 4177:127d84a4c8e0
358 *poutbuf = (uint8_t *)buf; 358 *poutbuf = (uint8_t *)buf;
359 *poutbuf_size = buf_size; 359 *poutbuf_size = buf_size;
360 return next; 360 return next;
361 } 361 }
362 #endif 362 #endif
363
364 #ifdef CONFIG_CAVSVIDEO_PARSER
365 static int cavsvideo_parse(AVCodecParserContext *s,
366 AVCodecContext *avctx,
367 uint8_t **poutbuf, int *poutbuf_size,
368 const uint8_t *buf, int buf_size)
369 {
370 ParseContext *pc = s->priv_data;
371 int next;
372
373 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
374 next= buf_size;
375 }else{
376 next= ff_cavs_find_frame_end(pc, buf, buf_size);
377
378 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
379 *poutbuf = NULL;
380 *poutbuf_size = 0;
381 return buf_size;
382 }
383 }
384 *poutbuf = (uint8_t *)buf;
385 *poutbuf_size = buf_size;
386 return next;
387 }
388 #endif /* CONFIG_CAVSVIDEO_PARSER */
389 363
390 int ff_mpeg4video_split(AVCodecContext *avctx, 364 int ff_mpeg4video_split(AVCodecContext *avctx,
391 const uint8_t *buf, int buf_size) 365 const uint8_t *buf, int buf_size)
392 { 366 {
393 int i; 367 int i;
855 mpeg4video_parse, 829 mpeg4video_parse,
856 ff_parse1_close, 830 ff_parse1_close,
857 ff_mpeg4video_split, 831 ff_mpeg4video_split,
858 }; 832 };
859 #endif 833 #endif
860 #ifdef CONFIG_CAVSVIDEO_PARSER
861 AVCodecParser cavsvideo_parser = {
862 { CODEC_ID_CAVS },
863 sizeof(ParseContext1),
864 NULL,
865 cavsvideo_parse,
866 ff_parse1_close,
867 ff_mpeg4video_split,
868 };
869 #endif
870 #ifdef CONFIG_MPEGAUDIO_PARSER 834 #ifdef CONFIG_MPEGAUDIO_PARSER
871 AVCodecParser mpegaudio_parser = { 835 AVCodecParser mpegaudio_parser = {
872 { CODEC_ID_MP2, CODEC_ID_MP3 }, 836 { CODEC_ID_MP2, CODEC_ID_MP3 },
873 sizeof(MpegAudioParseContext), 837 sizeof(MpegAudioParseContext),
874 mpegaudio_parse_init, 838 mpegaudio_parse_init,