[][src]Struct stainless_ffmpeg_sys::AVFilter

#[repr(C)]pub struct AVFilter {
    pub name: *const c_char,
    pub description: *const c_char,
    pub inputs: *const AVFilterPad,
    pub outputs: *const AVFilterPad,
    pub priv_class: *const AVClass,
    pub flags: c_int,
    pub preinit: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext) -> c_int>,
    pub init: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext) -> c_int>,
    pub init_dict: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext, options: *mut *mut AVDictionary) -> c_int>,
    pub uninit: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext)>,
    pub query_formats: Option<unsafe extern "C" fn(arg1: *mut AVFilterContext) -> c_int>,
    pub priv_size: c_int,
    pub flags_internal: c_int,
    pub next: *mut AVFilter,
    pub process_command: Option<unsafe extern "C" fn(arg1: *mut AVFilterContext, cmd: *const c_char, arg: *const c_char, res: *mut c_char, res_len: c_int, flags: c_int) -> c_int>,
    pub init_opaque: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext, opaque: *mut c_void) -> c_int>,
    pub activate: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext) -> c_int>,
}

Filter definition. This defines the pads a filter contains, and all the callback functions used to interact with the filter.

Fields

name: *const c_char

Filter name. Must be non-NULL and unique among filters.

description: *const c_char

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 inputs, terminated by a zeroed element.

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 outputs, terminated by a zeroed element.

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: c_int

A combination of AVFILTER_FLAG_*

preinit: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext) -> c_int>

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(ctx: *mut AVFilterContext) -> c_int>

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

init_dict: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext, options: *mut *mut AVDictionary) -> c_int>

Should be set instead of @ref AVFilter.init "init" by the filters that want to pass a dictionary of AVOptions to nested contexts that are allocated during init.

On return, the options dict should be freed and replaced with one that contains all the options which could not be processed by this filter (or with NULL if all the options were processed).

Otherwise the semantics is the same as for @ref AVFilter.init "init".

uninit: Option<unsafe extern "C" fn(ctx: *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.

query_formats: Option<unsafe extern "C" fn(arg1: *mut AVFilterContext) -> c_int>

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.out_formats on every input link and AVFilterLink.in_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 @ref AVFilterLink.in_samplerates "in_samplerates" / @ref AVFilterLink.out_samplerates "out_samplerates" and @ref AVFilterLink.in_channel_layouts "in_channel_layouts" / @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously.

This callback may be NULL for filters with one input, in which case libavfilter assumes that it supports all input formats and preserves them on output.

@return zero on success, a negative value corresponding to an AVERROR code otherwise

priv_size: c_int

< size of private data to allocate for the filter

flags_internal: c_int

< Additional flags for avfilter internal use only.

next: *mut AVFilter

Used by the filter registration system. Must not be touched by any other code.

process_command: Option<unsafe extern "C" fn(arg1: *mut AVFilterContext, cmd: *const c_char, arg: *const c_char, res: *mut c_char, res_len: c_int, flags: c_int) -> c_int>

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

init_opaque: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext, opaque: *mut c_void) -> c_int>

Filter initialization function, alternative to the init() callback. Args contains the user-supplied parameters, opaque is used for providing binary data.

activate: Option<unsafe extern "C" fn(ctx: *mut AVFilterContext) -> c_int>

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.

Trait Implementations

impl Clone for AVFilter[src]

impl Copy for AVFilter[src]

impl Debug for AVFilter[src]

impl Eq for AVFilter[src]

impl PartialEq<AVFilter> for AVFilter[src]

impl StructuralEq for AVFilter[src]

impl StructuralPartialEq for AVFilter[src]

Auto Trait Implementations

impl RefUnwindSafe for AVFilter

impl !Send for AVFilter

impl !Sync for AVFilter

impl Unpin for AVFilter

impl UnwindSafe for AVFilter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.