pub trait Decoder: Send {
// Required methods
fn stream_info(&self) -> &StreamInfo;
fn push_sample(&mut self, data: &[u8]) -> Result<()>;
fn finish(&mut self) -> Result<()>;
fn decode_next(&mut self) -> Result<Option<VideoFrame>>;
}Required Methods§
fn stream_info(&self) -> &StreamInfo
Sourcefn push_sample(&mut self, data: &[u8]) -> Result<()>
fn push_sample(&mut self, data: &[u8]) -> Result<()>
Feed one Annex-B (or codec-native — AV1 OBU, VP9 superframe) sample
into the decoder. Implementations may buffer internally until
finish is called or may decode eagerly and buffer produced
frames. Pull frames via decode_next at any point.
Sourcefn finish(&mut self) -> Result<()>
fn finish(&mut self) -> Result<()>
Signal end-of-stream. After this, no more push_sample calls;
decode_next drains remaining frames.
fn decode_next(&mut self) -> Result<Option<VideoFrame>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".