Skip to main content

VideoDecoder

Trait VideoDecoder 

Source
pub trait VideoDecoder: Send {
    // Required methods
    fn codec(&self) -> VideoCodec;
    fn decode(
        &mut self,
        data: &[u8],
        timestamp_us: u64,
    ) -> Result<Option<DecodedFrame>, VideoError>;
    fn flush(&mut self) -> Result<Vec<DecodedFrame>, VideoError>;
}
Expand description

Trait for video decoders that convert compressed NAL units to RGB8 frames.

Required Methods§

Source

fn codec(&self) -> VideoCodec

Source

fn decode( &mut self, data: &[u8], timestamp_us: u64, ) -> Result<Option<DecodedFrame>, VideoError>

Decode a single compressed access unit into an RGB8 frame. Returns None if the decoder needs more data (e.g., initial SPS/PPS).

Source

fn flush(&mut self) -> Result<Vec<DecodedFrame>, VideoError>

Flush any remaining buffered frames.

Implementors§