Skip to main content

Decoder

Trait Decoder 

Source
pub trait Decoder: Send {
    // Required methods
    fn info(&self) -> &VideoInfo;
    fn read_frame(&mut self, frame: &mut Frame) -> Result<bool, Error>;

    // Provided method
    fn next_frame(&mut self) -> Result<Option<Frame>, Error> { ... }
}
Expand description

Reads a file’s frames in presentation order.

Required Methods§

Source

fn info(&self) -> &VideoInfo

Source

fn read_frame(&mut self, frame: &mut Frame) -> Result<bool, Error>

Decodes the next frame into frame, reusing its buffer. Ok(false) at the end of the stream.

Provided Methods§

Source

fn next_frame(&mut self) -> Result<Option<Frame>, Error>

The next frame in a fresh buffer, Ok(None) at the end.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§