[FFmpeg-devel] [PATCH 1/4] lavfi: add flush callback.

Nicolas George nicolas.george at normalesup.org
Fri Jun 29 17:05:20 CEST 2012

Le duodi 12 messidor, an CCXX, Michael Niedermayer a écrit :
> a filters request_frame() gets called be the next filter.
> in case the next filter is a sink that sink can call a static
> flush function
> ret = request_frame()
> if(ret == EOF)
>     flush()
> This should be alot simpler and require no API changes

I am afraid you are missing part of the problem: how does that piece of code
above get reached? With buffersink, this is done by calling
av_buffersink_get_buffer_ref() or one of its derivatives. But not all sinks
are buffersinks, and not all sinks are known by the application. I believe
it is a design goal to be able to write "ffmpeg -filter_complex XXX" and
have some sinks in XXX, such a statistics gathering sinks.

Unfortunately, there is currently no way for EOF to reach those sinks.

That is the problem I am trying to address with this patch. There are other
solutions, I thought of some of them (I can expose them if people want), and
this one was the one I found had the best API change vs elegance compromise.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120629/119f18f6/attachment.asc>

More information about the ffmpeg-devel mailing list