Struct cros_codecs::decoders::h264::dpb::Dpb

source ·
pub struct Dpb<T: DecodedHandle + Clone> { /* private fields */ }

Implementations§

source§

impl<T: DecodedHandle + Clone> Dpb<T>

source

pub fn pictures(&self) -> impl Iterator<Item = Ref<'_, PictureData>>

Returns an iterator over the underlying H264 pictures stored in the DPB.

source

pub fn pictures_mut(&mut self) -> impl Iterator<Item = RefMut<'_, PictureData>>

Returns a mutable iterator over the underlying H264 pictures stored in the DPB.

source

pub fn len(&self) -> usize

Returns the length of the DPB.

source

pub fn is_empty(&self) -> bool

source

pub fn entries(&self) -> &Vec<DpbEntry<T>>

Get a reference to the whole DPB entries.

source

pub fn set_max_num_pics(&mut self, max_num_pics: usize)

Set the dpb’s max num pics.

source

pub fn max_num_pics(&self) -> usize

Get a reference to the dpb’s max num pics.

source

pub fn num_ref_frames(&self) -> usize

source

pub fn interlaced(&self) -> bool

Get a reference to the dpb’s interlaced mode.

source

pub fn set_interlaced(&mut self, interlaced: bool)

Set the dpb’s interlaced mode.

source

pub fn find_short_term_lowest_frame_num_wrap( &self ) -> Option<Rc<RefCell<PictureData>>>

Find the short term reference picture with the lowest frame_num_wrap value.

source

pub fn mark_all_as_unused_for_ref(&mut self)

Mark all pictures in the DPB as unused for reference.

source

pub fn remove_unused(&mut self)

Remove unused pictures from the DPB. A picture is not going to be used anymore if it’s a) not a reference and b) not needed for output

source

pub fn find_short_term_with_pic_num(&self, pic_num: i32) -> Option<DpbEntry<T>>

Find a short term reference picture with the given pic_num value.

source

pub fn find_long_term_with_long_term_pic_num( &self, long_term_pic_num: i32 ) -> Option<DpbEntry<T>>

Find a long term reference picture with the given long_term_pic_num value.

source

pub fn store_picture( &mut self, picture: Rc<RefCell<PictureData>>, handle: Option<T> ) -> Result<()>

Store a picture and its backend handle in the DPB.

source

pub fn has_empty_frame_buffer(&self) -> bool

Whether the DPB has an empty slot for a new picture.

source

pub fn needs_bumping(&self, to_insert: &PictureData) -> bool

Whether the DPB needs bumping, as described by clauses 1, 4, 5, 6 of C.4.5.3 “Bumping” process.

source

pub fn bump(&mut self, flush: bool) -> Option<DpbEntry<T>>

Bump the dpb, returning a picture as per the bumping process described in C.4.5.3. Note that this picture will still be referenced by its pair, if any.

source

pub fn drain(&mut self) -> Vec<DpbEntry<T>>

Drains the DPB by continuously invoking the bumping process.

source

pub fn clear(&mut self)

Clears the DPB, dropping all the pictures.

source

pub fn get_short_term_refs(&self, out: &mut Vec<DpbEntry<T>>)

Gets a Vec of short term refs into out

source

pub fn get_long_term_refs(&self, out: &mut Vec<DpbEntry<T>>)

Gets a Vec of long term refs into out

Trait Implementations§

source§

impl<T: DecodedHandle + Clone> Debug for Dpb<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: DecodedHandle + Clone> Default for Dpb<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Dpb<T>

§

impl<T> !Send for Dpb<T>

§

impl<T> !Sync for Dpb<T>

§

impl<T> Unpin for Dpb<T>where T: Unpin,

§

impl<T> !UnwindSafe for Dpb<T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.