[][src]Trait ac_ffmpeg::codec::Decoder

pub trait Decoder {
    type CodecParameters;
    type Frame;
    fn codec_parameters(&self) -> Self::CodecParameters;
fn try_push(&mut self, packet: Packet) -> Result<(), CodecError>;
fn try_flush(&mut self) -> Result<(), CodecError>;
fn take(&mut self) -> Result<Option<Self::Frame>, Error>; fn push(&mut self, packet: Packet) -> Result<(), Error> { ... }
fn flush(&mut self) -> Result<(), Error> { ... } }

A media decoder.

Common decoder operation

  1. Push a packet to the decoder.
  2. Take all frames from the decoder until you get None.
  3. If there are more packets to be decoded, continue with 1.
  4. Flush the decoder.
  5. Take all frames from the decoder until you get None.

Associated Types

Loading content...

Required methods

fn codec_parameters(&self) -> Self::CodecParameters

Get codec parameters.

fn try_push(&mut self, packet: Packet) -> Result<(), CodecError>

Push a given packet to the decoder.

fn try_flush(&mut self) -> Result<(), CodecError>

Flush the decoder.

fn take(&mut self) -> Result<Option<Self::Frame>, Error>

Take the next frame from the decoder.

Loading content...

Provided methods

fn push(&mut self, packet: Packet) -> Result<(), Error>

Push a given packet to the decoder.

Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

fn flush(&mut self) -> Result<(), Error>

Flush the decoder.

Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

Loading content...

Implementors

Loading content...