AVFilterPad Struct Reference

A filter pad used for either input or output. More...

#include <avfilter.h>


Data Fields

const char * name
 Pad name.
enum AVMediaType type
 AVFilterPad type.
int min_perms
 Input pads: Minimum required permissions on incoming buffers.
int rej_perms
 Input pads: Permissions which are not accepted on incoming buffers.
int(* start_frame )(AVFilterLink *link, AVFilterBufferRef *picref)
 Callback called before passing the first slice of a new frame.
AVFilterBufferRef *(* get_video_buffer )(AVFilterLink *link, int perms, int w, int h)
 Callback function to get a video buffer.
AVFilterBufferRef *(* get_audio_buffer )(AVFilterLink *link, int perms, int nb_samples)
 Callback function to get an audio buffer.
int(* end_frame )(AVFilterLink *link)
 Callback called after the slices of a frame are completely sent.
int(* draw_slice )(AVFilterLink *link, int y, int height, int slice_dir)
 Slice drawing callback.
int(* filter_samples )(AVFilterLink *link, AVFilterBufferRef *samplesref)
 Samples filtering callback.
int(* poll_frame )(AVFilterLink *link)
 Frame poll callback.
int(* request_frame )(AVFilterLink *link)
 Frame request callback.
int(* config_props )(AVFilterLink *link)
 Link configuration callback.
int needs_fifo
 The filter expects a fifo to be inserted on its input link, typically because it has a delay.


Detailed Description

A filter pad used for either input or output.

See doc/filter_design.txt for details on how to implement the methods.

Warning:
this struct might be removed from public API. users should call avfilter_pad_get_name() and avfilter_pad_get_type() to access the name and type fields; there should be no need to access any other fields from outside of libavfilter.

Definition at line 232 of file avfilter.h.


Field Documentation

Link configuration callback.

For output pads, this should set the following link properties: video: width, height, sample_aspect_ratio, time_base audio: sample_rate.

This should NOT set properties such as format, channel_layout, etc which are negotiated between filters by the filter system using the query_formats() callback before this function is called.

For input pads, this should check the properties of the link, and update the filter's internal state as necessary.

For both input and output pads, this should return zero on success, and another value on error.

Referenced by avfilter_config_links(), and movie_common_init().

Slice drawing callback.

This is where a filter receives video data and should do its processing.

Input video pads only.

Returns:
>= 0 on success, a negative AVERROR on error.

Referenced by ff_draw_slice(), and init().

Callback called after the slices of a frame are completely sent.

If NULL, the filter layer will default to releasing the reference stored in the link structure during start_frame().

Input video pads only.

Returns:
>= 0 on success, a negative AVERROR on error.

Referenced by av_buffersink_read(), ff_end_frame(), and init().

Samples filtering callback.

This is where a filter receives audio data and should do its processing.

Input audio pads only.

Returns:
>= 0 on success, a negative AVERROR on error. This function must ensure that samplesref is properly unreferenced on error if it hasn't been passed on to another filter.

Referenced by av_buffersink_read(), av_buffersink_read_samples(), ff_filter_samples_framed(), init(), and join_init().

Callback function to get an audio buffer.

If NULL, the filter system will use avfilter_default_get_audio_buffer().

Input audio pads only.

Referenced by ff_get_audio_buffer().

Callback function to get a video buffer.

If NULL, the filter system will use avfilter_default_get_video_buffer().

Input video pads only.

Referenced by ff_get_video_buffer().

Input pads: Minimum required permissions on incoming buffers.

Any buffer with insufficient permissions will be automatically copied by the filter system to a new buffer which provides the needed access permissions.

Output pads: Guaranteed permissions on outgoing buffers. Any buffer pushed on the link must have at least these permissions; this fact is checked by asserts. It can be used to optimize buffer allocation.

Definition at line 256 of file avfilter.h.

Referenced by ff_filter_samples(), ff_filter_samples_framed(), and ff_start_frame().

const char* AVFilterPad::name

Pad name.

The name is unique among inputs and among outputs, but an input may have the same name as an output. This may be NULL if this pad has no need to ever be referenced by name.

Definition at line 238 of file avfilter.h.

Referenced by avfilter_graph_dump_to_buf(), avfilter_graph_request_oldest(), avfilter_pad_get_name(), close_input(), config_output(), graph_check_validity(), init(), join_init(), join_uninit(), movie_common_init(), movie_uninit(), pad_count(), print_digraph(), process_frame(), show_filters(), split_init(), split_uninit(), and uninit().

The filter expects a fifo to be inserted on its input link, typically because it has a delay.

input pads only.

Definition at line 387 of file avfilter.h.

Referenced by graph_insert_fifos(), and join_init().

Frame poll callback.

This returns the number of immediately available samples. It should return a positive value if the next request_frame() is guaranteed to return one frame (with no delay).

Defaults to just calling the source poll_frame() method.

Output pads only.

Referenced by ff_poll_frame().

Input pads: Permissions which are not accepted on incoming buffers.

Any buffer which has any of these permissions set will be automatically copied by the filter system to a new buffer which does not have those permissions. This can be used to easily disallow buffers with AV_PERM_REUSE.

Output pads: Permissions which are automatically removed on outgoing buffers. It can be used to optimize buffer allocation.

Definition at line 270 of file avfilter.h.

Referenced by ff_filter_samples_framed(), ff_start_frame(), and split_init().

Frame request callback.

A call to this should result in at least one frame being output over the given link. This should return zero on success, and another value on error. See ff_request_frame() for the error codes with a specific meaning.

Output pads only.

Referenced by av_buffersrc_add_ref(), ff_request_frame(), and movie_common_init().

Callback called before passing the first slice of a new frame.

If NULL, the filter layer will default to storing a reference to the picture inside the link structure.

The reference given as argument is also available in link->cur_buf. It can be stored elsewhere or given away, but then clearing link->cur_buf is advised, as it is automatically unreferenced. The reference must not be unreferenced before end_frame(), as it may still be in use by the automatic copy mechanism.

Input video pads only.

Returns:
>= 0 on success, a negative AVERROR on error. picref will be unreferenced by the caller in case of error.

Referenced by av_buffersink_read(), ff_start_frame(), and init().


The documentation for this struct was generated from the following file:

Generated on Fri Oct 26 02:50:14 2012 for FFmpeg by  doxygen 1.5.8