pub struct SectionReassembler { /* private fields */ }Expand description
Reassembles PSI/SI sections from TS packets on a single PID.
Feed each TS packet’s payload with feed. Complete sections are
appended to an internal queue; drain them with pop_section.
Implementations§
Source§impl SectionReassembler
impl SectionReassembler
Sourcepub fn feed(&mut self, payload: &[u8], pusi: bool)
pub fn feed(&mut self, payload: &[u8], pusi: bool)
Feed a TS payload and whether its packet had PUSI set.
Extracts complete SI sections into the internal queue. A single call
can produce zero, one, or several sections — a payload may
concatenate multiple complete sections after the pointer_field
(EN 300 468 §5.1.4; common on EMM PIDs). Drain with a
while let Some(s) = r.pop_section() loop, not a single if let.
Sourcepub fn feed_with_continuity(
&mut self,
payload: &[u8],
pusi: bool,
continuity_counter: u8,
discontinuity: bool,
)
pub fn feed_with_continuity( &mut self, payload: &[u8], pusi: bool, continuity_counter: u8, discontinuity: bool, )
Like feed, additionally taking the packet’s
continuity_counter so a legally retransmitted continuation packet is
discarded rather than appended twice.
ISO/IEC 13818-1 §2.4.3.3 (continuity_counter semantics, see
private/specs/) permits a packet to be repeated once with the same
counter; such a duplicate of the previous packet on this PID is dropped
when it is a continuation (non-PUSI) packet. Call this for payload-bearing
packets only: the counter does not advance on packets without payload.
discontinuity is the packet’s adaptation-field
discontinuity_indicator (ISO/IEC 13818-1 §2.4.3.5): when it is
set an unchanged continuity counter is legal and the packet is not a
duplicate.
Sourcepub fn pop_section(&mut self) -> Option<Bytes>
pub fn pop_section(&mut self) -> Option<Bytes>
Pop one complete section. Returns None when the queue is empty.