alloc or std only.Expand description
Stream-descriptor codec/format/layout vocabulary for video, audio, and
subtitle tracks. Requires the alloc feature (std includes it) for
the Other(SmolStr) escape arms.
Stream-descriptor codec vocabulary for video, audio, subtitle,
data, and attachment tracks.
Generated from xtask/vendor/ffmpeg-codecs.txt (FFmpeg n9.0
libavcodec/codec_desc.c) by cargo xtask gen-codec — except
[AttachmentCodec], whose roster comes from a different FFmpeg
source; see its own doc comment for why. Every codec FFmpeg knows
under media types video / audio / subtitle / data has a
named variant here; the Other(SmolStr) arm remains a lossless
escape for codecs added in a future FFmpeg release before this
file is regenerated (or, for AttachmentCodec, before
ATTACHMENT_CODECS is re-derived by hand).
Regenerate in two steps:
cargo xtask sync— refreshes the vendored table.cargo xtask gen-codec— regenerates this file from it.
cargo xtask check verifies every named variant’s canonical string
exists in the vendored table (or, for AttachmentCodec, in
ATTACHMENT_CODECS) — CI gate against drift.
Derive threshold. Unwrap / TryUnwrap generate three methods
per variant, so an enum in the hundreds pays that in compile time for
one reachable payload arm.
[SubtitleCodec] (27), [DataCodec] (11), and [AttachmentCodec]
(3) are small enough to carry the pair; [VideoCodec] (279)
and [AudioCodec] (222) do not. The line is
variant count, not principle — reach for Other(_) on the large two
with a match or IsVariant’s is_other.
Enums§
- Attachment
Codec - Attachment codec family — the FFmpeg codec ids
libavformat/matroskadec.c’smkv_mime_tagstable assigns to anAVMEDIA_TYPE_ATTACHMENTstream (ATTACHMENT_CODECS; see its doc comment for the full census —libavcodec/codec_desc.chas noAVMEDIA_TYPE_ATTACHMENTmedia type to enumerate here the wayDataCodecand the other vendored enums are). - Audio
Codec - Audio codec family — every codec FFmpeg n9.0 knows under media type
audio. - Data
Codec - Data codec family — every codec FFmpeg n9.0 knows under media type
data. - Subtitle
Codec - Subtitle codec family — every codec FFmpeg n9.0 knows under media type
subtitle. - Video
Codec - Video codec family — every codec FFmpeg n9.0 knows under media type
video.