Skip to main content

channel_layout_from_ffmpeg

Function channel_layout_from_ffmpeg 

Source
pub fn channel_layout_from_ffmpeg(value: &ChannelLayout) -> ChannelLayout
Expand description

Maps an FFmpeg AvChannelLayout to the named ChannelLayout vocabulary.

Two rungs, in order:

  1. the constant-arm table — exactly ffmpeg_next’s ChannelLayout constant set, compared through av_channel_layout_compare;
  2. the describe rung — for a layout that falls off the table, FFmpeg names it via av_channel_layout_describe and that name goes through ChannelLayout’s own total door (FromStr).

The second rung is what makes binaural / 5.1.2 / 9.1.6 reachable: ChannelLayout names all three, ffmpeg_next 9.0.0 mints no constant for any of them, so the table alone can never produce them. It is also why a layout a later FFmpeg adds is reachable with no edit here, as long as the vocabulary already names it — FFmpeg speaks the name, the vocabulary reads the word, one source.

Returns ChannelLayout::default — the Other("") absent sentinel — when neither rung names the layout. The rendering itself is not smuggled into Other: an unrecognised layout stays absent, and ChannelLayoutDescription::text is where its FFmpeg rendering lives.