[FFmpeg-devel] [PATCH 1/2] avfilter: change ff_inlink_make_frame_writable() to take AVFrame* argument

wm4 nfxjfg at googlemail.com
Sat Jan 28 20:02:48 EET 2017


On Sat, 28 Jan 2017 18:35:01 +0100
Nicolas George <george at nsup.org> wrote:

> Le nonidi 9 pluviôse, an CCXXV, Muhammad Faiz a écrit :
> > So, if ff_inlink_make_frame_writable() takes AVFrame**, it will be
> > incompatible with framequeue framework, because it stores AVFrame*, so
> > it will contain dangling AVFrame*.  
> 
> There is nothing "incompatible" about it, what would it even mean? It
> just can not be used as is on this specific call site; it was not meant
> to. It is a smaller, more versatile brick. You just need to add the
> little bit of mortar to have it fit here.
> 
> It is not possible to "make" a frame writable, the original name is a
> misnomer; the only thing possible is to create a new copy that is

Well, that's what the existing API calls it. In several places.

> uniquely referenced and therefore writable. If that is needed, an extra
> copy can be made to have the new frame take the place of the old one.
> But that is only rarely needed; making that copy always like you propose

It doesn't always copy.

> following wm4's bad advice

Please cease your childish attacks.

> will just make the code less efficient and
> more awkward.

Amazing.

We're talking about copying a few bytes additional in a case that
copies an entire frame of media data. And it's only "rarely needed", as
you said just above. (To remind other readers,
ff_inlink_make_frame_writable() exits immediately if the frame is
writable.)


More information about the ffmpeg-devel mailing list