pub struct TsHeader {
pub tei: bool,
pub pusi: bool,
pub pid: u16,
pub scrambling: u8,
pub has_adaptation: bool,
pub has_payload: bool,
pub continuity_counter: u8,
}Expand description
Parsed TS header — the 4-byte transport header fields.
Fields§
§tei: boolTransport Error Indicator — set by the demodulator when an uncorrectable error is present in the packet.
pusi: boolPayload Unit Start Indicator — first byte of the payload is a new PES packet or PSI section header when set.
pid: u1613-bit Packet Identifier.
scrambling: u82-bit transport_scrambling_control (0 = not scrambled).
has_adaptation: boolAdaptation field present flag (adaptation_field_control bit 1).
has_payload: boolPayload present flag (adaptation_field_control bit 0).
continuity_counter: u84-bit continuity_counter (wraps 0..=15 per PID).
Implementations§
Source§impl TsHeader
impl TsHeader
Sourcepub const fn serialized_len() -> usize
pub const fn serialized_len() -> usize
Number of bytes written by serialize_into.
Sourcepub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serialize this header into the first 4 bytes of buf.
Sourcepub fn scrambling_control(&self) -> ScramblingControl
pub fn scrambling_control(&self) -> ScramblingControl
Typed view of the 2-bit transport_scrambling_control field.
See ScramblingControl for the spec citation (H.222.0 Table 2-4 +
ETSI TS 100 289 §5.1 Table 1).
Sourcepub fn adaptation_field_control(&self) -> AdaptationFieldControl
pub fn adaptation_field_control(&self) -> AdaptationFieldControl
Typed view of the adaptation_field_control 2-bit field, derived from the
has_adaptation/has_payload flags.
See AdaptationFieldControl for the spec citation (H.222.0 Table 2-5).
Trait Implementations§
impl Eq for TsHeader
Source§impl Serialize for TsHeader
impl Serialize for TsHeader
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.