Expand description
Stateful TS byte-stream resynchroniser — ISO/IEC 13818-1 §2.4.3.2.
Recovers 188-byte MPEG-TS packet alignment from an arbitrary byte stream (file reads, UDP payloads) that may start mid-packet or contain leading garbage. Also detects 204-byte Reed-Solomon-coded packets (DVB RS-coded outer forward-error-correction layer) and strips the 16 parity bytes, yielding standard 188-byte TS packets in both cases.
§Feature gate
This module is only compiled when the ts feature is enabled (the
default), because it depends on the TS constants in crate::ts.
§Example
use dvb_si::resync::TsResync;
let mut r = TsResync::new();
// Feed arbitrary bytes (file chunks, UDP datagrams, etc.).
let packets: Vec<[u8; 188]> = r.feed(b"some raw bytes");
let stats = r.stats();Structs§
- Resync
Stats - Counters accumulated during resynchronisation.
- TsResync
- Stateful TS byte-stream resynchroniser (ISO/IEC 13818-1 §2.4.3.2).
Enums§
- Packet
Stride - Detected packet size after locking.
Constants§
- LOCK_
CONFIRMATIONS - Consecutive sync bytes at the candidate stride required to declare lock.
- RS_
PACKET_ SIZE - Reed-Solomon-coded TS packet size: 188-byte payload + 16 parity bytes (DVB RS outer FEC, ISO/IEC 13818-1 §2.4.3.2 informative note).
- RS_
PARITY_ LEN - Number of Reed-Solomon parity bytes appended to a 204-byte packet.