[FFmpeg-devel] [RFC] Event loop

Mark Thompson sw at jkqxz.net
Thu Feb 18 23:58:45 EET 2021


On 18/02/2021 21:44, Nicolas George wrote:
> Mark Thompson (12021-02-18):
>> When is the callback for an output stream called?  What if it doesn't
>> have a packet available to write right now, but will do later?
> 
> It will be called when data has been written, of course. If there is no
> data to write, the stream is just idle.

I wrote the last packet a second ago and got a callback for writeability from the loop, but didn't have anything to write back then so I did nothing.

Now I have a packet to write, but the event loop is sitting idle in its poll() call.

You've said I'm not allowed to interact with the loop from another thread, so how do I make the loop generate a callback so I can write something on the thread which is allowed to write?

- Mark


More information about the ffmpeg-devel mailing list