timed_metadata/lib.rs
1//! Timed-metadata / DPI signalling conversion core.
2//!
3//! Translates SCTE-35 splice information to and from the carriages used in OTT
4//! delivery: HLS `EXT-X-DATERANGE` (RFC 8216 / draft-pantos-hls-rfc8216bis
5//! §4.4.5.1) and DASH `emsg` (SCTE 214-3, scheme `urn:scte:scte35:2013:bin`).
6//!
7//! Conversions are lossless: the original `splice_info_section` bytes are
8//! carried verbatim (DATERANGE `SCTE35-OUT` hex, emsg `message_data`).
9//!
10//! Pure functions live in [`convert`]; the stateful [`Timeline`] session adds a
11//! wall-clock [`TimeAnchor`] and 33-bit PTS wrap-unrolling.
12//!
13//! [`webvtt`] converts a different kind of timed metadata — CEA-608/708
14//! closed captions — to WebVTT cues (W3C WebVTT + RFC 8216 §3.5
15//! `X-TIMESTAMP-MAP`), feature `cc-data` for the CEA-608/708 extraction half.
16//! Lossy by design (see its module docs).
17#![no_std]
18#![forbid(unsafe_code)]
19#![cfg_attr(docsrs, feature(doc_cfg))]
20
21extern crate alloc;
22
23pub mod anchor;
24pub mod convert;
25pub mod daterange;
26pub mod error;
27pub mod event;
28pub mod timeline;
29pub mod webvtt;
30
31pub use anchor::TimeAnchor;
32pub use daterange::DateRange;
33pub use error::{Error, Result};
34pub use event::{EventKind, MediaDuration, MediaTime, SourcePayload, TimedEvent};
35pub use timeline::Timeline;
36
37/// 90 kHz — the SCTE-35 / MPEG-2 PTS clock.
38pub const PTS_HZ: u64 = 90_000;