Struct AVFilter
#[repr(C)]pub struct AVFilter {Show 17 fields
pub name: *const i8,
pub description: *const i8,
pub inputs: *const AVFilterPad,
pub outputs: *const AVFilterPad,
pub priv_class: *const AVClass,
pub flags: i32,
pub nb_inputs: u8,
pub nb_outputs: u8,
pub formats_state: u8,
pub preinit: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>,
pub init: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>,
pub uninit: Option<unsafe extern "C" fn(*mut AVFilterContext)>,
pub formats: AVFilter__bindgen_ty_1,
pub priv_size: i32,
pub flags_internal: i32,
pub process_command: Option<unsafe extern "C" fn(*mut AVFilterContext, *const i8, *const i8, *mut i8, i32, i32) -> i32>,
pub activate: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>,
}
Expand description
Filter definition. This defines the pads a filter contains, and all the callback functions used to interact with the filter.
Fields§
§name: *const i8
Filter name. Must be non-NULL and unique among filters.
description: *const i8
A description of the filter. May be NULL.
You should use the NULL_IF_CONFIG_SMALL() macro to define it.
inputs: *const AVFilterPad
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.
outputs: *const AVFilterPad
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.
priv_class: *const AVClass
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.
flags: i32
A combination of AVFILTER_FLAG_*
nb_inputs: u8
The number of entries in the list of inputs.
nb_outputs: u8
The number of entries in the list of outputs.
formats_state: u8
This field determines the state of the formats union. It is an enum FilterFormatsState value.
preinit: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>
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.
@return 0 on success, AVERROR code on failure (but the code will be dropped and treated as ENOMEM by the calling code)
init: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>
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.
@ref AVFilter.uninit “uninit” is guaranteed to be called even if initialization fails, so this callback does not have to clean up on failure.
@return 0 on success, a negative AVERROR on failure
uninit: Option<unsafe extern "C" fn(*mut AVFilterContext)>
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 @ref AVFilter.init “init” was not called or failed, so it must be prepared to handle such a situation.
formats: AVFilter__bindgen_ty_1
§priv_size: i32
< size of private data to allocate for the filter
flags_internal: i32
< Additional flags for avfilter internal use only.
process_command: Option<unsafe extern "C" fn(*mut AVFilterContext, *const i8, *const i8, *mut i8, i32, i32) -> i32>
Make the filter instance process a command.
@param cmd the command to process, for handling simplicity all commands must be alphanumeric only @param arg the argument for the command @param 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. @param 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
@returns >=0 on success otherwise an error code. AVERROR(ENOSYS) on unsupported commands
activate: Option<unsafe extern "C" fn(*mut AVFilterContext) -> i32>
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.