#[non_exhaustive]pub enum TextFormat {
Utf8,
PangoMarkup,
Srt,
WebVtt,
Ssa,
Ttml,
Teletext,
}Expand description
Format of a Caps::Text stream. Generalizes “subtitles”: a Text link
carries any timed-or-untimed text payload (a subtitle cue, a caption, a
transcription, an OCR result, an overlay string), the format naming the
on-the-wire syntax. “Subtitle” is not a separate media kind here, just timed
Text frames (timing rides on FrameTiming),
so one variant serves overlay, captioning, and analytics text alike. A parser
converts a structured format (Srt / WebVtt / Ssa / Ttml) to the plain
Utf8 cues a renderer or consumer wants, like a codec decode for text.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Utf8
Plain UTF-8 text, no markup. The decoded/common-denominator form a subtitle parser emits and an overlay or sink consumes.
PangoMarkup
UTF-8 with Pango inline markup (<b>, <i>, <span>…), the styled
text an overlay renderer draws directly (GStreamer pango-markup).
Srt
SubRip (.srt): blank-line-separated cues, each an index, a
HH:MM:SS,mmm --> HH:MM:SS,mmm time range, then the text lines.
WebVtt
WebVTT (.vtt, RFC 8538): a WEBVTT header then start --> end cues with
.-millisecond timestamps; the HTML5 / HLS subtitle format.
Ssa
SubStation Alpha / Advanced SSA (.ssa / .ass): a sectioned INI-like
script with styled Dialogue: events. The fansub / Matroska text format.
Ttml
Timed Text Markup Language (W3C TTML / SMPTE-TT / EBU-TT, also DFXP): an
XML timed-text document. The broadcast / DASH caption format.
Teletext
EBU teletext (ETSI EN 300 706) as a DVB private PES carries it (EN 300
472): a data_identifier byte then fixed-size data units, each one
teletext line with a framing code, a hamming 8/4 magazine / packet
address, and 40 odd-parity bytes. Not readable text yet: a teletext
decoder assembles the addressed page’s rows and emits Self::Utf8
cues, the way a subtitle parser converts Self::Srt.
Trait Implementations§
Source§impl Clone for TextFormat
impl Clone for TextFormat
Source§fn clone(&self) -> TextFormat
fn clone(&self) -> TextFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more