pub struct BbframePump { /* private fields */ }Expand description
Per-PLP BBFrame→inner-TS pump.
Feed one PLP’s BBFrame data-field bytes at a time with feed;
the pump parses the BBHEADER, detects NM vs HEM, and runs the per-PLP
CarryOverExtractor — interleaved PLPs keep independent carry-over state.
The returned slice borrows an internal buffer that is cleared on every call; copy out anything you need to keep.
use dvb_bbframe::pump::BbframePump;
let mut pump = BbframePump::new();
// Receive a BBFrame data-field byte slice (BBHEADER + data field)
// for PLP 5:
let df_bytes = vec![0u8; 200];
let inner_ts_packets = pump.feed(5, &df_bytes);
for pkt in inner_ts_packets {
println!("inner TS packet recovered");
}Implementations§
Source§impl BbframePump
impl BbframePump
Sourcepub fn feed(&mut self, plp_id: u8, df_bytes: &[u8]) -> &[[u8; 188]]
pub fn feed(&mut self, plp_id: u8, df_bytes: &[u8]) -> &[[u8; 188]]
Feed one PLP’s BBFrame data-field bytes (df_bytes = 10-byte BBHEADER
- data field).
Returns the inner 188-byte TS packets completed by this frame.
Per-PLP carry-over state is keyed by plp_id so interleaved PLPs don’t
corrupt each other’s carry-over. A new plp_id lazily creates a
fresh extractor.
This method is infallible: malformed input, bad BBHEADERs, and non-TS payloads emit no packets and bump a stat counter — never panics, never errors out.
Sourcepub fn stats(&self) -> BbframePumpStats
pub fn stats(&self) -> BbframePumpStats
Diagnostic counters accumulated across all feed calls.
The per-PLP carry_over field aggregates the stats from all
PLP extractors; check carry_over.npd_unsupported in particular —
a non-zero value means valid HEM frames were dropped (NPD reinsertion
unsupported).