Skip to main content

HardwareZeroCopyDecoder

Struct HardwareZeroCopyDecoder 

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

Zero-copy GPU interop hardware decoder adapter producing VideoGpuSurfaceHandle frames without CPU readback.

Implementations§

Source§

impl HardwareZeroCopyDecoder

Constructors for HardwareZeroCopyDecoder.

Source

pub fn for_backend(kind: HardwareDecoderKind, device_id: u64) -> Self

Creates a zero-copy GPU interop hardware decoder adapter bound to kind and device_id.

§Arguments
  • HardwareDecoderKind - Target hardware backend (VideoToolbox, MediaCodec, Vaapi, Dxva, WebCodecs).
  • u64 - Target GPU device identifier.
§Returns
  • Self - Initialized zero-copy GPU hardware decoder adapter.
Source§

impl HardwareZeroCopyDecoder

Source

pub fn get_kind(&self) -> HardwareDecoderKind

Source

pub fn get_mut_kind(&mut self) -> &mut HardwareDecoderKind

Source

pub fn set_kind(&mut self, val: HardwareDecoderKind) -> &mut Self

Source

pub fn get_device_id(&self) -> u64

Source

pub fn get_mut_device_id(&mut self) -> &mut u64

Source

pub fn set_device_id(&mut self, val: u64) -> &mut Self

Source

pub fn get_pixel_format(&self) -> VideoPixelFormat

Source

pub fn get_mut_pixel_format(&mut self) -> &mut VideoPixelFormat

Source

pub fn set_pixel_format(&mut self, val: VideoPixelFormat) -> &mut Self

Source

pub fn get_config(&self) -> VideoDecoderConfig

Source

pub fn get_mut_config(&mut self) -> &mut VideoDecoderConfig

Source

pub fn set_config(&mut self, val: VideoDecoderConfig) -> &mut Self

Source

pub fn get_next_surface_id(&self) -> u64

Source

pub fn get_mut_next_surface_id(&mut self) -> &mut u64

Source

pub fn set_next_surface_id(&mut self, val: u64) -> &mut Self

Source

pub fn get_next_fence_value(&self) -> u64

Source

pub fn get_mut_next_fence_value(&mut self) -> &mut u64

Source

pub fn set_next_fence_value(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for HardwareZeroCopyDecoder

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 HardwareZeroCopyDecoder

Source§

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

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

impl Default for HardwareZeroCopyDecoder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl VideoDecoderBackend for HardwareZeroCopyDecoder

Zero-copy GPU surface VideoDecoderBackend implementation for HardwareZeroCopyDecoder.

Source§

fn backend_kind(&self) -> HardwareDecoderKind

Returns the configured hardware backend kind.

§Arguments
  • &Self - Hardware decoder reference.
§Returns
  • HardwareDecoderKind - Active hardware backend kind.
Source§

fn capabilities(&self) -> HardwareDecoderCapabilities

Returns hardware capabilities for the configured platform backend.

§Arguments
  • &Self - Hardware decoder reference.
§Returns
  • HardwareDecoderCapabilities - Hardware capability descriptor.
Source§

fn configure(&mut self, config: &VideoDecoderConfig) -> Result<(), String>

Configures surface format (P010 for HDR10/10-bit streams, Nv12 for SDR) and track geometry.

§Arguments
  • &Self - Mutable hardware decoder.
  • &VideoDecoderConfig - Video track metadata.
§Returns
  • Result<(), String> - Ok(()) when dimensions are valid.
Source§

fn decode_packet( &mut self, packet: &EncodedVideoPacket, _pool: &VideoFramePool, ) -> Result<Option<DecodedVideoFrame>, String>

Emits a zero-copy VideoGpuSurfaceHandle backed frame without touching the CPU frame pool.

§Arguments
  • &Self - Mutable hardware decoder.
  • &EncodedVideoPacket - Demuxed video packet.
  • &VideoFramePool - Unused CPU pool (zero CPU allocation on hardware zero-copy path).
§Returns
  • Result<Option<DecodedVideoFrame>, String> - GPU-surface-backed decoded frame.
Source§

fn flush(&mut self)

Resets hardware decoder reorder state on seek.

§Arguments
  • &Self - Mutable hardware decoder.

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> 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> 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> 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.