Skip to main content

SoftwareVideoDecoder

Struct SoftwareVideoDecoder 

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

Pure-Rust software fallback decoder handling intra RGBA8, intra YUV420P (with full CICP color matrix math), and P-frame XOR delta packets.

Implementations§

Source§

impl SoftwareVideoDecoder

Packet encoders and YUV-to-RGB color conversion helpers for SoftwareVideoDecoder.

Source

pub fn encode_intra_rgba_packet(width: u32, height: u32, rgba: &[u8]) -> Vec<u8> ⓘ

Encodes an intra-coded EVF1 RGBA8 frame packet for pure-Rust software decoding.

§Arguments
  • u32 - Frame width in pixels.
  • u32 - Frame height in pixels.
  • &[u8] - Packed RGBA8 pixel data (width * height * 4).
§Returns
  • Vec<u8> - Encoded EVF1 intra RGBA8 packet bytes.
Source

pub fn encode_intra_yuv420p_packet( width: u32, height: u32, y_plane: &[u8], u_plane: &[u8], v_plane: &[u8], ) -> Vec<u8> ⓘ

Encodes an intra-coded EVF1 tri-planar YUV420P frame packet decoded using the track’s VideoColorInfo matrix and range.

§Arguments
  • u32 - Frame width in pixels.
  • u32 - Frame height in pixels.
  • &[u8] - Y luma plane (width * height).
  • &[u8] - U (Cb) chroma plane (ceil(width / 2) * ceil(height / 2)).
  • &[u8] - V (Cr) chroma plane (ceil(width / 2) * ceil(height / 2)).
§Returns
  • Vec<u8> - Encoded EVF1 intra YUV420P packet bytes.
Source

pub fn encode_delta_xor_packet( width: u32, height: u32, prev_rgba: &[u8], target_rgba: &[u8], ) -> Vec<u8> ⓘ

Encodes an inter-coded P-frame XOR delta packet relative to prev_rgba.

§Arguments
  • u32 - Frame width in pixels.
  • u32 - Frame height in pixels.
  • &[u8] - Previous reference RGBA8 frame bytes.
  • &[u8] - Target RGBA8 frame bytes.
§Returns
  • Vec<u8> - Encoded EVF1 P-frame delta packet bytes.
Source§

impl SoftwareVideoDecoder

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_has_reference(&self) -> bool

Source

pub fn get_mut_has_reference(&mut self) -> &mut bool

Source

pub fn set_has_reference(&mut self, val: bool) -> &mut Self

Source

pub fn get_decoded_frames(&self) -> u64

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for SoftwareVideoDecoder

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 SoftwareVideoDecoder

Source§

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

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

impl Default for SoftwareVideoDecoder

Source§

fn default() -> Self

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

impl VideoDecoderBackend for SoftwareVideoDecoder

Pure-Rust software fallback VideoDecoderBackend implementation for SoftwareVideoDecoder.

Source§

fn backend_kind(&self) -> HardwareDecoderKind

Returns HardwareDecoderKind::SoftwareFallback.

§Arguments
  • &Self - Decoder reference.
§Returns
  • HardwareDecoderKind - Always SoftwareFallback.
Source§

fn capabilities(&self) -> HardwareDecoderCapabilities

Returns software fallback capabilities.

§Arguments
  • &Self - Decoder reference.
§Returns
  • HardwareDecoderCapabilities - Software capability profile.
Source§

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

Configures the software decoder for the track’s dimensions and color metadata.

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

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

Decodes an EVF1 intra/YUV420P/delta packet or raw RGBA8 frame into a pooled CPU DecodedVideoFrame.

§Arguments
  • &Self - Mutable software decoder.
  • &EncodedVideoPacket - Encoded packet with DTS/PTS and seek generation.
  • &VideoFramePool - Bounded CPU pixel pool.
§Returns
  • Result<Option<DecodedVideoFrame>, String> - Decoded CPU pooled frame or error.
Source§

fn flush(&mut self)

Clears the retained reference frame upon seek or discontinuity.

§Arguments
  • &Self - Mutable software 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.