pub enum MediaKind {
Video,
Audio,
Subtitle,
Data,
Attachment,
Unknown,
}Expand description
What a track is, folded from AVCodecParameters.codec_type read as
the integer it is on the wire.
The dependency-API half of this crate’s open-C-enum discipline.
ffmpeg_next::codec::Parameters::medium() materialises an
AVMediaType out of FFmpeg memory to answer the same question, and
a value outside this build’s discriminant set is undefined behaviour
the moment it exists — before any match on it can run. That the
set is small and has been stable for years is a reason it has not
bitten, not a reason it cannot.
So the read is raw and the fold is total: anything this build does
not name becomes Unknown, which the callers
already had to handle.
Variants§
Video
AVMEDIA_TYPE_VIDEO.
Audio
AVMEDIA_TYPE_AUDIO.
Subtitle
AVMEDIA_TYPE_SUBTITLE.
Data
AVMEDIA_TYPE_DATA.
Attachment
AVMEDIA_TYPE_ATTACHMENT.
Unknown
Anything this build of FFmpeg does not name, AVMEDIA_TYPE_UNKNOWN
included.
Implementations§
Source§impl MediaKind
impl MediaKind
Sourcepub const fn is_video(&self) -> bool
pub const fn is_video(&self) -> bool
Returns true if this value is of type Video. Returns false otherwise
Sourcepub const fn is_audio(&self) -> bool
pub const fn is_audio(&self) -> bool
Returns true if this value is of type Audio. Returns false otherwise
Sourcepub const fn is_subtitle(&self) -> bool
pub const fn is_subtitle(&self) -> bool
Returns true if this value is of type Subtitle. Returns false otherwise
Sourcepub const fn is_data(&self) -> bool
pub const fn is_data(&self) -> bool
Returns true if this value is of type Data. Returns false otherwise
Sourcepub const fn is_attachment(&self) -> bool
pub const fn is_attachment(&self) -> bool
Returns true if this value is of type Attachment. Returns false otherwise
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if this value is of type Unknown. Returns false otherwise