[][src]Trait ac_ffmpeg::codec::Encoder

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

A media encoder.

Common encoder operation

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

Associated Types

Loading content...

Required methods

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

Get codec parameters.

fn try_push(&mut self, frame: Self::Frame) -> Result<(), CodecError>

Push a given frame to the encoder.

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

Flush the encoder.

fn take(&mut self) -> Result<Option<Packet>, Error>

Take the next packet from the encoder.

Loading content...

Provided methods

fn push(&mut self, frame: Self::Frame) -> Result<(), Error>

Push a given frame to the encoder.

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

Panics

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

Loading content...

Implementors

Loading content...