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>
impl<'buf> FecHeader<'buf>
Sourcepub fn from_bytes(buf: &'buf [u8]) -> Result<FecHeader<'buf>, FecHeaderError>
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.
Sourcepub fn split_from_bytes(
buf: &'buf [u8],
) -> Result<(FecHeader<'buf>, &'buf [u8]), FecHeaderError>
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.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the length in bytes of the headers this object represents.
Sourcepub fn sn_base(&self) -> u32
pub fn sn_base(&self) -> u32
24 bit value of the minimum sequence number of media packets associated with this FEC packet
Sourcepub fn sn_base_low_bits(&self) -> Seq
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
Sourcepub fn length_recovery(&self) -> u16
pub fn length_recovery(&self) -> u16
The length of media packets associated with this FEC packet
Sourcepub fn extended(&self) -> bool
pub fn extended(&self) -> bool
Flag indicating if this header includes extension fields (must be true for SMPTE 2022-1
packets
Sourcepub fn pt_recovery(&self) -> u8
pub fn pt_recovery(&self) -> u8
Field allowing recovery of the payload type of media packets associated with this FEC packet
Sourcepub fn ts_recovery(&self) -> u32
pub fn ts_recovery(&self) -> u32
Used to recover the timestamp field of any packets associated with this FEC packet
Sourcepub fn orientation(&self) -> Orientation
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.
Sourcepub fn fec_type(&self) -> u8
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.
Sourcepub fn offset(&self) -> u8
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.
Sourcepub fn number_associated(&self) -> u8
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.
Sourcepub fn sn_base_ext_bits(&self) -> u8
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.
Sourcepub fn associates_with(&self, seq: Seq) -> bool
pub fn associates_with(&self, seq: Seq) -> bool
true iff a packet with the given sequence number would be associated with this FEC packet