dvb-stream
Async/tokio stream adapters over dvb-si SiDemux and
dvb-t2mi T2miPump (7.0 libs).
What it does
dvb-stream wraps the synchronous dvb-si/dvb-t2mi pumps as
[futures_core::Stream] implementations, quarantining tokio and
futures-core away from the pure-Rust parser crates.
-
SectionStream— feed anytokio::io::AsyncRead(file, TCP, UDP), receive onedvb_si::demux::SectionEventper changed complete SI section. Events are owned (bytes::Bytes),'static,Clone, andSend + Sync. -
T2miEventStream— same treatment for T2-MI: feed anyAsyncRead, receive onedvb_t2mi::pump::T2miEventper CRC-valid T2-MI packet. Construct withT2miEventStream::new(reader, pid)for a TS-encapsulated source, orT2miEventStream::with_pump(reader, pump)for a pre-configured pump.
Both streams perform 188-byte TS packet alignment and resync on the byte stream. No internal tasks are spawned; cancellation is simply dropping the stream.
With the udp feature (default), bind_multicast convenience constructors are
provided for the dominant real-world DVB transport (UDP multicast, e.g.
239.0.0.1:5004).
dvb-stream is a std-only crate (tokio requires std).
Quickstart
use StreamExt;
use SectionStream;
use AnyTableSection;
async
MSRV and versioning
MSRV: 1.81 (matches the workspace). dvb-stream is versioned and released
independently from the dvb-si/dvb-t2mi lockstep (0.x series), because
tokio's own MSRV moves faster than the workspace pin.
Feature flags
| Feature | Default | Description |
|---|---|---|
udp |
on | SectionStream::bind_multicast / T2miEventStream::bind_multicast via tokio::net::UdpSocket. |
Examples
Run with cargo run -p dvb-stream --example <name>:
count_sections— drive the asyncSectionStreamover an in-memory TS and count SI sections.stream_stats— tally table types and report demux + resync statistics.
License
MIT OR Apache-2.0.