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>;
// Provided method
fn frame_buffer(&mut self, len: usize) -> Option<&mut [u8]> { ... }
}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§
Sourcefn describe(&self) -> &Descriptor
fn describe(&self) -> &Descriptor
What the extractor reads and emits.
Sourcefn begin(&mut self, context: &RunContext) -> Result<(), ExtractorError>
fn begin(&mut self, context: &RunContext) -> Result<(), ExtractorError>
Sourcefn video(
&mut self,
frame: &VideoInput,
out: &mut Emitter,
) -> Result<(), ExtractorError>
fn video( &mut self, frame: &VideoInput, out: &mut Emitter, ) -> Result<(), ExtractorError>
Sourcefn audio(
&mut self,
block: &AudioInput,
out: &mut Emitter,
) -> Result<(), ExtractorError>
fn audio( &mut self, block: &AudioInput, out: &mut Emitter, ) -> Result<(), ExtractorError>
Provided Methods§
Sourcefn frame_buffer(&mut self, len: usize) -> Option<&mut [u8]>
fn frame_buffer(&mut self, len: usize) -> Option<&mut [u8]>
Memory of exactly len bytes for the next supplied frame’s delivered pixels, for an
extractor that would otherwise copy them. When it gives some and the frame is written
there, the video call that delivers it gets empty VideoInput::bytes. None, the
default, keeps the pixels in bytes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".