FFmpeg
|
Go to the source code of this file.
Macros | |
#define | FFERROR_NOT_READY FFERRTAG('N','R','D','Y') |
Filters implementation helper functions. More... | |
#define | FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink) |
Forward the status on an output link to an input link. More... | |
#define | FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter) |
Forward the status on an output link to all input links. More... | |
#define | FF_FILTER_FORWARD_STATUS(inlink, outlink) |
Acknowledge the status on an input link and forward it to an output link. More... | |
#define | FF_FILTER_FORWARD_STATUS_ALL(inlink, filter) |
Acknowledge the status on an input link and forward it to an output link. More... | |
#define | FF_FILTER_FORWARD_WANTED(outlink, inlink) |
Forward the frame_wanted_out flag from an output link to an input link. More... | |
Functions | |
void | ff_filter_set_ready (AVFilterContext *filter, unsigned priority) |
Mark a filter ready and schedule it for activation. More... | |
int | ff_inlink_process_commands (AVFilterLink *link, const AVFrame *frame) |
Process the commands queued in the link up to the time of the frame. More... | |
int | ff_inlink_evaluate_timeline_at_frame (AVFilterLink *link, const AVFrame *frame) |
Evaluate the timeline expression of the link for the time and properties of the frame. More... | |
size_t | ff_inlink_queued_frames (AVFilterLink *link) |
Get the number of frames available on the link. More... | |
int | ff_inlink_check_available_frame (AVFilterLink *link) |
Test if a frame is available on the link. More... | |
int | ff_inlink_queued_samples (AVFilterLink *link) |
int | ff_inlink_check_available_samples (AVFilterLink *link, unsigned min) |
Test if enough samples are available on the link. More... | |
int | ff_inlink_consume_frame (AVFilterLink *link, AVFrame **rframe) |
Take a frame from the link's FIFO and update the link's stats. More... | |
int | ff_inlink_consume_samples (AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe) |
Take samples from the link's FIFO and update the link's stats. More... | |
AVFrame * | ff_inlink_peek_frame (AVFilterLink *link, size_t idx) |
Access a frame in the link fifo without consuming it. More... | |
int | ff_inlink_make_frame_writable (AVFilterLink *link, AVFrame **rframe) |
Make sure a frame is writable. More... | |
int | ff_inlink_acknowledge_status (AVFilterLink *link, int *rstatus, int64_t *rpts) |
Test and acknowledge the change of status on the link. More... | |
void | ff_inlink_request_frame (AVFilterLink *link) |
Mark that a frame is wanted on the link. More... | |
void | ff_inlink_set_status (AVFilterLink *link, int status) |
Set the status on an input link. More... | |
static int | ff_outlink_frame_wanted (AVFilterLink *link) |
Test if a frame is wanted on an output link. More... | |
int | ff_outlink_get_status (AVFilterLink *link) |
Get the status on an output link. More... | |
static void | ff_outlink_set_status (AVFilterLink *link, int status, int64_t pts) |
Set the status field of a link from the source filter. More... | |
int | ff_inoutlink_check_flow (AVFilterLink *inlink, AVFilterLink *outlink) |
Check for flow control between input and output. More... | |
Filters implementation helper functions.
Special return code when activate() did not do anything.
#define FF_FILTER_FORWARD_STATUS_BACK | ( | outlink, | |
inlink | |||
) |
Forward the status on an output link to an input link.
If the status is set, it will discard all queued frames and this macro will return immediately.
#define FF_FILTER_FORWARD_STATUS_BACK_ALL | ( | outlink, | |
filter | |||
) |
Forward the status on an output link to all input links.
If the status is set, it will discard all queued frames and this macro will return immediately.
#define FF_FILTER_FORWARD_STATUS | ( | inlink, | |
outlink | |||
) |
#define FF_FILTER_FORWARD_WANTED | ( | outlink, | |
inlink | |||
) |
Forward the frame_wanted_out flag from an output link to an input link.
If the flag is set, this macro will return immediately.
void ff_filter_set_ready | ( | AVFilterContext * | filter, |
unsigned | priority | ||
) |
Mark a filter ready and schedule it for activation.
This is automatically done when something happens to the filter (queued frame, status change, request on output). Filters implementing the activate callback can call it directly to perform one more round of processing later. It is also useful for filters reacting to external or asynchronous events.
Definition at line 234 of file avfilter.c.
Referenced by activate(), ff_avfilter_link_set_in_status(), ff_filter_frame(), ff_filter_frame_to_filter(), ff_inlink_request_frame(), ff_request_frame(), filter_frame(), forward_status_change(), link_set_out_status(), process_frame(), request_frame(), spatial_activate(), xfade_activate(), and xfade_opencl_activate().
int ff_inlink_process_commands | ( | AVFilterLink * | link, |
const AVFrame * | frame | ||
) |
Process the commands queued in the link up to the time of the frame.
Commands will trigger the process_command() callback.
Definition at line 1532 of file avfilter.c.
Referenced by consume_update(), and ff_filter_frame_framed().
int ff_inlink_evaluate_timeline_at_frame | ( | AVFilterLink * | link, |
const AVFrame * | frame | ||
) |
Evaluate the timeline expression of the link for the time and properties of the frame.
Definition at line 1547 of file avfilter.c.
Referenced by consume_update(), and ff_filter_frame_framed().
size_t ff_inlink_queued_frames | ( | AVFilterLink * | link | ) |
Get the number of frames available on the link.
Definition at line 1408 of file avfilter.c.
Referenced by activate(), create_frame(), filter_frame(), filter_have_queued(), and xfade_opencl_activate().
int ff_inlink_check_available_frame | ( | AVFilterLink * | link | ) |
Test if a frame is available on the link.
Definition at line 1414 of file avfilter.c.
Referenced by activate(), ff_inlink_consume_frame(), ff_inoutlink_check_flow(), and xfade_activate().
int ff_inlink_queued_samples | ( | AVFilterLink * | link | ) |
Definition at line 1420 of file avfilter.c.
Referenced by activate(), check_ir(), convert_coeffs(), filter_frame(), plot_spectrum_column(), and try_push_frame().
int ff_inlink_check_available_samples | ( | AVFilterLink * | link, |
unsigned | min | ||
) |
Test if enough samples are available on the link.
Definition at line 1426 of file avfilter.c.
Referenced by activate(), check_ir(), and ff_inlink_consume_samples().
int ff_inlink_consume_frame | ( | AVFilterLink * | link, |
AVFrame ** | rframe | ||
) |
Take a frame from the link's FIFO and update the link's stats.
If ff_inlink_check_available_frame() was previously called, the preferred way of expressing it is "av_assert1(ret);" immediately after ff_inlink_consume_frame(). Negative error codes must still be checked.
Definition at line 1445 of file avfilter.c.
Referenced by activate(), consume_from_fifos(), dnn_classify_activate(), dnn_detect_activate(), ff_filter_frame_to_filter(), filter_frame(), forward_frame(), get_frame_internal(), handle_input(), read_frame(), spatial_activate(), xfade_activate(), and xfade_opencl_activate().
int ff_inlink_consume_samples | ( | AVFilterLink * | link, |
unsigned | min, | ||
unsigned | max, | ||
AVFrame ** | rframe | ||
) |
Take samples from the link's FIFO and update the link's stats.
If ff_inlink_check_available_samples() was previously called, the preferred way of expressing it is "av_assert1(ret);" immediately after ff_inlink_consume_samples(). Negative error codes must still be checked.
Definition at line 1465 of file avfilter.c.
Referenced by activate(), convert_coeffs(), ff_filter_frame_to_filter(), ff_inlink_consume_frame(), get_frame_internal(), and try_push_frame().
AVFrame* ff_inlink_peek_frame | ( | AVFilterLink * | link, |
size_t | idx | ||
) |
Access a frame in the link fifo without consuming it.
The first frame is numbered 0; the designated frame must exist.
Definition at line 1486 of file avfilter.c.
Referenced by activate(), xfade_activate(), and xfade_opencl_activate().
int ff_inlink_make_frame_writable | ( | AVFilterLink * | link, |
AVFrame ** | rframe | ||
) |
Make sure a frame is writable.
This is similar to av_frame_make_writable() except it uses the link's buffer allocation callback, and therefore allows direct rendering.
Definition at line 1492 of file avfilter.c.
Referenced by activate(), apply_palette(), ff_filter_frame_framed(), ff_framesync_dualinput_get_writable(), ff_framesync_get_frame(), filter_frame(), filter_frame16(), filter_frame8(), overlay_cuda_blend(), and plot_spectrum_column().
int ff_inlink_acknowledge_status | ( | AVFilterLink * | link, |
int * | rstatus, | ||
int64_t * | rpts | ||
) |
Test and acknowledge the change of status on the link.
Status means EOF or an error condition; a change from the normal (0) status to a non-zero status can be queued in a filter's input link, it becomes relevant after the frames queued in the link's FIFO are processed. This function tests if frames are still queued and if a queued status change has not yet been processed. In that case it performs basic treatment (updating the link's timestamp) and returns a positive value to let the filter do its own treatments (flushing...).
Filters implementing the activate callback should call this function when they think it might succeed (usually after checking unsuccessfully for a queued frame). Filters implementing the filter_frame and request_frame callbacks do not need to call that since the same treatment happens in ff_filter_frame().
[out] | rstatus | new or current status |
[out] | rpts | current timestamp of the link in link time base |
Definition at line 1392 of file avfilter.c.
Referenced by activate(), consume_from_fifos(), dnn_classify_activate(), dnn_detect_activate(), forward_frame(), get_frame_internal(), handle_input(), request_frame(), xfade_activate(), and xfade_opencl_activate().
void ff_inlink_request_frame | ( | AVFilterLink * | link | ) |
Mark that a frame is wanted on the link.
Unlike ff_filter_frame(), it must not be called when the link has a non-zero status, and thus does not acknowledge it. Also it cannot fail.
Definition at line 1571 of file avfilter.c.
Referenced by activate(), check_ir(), consume_from_fifos(), filter_frame(), forward_frame(), get_frame_internal(), if(), libplacebo_activate(), request_samples(), spatial_activate(), xfade_activate(), and xfade_opencl_activate().
void ff_inlink_set_status | ( | AVFilterLink * | link, |
int | status | ||
) |
Set the status on an input link.
Also discard all frames in the link's FIFO.
Definition at line 1580 of file avfilter.c.
Referenced by activate(), ff_filter_activate_default(), if(), and xfade_activate().
|
inlinestatic |
int ff_outlink_get_status | ( | AVFilterLink * | link | ) |
Get the status on an output link.
Definition at line 1596 of file avfilter.c.
Referenced by activate(), create_frame(), draw_items(), filter_frame(), filter_have_eof(), and xfade_opencl_activate().
|
inlinestatic |
Set the status field of a link from the source filter.
The pts should reflect the timestamp of the status change, in link time base and relative to the frames timeline. In particular, for AVERROR_EOF, it should reflect the end time of the last frame.
Definition at line 189 of file filters.h.
Referenced by activate(), dnn_classify_activate(), dnn_detect_activate(), forward_frame(), framesync_eof(), fsync_config_props(), libplacebo_activate(), output_frame(), request_frame(), testsrc_vulkan_activate(), try_push_frame(), xfade_activate(), and xfade_opencl_activate().
int ff_inoutlink_check_flow | ( | AVFilterLink * | inlink, |
AVFilterLink * | outlink | ||
) |
Check for flow control between input and output.
This is necessary for filters that may produce several output frames for a single input event, otherwise they may produce them all at once, causing excessive memory consumption.
Definition at line 1602 of file avfilter.c.
Referenced by activate().