Trait re_video::decode::AsyncDecoder

source ·
pub trait AsyncDecoder: Send + Sync {
    // Required methods
    fn submit_chunk(&mut self, chunk: Chunk) -> Result<()>;
    fn reset(&mut self) -> Result<()>;

    // Provided methods
    fn end_of_video(&mut self) -> Result<()> { ... }
    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§

source

fn submit_chunk(&mut self, chunk: Chunk) -> Result<()>

Submits a chunk for decoding in the background.

Chunks are expected to come in the order of their decoding timestamp.

source

fn reset(&mut self) -> Result<()>

Resets the decoder.

This does not block, all chunks sent to decode before this point will be discarded.

Provided Methods§

source

fn end_of_video(&mut self) -> Result<()>

Called after submitting the last chunk.

Should flush all pending frames.

source

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.

Implementors§