[FFmpeg-devel] [PATCH] libavcodec/utils: Simplify get_buffer compatibility wrapper.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Feb 17 00:22:12 CET 2014


On Mon, Feb 17, 2014 at 12:16:14AM +0100, Reimar Döffinger wrote:
> On Sun, Feb 16, 2014 at 11:57:23PM +0100, wm4 wrote:
> > This is probably not legal. Code can assume that it can access the
> > whole referenced buffer, not just where the plane data is. Look for
> > example what vf_pad.c does: it tries to use "unused" space in the
> > buffer data area to extend the planes without copy. But I'm not sure if
> > I read this code right.
> 
> So by my current understanding, to _actually_ be backwards compatible,
> the utils.c code would have to generate one refbuffer _per line_, not
> per plane.
> That is obviously quite insane...

And not actually supported by the API.
So if (as a very made-up example) you had a frame that had each line on
its own page, with unallocated pages in-between that would no longer
be representable as an AVFrame since the reference counting was added.


More information about the ffmpeg-devel mailing list