Skip to main content

Filter

Trait Filter 

Source
pub trait Filter:
    Sized
    + Send
    + Sync
    + RefUnwindSafe
    + 'static {
    type Error: AsRef<CStr>;
    type FrameType: Frame;
    type FilterData: Sync + 'static;

    const NAME: &'static CStr;
    const ARGS: &'static CStr;
    const RETURN_TYPE: &'static CStr;
    const FLAGS: i32 = 0;
    const FILTER_MODE: FilterMode = FilterMode::Parallel;

    // Required methods
    fn create(
        input: MapRef<'_>,
        output: MapMut<'_>,
        data: Option<&Self::FilterData>,
        core: CoreRef<'_>,
    ) -> Result<(), Self::Error>;
    fn get_frame(
        &self,
        n: i32,
        activation_reason: VSActivationReason,
        frame_data: *mut *mut c_void,
        frame_ctx: FrameContext,
        core: CoreRef<'_>,
    ) -> Result<Option<Self::FrameType>, Self::Error>;

    // Provided method
    fn free(self, core: CoreRef<'_>) { ... }
}
Expand description

A filter instance that VapourSynth can move between worker threads and call concurrently.

Required Associated Constants§

Source

const NAME: &'static CStr

Source

const ARGS: &'static CStr

Source

const RETURN_TYPE: &'static CStr

Provided Associated Constants§

Source

const FLAGS: i32 = 0

Bitmask of ffi::VSFilterFlags used when creating video nodes. GPU output must agree with Self::RETURN_TYPE; defaults to CPU output.

Source

const FILTER_MODE: FilterMode = FilterMode::Parallel

Required Associated Types§

Source

type Error: AsRef<CStr>

Filter error that can turned into a &CStr

Source

type FrameType: Frame

Source

type FilterData: Sync + 'static

Shared registration data available to each call to Self::create.

Required Methods§

Source

fn create( input: MapRef<'_>, output: MapMut<'_>, data: Option<&Self::FilterData>, core: CoreRef<'_>, ) -> Result<(), Self::Error>

§Errors

Return Self::Error if anything happens during the filter creation. The error message will be passed to VapourSynth.

Source

fn get_frame( &self, n: i32, activation_reason: VSActivationReason, frame_data: *mut *mut c_void, frame_ctx: FrameContext, core: CoreRef<'_>, ) -> Result<Option<Self::FrameType>, Self::Error>

§Errors

Return Self::Error if anything happens during the filter creation. The error message will be passed to VapourSynth.

Provided Methods§

Source

fn free(self, core: CoreRef<'_>)

Free the filter

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§