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.
A device can encode one codec and not another, so each export asks about its own. Linux and macOS have 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: on Windows the first of H.264, HEVC and AV1 this device encodes, elsewhere the one encoder there is.
§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.
Everything that can refuse does so before the output file exists.
§Errors
HardwareEncodeOpenError::Refused before any output exists,
HardwareEncodeOpenError::Failed once creating it went wrong.