Skip to main content

VulkanFrameLease

Struct VulkanFrameLease 

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

Ref-counted ownership of an opaque FFmpeg Vulkan frame.

Implementations§

Source§

impl VulkanFrameLease

Source

pub fn new(frame: AVFrame) -> Self

Takes ownership of one decoded AV_PIX_FMT_VULKAN frame.

Source

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

Copies this frame’s pixels to the CPU, for a surface that could not be imported.

Every byte of the copy’s rows, up to its linesizes, is written (the padding past the pixels is zero), so its planes are shared.

§Errors

Returns BridgeError when FFmpeg cannot transfer the frame.

Source

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

Returns a locked snapshot of the frame’s native image state.

§Errors

Returns BridgeError when the frame or its hardware context is invalid.

Source

pub fn lock_access(&self) -> Result<VulkanFrameAccessGuard<'_>, BridgeError>

Locks the FFmpeg frame and queue for one native GPU handoff.

§Errors

Returns BridgeError if the frame has no usable sampled images or queue.

Trait Implementations§

Source§

impl Debug for VulkanFrameLease

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

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.