Skip to main content

Extractor

Trait Extractor 

Source
pub trait Extractor {
    // Required methods
    fn describe(&self) -> &Descriptor;
    fn begin(&mut self, context: &RunContext) -> Result<(), ExtractorError>;
    fn pass(&mut self, pass: &PassInfo) -> Result<(), ExtractorError>;
    fn video(
        &mut self,
        frame: &VideoInput,
        out: &mut Emitter,
    ) -> Result<(), ExtractorError>;
    fn audio(
        &mut self,
        block: &AudioInput,
        out: &mut Emitter,
    ) -> Result<(), ExtractorError>;
    fn end(&mut self, out: &mut Emitter) -> Result<(), ExtractorError>;
}
Expand description

A function that is supplied frames or audio and returns primitives. Runs ahead of time over a range; what it emits is recorded as data sets.

Required Methods§

Source

fn describe(&self) -> &Descriptor

What the extractor reads and emits.

Source

fn begin(&mut self, context: &RunContext) -> Result<(), ExtractorError>

The run begins; model loading belongs here.

§Errors

The extractor’s failure, which ends the run.

Source

fn pass(&mut self, pass: &PassInfo) -> Result<(), ExtractorError>

A pass begins.

§Errors

The extractor’s failure, which ends the run.

Source

fn video( &mut self, frame: &VideoInput, out: &mut Emitter, ) -> Result<(), ExtractorError>

A video frame of the current pass.

§Errors

The extractor’s failure, which ends the run.

Source

fn audio( &mut self, block: &AudioInput, out: &mut Emitter, ) -> Result<(), ExtractorError>

An audio block of the current pass.

§Errors

The extractor’s failure, which ends the run.

Source

fn end(&mut self, out: &mut Emitter) -> Result<(), ExtractorError>

Every pass ended; whole-range work belongs here and may emit any time in the range.

§Errors

The extractor’s failure, which ends the run.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§