Skip to main content

HardwareEncodeCapability

Struct HardwareEncodeCapability 

Source
pub struct HardwareEncodeCapability {
Show 18 fields pub backend: HardwareEncodeBackend, pub encoder: &'static str, pub codec: NativeVideoCodec, pub gpu_input_only: bool, pub input_layout: EncoderInputLayout, pub handoff: EncoderInputHandoff, pub shares_renderer_device: bool, pub minimum: (u32, u32), pub maximum: (u32, u32), pub granularity: (u32, u32), pub max_p_picture_l0_references: Option<u32>, pub max_b_picture_l0_references: Option<u32>, pub max_l1_references: Option<u32>, pub rate_control_modes: Vec<&'static str>, pub plane_ring_slots: usize, pub handoff_retained_surfaces: usize, pub codec_retained_surfaces: usize, pub default_channel_depth: usize,
}
Expand description

What one hardware encoder accepts on this device, read from the device.

Fields§

§backend: HardwareEncodeBackend

The native API the session drives.

§encoder: &'static str

The FFmpeg encoder a session opens.

§codec: NativeVideoCodec

The codec it encodes.

§gpu_input_only: bool

Whether the encoder takes GPU frames only. Pinning such an encoder selects this path; one the readback path can also feed (h264_videotoolbox) can be pinned on either.

§input_layout: EncoderInputLayout

The surface layout it takes.

§handoff: EncoderInputHandoff

How a packed frame reaches its surface.

§shares_renderer_device: bool

Whether the encoder runs on the renderer’s own device. Backends needing a cross-device copy are not offered as GPU-resident.

§minimum: (u32, u32)

Smallest accepted coded width and height.

§maximum: (u32, u32)

Largest accepted coded width and height.

§granularity: (u32, u32)

Granularity the output size is aligned up to before the limits apply.

§max_p_picture_l0_references: Option<u32>

References a P picture may use, when the device reports it.

§max_b_picture_l0_references: Option<u32>

Forward references a B picture may use; zero with max_l1_references zero means no B pictures. None when not reported.

§max_l1_references: Option<u32>

Backward references a B picture may use, when the device reports it.

§rate_control_modes: Vec<&'static str>

The rate-control modes the device reports: cbr, vbr, disabled (constant quantizer), and on D3D12 qvbr.

§plane_ring_slots: usize

Plane-texture pairs the renderer packs into, allocated for the whole session. Zero when it packs into the surfaces themselves.

§handoff_retained_surfaces: usize

Surfaces the handoff may still hold after the host released them (a copying backend keeps each until its slot comes round). Allocated on top of the host’s, so budgets count them.

§codec_retained_surfaces: usize

Surfaces the encoder holds after accepting them, until consumed. Also on top of the host’s.

§default_channel_depth: usize

The default encode channel depth (ALPHA2_ENCODE_QUEUE_DEPTH overrides): the smallest depth within 3 % of the best measured per-frame time on this backend.

Implementations§

Source§

impl HardwareEncodeCapability

Source

pub const fn retained_surfaces(&self) -> usize

Every surface the pool may hold beyond those the host has leased.

Source§

impl HardwareEncodeCapability

Source

pub const fn coded(&self, width: u32, height: u32) -> (u32, u32)

The coded extent an output of this size is encoded at.

Source

pub fn accepts(&self, width: u32, height: u32) -> Result<(), String>

Whether an output of this size can be encoded, and if not, why.

§Errors

Names the limit the size misses.

Trait Implementations§

Source§

impl Clone for HardwareEncodeCapability

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HardwareEncodeCapability

Source§

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

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

impl Eq for HardwareEncodeCapability

Source§

impl PartialEq for HardwareEncodeCapability

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HardwareEncodeCapability

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,