Skip to main content

VulkanImportLease

Struct VulkanImportLease 

Source
pub struct VulkanImportLease { /* private fields */ }
Expand description

Owns the imported texture, FFmpeg frame, and native transition commands.

Implementations§

Source§

impl VulkanImportLease

Source

pub const fn retained_bytes(&self) -> u64

Approximate decoded-surface bytes retained by this import.

Source

pub fn staged_signals(&self) -> usize

Timeline signals this lease has staged on the wgpu queue: nonzero only between staging the sampling submission and its completion. A nonzero count when the next frame starts staging means a stale signal would ride on it.

Source

pub fn prepare_submission(self: &Arc<Self>)

Queues this import for the next Self::flush_submission, which acquires the frame and adds its timeline signals to the sampling wgpu submission. Queuing twice is harmless.

Source

pub fn flush_submission(&self) -> Result<(), BridgeError>

Acquires every queued import of this context, one native submission per frame under that frame’s lock, and stages the signals of the sampling wgpu submission.

§Errors

Returns an error if a frame cannot be locked, its acquire fails, or its signals cannot be staged. Imports not yet acquired can be queued again for a retry.

Source

pub fn submitted(&self) -> Result<(), BridgeError>

Records that the wgpu submission sampling this import was made.

If the frame’s signals were staged on it, the frame already records its value and layout. Otherwise the planes are returned to FFmpeg’s layout in a submission of their own.

§Errors

Returns an error if the frame can no longer be locked or submitted.

Trait Implementations§

Source§

impl Debug for VulkanImportLease

Source§

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

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

impl Drop for VulkanImportLease

Source§

fn drop(&mut self)

Leaves the frame in a state FFmpeg can continue from, and returns the ticket.

An acquired lease whose sampling submission never released it still owes the frame its signal. If the signal was staged, the frame records that value and a later decode may already wait on it, so removing the signal alone would hang the decode queue. Under the frame’s lock (held by FFmpeg from reading the value to submitting its wait), an unsubmitted signal is taken off wgpu’s queue and raised by a submission of its own after the acquire. A lease with nothing staged releases the frame from its current state.

The ticket goes back to the pool, which reuses it only after every fence it submitted has signalled, since an acquire may still be waiting on the decoder.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for VulkanImportLease

Source§

impl Sync for VulkanImportLease

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,