Trait cros_codecs::decoders::VideoDecoderBackend
source · [−]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
sourcetype Handle: DecodedHandle
type Handle: DecodedHandle
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
sourcefn coded_resolution(&self) -> Option<Resolution>
fn coded_resolution(&self) -> Option<Resolution>
Returns the current coded resolution of the bitstream being processed. This may be None if we have not read the stream parameters yet.
sourcefn display_resolution(&self) -> Option<Resolution>
fn display_resolution(&self) -> Option<Resolution>
Returns the current display resolution of the bitstream being processed. This may be None if we have not read the stream parameters yet.
sourcefn num_resources_total(&self) -> usize
fn num_resources_total(&self) -> usize
Gets the number of output resources allocated by the backend.
sourcefn num_resources_left(&self) -> usize
fn num_resources_left(&self) -> usize
Gets the number of output resources left in the backend.
sourcefn format(&self) -> Option<DecodedFormat>
fn format(&self) -> Option<DecodedFormat>
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.
sourcefn try_format(&mut self, format: DecodedFormat) -> Result<()>
fn try_format(&mut self, format: DecodedFormat) -> Result<()>
Try altering the decoded format.
Poll for any ready pictures. block
dictates whether this call should
block on the operation or return immediately.
sourcefn handle_is_ready(&self, handle: &Self::Handle) -> bool
fn handle_is_ready(&self, handle: &Self::Handle) -> bool
Whether the handle is ready for presentation. The decoder will check this before returning the handle to clients.
sourcefn block_on_handle(
&mut self,
handle: &Self::Handle
) -> StatelessBackendResult<()>
fn block_on_handle(
&mut self,
handle: &Self::Handle
) -> StatelessBackendResult<()>
Block on handle handle
.