On Mon, Aug 28, 2017 at 11:36 PM, Jorge Ramirez <jorge.ramirez-or...@linaro.org> wrote: >> >> But manually "nesting" AVBufferRefs to make any underlying state >> refcounted would also work. > > > I think so, context release now looks like this (it raises an ERROR to the > user) but will not lock or poll. >
Thats not really what he was referring to, but to avoid the "blocking" entirely. Basically, what you would do is have an AVBufferRef that basically "holds" your v4l2 context, and every frame holds a reference on this AVBufferRef - and only when all frames are released, the "free" function on your context AVBufferRef is called, and you can then release all its resources - without having to block the avcodec_close function. This is basically what AVHWFramesContext does, just with more frills around it. - Hendrik _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel