Skip to main content

HardwareEncodeCapability

Struct HardwareEncodeCapability 

Source
pub struct HardwareEncodeCapability {
Show 17 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,
}
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 is asking for this path; an encoder 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. A backend that would need a copy between devices is 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 together with max_l1_references means no B pictures. None when the device does not report it.

§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 (a constant quantizer), and on D3D12 qvbr.

§plane_ring_slots: usize

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

§handoff_retained_surfaces: usize

Surfaces the handoff may still hold after the host has let go of them: a copying backend keeps each surface it copied into until its slot comes round again. They are allocated on top of the frames the host holds, so a budget has to count them.

§codec_retained_surfaces: usize

Surfaces the encoder itself still holds after it has accepted them, until it has consumed them. Also allocated on top of the host’s.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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,