Filter

Trait Filter 

Source
pub trait Filter<'core>: Send + Sync {
    // Required methods
    fn video_info(
        &self,
        api: API,
        core: CoreRef<'core>,
    ) -> Vec<VideoInfo<'core>>;
    fn get_frame_initial(
        &self,
        api: API,
        core: CoreRef<'core>,
        context: FrameContext<'_>,
        n: usize,
    ) -> Result<Option<FrameRef<'core>>>;
    fn get_frame(
        &self,
        api: API,
        core: CoreRef<'core>,
        context: FrameContext<'_>,
        n: usize,
    ) -> Result<FrameRef<'core>>;
}
Expand description

A filter interface.

Required Methods§

Source

fn video_info(&self, api: API, core: CoreRef<'core>) -> Vec<VideoInfo<'core>>

Returns the parameters of this filter’s output node.

The returned vector should contain one entry for each node output index.

Source

fn get_frame_initial( &self, api: API, core: CoreRef<'core>, context: FrameContext<'_>, n: usize, ) -> Result<Option<FrameRef<'core>>>

Requests the necessary frames from downstream nodes.

This is always the first function to get called for a given frame n.

In this function you should call request_frame_filter() on any input nodes that you need and return None. If you do not need any input frames, you should generate the output frame and return it here.

Do not call Node::get_frame() from within this function.

Source

fn get_frame( &self, api: API, core: CoreRef<'core>, context: FrameContext<'_>, n: usize, ) -> Result<FrameRef<'core>>

Returns the requested frame.

This is always the second function to get called for a given frame n. If the frame was retrned from get_frame_initial(), this function is not called.

In this function you should call get_frame_filter() on the input nodes to retrieve the frames you requested in get_frame_initial().

Do not call Node::get_frame() from within this function.

Implementors§