A lot of changes happen at the same time:
- Add a framequeue fifo to AVFilterLink.
- split AVFilterLink.status into status_in and status_out: requires
changes to the few filters and programs that use it directly
(f_interleave, split, filtfmts).
- Add a field ready to AVFilterContext, marking when the filter is ready
and its activation priority.
- Add flags to mark blocked links.
- Change ff_filter_frame() to enqueue the frame.
- Change all filtering functions to update the ready field and the
blocked flags.
- Update ff_filter_graph_run_once() to use the ready field.
- buffersrc: always push the frame immediately.
Instead of calling the input filter request_frame() method,
ff_request_frame() now marks the link and returns immediately.
buffersink is changed to activate the marked filters until
a frame is obtained.
The status field can carry any error code instead of just EOF.
Also only update it through a wrapper function and provide a timestamp.
Update the few filters that used it directly.
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.
All of these were found by using av_warn_unused_result, demonstrating its utility.
Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.
Fixes: CID 1325680, 1325679, 1325678.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Do not assume that ff_request_frame() returning success
implies a frame has arrived in the FIFO.
Instead, just loop until a frame is in the FIFO.
It does not change anything since the same loop is present
in ff_request_frame(), confirmed by an assertion.
Use sizeof(void *) as its value, because AVFilterBufferRef is deprecated.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Previously it was partly only added to central functions called
internally, however if GCC would inline these into the public fuction, the
alignment attribute would not take effect.
Instead, add it to all public entry points to avoid these problems.
Signed-off-by: Martin Storsjö <martin@martin.st>
Previously it was partly only added to central functions called
internally, however if GCC would inline these into the public fuction, the
alignment attribute would not take effect.
Instead, add it to all public entry points to avoid these problems.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The functions which actually drive the filter graph by pushing
frames through it need to ensure an aligned stack for SIMD functions.
This fixes a crash in YADIF filter when using a mingw build in a MSVC
application.
Signed-off-by: Martin Storsjö <martin@martin.st>
Move validation from init to query_formats().
Accept the formats lists as binary options.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is mostly automated global search and replace
The deprecated aconvert filter is disabled, if it still has users
it should be updated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The functions which actually drive the filter graph by pushing
frames through it need to ensure an aligned stack for SIMD functions.
This fixes a crash in YADIF filter when using a mingw build in a MSVC application.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Note: the implementation could be more efficient, but at
the cost of more diff.
Most of the code from the following commit:
commit a2cd9be212
Author: Anton Khirnov <anton@khirnov.net>
Date: Fri May 4 19:22:38 2012 +0200
lavfi: add an audio buffer sink.
Adapted to call av_buffersink_get_frame_flags() instead of
accessing the frame directly.
Add a field to the AVBufferSinkParams for a list of accepted
channel counts.
Change the default value for the lists in AVBufferSinkParams
to NULL, to let lavfi fill them with something useful.
The fail_enomem path is unneeded because filters are uninited
on failure.
Implement av_buffersink_read() and av_buffersink_read_samples()
for ffmpeg's version of buffersink.
With this change, avconv linked against ffmpeg's libraries passes
the same number of tests whether it uses ffbuffersink or
buffersink_old.