pub struct OutputQueue {
num_buffers: usize,
buffers: BTreeMap<u32, GuestResource>,
ready_buffers: VecDeque<u32>,
}
Expand description
Queue of all the output buffers provided by crosvm.
Fields§
§num_buffers: usize
§buffers: BTreeMap<u32, GuestResource>
§ready_buffers: VecDeque<u32>
Implementations§
source§impl OutputQueue
impl OutputQueue
sourcepub fn new(num_buffers: usize) -> Self
pub fn new(num_buffers: usize) -> Self
Creates a new output queue capable of containing num_buffers
buffers.
sourcepub fn import_buffer(
&mut self,
picture_buffer_id: u32,
resource: GuestResource,
) -> Result<(), OutputBufferImportError>
pub fn import_buffer( &mut self, picture_buffer_id: u32, resource: GuestResource, ) -> Result<(), OutputBufferImportError>
Import a buffer, i.e. associate the buffer’s resource
to a given picture_buffer_id
, and
make the buffer ready for use.
A buffer with a given picture_buffer_id
can only be imported once.
sourcepub fn reuse_buffer(
&mut self,
picture_buffer_id: u32,
) -> Result<(), OutputBufferReuseError>
pub fn reuse_buffer( &mut self, picture_buffer_id: u32, ) -> Result<(), OutputBufferReuseError>
Mark the previously-imported buffer with ID picture_buffer_id
as ready for being used.
sourcepub fn try_get_ready_buffer(&mut self) -> Option<(u32, &mut GuestResource)>
pub fn try_get_ready_buffer(&mut self) -> Option<(u32, &mut GuestResource)>
Get a buffer ready to be decoded into, if any is available.
pub fn clear_ready_buffers(&mut self)
Auto Trait Implementations§
impl Freeze for OutputQueue
impl RefUnwindSafe for OutputQueue
impl Send for OutputQueue
impl Sync for OutputQueue
impl Unpin for OutputQueue
impl UnwindSafe for OutputQueue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.