[Libav-user] one questions about the usage of av_frame_ref() and av_frame_unref()

qw applemax82 at 163.com
Wed Jul 13 11:03:30 CEST 2016


Hi,

I have one question about the usage of av_frame_ref() and av_frame_unref().

For avcodec_decode_video2(), the following url is its description:

http://ffmpeg.org/doxygen/3.1/group__lavc__decoding.html#ga3ac51525b7ad8bca4ced9f3446e96532

When AVCodecContext.refcounted_frames is set to 1, the frame is reference counted and the returned reference belongs to the caller. The caller must release the frame using av_frame_unref() when the frame is no longer needed.

For example, avcodec_decode_video2() is used to get one decoded frame, i.e. decoded_frame. If av_frame_ref(ref_frame, decoded_frame) is invoked, how to unreference two frames? Can I use two threads to invoke av_frame_unref() to unreference two frames respectively? Is av_frame_ref() thread-safe?

Thanks!

Regards

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160713/185ba276/attachment.html>


More information about the Libav-user mailing list