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.
Auto Trait Implementations§
impl Freeze for AudioTranscoder
impl RefUnwindSafe for AudioTranscoder
impl Send for AudioTranscoder
impl Sync for AudioTranscoder
impl Unpin for AudioTranscoder
impl UnwindSafe for AudioTranscoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more