Expand description
Conversions from FFmpeg’s ffmpeg_next::ChannelLayout /
ffmpeg_next::ffi::AVChannelOrder to the channel-layout vocabulary
mediaframe owns (ChannelLayout, ChannelOrder,
ChannelSpec, ChannelLayoutDescription).
These live as free functions (not From trait impls) because of
Rust’s orphan rule: this crate owns neither From nor
mediaframe::audio::*, so we can’t write the impl here. Calling
mediadecode_ffmpeg::channel_layout_description_from_ffmpeg(layout)
is the ergonomic boundary instead.
FFmpeg’s own type is imported as AvChannelLayout so the name
ChannelLayout can stay with the vocabulary these functions
produce.
Functions§
- channel_
layout_ description_ from_ ffmpeg - Builds a fully-populated
ChannelLayoutDescriptionfrom an FFmpegAvChannelLayout. - channel_
layout_ ⚠description_ from_ raw_ ptr - Pointer variant of
channel_layout_description_from_ffmpeg. Safe-API callers that already hold a&AvChannelLayoutshould prefer that function; the pointer form exists so the convert path (which never forms&AVFrame) can passaddr_of!((*av_frame).ch_layout)straight through without materializing a typed reference. - channel_
layout_ from_ ffmpeg - Maps an FFmpeg
AvChannelLayoutto the namedChannelLayoutvocabulary. - channel_
order_ from_ ffmpeg - Maps FFmpeg’s
AVChannelOrderto theChannelOrdertag. - channel_
order_ from_ raw - Variant of
channel_order_from_ffmpegthat takes the raw integer directly. Use this when the caller has just readAVChannelLayout.orderfrom FFmpeg memory and doesn’t want to risk constructing an invalid bindgen enum value first.