FFmpeg
|
Filter definition. More...
#include <avfilter.h>
Data Fields | |
const char * | name |
Filter name. More... | |
const char * | description |
A description of the filter. More... | |
const AVFilterPad * | inputs |
List of static inputs. More... | |
const AVFilterPad * | outputs |
List of static outputs. More... | |
const AVClass * | priv_class |
A class for the private data, used to declare filter private AVOptions. More... | |
int | flags |
A combination of AVFILTER_FLAG_*. More... | |
uint8_t | nb_inputs |
The number of entries in the list of inputs. More... | |
uint8_t | nb_outputs |
The number of entries in the list of outputs. More... | |
uint8_t | formats_state |
This field determines the state of the formats union. More... | |
int(* | preinit )(AVFilterContext *ctx) |
Filter pre-initialization function. More... | |
int(* | init )(AVFilterContext *ctx) |
Filter initialization function. More... | |
void(* | uninit )(AVFilterContext *ctx) |
Filter uninitialization function. More... | |
union { | |
int(* query_func )(AVFilterContext *) | |
Query formats supported by the filter on its inputs and outputs. More... | |
enum AVPixelFormat * pixels_list | |
A pointer to an array of admissible pixel formats delimited by AV_PIX_FMT_NONE. More... | |
enum AVSampleFormat * samples_list | |
Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE and restricted to filters that only have AVMEDIA_TYPE_AUDIO inputs and outputs. More... | |
enum AVPixelFormat pix_fmt | |
Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list. More... | |
enum AVSampleFormat sample_fmt | |
Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list. More... | |
} | formats |
The state of the following union is determined by formats_state. More... | |
int | priv_size |
size of private data to allocate for the filter More... | |
int | flags_internal |
Additional flags for avfilter internal use only. More... | |
int(* | process_command )(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags) |
Make the filter instance process a command. More... | |
int(* | activate )(AVFilterContext *ctx) |
Filter activation function. More... | |
Filter definition.
This defines the pads a filter contains, and all the callback functions used to interact with the filter.
Definition at line 166 of file avfilter.h.
const char* AVFilter::name |
Filter name.
Must be non-NULL and unique among filters.
Definition at line 170 of file avfilter.h.
Referenced by avfilter_graph_parse(), avgblur_opencl_filter_frame(), config_output(), convolution_opencl_filter_frame(), convolution_opencl_init(), ff_vk_filter_init_context(), lavfi_read_header(), neighbor_opencl_init(), print_digraph(), program_opencl_init(), and stack_init().
const char* AVFilter::description |
A description of the filter.
May be NULL.
You should use the NULL_IF_CONFIG_SMALL() macro to define it.
Definition at line 177 of file avfilter.h.
const AVFilterPad* AVFilter::inputs |
List of static inputs.
NULL if there are no (static) inputs. Instances of filters with AVFILTER_FLAG_DYNAMIC_INPUTS set may have more inputs than present in this list.
Definition at line 186 of file avfilter.h.
const AVFilterPad* AVFilter::outputs |
List of static outputs.
NULL if there are no (static) outputs. Instances of filters with AVFILTER_FLAG_DYNAMIC_OUTPUTS set may have more outputs than present in this list.
Definition at line 195 of file avfilter.h.
const AVClass* AVFilter::priv_class |
A class for the private data, used to declare filter private AVOptions.
This field is NULL for filters that do not declare any options.
If this field is non-NULL, the first member of the filter private data must be a pointer to AVClass, which will be set by libavfilter generic code to this class.
Definition at line 205 of file avfilter.h.
int AVFilter::flags |
A combination of AVFILTER_FLAG_*.
Definition at line 210 of file avfilter.h.
Referenced by ff_filter_frame_framed().
uint8_t AVFilter::nb_inputs |
The number of entries in the list of inputs.
Definition at line 223 of file avfilter.h.
uint8_t AVFilter::nb_outputs |
The number of entries in the list of outputs.
Definition at line 228 of file avfilter.h.
uint8_t AVFilter::formats_state |
This field determines the state of the formats union.
It is an enum FilterFormatsState value.
Definition at line 234 of file avfilter.h.
int(* AVFilter::preinit) (AVFilterContext *ctx) |
Filter pre-initialization function.
This callback will be called immediately after the filter context is allocated, to allow allocating and initing sub-objects.
If this callback is not NULL, the uninit callback will be called on allocation failure.
Definition at line 249 of file avfilter.h.
int(* AVFilter::init) (AVFilterContext *ctx) |
Filter initialization function.
This callback will be called only once during the filter lifetime, after all the options have been set, but before links between filters are established and format negotiation is done.
Basic filter initialization should be done here. Filters with dynamic inputs and/or outputs should create those inputs/outputs here based on provided options. No more changes to this filter's inputs/outputs can be done after this callback.
This callback must not assume that the filter links exist or frame parameters are known.
uninit is guaranteed to be called even if initialization fails, so this callback does not have to clean up on failure.
Definition at line 272 of file avfilter.h.
void(* AVFilter::uninit) (AVFilterContext *ctx) |
Filter uninitialization function.
Called only once right before the filter is freed. Should deallocate any memory held by the filter, release any buffer references, etc. It does not need to deallocate the AVFilterContext.priv memory itself.
This callback may be called even if init was not called or failed, so it must be prepared to handle such a situation.
Definition at line 284 of file avfilter.h.
int(* AVFilter::query_func) (AVFilterContext *) |
Query formats supported by the filter on its inputs and outputs.
This callback is called after the filter is initialized (so the inputs and outputs are fixed), shortly before the format negotiation. This callback may be called more than once.
This callback must set AVFilterLink's outcfg.formats on every input link and incfg.formats on every output link to a list of pixel/sample formats that the filter supports on that link. For audio links, this filter must also set incfg.samplerates / outcfg.samplerates and incfg.channel_layouts / outcfg.channel_layouts analogously.
This callback must never be NULL if the union is in this state.
Definition at line 318 of file avfilter.h.
enum AVPixelFormat* AVFilter::pixels_list |
A pointer to an array of admissible pixel formats delimited by AV_PIX_FMT_NONE.
The generic code will use this list to indicate that this filter supports each of these pixel formats, provided that all inputs and outputs use the same pixel format.
This list must never be NULL if the union is in this state. The type of all inputs and outputs of filters using this must be AVMEDIA_TYPE_VIDEO.
Definition at line 329 of file avfilter.h.
enum AVSampleFormat* AVFilter::samples_list |
Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE and restricted to filters that only have AVMEDIA_TYPE_AUDIO inputs and outputs.
In addition to that the generic code will mark all inputs and all outputs as supporting all sample rates and every channel count and channel layout, as long as all inputs and outputs use the same sample rate and channel count/layout.
Definition at line 340 of file avfilter.h.
enum AVPixelFormat AVFilter::pix_fmt |
Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list.
Definition at line 344 of file avfilter.h.
enum AVSampleFormat AVFilter::sample_fmt |
Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list.
Definition at line 348 of file avfilter.h.
union { ... } AVFilter::formats |
The state of the following union is determined by formats_state.
See the documentation of enum FilterFormatsState in internal.h.
int AVFilter::priv_size |
size of private data to allocate for the filter
Definition at line 351 of file avfilter.h.
int AVFilter::flags_internal |
Additional flags for avfilter internal use only.
Definition at line 353 of file avfilter.h.
int(* AVFilter::process_command) (AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags) |
Make the filter instance process a command.
cmd | the command to process, for handling simplicity all commands must be alphanumeric only |
arg | the argument for the command |
res | a buffer with size res_size where the filter(s) can return a response. This must not change when the command is not supported. |
flags | if AVFILTER_CMD_FLAG_FAST is set and the command would be time consuming then a filter should treat it like an unsupported command |
Definition at line 367 of file avfilter.h.
int(* AVFilter::activate) (AVFilterContext *ctx) |
Filter activation function.
Called when any processing is needed from the filter, instead of any filter_frame and request_frame on pads.
The function must examine inlinks and outlinks and perform a single step of processing. If there is nothing to do, the function must do nothing and not return an error. If more steps are or may be possible, it must use ff_filter_set_ready() to schedule another activation.
Definition at line 381 of file avfilter.h.
Referenced by avfilter_graph_request_oldest().