Skip to main content

AudioDecoder

Trait AudioDecoder 

Source
pub trait AudioDecoder: Send {
    // Required methods
    fn decode(
        &mut self,
        packet: &[u8],
        pts: i64,
    ) -> Result<Vec<AudioFrame>, AudioError>;
    fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>;
}

Required Methods§

Source

fn decode( &mut self, packet: &[u8], pts: i64, ) -> Result<Vec<AudioFrame>, AudioError>

Decode one input packet at the given PTS (microseconds). May return zero or more output frames (zero is normal — some decoders need to see two frames before emitting one).

Source

fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>

Drain any frames buffered inside the decoder. Call once at EOS.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§