1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! WebCodecs codec identifiers.
//!
//! WebCodecs identifies codecs by RFC 6381 / ISOBMFF MIME-style
//! strings (`avc1.640028`, `vp09.00.10.08.420.0.1.1.1`,
//! `hvc1.1.6.L93.B0`, `av01.0.05M.08`, `opus`, `mp4a.40.2`).
//! Building those strings precisely needs codec-specific metadata
//! parsing (SPS for H.264, sequence header for VP9 / AV1, …).
//!
//! [`VideoCodecId`] / [`AudioCodecId`] enumerate the codecs this
//! crate knows by name; the [`crate::codec_string`] module
//! converts them to WebCodecs strings, falling back to
//! `Err(VideoDecodeError::UnsupportedCodec)` when the variant
//! genuinely needs caller-supplied bytes (e.g. SPS) that we don't
//! yet parse. Callers in that situation use the
//! `*_with_codec_string` constructors and supply the string
//! themselves (typically from a JS-side demuxer such as
//! `mp4box.js`).
/// A WebCodecs video codec.
/// A WebCodecs audio codec.