#[non_exhaustive]pub enum AdaptationFieldControl {
Reserved,
PayloadOnly,
AdaptationOnly,
AdaptationAndPayload,
}Expand description
2-bit adaptation_field_control field — ITU-T H.222.0 (08/2023) Table 2-5.
Decoders shall discard packets with value 00 (Reserved). Null packets use 01
(PayloadOnly). The two flags has_adaptation/has_payload on TsHeader carry
the decoded booleans; this enum provides the typed composite view.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Reserved
00 — reserved for future use; decoders shall discard (H.222.0 Table 2-5).
PayloadOnly
01 — no adaptation_field, payload only (H.222.0 Table 2-5).
AdaptationOnly
10 — adaptation_field only, no payload (H.222.0 Table 2-5).
AdaptationAndPayload
11 — adaptation_field followed by payload (H.222.0 Table 2-5).
Implementations§
Source§impl AdaptationFieldControl
impl AdaptationFieldControl
Sourcepub fn from_flags(has_adaptation: bool, has_payload: bool) -> Self
pub fn from_flags(has_adaptation: bool, has_payload: bool) -> Self
Derive from the two decoded boolean flags stored on TsHeader.
Sourcepub fn to_bits(self) -> u8
pub fn to_bits(self) -> u8
Encode as the 2-bit adaptation_field_control field value ([1:0]).
Bit 1 = adaptation present, bit 0 = payload present (H.222.0 Table 2-5).
The returned byte is in the range 0x00–0x03; the caller shifts it
into bits [5:4] of TS header byte 3.
Trait Implementations§
Source§impl Clone for AdaptationFieldControl
impl Clone for AdaptationFieldControl
Source§fn clone(&self) -> AdaptationFieldControl
fn clone(&self) -> AdaptationFieldControl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more