pub struct VulkanFrameAccessGuard<'a> { /* private fields */ }Expand description
Guard for one locked FFmpeg frame and queue handoff.
Safe code can read the frame’s state but not change what is written back to it: a timeline value nothing signals would hang every later user of the frame, and a layout the image is not in makes its contents undefined.
let mut guard = lease.lock_access().unwrap();
guard.access_mut().frame_mut().semaphore_values[0] += 1000;
guard.commit();Implementations§
Source§impl VulkanFrameAccessGuard<'_>
impl VulkanFrameAccessGuard<'_>
Sourcepub const fn access(&self) -> &VulkanFrameAccess
pub const fn access(&self) -> &VulkanFrameAccess
The frame’s state while its FFmpeg locks are held.
Sourcepub const unsafe fn access_mut(&mut self) -> &mut VulkanFrameAccess
pub const unsafe fn access_mut(&mut self) -> &mut VulkanFrameAccess
The record written back to the frame on Self::commit, for a
submission to update.
The end call writes a plane back only while its image and semaphore
are the ones begin read, and a timeline value only when it does not
go below the frame’s; the rest it cannot check.
§Safety
When the guard is committed, each plane’s layout and access mask must
be the ones the work submitted on it leaves the image in, and each
timeline value one that work submitted before the guard drops
signals: FFmpeg waits for it before its next use of the frame.
Trait Implementations§
Source§impl Drop for VulkanFrameAccessGuard<'_>
Available on Linux and crate feature hwdevice only.
impl Drop for VulkanFrameAccessGuard<'_>
hwdevice only.