pub struct AcquiredFrameView<'a> { /* private fields */ }Expand description
A view scope of AcquiredFrameHandle, which ends when it drops. Its
getters lend values that stay valid until then, and its owner can’t
be consumed while it lives.
Keeps an acquired frame’s texture and sync objects in place while you use them.
See mln_acquired_frame_view_begin in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Implementations§
Source§impl AcquiredFrameView<'_>
impl AcquiredFrameView<'_>
Sourcepub fn get_dma_buf(&self) -> Result<Lent<'_, DmaBufFrame>>
pub fn get_dma_buf(&self) -> Result<Lent<'_, DmaBufFrame>>
Gets the dmabuf of an acquired frame.
Wait for AcquiredFrameView::get_producer_sync() before you read the
buffer. Once you release or discard the frame, the session may render
into the buffer again. You can map a buffer with DRM_FORMAT_MOD_LINEAR,
which has one plane, with mmap, and bracket your reads with
DMA_BUF_IOCTL_SYNC.
The session owns the planes’ file descriptors, so don’t close them. To
keep the buffer after you release the frame, duplicate each file
descriptor with dup. A duplicate keeps the buffer’s memory, but not
its contents.
See mln_acquired_frame_get_dma_buf in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Sourcepub fn get_open_gl_texture(&self) -> Result<Lent<'_, OpenGlTextureFrame>>
pub fn get_open_gl_texture(&self) -> Result<Lent<'_, OpenGlTextureFrame>>
Gets the OpenGL texture of an acquired frame.
See mln_acquired_frame_get_open_gl_texture in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Sourcepub fn get_producer_sync(&self) -> Result<Lent<'_, GpuSync>>
pub fn get_producer_sync(&self) -> Result<Lent<'_, GpuSync>>
Reads what to wait for before you read an acquired frame’s texture.
See mln_acquired_frame_get_producer_sync in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Sourcepub fn get_vulkan_texture(&self) -> Result<Lent<'_, VulkanTextureFrame>>
pub fn get_vulkan_texture(&self) -> Result<Lent<'_, VulkanTextureFrame>>
Gets the Vulkan image of an acquired frame.
See mln_acquired_frame_get_vulkan_texture in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for AcquiredFrameView<'a>
impl<'a> RefUnwindSafe for AcquiredFrameView<'a>
impl<'a> Send for AcquiredFrameView<'a>
impl<'a> Sync for AcquiredFrameView<'a>
impl<'a> Unpin for AcquiredFrameView<'a>
impl<'a> UnsafeUnpin for AcquiredFrameView<'a>
impl<'a> UnwindSafe for AcquiredFrameView<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more