Trait Decoder

Source
pub trait Decoder: Send {
    // Required methods
    fn read_video_frame<T: Pixel>(&mut self) -> Option<Frame<T>>;
    fn get_bit_depth(&self) -> usize;
    fn get_video_details(&self) -> VideoDetails;

    // Provided method
    fn read_specific_frame<T: Pixel>(
        &mut self,
        frame_number: usize,
    ) -> Option<Frame<T>> { ... }
}
Expand description

A trait for allowing metrics to decode generic video formats.

Currently, y4m decoding support using the y4m crate is built-in to this crate. This trait is extensible so users may implement their own decoders.

Required Methods§

Source

fn read_video_frame<T: Pixel>(&mut self) -> Option<Frame<T>>

Read the next frame from the input video.

Expected to return Err if the end of the video is reached.

Source

fn get_bit_depth(&self) -> usize

Get the bit depth of the video.

Source

fn get_video_details(&self) -> VideoDetails

Get the Video Details

Provided Methods§

Source

fn read_specific_frame<T: Pixel>( &mut self, frame_number: usize, ) -> Option<Frame<T>>

Read a specific frame from the input video

Expected to return Err if the frame is not found.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§