pub struct ContainerFormat { /* private fields */ }Expand description
The container identification libavformat made for a session.
§This is the DEMUXER’s identity, not a filename’s
It is AVInputFormat’s own words — what libavformat concluded from
the bytes, having probed them. That is precisely what a
content-addressed row wants and what an extension cannot give: the
same bytes at movie.mov and movie.mp4 are one content, and this
answers identically for both because it never looked at the path.
§One demuxer, several words — and name is the list
FFmpeg registers one demuxer per family, so its name is a
comma-separated list of the short names that family handles:
"mov,mp4,m4a,3gp,3g2,mj2" for the ISOBMFF demuxer, "matroska,webm"
for Matroska. name is that string verbatim and
names walks it.
The list does not narrow to one word, and this type does not
pretend it does. libavformat identified the demuxer; which brand
inside that family a file is — an .mp4 against an .m4a — is a
question it did not answer and one nothing here can answer for it.
A door that returned a single word would have had to pick, and a
pick is the guess this whole seat exists to avoid.
§Crossing into a typed vocabulary
The words are FFmpeg’s own slugs, which is what makes them
crossable: a consumer that wants
mediaframe::container::Format tries
names against its FromStr and takes what it
recognises, deciding for itself what to do when a family offers
several. This crate stays out of that decision — the fold belongs to
whoever owns the vocabulary, and doing it here would put a second
one somewhere a caller cannot see it.
§An open vocabulary
Never an enum. A container FFmpeg learns to demux in its next release names itself here with nothing to change on this side, which is the whole reason the identity is carried as text.
Implementations§
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub const fn new(name: SmolStr, long_name: Option<SmolStr>) -> Self
pub const fn new(name: SmolStr, long_name: Option<SmolStr>) -> Self
Constructs a ContainerFormat from a demuxer’s short-name list and
its optional description.
Public so a consumer can build the value in a test or a fake; a
session builds its own from AVFormatContext.iformat.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The demuxer’s short-name list, verbatim — "mov,mp4,m4a,3gp,3g2,mj2".
See names for the words in it.
Trait Implementations§
Source§impl Clone for ContainerFormat
impl Clone for ContainerFormat
Source§fn clone(&self) -> ContainerFormat
fn clone(&self) -> ContainerFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more