Struct ac_ffmpeg::codec::audio::transcoder::AudioTranscoder
source · pub struct AudioTranscoder { /* private fields */ }
Expand description
Audio transcoder.
Transcoder operation
- Push a packet to the transcoder.
- Take all packets from the transcoder until you get None.
- If there are more packets to be transcoded, continue with 1.
- Flush the transcoder.
- Take all packets from the transcoder until you get None.
Implementations§
source§impl AudioTranscoder
impl AudioTranscoder
sourcepub fn new(
input: AudioCodecParameters,
output: AudioCodecParameters
) -> Result<AudioTranscoder, Error>
pub fn new(
input: AudioCodecParameters,
output: AudioCodecParameters
) -> Result<AudioTranscoder, Error>
Create a new transcoder for a given input and output.
sourcepub fn builder(
input: AudioCodecParameters,
output: AudioCodecParameters
) -> Result<AudioTranscoderBuilder, Error>
pub fn builder(
input: AudioCodecParameters,
output: AudioCodecParameters
) -> Result<AudioTranscoderBuilder, Error>
Create a new transcoder builder for a given input and output.
sourcepub fn codec_parameters(&self) -> AudioCodecParameters
pub fn codec_parameters(&self) -> AudioCodecParameters
Get codec parameters of the transcoded stream.
sourcepub fn push(&mut self, packet: Packet) -> Result<(), Error>
pub fn push(&mut self, packet: Packet) -> Result<(), Error>
Push a given packet to the transcoder.
Panics
The method panics if the operation is not expected (i.e. another operation needs to be done).
sourcepub fn try_push(&mut self, packet: Packet) -> Result<(), CodecError>
pub fn try_push(&mut self, packet: Packet) -> Result<(), CodecError>
Push a given packet to the transcoder.
sourcepub fn flush(&mut self) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
Flush the transcoder.
Panics
The method panics if the operation is not expected (i.e. another operation needs to be done).
sourcepub fn try_flush(&mut self) -> Result<(), CodecError>
pub fn try_flush(&mut self) -> Result<(), CodecError>
Flush the transcoder.