[FFmpeg-devel] [RFC][PATCH] avcodec: add a get_enc_buffer() callback to AVCodecContext

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sun Feb 21 02:27:32 EET 2021


Lynne:
> Feb 21, 2021, 01:10 by jamrial at gmail.com:
> 
>> On 2/20/2021 8:41 PM, Lynne wrote:
>>
>>> Maybe mention thread safety? Since in a frame-threaded encoder
>>> this may be called from different threads.
>>>
>>
>> So copy paste the paragraph "If frame multithreading is used, this callback may be called from a different thread, but not from more than one at once. Does not need to be reentrant" from get_buffer2()?.
>>
> 
> No, that's the previous definition before we deprecated "thread_safe_callbacks".
> So something like "The callback should be thread-safe, as when frame multithreading
> is used, it may be called from multiple threads simultaneously.".

If you look at thread_get_buffer_internal, you'll see that calls to
ff_get_buffer never happen simultaneously from different threads. Even
with thread_safe_callbacks. The deprecation hasn't changed that.

- Andreas


More information about the ffmpeg-devel mailing list