dvb‑subtitle
DVB subtitling (bitmap) segment parser and serializer — ETSI EN 300 743 V1.6.1.
Feed it the reassembled PES data field of a DVB subtitle stream (the payload
from a PES packet with stream_id signalling private-data subtitling); it
returns typed, decoded segments. It depends only on
broadcast‑common and works #![no_std]
(+ alloc).
Features
- Every segment type from §7.2 — display definition, page composition, region composition, CLUT definition, object data (incl. 2/4/8-bit pixel‑data sub‑blocks, character strings, and progressive zlib‑compressed pixel blocks), disparity signalling, alternative CLUT, end of display set, and stuffing.
- Symmetric
Parse<'a>/Serializewith round‑trip tests — parse then serialize is byte‑identical, and serialize then parse compares equal. - Unified dispatch via
AnySegment: feed the raw PES payload, get back an enum that you pattern‑match on. #![no_std]with optionalstd(linkingthiserror/std). Serde support is behind theserdefeature.- Re‑exports every public segment type and its component enums, so you
only ever need
use dvb_subtitle.
Examples
Two runnable examples ship with this crate
(cargo run -p dvb-subtitle --example <name>).
parse_segment
```include_str!
parse_full_pes
```include_str!
Usage
use Parse;
use ;
let bytes = ;
let field = parse.unwrap;
for seg in &field.segments
Licence
MIT OR Apache‑2.0