Skip to main content

channel_layout_description_from_raw_ptr

Function channel_layout_description_from_raw_ptr 

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

Pointer variant of channel_layout_description_from_ffmpeg. Safe-API callers that already hold a &AvChannelLayout 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.