lavfi: loop on request_frame if necessary.

Some filters need several input frames before producing output.
For these filter, it becomes simpler to return 0 in
request_frame() and let the framework call it again until
output has been produced.
This commit is contained in:
Nicolas George 2013-03-31 19:17:57 +02:00
parent c208576cef
commit 79d8cfacf0
3 changed files with 40 additions and 2 deletions

View file

@ -325,4 +325,18 @@ int ff_buffersink_read_samples_compat(AVFilterContext *ctx, AVFilterBufferRef **
*/
int ff_filter_frame(AVFilterLink *link, AVFrame *frame);
/**
* Flags for AVFilterLink.flags.
*/
enum {
/**
* Frame requests may need to loop in order to be fulfilled.
* A filter must set this flags on an output link if it may return 0 in
* request_frame() without filtering a frame.
*/
FF_LINK_FLAG_REQUEST_LOOP = 1,
};
#endif /* AVFILTER_INTERNAL_H */