Trait afi::Decoder

source ·
pub trait Decoder<T>where
    Self: Sized,
{ fn new(data: T, colors: ColorChannels) -> Option<Self>; fn run(
        &mut self,
        audio: &mut Option<Audio>,
        video: &mut Option<Video>
    ) -> Option<bool>; fn get(&self) -> Index; fn set(&mut self, index: Index); }
Expand description

A trait for implementing decoding audio, video or both.

Required Methods§

Create a new decoder for this format. None is returned when the decoder can’t handle data’s format: try a different decoder.

Decode a frame. None is returned if the file is corrupt, Some(true) if it succeeded, and Some(false) if it can’t add anymore frames because the input file ended. audio and video should initially be set to None.

Get the frame number (24 frames per second).

Set the frame number to seek forward or backwards.

Implementors§