pub struct HardwareEncodeDevice { /* private fields */ }Expand description
The renderer’s device, as a hardware encoder can use it.
Implementations§
Source§impl HardwareEncodeDevice
impl HardwareEncodeDevice
Sourcepub const fn vulkan(context: SharedVulkanContext) -> Self
pub const fn vulkan(context: SharedVulkanContext) -> Self
The shared Vulkan device the renderer runs on.
Sourcepub fn capability(
&self,
codec: NativeVideoCodec,
) -> Result<HardwareEncodeCapability, String>
pub fn capability( &self, codec: NativeVideoCodec, ) -> Result<HardwareEncodeCapability, String>
What this device’s hardware encoder accepts for codec.
Windows and Linux ask the device per codec; macOS has one hardware encoder, for H.264.
§Errors
Says why this device has no usable hardware encoder for codec.
Sourcepub fn preferred_capability(&self) -> Result<HardwareEncodeCapability, String>
pub fn preferred_capability(&self) -> Result<HardwareEncodeCapability, String>
The capability a report leads with: the first of H.264, HEVC and AV1 the device encodes (Windows, Linux), or the one encoder on macOS.
§Errors
Says why this device has no usable hardware encoder at all.
Sourcepub fn open(
&self,
request: &HardwareEncodeRequest<'_>,
) -> Result<(HardwareEncodeSession, HardwareEncodeInput), HardwareEncodeOpenError>
pub fn open( &self, request: &HardwareEncodeRequest<'_>, ) -> Result<(HardwareEncodeSession, HardwareEncodeInput), HardwareEncodeOpenError>
Opens a session writing request.output and its input half.
§Errors
HardwareEncodeOpenError::Refused before any output exists,
HardwareEncodeOpenError::Failed once creating it went wrong.
Trait Implementations§
Source§impl Clone for HardwareEncodeDevice
impl Clone for HardwareEncodeDevice
Auto Trait Implementations§
impl !RefUnwindSafe for HardwareEncodeDevice
impl !Sync for HardwareEncodeDevice
impl !UnwindSafe for HardwareEncodeDevice
impl Freeze for HardwareEncodeDevice
impl Send for HardwareEncodeDevice
impl Unpin for HardwareEncodeDevice
impl UnsafeUnpin for HardwareEncodeDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more