Skip to main content

Module channel_layout

Module channel_layout 

Source
Expand description

Conversions from FFmpeg’s ffmpeg_next::ChannelLayout / ffmpeg_next::ffi::AVChannelOrder to the channel-layout types mediadecode owns (mediadecode::channel::ChannelLayoutKind, mediadecode::channel::AudioChannelOrderKind, mediadecode::channel::AudioChannelSpec, mediadecode::channel::AudioChannelLayout).

These live as free functions (not From trait impls) because of Rust’s orphan rule: this crate owns neither From nor mediadecode::channel::*, so we can’t write the impl here. Calling mediadecode_ffmpeg::audio_channel_layout_from_ffmpeg(layout) is the ergonomic boundary instead.

Functions§

audio_channel_layout_from_ffmpeg
Builds a fully-populated AudioChannelLayout from an FFmpeg ChannelLayout.
audio_channel_layout_from_raw_ptr
Pointer variant of audio_channel_layout_from_ffmpeg. Safe-API callers that already hold a &ChannelLayout should prefer that function; the pointer form exists so the convert path (which never forms &AVFrame) can pass addr_of!((*av_frame).ch_layout) straight through without materializing a typed reference.
audio_channel_order_kind_from_ffmpeg
Maps FFmpeg’s AVChannelOrder to the AudioChannelOrderKind tag.
audio_channel_order_kind_from_raw
Variant of audio_channel_order_kind_from_ffmpeg that takes the raw integer directly. Use this when the caller has just read AVChannelLayout.order from FFmpeg memory and doesn’t want to risk constructing an invalid bindgen enum value first.
channel_layout_kind_from_ffmpeg
Maps an FFmpeg ChannelLayout to the high-level ChannelLayoutKind tag.