Skip to main content

audio_channel_layout_from_raw_ptr

Function audio_channel_layout_from_raw_ptr 

Source
pub unsafe fn audio_channel_layout_from_raw_ptr(
    ptr: *const AVChannelLayout,
) -> AudioChannelLayout
Expand description

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.

§Safety

ptr must be a live *const AVChannelLayout for the duration of this call. The function reads order raw, then nb_channels, then either u.mask (NATIVE / AMBISONIC) or u.map (CUSTOM) — only after the order discriminant has been validated. It never forms a &AVChannelLayout reference.