pub(crate) trait VideoDecoderBackend {
    type Handle: DecodedHandle;

    fn coded_resolution(&self) -> Option<Resolution>;
    fn display_resolution(&self) -> Option<Resolution>;
    fn num_resources_total(&self) -> usize;
    fn num_resources_left(&self) -> usize;
    fn format(&self) -> Option<DecodedFormat>;
    fn try_format(&mut self, format: DecodedFormat) -> Result<()>;
    fn poll(
        &mut self,
        blocking_mode: BlockingMode
    ) -> Result<VecDeque<Self::Handle>>; fn handle_is_ready(&self, handle: &Self::Handle) -> bool; fn block_on_handle(
        &mut self,
        handle: &Self::Handle
    ) -> StatelessBackendResult<()>; }

Required Associated Types

The type that the backend returns as a result of a decode operation. This will usually be some backend-specific type with a resource and a resource pool so that said buffer can be reused for another decode operation when it goes out of scope.

Required Methods

Returns the current coded resolution of the bitstream being processed. This may be None if we have not read the stream parameters yet.

Returns the current display resolution of the bitstream being processed. This may be None if we have not read the stream parameters yet.

Gets the number of output resources allocated by the backend.

Gets the number of output resources left in the backend.

Gets the chosen format. This is set to a default after the decoder reads enough stream metadata from the bitstream. Some buffers need to be processed first before the default format can be set.

Try altering the decoded format.

Poll for any ready pictures. block dictates whether this call should block on the operation or return immediately.

Whether the handle is ready for presentation. The decoder will check this before returning the handle to clients.

Block on handle handle.

Implementors