Struct cros_codecs::utils::vaapi::SurfacePoolHandle
source · [−]pub struct SurfacePoolHandle {
surfaces: Rc<RefCell<VecDeque<Surface>>>,
coded_resolution: Resolution,
}
Expand description
A surface pool handle to reduce the number of costly Surface allocations.
Fields
surfaces: Rc<RefCell<VecDeque<Surface>>>
coded_resolution: Resolution
Implementations
sourceimpl SurfacePoolHandle
impl SurfacePoolHandle
sourcepub fn new(surfaces: Vec<Surface>, resolution: Resolution) -> Self
pub fn new(surfaces: Vec<Surface>, resolution: Resolution) -> Self
Creates a new pool
sourcepub fn coded_resolution(&self) -> Resolution
pub fn coded_resolution(&self) -> Resolution
Retrieve the current coded resolution of the pool
sourcepub fn add_surface(&mut self, surface: Surface)
pub fn add_surface(&mut self, surface: Surface)
Adds a new surface to the pool
sourcepub fn get_surface(&mut self) -> Option<Surface>
pub fn get_surface(&mut self) -> Option<Surface>
Gets a free surface from the pool
sourcepub fn num_surfaces_left(&self) -> usize
pub fn num_surfaces_left(&self) -> usize
Returns new number of surfaces left.
Trait Implementations
sourceimpl Clone for SurfacePoolHandle
impl Clone for SurfacePoolHandle
sourcefn clone(&self) -> SurfacePoolHandle
fn clone(&self) -> SurfacePoolHandle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl !RefUnwindSafe for SurfacePoolHandle
impl !Send for SurfacePoolHandle
impl !Sync for SurfacePoolHandle
impl Unpin for SurfacePoolHandle
impl !UnwindSafe for SurfacePoolHandle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more