[Libav-user] Using custom asynchronous I/O with avio_alloc_context

Nicolas efyxps at gmail.com
Sat Mar 9 10:38:49 CET 2013


Hi,

I am using libav with custom I/O (with avio_alloc_context()) for reading
various stream.

In my project, all my I/O are asynchronous but ffmpeg callbacks work in a
synchronous way. So right now, what I am doing is to use an internal buffer
4 times bigger than my avio buffer and each time my read callback is called
I copy a part of my buffer and get new data asynchronously, this works well
for reading, but when I seek my media I don't have (yet) data in my
internal buffer. In such case what should I return in my read callback?

Also, there is a flag AVIO_FLAG_NONBLOCKING that I could pass to
avio_alloc_context but i couldn't figure how to use it (what should I
return in my read callback?)

is there any way to use custom I/O in an asynchronous fashion?

Thanks.
Nic.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130309/d0e08bef/attachment.html>


More information about the Libav-user mailing list