[FFmpeg-devel] [PATCH 1/2] avcodec/thread: add support for frame threading receive_frame based decoders
Timo Rothenpieler
timo at rothenpieler.org
Tue Dec 6 16:39:50 EET 2022
On 06/12/2022 15:37, Anton Khirnov wrote:
> Quoting Timo Rothenpieler (2022-12-05 14:39:37)
>> This is fairly basic and makes a lot of assumptions, but it works
>> for the most simple cases.
>>
>> For one, it only ever fetches exactly one packet per call to receive_frame.
>> Right now it's impossible for there to ever be more than one, but the API
>> allows for more, which might need handled in the future.
>>
>> It also basically translates the new API back to the old, since that's how
>> the frame threading code operates. Which feels backwards in regards to
>> the new API, but it was the path with least resistance in implementing this.
>
> If it only supports one packet to one frame, then it goes against the
> whole point of using the receive_frame API.
Otherwise the entirety of pthread_frame.c would need rewritten from
scratch. It has that assumption coded into it.
It also raises question as to how it'd distribute those packets accross
threads.
Does it just try to read packets until it either runs out of ready
threads or encounters EAGAIN?
Or does it read until EAGAIN and then passes all those to the same threads?
More information about the ffmpeg-devel
mailing list