Skip to main content

VulkanQueueLock

Struct VulkanQueueLock 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.
Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Sync for VulkanQueueLock

Available on Linux and crate feature hwdevice only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.