pub trait AudioDecoder: Send {
// Required methods
fn decode(
&mut self,
packet: &[u8],
pts: i64,
) -> Result<Vec<AudioFrame>, AudioError>;
fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>;
}Required Methods§
Sourcefn decode(
&mut self,
packet: &[u8],
pts: i64,
) -> Result<Vec<AudioFrame>, AudioError>
fn decode( &mut self, packet: &[u8], pts: i64, ) -> Result<Vec<AudioFrame>, AudioError>
Decode one input packet at the given PTS (microseconds). May return zero or more output frames (zero is normal — some decoders need to see two frames before emitting one).
Sourcefn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>
fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>
Drain any frames buffered inside the decoder. Call once at EOS.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".