pub struct MuxCaps {
pub codecs: &'static [CodecId],
pub max_streams: Option<usize>,
pub still_image: bool,
}Expand description
What a container’s muxer will accept: the machine-readable half of the rules each muxer already enforces when it writes a header.
Muxers validate at run time, and a few historically wrote a zero codec tag
rather than refusing an unmappable codec. Declaring the same rules here lets
a caller answer “what can this file become?” before opening an encoder —
which is what rff-targets is built on.
Fields§
§codecs: &'static [CodecId]Every codec this muxer can write. Empty for demux-only formats.
max_streams: Option<usize>Most streams the container holds; None when there is no fixed limit.
still_image: boolTrue when the container holds exactly ONE picture, so extra frames are refused or dropped (png, jpeg, gif, webp, avif, jxl, av2f).
Implementations§
Source§impl MuxCaps
impl MuxCaps
Sourcepub const fn container(codecs: &'static [CodecId]) -> MuxCaps
pub const fn container(codecs: &'static [CodecId]) -> MuxCaps
A container interleaving any number of streams (mp4, matroska, mpegts).
Sourcepub const fn single(codecs: &'static [CodecId]) -> MuxCaps
pub const fn single(codecs: &'static [CodecId]) -> MuxCaps
A file holding exactly one elementary stream (wav, mp3, ivf, ogg).
Sourcepub fn accepts_media(&self, media: MediaType) -> bool
pub fn accepts_media(&self, media: MediaType) -> bool
Can this muxer carry any stream of media at all?
Sourcepub fn codecs_for(&self, media: MediaType) -> impl Iterator<Item = CodecId> + '_
pub fn codecs_for(&self, media: MediaType) -> impl Iterator<Item = CodecId> + '_
The codecs this muxer accepts for one media category.