pub trait AsyncDecoder: Send + Sync {
// Required methods
fn submit_chunk(&mut self, chunk: Chunk) -> Result<(), Error>;
fn reset(&mut self) -> Result<(), Error>;
// Provided methods
fn end_of_video(&mut self) -> Result<(), Error> { ... }
fn min_num_samples_to_enqueue_ahead(&self) -> usize { ... }
}
Expand description
Interface for an asynchronous video decoder.
Output callback is passed in on creation of a concrete type.
Required Methods§
Provided Methods§
Sourcefn end_of_video(&mut self) -> Result<(), Error>
fn end_of_video(&mut self) -> Result<(), Error>
Called after submitting the last chunk.
Should flush all pending frames.
Sourcefn min_num_samples_to_enqueue_ahead(&self) -> usize
fn min_num_samples_to_enqueue_ahead(&self) -> usize
Minimum number of samples the decoder requests to stay head of the currently requested sample.
I.e. if sample N is requested, then the encoder would like to see at least all the samples from
[start of N’s GOP] until [N + min_num_samples_to_enqueue_ahead
].
Codec specific constraints regarding what samples can be decoded (samples may depend on other samples in their GOP)
still apply independently of this.
This can be used as a workaround for decoders that are known to need additional samples to produce outputs.