Trait StatelessH264DecoderBackend

Source
pub trait StatelessH264DecoderBackend: StatelessDecoderBackend + StatelessDecoderBackendPicture<H264> {
    // Required methods
    fn new_sequence(&mut self, sps: &Rc<Sps>) -> StatelessBackendResult<()>;
    fn new_picture(&mut self, timestamp: u64) -> NewPictureResult<Self::Picture>;
    fn new_field_picture(
        &mut self,
        timestamp: u64,
        first_field: &Self::Handle,
    ) -> NewPictureResult<Self::Picture>;
    fn start_picture(
        &mut self,
        picture: &mut Self::Picture,
        picture_data: &PictureData,
        sps: &Sps,
        pps: &Pps,
        dpb: &Dpb<Self::Handle>,
        hdr: &SliceHeader,
    ) -> StatelessBackendResult<()>;
    fn decode_slice(
        &mut self,
        picture: &mut Self::Picture,
        slice: &Slice<'_>,
        sps: &Sps,
        pps: &Pps,
        ref_pic_list0: &[&DpbEntry<Self::Handle>],
        ref_pic_list1: &[&DpbEntry<Self::Handle>],
    ) -> StatelessBackendResult<()>;
    fn submit_picture(
        &mut self,
        picture: Self::Picture,
    ) -> StatelessBackendResult<Self::Handle>;
}
Expand description

Stateless backend methods specific to H.264.

Required Methods§

Source

fn new_sequence(&mut self, sps: &Rc<Sps>) -> StatelessBackendResult<()>

Called when a new SPS is parsed.

Source

fn new_picture(&mut self, timestamp: u64) -> NewPictureResult<Self::Picture>

Called when the decoder determines that a frame or field was found.

Source

fn new_field_picture( &mut self, timestamp: u64, first_field: &Self::Handle, ) -> NewPictureResult<Self::Picture>

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.

Source

fn start_picture( &mut self, picture: &mut Self::Picture, picture_data: &PictureData, sps: &Sps, pps: &Pps, dpb: &Dpb<Self::Handle>, hdr: &SliceHeader, ) -> StatelessBackendResult<()>

Called by the decoder when starting a new frame or field.

Source

fn decode_slice( &mut self, picture: &mut Self::Picture, slice: &Slice<'_>, sps: &Sps, pps: &Pps, ref_pic_list0: &[&DpbEntry<Self::Handle>], ref_pic_list1: &[&DpbEntry<Self::Handle>], ) -> StatelessBackendResult<()>

Called to dispatch a decode operation to the backend.

Source

fn submit_picture( &mut self, picture: Self::Picture, ) -> StatelessBackendResult<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.

This call will assign the ownership of the BackendHandle to the Picture and then assign the ownership of the Picture to the Handle.

Implementors§