Skip to main content

ModEx

Struct ModEx 

Source
pub struct ModEx {
    pub mod_ex_type: u8,
    pub data: Vec<u8>,
}
Expand description

One entry in the Enhanced RTMP v2 ModEx prelude chain (enhanced-rtmp-v2.pdf §“ExVideoTagHeader” / §“ExAudioTagHeader”).

On the wire each entry is modExDataSize (1-byte UI8 + 1, or a 16-bit UI16 + 1 escape when the 8-bit form would be 256), followed by modExDataSize bytes of modExData, then a single byte whose high nibble is the mod_ex_type (UB[4]) and whose low nibble is the next PacketType (UB[4]). The decoded struct keeps only the per-entry payload; the trailing nibble byte is reconstructed from the chain order + the tag’s real packet type when re-encoding.

Fields§

§mod_ex_type: u8

AudioPacketModExType / VideoPacketModExType — the high nibble of the byte that follows the data. One of MOD_EX_TYPE_* (only TimestampOffsetNano = 0 defined today).

§data: Vec<u8>

Raw modExData bytes (1..=65536 bytes). For TimestampOffsetNano this is at least 3 bytes whose first three big-endian bytes are the UI24 nanosecond offset.

Implementations§

Source§

impl ModEx

Source

pub fn timestamp_offset_nano(&self) -> Option<u32>

Decode the TimestampOffsetNano value (bytesToUI24 of the first three data bytes) when this entry is that subtype. Returns None for any other mod_ex_type or if data is shorter than the spec-mandated three bytes.

Source

pub fn timestamp_offset_nano_entry(nano: u32) -> ModEx

Build a TimestampOffsetNano ModEx entry from a nanosecond offset (0..=999_999 ns per spec) encoded as a bytesToUI24 3-byte big-endian payload.

Trait Implementations§

Source§

impl Clone for ModEx

Source§

fn clone(&self) -> ModEx

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 ModEx

Source§

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

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

impl Eq for ModEx

Source§

impl PartialEq for ModEx

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ModEx

Auto Trait Implementations§

§

impl Freeze for ModEx

§

impl RefUnwindSafe for ModEx

§

impl Send for ModEx

§

impl Sync for ModEx

§

impl Unpin for ModEx

§

impl UnsafeUnpin for ModEx

§

impl UnwindSafe for ModEx

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.