[FFmpeg-devel] Google Summer of Code participation

Stefano Sabatini stefano.sabatini-lala
Wed Apr 1 22:40:17 CEST 2009


On date Wednesday 2009-04-01 22:13:12 +0200, Thilo Borgmann encoded:
> Ok here is a patch which shows my proposals. Remark: This is not meant  
> to be applied, just reviewed... so no need to point at the wrong indents  
> at some places and such....
>
> I forgot to mention that there are three little workarounds in  
> libavcodec/avcodec.h and libavutils/utils.c. They do also call the  
> decoding function and have to do this using the new AVPacket version.  
> Therefore a dummy AVPacket is created, .data and .size set and the  
> AVPacket is then passed to the decoder.
> Finally, these functions have to be updated up to the application layer  
> (ffplay.c, ffmpeg.c) as the avcodec_decode_video() function had to.
>
> As I said, this already works for the two altered decoders (pngdec.c &  
> pcm.c).
>
> Well I've also thought about the struct-expansion-Null-checking idea...  
> ehm... let's make it right from the beginning. If my qualification  
> fails, there will be at least some benefit for FFmpeg. If no one  
> volunteers, I will alter the codecs.
>

> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(Revision 18211)
> +++ ffmpeg.c	(Arbeitskopie)
> @@ -1246,7 +1246,7 @@
>                      avcodec_get_frame_defaults(&picture);
>  
>                      ret = avcodec_decode_video(ist->st->codec,
> -                                               &picture, &got_picture, ptr, len);
> +                                               &picture, &got_picture, pkt);
>                      ist->st->quality= picture.quality;
>                      if (ret < 0)


>                          goto fail_decode;
> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(Revision 18211)
> +++ ffplay.c	(Arbeitskopie)
> @@ -1374,7 +1374,7 @@
>          is->video_st->codec->reordered_opaque= pkt->pts;
>          len1 = avcodec_decode_video(is->video_st->codec,
>                                      frame, &got_picture,
> -                                    pkt->data, pkt->size);
> +                                    pkt);
>  
>          if(   (decoder_reorder_pts || pkt->dts == AV_NOPTS_VALUE)
>             && frame->reordered_opaque != AV_NOPTS_VALUE)
> Index: libavcodec/pngdec.c
> ===================================================================
> --- libavcodec/pngdec.c	(Revision 18211)
> +++ libavcodec/pngdec.c	(Arbeitskopie)
> @@ -486,8 +486,8 @@
>                      av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>                      goto fail;
>                  }
> -                p->pict_type= FF_I_TYPE;
> -                p->key_frame= 1;
> +				p->pict_type= FF_I_TYPE;
> +				p->key_frame= 1;

Please indent properly the patch, these random reindents make hard to
distinguish signal from the noise.

[...]

Regards.
-- 
FFmpeg = Fundamentalist and Faboulous Mere Pitiful Evanescent Gangster



More information about the ffmpeg-devel mailing list