Trait cros_codecs::decoders::h264::backends::StatelessDecoderBackend
source · [−]pub(crate) trait StatelessDecoderBackend: VideoDecoderBackend {
fn new_sequence(&mut self, sps: &Sps) -> Result<()>;
fn new_picture(&mut self, picture: &PictureData, timestamp: u64) -> Result<()>;
fn new_field_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
first_field: &Self::Handle
) -> Result<()>;
fn handle_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
sps: &Sps,
pps: &Pps,
dpb: &Dpb<Self::Handle>,
slice: &Slice<&[u8]>
) -> Result<()>;
fn decode_slice(
&mut self,
slice: &Slice<&[u8]>,
sps: &Sps,
pps: &Pps,
dpb: &Dpb<Self::Handle>,
ref_pic_list0: &[DpbEntry<Self::Handle>],
ref_pic_list1: &[DpbEntry<Self::Handle>]
) -> Result<()>;
fn submit_picture(
&mut self,
picture: &PictureData,
block: BlockingMode
) -> Result<Self::Handle>;
}
Expand description
Trait for stateless decoder backends. The decoder will call into the backend to request decode operations. The backend can operate in blocking mode, where it will wait until the current decode finishes, or in non-blocking mode, where it should return immediately with any previously decoded frames that happen to be ready.
Required Methods
sourcefn new_sequence(&mut self, sps: &Sps) -> Result<()>
fn new_sequence(&mut self, sps: &Sps) -> Result<()>
Called when a new SPS is parsed.
sourcefn new_picture(&mut self, picture: &PictureData, timestamp: u64) -> Result<()>
fn new_picture(&mut self, picture: &PictureData, timestamp: u64) -> Result<()>
Called when the decoder determines that a frame or field was found.
sourcefn new_field_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
first_field: &Self::Handle
) -> Result<()>
fn new_field_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
first_field: &Self::Handle
) -> Result<()>
Called when the decoder determines that a second field was found. Indicates that the underlying BackendHandle is to be shared between the two pictures. This is so both fields decode to the same underlying resource and can thus be presented together as a single frame.
Called by the decoder for every frame or field found.
Called to dispatch a decode operation to the backend.
sourcefn submit_picture(
&mut self,
picture: &PictureData,
block: BlockingMode
) -> Result<Self::Handle>
fn submit_picture(
&mut self,
picture: &PictureData,
block: BlockingMode
) -> Result<Self::Handle>
Called when the decoder wants the backend to finish the decoding
operations for picture
. At this point, decode_slice
has been called
for all slices. The argument block
dictates whether this call should
wait until the current decode finishes, or whether it should return
immediately.
This call will assign the ownership of the BackendHandle to the Picture and then assign the ownership of the Picture to the Handle.