Skip to main content

Decoder

Trait Decoder 

Source
pub trait Decoder: Send {
    // Required methods
    fn stream_info(&self) -> &StreamInfo;
    fn push_sample(&mut self, data: &[u8]) -> Result<()>;
    fn finish(&mut self) -> Result<()>;
    fn decode_next(&mut self) -> Result<Option<VideoFrame>>;
}

Required Methods§

Source

fn stream_info(&self) -> &StreamInfo

Source

fn push_sample(&mut self, data: &[u8]) -> Result<()>

Feed one Annex-B (or codec-native — AV1 OBU, VP9 superframe) sample into the decoder. Implementations may buffer internally until finish is called or may decode eagerly and buffer produced frames. Pull frames via decode_next at any point.

Source

fn finish(&mut self) -> Result<()>

Signal end-of-stream. After this, no more push_sample calls; decode_next drains remaining frames.

Source

fn decode_next(&mut self) -> Result<Option<VideoFrame>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§