[FFmpeg-devel] [PATCHv6 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

Hendrik Leppkes h.leppkes at gmail.com
Tue Aug 29 00:42:35 EEST 2017


On Mon, Aug 28, 2017 at 11:36 PM, Jorge Ramirez
<jorge.ramirez-ortiz at 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


More information about the ffmpeg-devel mailing list