pub struct VulkanImportLease { /* private fields */ }Expand description
Owns the imported texture, FFmpeg frame, and native transition commands.
Implementations§
Source§impl VulkanImportLease
impl VulkanImportLease
Sourcepub const fn retained_bytes(&self) -> u64
pub const fn retained_bytes(&self) -> u64
Approximate decoded-surface bytes retained by this import.
Sourcepub fn staged_signals(&self) -> usize
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.
Sourcepub fn prepare_submission(self: &Arc<Self>)
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.
Sourcepub fn flush_submission(&self) -> Result<(), BridgeError>
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.
Sourcepub fn submitted(&self) -> Result<(), BridgeError>
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
impl Debug for VulkanImportLease
Source§impl Drop for VulkanImportLease
impl Drop for VulkanImportLease
Source§fn drop(&mut self)
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.