pub struct VulkanQueueLock { /* private fields */ }Expand description
Serializes one shared Vulkan queue family across FFmpeg and the renderer.
The bridge installs its own recursive queue locks on the device context, so
this handle takes the same lock FFmpeg takes around its own submissions.
It is only made over a context create_vulkan_device_context set up:
any other has no such lock, and one of another device type keeps other
data where the shim keeps its locks.
Implementations§
Source§impl VulkanQueueLock
impl VulkanQueueLock
Sourcepub fn new(
device: AVHWDeviceContext,
queue_family: u32,
) -> Result<Self, BridgeError>
pub fn new( device: AVHWDeviceContext, queue_family: u32, ) -> Result<Self, BridgeError>
Locks submissions to queue_family on device.
§Errors
Returns an input error unless device is a context
create_vulkan_device_context initialized and queue_family is one
it keeps a lock for. Locking anything else would serialize nothing.
Sourcepub fn lock(&self) -> VulkanQueueGuard<'_>
pub fn lock(&self) -> VulkanQueueGuard<'_>
Holds the shared queue lock until the returned guard drops, on this thread: the lock is a mutex its owning thread has to release.
Sourcepub unsafe fn raw_lock(&self)
pub unsafe fn raw_lock(&self)
Acquires the shared queue lock without a guard, for an adapter to a lock/unlock protocol of its own.
§Safety
The calling thread must release it with exactly one
Self::raw_unlock, in the reverse order of every other hold it
takes on this lock.
Sourcepub unsafe fn raw_unlock(&self)
pub unsafe fn raw_unlock(&self)
Releases a hold taken by Self::raw_lock.
§Safety
The calling thread must hold the lock from a Self::raw_lock not
yet released, and this must be the most recent hold it took. A mutex
another thread holds cannot be released, and an unbalanced release
lets two submissions reach the queue at once.
Trait Implementations§
Source§impl Debug for VulkanQueueLock
Available on Linux and crate feature hwdevice only.
impl Debug for VulkanQueueLock
hwdevice only.impl Sync for VulkanQueueLock
hwdevice only.