Skip to main content

dvb_cc/
lib.rs

1//! DVB closed-caption carriage — `cc_data()` per ETSI TS 101 154 §B.5, Table B.9.
2//!
3//! Parses the closed-caption carriage structure carried in MPEG-2 / AVC / HEVC
4//! picture `user_data` (the DVB-native, normative form of the ATSC/CEA `cc_data()`).
5//! Exposes the typed caption triplets (`cc_valid`, `cc_type`, `cc_data_1/2`) and a
6//! CEA-608 vs CEA-708 split by `cc_type`. The *meaning* of the caption byte pair
7//! (the CEA-708-E character/control decode) is a layer above this carriage and is
8//! out of scope.
9//!
10//! Feed it the `cc_data()` bytes (the caller extracts them from the picture
11//! user_data / SEI). Depends only on `dvb-common`, `#![no_std]` (+ `alloc`).
12#![no_std]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14#![warn(missing_docs)]
15// Runnable examples, embedded so they render on docs.rs and stay in sync with
16// the actual `examples/*.rs` files (shown, not compiled).
17#![doc = "\n# Examples\n"]
18#![doc = "Two runnable examples ship with this crate (`cargo run -p dvb-cc --example <name>`).\n"]
19#![doc = "\n## `parse_cc_data`\n\n```rust,ignore"]
20#![doc = include_str!("../examples/parse_cc_data.rs")]
21#![doc = "```\n\n## `build_cc_data`\n\n```rust,ignore"]
22#![doc = include_str!("../examples/build_cc_data.rs")]
23#![doc = "```"]
24
25extern crate alloc;
26
27mod cc_data;
28mod error;
29
30pub use cc_data::{CcData, CcTriplet, CcType};
31pub use error::{Error, Result};