[FFmpeg-devel] [PATCH V4 2/4] libavfilter/buffersink.c: unref private_ref when frame leaves libavfilter

Guo, Yejun yejun.guo at intel.com
Mon Mar 1 16:58:18 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Nicolas
> George
> Sent: 2021年3月1日 22:24
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V4 2/4] libavfilter/buffersink.c: unref
> private_ref when frame leaves libavfilter
> 
> Guo, Yejun (12021-03-01):
> > Thanks for the review, as we talked at
> > http://ffmpeg.org/pipermail/ffmpeg-devel/2021-February/276728.html,
> > private_ref is allocated in filter vf_dnn_detect.c for detected
> > results, and other filters such as vf_drawbox/text (in plan) will read it.
> >
> > Since private_ref is for a single libav* library, it has to be NULL
> > when it leaves libavfilter, so I have to unref it at the last step of libavfilter,
> that's in buffersink. Any other suggestion? thanks.
> 
> Sorry, I did not have this reply in my archives, I somehow missed it.
> 
> What this is basically saying is that private_ref in libavfilter will be
> appropriated for the only use of bounding boxes. I think it is a significantly
> worse solution than using side data as you originally considered.

yes, this is what we did earlier. Actually, I think private_ref in libavfilter can only
be used for an exclusive usage at a time.

As Paul mentioned, I think AVFrame.metadata is a better choice.


More information about the ffmpeg-devel mailing list