Trait ac_ffmpeg::codec::Decoder

source ·
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> { ... }
}
Expand description

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.

Required Associated Types§

Required Methods§

Get codec parameters.

Push a given packet to the decoder.

Flush the decoder.

Take the next frame from the decoder.

Provided Methods§

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).

Flush the decoder.

Panics

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

Implementors§