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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! The VIDEO track's codec seat.
use VideoCodec as Foreign;
/// **What a video track's bytes are encoded with** — an FFmpeg video codec name in the lowercase
/// canon, or the open escape for one this build's roster does not carry.
///
/// The citizen wrapping [`mediaframe::codec::VideoCodec`], which is where the roster, the escape
/// and the ASCII fold all live. What this type adds is the right to give them a wire face, a filter
/// and a storage shape — the rights the orphan rule reserves to the crate owning the type, which is
/// why the newtype exists at all.
///
/// # Every string is a value, and that is the vocabulary rather than this type
///
/// [`new`](Self::new) cannot fail. `h264` names a codec, `Some Codec 9000` names one this build has
/// never heard of, and both are values — the second in the escape arm, losslessly. What separates
/// them is [`is_registered`](Self::is_registered), which is the question the absent refusal would
/// have been asking.
///
/// Refusing the unknown one would be the worse bargain by some distance, and it is the same bargain
/// [`Language`](crate::primitives::lang::Language) states for an unregistered subtag: the FFmpeg
/// table gains codecs, a generated roster is a snapshot, and a container in the wild carries
/// whatever its muxer wrote. Refusing would make a file unindexable because of a table
/// `mediaframe` last regenerated at n9.0.
///
/// # Equality is the CANONICAL slug, and the door is what makes that true
///
/// `VideoCodec::new("H264") == VideoCodec::new("h264")`, because the door folds and both hold the
/// named `h264`. The fold happens ONCE, at construction, so a stored column is canonical and
/// storage equality IS value equality: `WHERE "codec" = 'h264'` finds the row an `H264` tag
/// produced.
///
/// It holds against the upstream value too, which is the case that needs saying:
/// [`From<mediaframe::codec::VideoCodec>`](From) re-runs the slug table, so a
/// `mediaframe::codec::VideoCodec::other("h264")` — an escape arm holding a name the roster
/// already spells, which upstream admits and compares unequal to the named variant — becomes the
/// named variant on the way in. No second spelling of one codec exists inside this type.
///
/// # Ordering is ALPHABETICAL over that slug
///
/// `av1 < h264 < prores`. It orders the SPELLINGS and says nothing about the codecs — see the
/// module note, where the bargain is argued and the agreement with the `TEXT` column's own order is
/// what earns it a cursor seat.
;
codec_citizen!;