pub trait Decoder {
// Required methods
fn init(&mut self) -> Result<()>;
fn decode(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize>;
fn get_info(&self) -> DecoderInfo;
fn get_state(&self) -> Result<DecoderState>;
fn reset(&mut self) -> Result<()>;
}
Expand description
Audio decoder interface
This trait defines the operations for audio decoders, supporting initialization, decoding, and state management.
Required Methods§
Sourcefn decode(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize>
fn decode(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize>
Decode a block of input data Returns the number of bytes written to output
Sourcefn get_info(&self) -> DecoderInfo
fn get_info(&self) -> DecoderInfo
Get decoder capabilities and information
Sourcefn get_state(&self) -> Result<DecoderState>
fn get_state(&self) -> Result<DecoderState>
Get current decoder state