Struct FecHeader

Source
pub struct FecHeader<'buf> { /* private fields */ }
Expand description

The set of headers values in a SMPTE 2022-1 packet.

Implementations§

Source§

impl<'buf> FecHeader<'buf>

Source

pub fn from_bytes(buf: &'buf [u8]) -> Result<FecHeader<'buf>, FecHeaderError>

wrap the given byte-slice in a FecHeader object, or return a FecHeaderError if the given slice does not represent a valid header.

Source

pub fn split_from_bytes( buf: &'buf [u8], ) -> Result<(FecHeader<'buf>, &'buf [u8]), FecHeaderError>

Returns a FecHeader, and the remaining payload data from the given slice immediately following the header.

Source

pub fn header_len(&self) -> usize

Returns the length in bytes of the headers this object represents.

Source

pub fn sn_base(&self) -> u32

24 bit value of the minimum sequence number of media packets associated with this FEC packet

Source

pub fn sn_base_low_bits(&self) -> Seq

The low 16 bits of the minimum sequence number of media packets associated with this FEC packet

Source

pub fn length_recovery(&self) -> u16

The length of media packets associated with this FEC packet

Source

pub fn extended(&self) -> bool

Flag indicating if this header includes extension fields (must be true for SMPTE 2022-1 packets

Source

pub fn pt_recovery(&self) -> u8

Field allowing recovery of the payload type of media packets associated with this FEC packet

Source

pub fn mask(&self) -> u32

Set to all-zeros for SMPTE 2022-1 streams

Source

pub fn ts_recovery(&self) -> u32

Used to recover the timestamp field of any packets associated with this FEC packet

Source

pub fn orientation(&self) -> Orientation

Orientation::Column for FEC packets from the first FEC stream, and Orientation::Row for FEC packets from the second FEC stream.

In the spec this header field is named D.

Source

pub fn fec_type(&self) -> u8

3-bit value indicating which error-correcting code is chosen, but always set to 0 for SMPTE 2022-1 streams.

Packets with an unrecognized value to be ignored.

Source

pub fn index(&self) -> u8

3-bit value always set to 0 for SMPTE 2022-1 streams.

Source

pub fn offset(&self) -> u8

Selects the media packets associated with this FEC packet.

Equal to the the L parameter for the first FEC stream, and always equal to 1 for the second FEC stream.

Source

pub fn number_associated(&self) -> u8

The number of media packets associated with this FEC packet.

This is the NA field from the spec, equal to the D parameter or FEC packets belonging to the first FEC stream, and equal to the L parameter or FEC packets belonging to the second FEC stream.

Source

pub fn sn_base_ext_bits(&self) -> u8

The top 8 bits of the sequence number, or 0 if the sequence number fits in the 16 bits sn_base field.

Source

pub fn associates_with(&self, seq: Seq) -> bool

true iff a packet with the given sequence number would be associated with this FEC packet

Trait Implementations§

Source§

impl<'buf> Debug for FecHeader<'buf>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> Freeze for FecHeader<'buf>

§

impl<'buf> RefUnwindSafe for FecHeader<'buf>

§

impl<'buf> Send for FecHeader<'buf>

§

impl<'buf> Sync for FecHeader<'buf>

§

impl<'buf> Unpin for FecHeader<'buf>

§

impl<'buf> UnwindSafe for FecHeader<'buf>

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