Go to the documentation of this file.
21 #ifndef AVFILTER_FILTERS_H
22 #define AVFILTER_FILTERS_H
34 #define FFERROR_NOT_READY FFERRTAG('N','R','D','Y')
174 return link->frame_wanted_out;
199 #define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink) do { \
200 int ret = ff_outlink_get_status(outlink); \
202 ff_inlink_set_status(inlink, ret); \
212 #define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter) do { \
213 int ret = ff_outlink_get_status(outlink); \
216 for (i = 0; i < filter->nb_inputs; i++) \
217 ff_inlink_set_status(filter->inputs[i], ret); \
226 #define FF_FILTER_FORWARD_STATUS(inlink, outlink) do { \
229 if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { \
230 ff_outlink_set_status(outlink, status, pts); \
239 #define FF_FILTER_FORWARD_STATUS_ALL(inlink, filter) do { \
242 if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { \
244 for (i = 0; i < filter->nb_outputs; i++) \
245 ff_outlink_set_status(filter->outputs[i], status, pts); \
254 #define FF_FILTER_FORWARD_WANTED(outlink, inlink) do { \
255 if (ff_outlink_frame_wanted(outlink)) { \
256 ff_inlink_request_frame(inlink); \
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.
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min)
Test if enough samples are available on the link.
int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink)
Check for flow control between input and output.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
This structure describes decoded (raw) audio or video data.
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
A link between two filters.
AVFrame * ff_inlink_peek_frame(AVFilterLink *link, size_t idx)
Access a frame in the link fifo without consuming it.
static int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
int ff_inlink_queued_samples(AVFilterLink *link)
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int ff_inlink_check_available_frame(AVFilterLink *link)
Test if a frame is available on the link.
size_t ff_inlink_queued_frames(AVFilterLink *link)
Get the number of frames available on the link.
int ff_outlink_get_status(AVFilterLink *link)
Get the status on an output link.
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
void ff_inlink_set_status(AVFilterLink *link, int status)
Set the status on an input link.
int ff_inlink_process_commands(AVFilterLink *link, const AVFrame *frame)
Process the commands queued in the link up to the time of the frame.
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.