[FFmpeg-devel] [PATCH] lavc: set frame defaults in internals codec frames

Stefano Sabatini stefano.sabatini-lala at poste.it
Tue May 3 00:03:35 CEST 2011


On date Monday 2011-05-02 12:29:58 +0200, Michael Niedermayer encoded:
> On Mon, May 02, 2011 at 10:57:21AM +0200, Stefano Sabatini wrote:
> > On date Monday 2011-05-02 02:18:11 +0200, Stefano Sabatini encoded:
> > > This is required, specifically for setting frame->format to -1,
> > > otherwise it will be set to 0 = PIX_FMT_YUV420P and code reading
> > > format from the output decoded frame will get misled.
> > > 
> > > In particular fix regressions occurring with the pending vsrc_buffer
> > > patch.
> > > ---
> > >  libavcodec/dnxhddec.c    |    1 +
> > >  libavcodec/dv.c          |    1 +
> > >  libavcodec/flashsv.c     |    1 +
> > >  libavcodec/huffyuv.c     |    1 +
> > >  libavcodec/mjpegdec.c    |    1 +
> > >  libavcodec/qtrle.c       |    2 ++
> > >  libavcodec/roqvideodec.c |    2 ++
> > >  7 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > I'm working through the complete fate suite and there a lot more than
> > these. So my question is, is acceptable to require to use
> > avcodec_get_frame_defaults() in all codecs?
> > 
> > Alternatively we may just set frame.format = -1, but using
> > avcodec_get_frame_defaults() should be more future-proof.
> 
> i agree, its probably a good idea to use avcodec_get_frame_defaults()
> the patch also LGTM if it works
> 
> also note we might need special freeing code if frames ever use
> string type

Updated, passes fate when the vsrc_buffer patch is applied.  Possibly
other codecs may be affected, I'll check, but fixing them would be
trivial.

BTW, why the function is named avcodec_GET_frame_defaults rather
than avcodec_SET_frame_defaults?
-- 
FFmpeg = Foolish Fascinating Miracolous Peaceful Explosive Glue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-lavc-set-defaults-in-internal-codec-frames.patch
Type: text/x-diff
Size: 32396 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110503/2e4610b1/attachment.bin>


More information about the ffmpeg-devel mailing list