FFmpeg
channel_layout.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3  * Copyright (c) 2008 Peter Ross
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVUTIL_CHANNEL_LAYOUT_H
23 #define AVUTIL_CHANNEL_LAYOUT_H
24 
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #include "version.h"
29 #include "attributes.h"
30 
31 /**
32  * @file
33  * @ingroup lavu_audio_channels
34  * Public libavutil channel layout APIs header.
35  */
36 
37 
38 /**
39  * @defgroup lavu_audio_channels Audio channels
40  * @ingroup lavu_audio
41  *
42  * Audio channel layout utility functions
43  *
44  * @{
45  */
46 
47 enum AVChannel {
48  ///< Invalid channel index
68  /** Stereo downmix. */
70  /** See above. */
82 
83  /** Channel is empty can be safely skipped. */
84  AV_CHAN_UNUSED = 0x200,
85 
86  /** Channel contains data, but its position is unknown. */
87  AV_CHAN_UNKNOWN = 0x300,
88 
89  /**
90  * Range of channels between AV_CHAN_AMBISONIC_BASE and
91  * AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system.
92  *
93  * Given a channel id `<i>` between AV_CHAN_AMBISONIC_BASE and
94  * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `<n>` is
95  * `<n> = <i> - AV_CHAN_AMBISONIC_BASE`.
96  *
97  * @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel
98  * orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels
99  * implicitly by their position in the stream.
100  */
102  // leave space for 1024 ids, which correspond to maximum order-32 harmonics,
103  // which should be enough for the foreseeable use cases
105 };
106 
108  /**
109  * Only the channel count is specified, without any further information
110  * about the channel order.
111  */
113  /**
114  * The native channel order, i.e. the channels are in the same order in
115  * which they are defined in the AVChannel enum. This supports up to 63
116  * different channels.
117  */
119  /**
120  * The channel order does not correspond to any other predefined order and
121  * is stored as an explicit map. For example, this could be used to support
122  * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE)
123  * channels at arbitrary positions.
124  */
126  /**
127  * The audio is represented as the decomposition of the sound field into
128  * spherical harmonics. Each channel corresponds to a single expansion
129  * component. Channels are ordered according to ACN (Ambisonic Channel
130  * Number).
131  *
132  * The channel with the index n in the stream contains the spherical
133  * harmonic of degree l and order m given by
134  * @code{.unparsed}
135  * l = floor(sqrt(n)),
136  * m = n - l * (l + 1).
137  * @endcode
138  *
139  * Conversely given a spherical harmonic of degree l and order m, the
140  * corresponding channel index n is given by
141  * @code{.unparsed}
142  * n = l * (l + 1) + m.
143  * @endcode
144  *
145  * Normalization is assumed to be SN3D (Schmidt Semi-Normalization)
146  * as defined in AmbiX format $ 2.1.
147  */
149 };
150 
151 
152 /**
153  * @defgroup channel_masks Audio channel masks
154  *
155  * A channel layout is a 64-bits integer with a bit set for every channel.
156  * The number of bits set must be equal to the number of channels.
157  * The value 0 means that the channel layout is not known.
158  * @note this data structure is not powerful enough to handle channels
159  * combinations that have the same channel multiple times, such as
160  * dual-mono.
161  *
162  * @{
163  */
164 #define AV_CH_FRONT_LEFT (1ULL << AV_CHAN_FRONT_LEFT )
165 #define AV_CH_FRONT_RIGHT (1ULL << AV_CHAN_FRONT_RIGHT )
166 #define AV_CH_FRONT_CENTER (1ULL << AV_CHAN_FRONT_CENTER )
167 #define AV_CH_LOW_FREQUENCY (1ULL << AV_CHAN_LOW_FREQUENCY )
168 #define AV_CH_BACK_LEFT (1ULL << AV_CHAN_BACK_LEFT )
169 #define AV_CH_BACK_RIGHT (1ULL << AV_CHAN_BACK_RIGHT )
170 #define AV_CH_FRONT_LEFT_OF_CENTER (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER )
171 #define AV_CH_FRONT_RIGHT_OF_CENTER (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER)
172 #define AV_CH_BACK_CENTER (1ULL << AV_CHAN_BACK_CENTER )
173 #define AV_CH_SIDE_LEFT (1ULL << AV_CHAN_SIDE_LEFT )
174 #define AV_CH_SIDE_RIGHT (1ULL << AV_CHAN_SIDE_RIGHT )
175 #define AV_CH_TOP_CENTER (1ULL << AV_CHAN_TOP_CENTER )
176 #define AV_CH_TOP_FRONT_LEFT (1ULL << AV_CHAN_TOP_FRONT_LEFT )
177 #define AV_CH_TOP_FRONT_CENTER (1ULL << AV_CHAN_TOP_FRONT_CENTER )
178 #define AV_CH_TOP_FRONT_RIGHT (1ULL << AV_CHAN_TOP_FRONT_RIGHT )
179 #define AV_CH_TOP_BACK_LEFT (1ULL << AV_CHAN_TOP_BACK_LEFT )
180 #define AV_CH_TOP_BACK_CENTER (1ULL << AV_CHAN_TOP_BACK_CENTER )
181 #define AV_CH_TOP_BACK_RIGHT (1ULL << AV_CHAN_TOP_BACK_RIGHT )
182 #define AV_CH_STEREO_LEFT (1ULL << AV_CHAN_STEREO_LEFT )
183 #define AV_CH_STEREO_RIGHT (1ULL << AV_CHAN_STEREO_RIGHT )
184 #define AV_CH_WIDE_LEFT (1ULL << AV_CHAN_WIDE_LEFT )
185 #define AV_CH_WIDE_RIGHT (1ULL << AV_CHAN_WIDE_RIGHT )
186 #define AV_CH_SURROUND_DIRECT_LEFT (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT )
187 #define AV_CH_SURROUND_DIRECT_RIGHT (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT)
188 #define AV_CH_LOW_FREQUENCY_2 (1ULL << AV_CHAN_LOW_FREQUENCY_2 )
189 #define AV_CH_TOP_SIDE_LEFT (1ULL << AV_CHAN_TOP_SIDE_LEFT )
190 #define AV_CH_TOP_SIDE_RIGHT (1ULL << AV_CHAN_TOP_SIDE_RIGHT )
191 #define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER )
192 #define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT )
193 #define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT )
194 
195 #if FF_API_OLD_CHANNEL_LAYOUT
196 /** Channel mask value used for AVCodecContext.request_channel_layout
197  to indicate that the user requests the channel order of the decoder output
198  to be the native codec channel order.
199  @deprecated channel order is now indicated in a special field in
200  AVChannelLayout
201  */
202 #define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
203 #endif
204 
205 /**
206  * @}
207  * @defgroup channel_mask_c Audio channel layouts
208  * @{
209  * */
210 #define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
211 #define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
212 #define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
213 #define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
214 #define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
215 #define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
216 #define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
217 #define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
218 #define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
219 #define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
220 #define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
221 #define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
222 #define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
223 #define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
224 #define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
225 #define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
226 #define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
227 #define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
228 #define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
229 #define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
230 #define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
231 #define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
232 #define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
233 #define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
234 #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
235 #define AV_CH_LAYOUT_7POINT1_TOP_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
236 #define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
237 #define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
238 #define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
239 #define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
240 #define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
241 
251 };
252 
253 /**
254  * @}
255  */
256 
257 /**
258  * An AVChannelCustom defines a single channel within a custom order layout
259  *
260  * Unlike most structures in FFmpeg, sizeof(AVChannelCustom) is a part of the
261  * public ABI.
262  *
263  * No new fields may be added to it without a major version bump.
264  */
265 typedef struct AVChannelCustom {
266  enum AVChannel id;
267  char name[16];
268  void *opaque;
270 
271 /**
272  * An AVChannelLayout holds information about the channel layout of audio data.
273  *
274  * A channel layout here is defined as a set of channels ordered in a specific
275  * way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
276  * AVChannelLayout carries only the channel count).
277  * All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
278  * ignoring everything but the channel count, as long as av_channel_layout_check()
279  * considers they are valid.
280  *
281  * Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the
282  * public ABI and may be used by the caller. E.g. it may be allocated on stack
283  * or embedded in caller-defined structs.
284  *
285  * AVChannelLayout can be initialized as follows:
286  * - default initialization with {0}, followed by setting all used fields
287  * correctly;
288  * - by assigning one of the predefined AV_CHANNEL_LAYOUT_* initializers;
289  * - with a constructor function, such as av_channel_layout_default(),
290  * av_channel_layout_from_mask() or av_channel_layout_from_string().
291  *
292  * The channel layout must be unitialized with av_channel_layout_uninit()
293  *
294  * Copying an AVChannelLayout via assigning is forbidden,
295  * av_channel_layout_copy() must be used instead (and its return value should
296  * be checked)
297  *
298  * No new fields may be added to it without a major version bump, except for
299  * new elements of the union fitting in sizeof(uint64_t).
300  */
301 typedef struct AVChannelLayout {
302  /**
303  * Channel order used in this layout.
304  * This is a mandatory field.
305  */
307 
308  /**
309  * Number of channels in this layout. Mandatory field.
310  */
312 
313  /**
314  * Details about which channels are present in this layout.
315  * For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be
316  * used.
317  */
318  union {
319  /**
320  * This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used
321  * for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
322  * It is a bitmask, where the position of each set bit means that the
323  * AVChannel with the corresponding value is present.
324  *
325  * I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO
326  * is present in the layout. Otherwise it is not present.
327  *
328  * @note when a channel layout using a bitmask is constructed or
329  * modified manually (i.e. not using any of the av_channel_layout_*
330  * functions), the code doing it must ensure that the number of set bits
331  * is equal to nb_channels.
332  */
333  uint64_t mask;
334  /**
335  * This member must be used when the channel order is
336  * AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each
337  * element signalling the presence of the AVChannel with the
338  * corresponding value in map[i].id.
339  *
340  * I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the
341  * i-th channel in the audio data.
342  *
343  * When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and
344  * AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic
345  * component with ACN index (as defined above)
346  * n = map[i].id - AV_CHAN_AMBISONIC_BASE.
347  *
348  * map[i].name may be filled with a 0-terminated string, in which case
349  * it will be used for the purpose of identifying the channel with the
350  * convenience functions below. Otherise it must be zeroed.
351  */
353  } u;
354 
355  /**
356  * For some private data of the user.
357  */
358  void *opaque;
360 
361 /**
362  * Macro to define native channel layouts
363  *
364  * @note This doesn't use designated initializers for compatibility with C++ 17 and older.
365  */
366 #define AV_CHANNEL_LAYOUT_MASK(nb, m) \
367  { /* .order */ AV_CHANNEL_ORDER_NATIVE, \
368  /* .nb_channels */ (nb), \
369  /* .u.mask */ { m }, \
370  /* .opaque */ NULL }
371 
372 /**
373  * @name Common pre-defined channel layouts
374  * @{
375  */
376 #define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO)
377 #define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO)
378 #define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1)
379 #define AV_CHANNEL_LAYOUT_2_1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2_1)
380 #define AV_CHANNEL_LAYOUT_SURROUND AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_SURROUND)
381 #define AV_CHANNEL_LAYOUT_3POINT1 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_3POINT1)
382 #define AV_CHANNEL_LAYOUT_4POINT0 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_4POINT0)
383 #define AV_CHANNEL_LAYOUT_4POINT1 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_4POINT1)
384 #define AV_CHANNEL_LAYOUT_2_2 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_2_2)
385 #define AV_CHANNEL_LAYOUT_QUAD AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_QUAD)
386 #define AV_CHANNEL_LAYOUT_5POINT0 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0)
387 #define AV_CHANNEL_LAYOUT_5POINT1 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1)
388 #define AV_CHANNEL_LAYOUT_5POINT0_BACK AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0_BACK)
389 #define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK)
390 #define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0)
391 #define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT)
392 #define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL)
393 #define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1)
394 #define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK)
395 #define AV_CHANNEL_LAYOUT_6POINT1_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_FRONT)
396 #define AV_CHANNEL_LAYOUT_7POINT0 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0)
397 #define AV_CHANNEL_LAYOUT_7POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0_FRONT)
398 #define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1)
399 #define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE)
400 #define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK)
401 #define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_TOP_BACK)
402 #define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL)
403 #define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE)
404 #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
405 #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX)
406 #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
407 
408 #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
409  { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \
410  /* .nb_channels */ 4, \
411  /* .u.mask */ { 0 }, \
412  /* .opaque */ NULL }
413 /** @} */
414 
415 struct AVBPrint;
416 
417 #if FF_API_OLD_CHANNEL_LAYOUT
418 /**
419  * @name Deprecated Functions
420  * @{
421  */
422 
423 /**
424  * Return a channel layout id that matches name, or 0 if no match is found.
425  *
426  * name can be one or several of the following notations,
427  * separated by '+' or '|':
428  * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
429  * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
430  * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
431  * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
432  * - a number of channels, in decimal, followed by 'c', yielding
433  * the default channel layout for that number of channels (@see
434  * av_get_default_channel_layout);
435  * - a channel layout mask, in hexadecimal starting with "0x" (see the
436  * AV_CH_* macros).
437  *
438  * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7"
439  *
440  * @deprecated use av_channel_layout_from_string()
441  */
443 uint64_t av_get_channel_layout(const char *name);
444 
445 /**
446  * Return a channel layout and the number of channels based on the specified name.
447  *
448  * This function is similar to (@see av_get_channel_layout), but can also parse
449  * unknown channel layout specifications.
450  *
451  * @param[in] name channel layout specification string
452  * @param[out] channel_layout parsed channel layout (0 if unknown)
453  * @param[out] nb_channels number of channels
454  *
455  * @return 0 on success, AVERROR(EINVAL) if the parsing fails.
456  * @deprecated use av_channel_layout_from_string()
457  */
459 int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels);
460 
461 /**
462  * Return a description of a channel layout.
463  * If nb_channels is <= 0, it is guessed from the channel_layout.
464  *
465  * @param buf put here the string containing the channel layout
466  * @param buf_size size in bytes of the buffer
467  * @param nb_channels number of channels
468  * @param channel_layout channel layout bitset
469  * @deprecated use av_channel_layout_describe()
470  */
472 void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
473 
474 /**
475  * Append a description of a channel layout to a bprint buffer.
476  * @deprecated use av_channel_layout_describe()
477  */
479 void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
480 
481 /**
482  * Return the number of channels in the channel layout.
483  * @deprecated use AVChannelLayout.nb_channels
484  */
486 int av_get_channel_layout_nb_channels(uint64_t channel_layout);
487 
488 /**
489  * Return default channel layout for a given number of channels.
490  *
491  * @deprecated use av_channel_layout_default()
492  */
494 int64_t av_get_default_channel_layout(int nb_channels);
495 
496 /**
497  * Get the index of a channel in channel_layout.
498  *
499  * @param channel_layout channel layout bitset
500  * @param channel a channel layout describing exactly one channel which must be
501  * present in channel_layout.
502  *
503  * @return index of channel in channel_layout on success, a negative AVERROR
504  * on error.
505  *
506  * @deprecated use av_channel_layout_index_from_channel()
507  */
509 int av_get_channel_layout_channel_index(uint64_t channel_layout,
510  uint64_t channel);
511 
512 /**
513  * Get the channel with the given index in channel_layout.
514  * @deprecated use av_channel_layout_channel_from_index()
515  */
517 uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
518 
519 /**
520  * Get the name of a given channel.
521  *
522  * @return channel name on success, NULL on error.
523  *
524  * @deprecated use av_channel_name()
525  */
527 const char *av_get_channel_name(uint64_t channel);
528 
529 /**
530  * Get the description of a given channel.
531  *
532  * @param channel a channel layout with a single channel
533  * @return channel description on success, NULL on error
534  * @deprecated use av_channel_description()
535  */
537 const char *av_get_channel_description(uint64_t channel);
538 
539 /**
540  * Get the value and name of a standard channel layout.
541  *
542  * @param[in] index index in an internal list, starting at 0
543  * @param[out] layout channel layout mask
544  * @param[out] name name of the layout
545  * @return 0 if the layout exists,
546  * <0 if index is beyond the limits
547  * @deprecated use av_channel_layout_standard()
548  */
550 int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
551  const char **name);
552 /**
553  * @}
554  */
555 #endif
556 
557 /**
558  * Get a human readable string in an abbreviated form describing a given channel.
559  * This is the inverse function of @ref av_channel_from_string().
560  *
561  * @param buf pre-allocated buffer where to put the generated string
562  * @param buf_size size in bytes of the buffer.
563  * @param channel the AVChannel whose name to get
564  * @return amount of bytes needed to hold the output string, or a negative AVERROR
565  * on failure. If the returned value is bigger than buf_size, then the
566  * string was truncated.
567  */
568 int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel);
569 
570 /**
571  * bprint variant of av_channel_name().
572  *
573  * @note the string will be appended to the bprint buffer.
574  */
575 void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
576 
577 /**
578  * Get a human readable string describing a given channel.
579  *
580  * @param buf pre-allocated buffer where to put the generated string
581  * @param buf_size size in bytes of the buffer.
582  * @param channel the AVChannel whose description to get
583  * @return amount of bytes needed to hold the output string, or a negative AVERROR
584  * on failure. If the returned value is bigger than buf_size, then the
585  * string was truncated.
586  */
587 int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel);
588 
589 /**
590  * bprint variant of av_channel_description().
591  *
592  * @note the string will be appended to the bprint buffer.
593  */
594 void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
595 
596 /**
597  * This is the inverse function of @ref av_channel_name().
598  *
599  * @return the channel with the given name
600  * AV_CHAN_NONE when name does not identify a known channel
601  */
602 enum AVChannel av_channel_from_string(const char *name);
603 
604 /**
605  * Initialize a native channel layout from a bitmask indicating which channels
606  * are present.
607  *
608  * @param channel_layout the layout structure to be initialized
609  * @param mask bitmask describing the channel layout
610  *
611  * @return 0 on success
612  * AVERROR(EINVAL) for invalid mask values
613  */
614 int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask);
615 
616 /**
617  * Initialize a channel layout from a given string description.
618  * The input string can be represented by:
619  * - the formal channel layout name (returned by av_channel_layout_describe())
620  * - single or multiple channel names (returned by av_channel_name(), eg. "FL",
621  * or concatenated with "+", each optionally containing a custom name after
622  * a "@", eg. "FL@Left+FR@Right+LFE")
623  * - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4")
624  * - the number of channels with default layout (eg. "4c")
625  * - the number of unordered channels (eg. "4C" or "4 channels")
626  * - the ambisonic order followed by optional non-diegetic channels (eg.
627  * "ambisonic 2+stereo")
628  *
629  * @param channel_layout input channel layout
630  * @param str string describing the channel layout
631  * @return 0 channel layout was detected, AVERROR_INVALIDATATA otherwise
632  */
634  const char *str);
635 
636 /**
637  * Get the default channel layout for a given number of channels.
638  *
639  * @param ch_layout the layout structure to be initialized
640  * @param nb_channels number of channels
641  */
642 void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels);
643 
644 /**
645  * Iterate over all standard channel layouts.
646  *
647  * @param opaque a pointer where libavutil will store the iteration state. Must
648  * point to NULL to start the iteration.
649  *
650  * @return the standard channel layout or NULL when the iteration is
651  * finished
652  */
653 const AVChannelLayout *av_channel_layout_standard(void **opaque);
654 
655 /**
656  * Free any allocated data in the channel layout and reset the channel
657  * count to 0.
658  *
659  * @param channel_layout the layout structure to be uninitialized
660  */
661 void av_channel_layout_uninit(AVChannelLayout *channel_layout);
662 
663 /**
664  * Make a copy of a channel layout. This differs from just assigning src to dst
665  * in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM.
666  *
667  * @note the destination channel_layout will be always uninitialized before copy.
668  *
669  * @param dst destination channel layout
670  * @param src source channel layout
671  * @return 0 on success, a negative AVERROR on error.
672  */
674 
675 /**
676  * Get a human-readable string describing the channel layout properties.
677  * The string will be in the same format that is accepted by
678  * @ref av_channel_layout_from_string(), allowing to rebuild the same
679  * channel layout, except for opaque pointers.
680  *
681  * @param channel_layout channel layout to be described
682  * @param buf pre-allocated buffer where to put the generated string
683  * @param buf_size size in bytes of the buffer.
684  * @return amount of bytes needed to hold the output string, or a negative AVERROR
685  * on failure. If the returned value is bigger than buf_size, then the
686  * string was truncated.
687  */
688 int av_channel_layout_describe(const AVChannelLayout *channel_layout,
689  char *buf, size_t buf_size);
690 
691 /**
692  * bprint variant of av_channel_layout_describe().
693  *
694  * @note the string will be appended to the bprint buffer.
695  * @return 0 on success, or a negative AVERROR value on failure.
696  */
697 int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout,
698  struct AVBPrint *bp);
699 
700 /**
701  * Get the channel with the given index in a channel layout.
702  *
703  * @param channel_layout input channel layout
704  * @param idx index of the channel
705  * @return channel with the index idx in channel_layout on success or
706  * AV_CHAN_NONE on failure (if idx is not valid or the channel order is
707  * unspecified)
708  */
709 enum AVChannel
710 av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx);
711 
712 /**
713  * Get the index of a given channel in a channel layout. In case multiple
714  * channels are found, only the first match will be returned.
715  *
716  * @param channel_layout input channel layout
717  * @param channel the channel whose index to obtain
718  * @return index of channel in channel_layout on success or a negative number if
719  * channel is not present in channel_layout.
720  */
721 int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout,
722  enum AVChannel channel);
723 
724 /**
725  * Get the index in a channel layout of a channel described by the given string.
726  * In case multiple channels are found, only the first match will be returned.
727  *
728  * This function accepts channel names in the same format as
729  * @ref av_channel_from_string().
730  *
731  * @param channel_layout input channel layout
732  * @param name string describing the channel whose index to obtain
733  * @return a channel index described by the given string, or a negative AVERROR
734  * value.
735  */
736 int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout,
737  const char *name);
738 
739 /**
740  * Get a channel described by the given string.
741  *
742  * This function accepts channel names in the same format as
743  * @ref av_channel_from_string().
744  *
745  * @param channel_layout input channel layout
746  * @param name string describing the channel to obtain
747  * @return a channel described by the given string in channel_layout on success
748  * or AV_CHAN_NONE on failure (if the string is not valid or the channel
749  * order is unspecified)
750  */
751 enum AVChannel
753  const char *name);
754 
755 /**
756  * Find out what channels from a given set are present in a channel layout,
757  * without regard for their positions.
758  *
759  * @param channel_layout input channel layout
760  * @param mask a combination of AV_CH_* representing a set of channels
761  * @return a bitfield representing all the channels from mask that are present
762  * in channel_layout
763  */
764 uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout,
765  uint64_t mask);
766 
767 /**
768  * Check whether a channel layout is valid, i.e. can possibly describe audio
769  * data.
770  *
771  * @param channel_layout input channel layout
772  * @return 1 if channel_layout is valid, 0 otherwise.
773  */
774 int av_channel_layout_check(const AVChannelLayout *channel_layout);
775 
776 /**
777  * Check whether two channel layouts are semantically the same, i.e. the same
778  * channels are present on the same positions in both.
779  *
780  * If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the other is
781  * not, they are considered to be unequal. If both are AV_CHANNEL_ORDER_UNSPEC,
782  * they are considered equal iff the channel counts are the same in both.
783  *
784  * @param chl input channel layout
785  * @param chl1 input channel layout
786  * @return 0 if chl and chl1 are equal, 1 if they are not equal. A negative
787  * AVERROR code if one or both are invalid.
788  */
789 int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1);
790 
791 /**
792  * @}
793  */
794 
795 #endif /* AVUTIL_CHANNEL_LAYOUT_H */
av_get_channel_layout_string
attribute_deprecated void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
Return a description of a channel layout.
Definition: channel_layout.c:315
AVChannelOrder
AVChannelOrder
Definition: channel_layout.h:107
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AV_CHAN_WIDE_LEFT
@ AV_CHAN_WIDE_LEFT
Definition: channel_layout.h:72
av_get_channel_name
const attribute_deprecated char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
Definition: channel_layout.c:347
AVChannelLayout::map
AVChannelCustom * map
This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM.
Definition: channel_layout.h:352
av_channel_layout_channel_from_index
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
Definition: channel_layout.c:802
av_get_standard_channel_layout
attribute_deprecated int av_get_standard_channel_layout(unsigned index, uint64_t *layout, const char **name)
Get the value and name of a standard channel layout.
Definition: channel_layout.c:383
AVChannelLayout::order
enum AVChannelOrder order
Channel order used in this layout.
Definition: channel_layout.h:306
AVChannelLayout::mask
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
Definition: channel_layout.h:333
av_get_channel_layout_nb_channels
attribute_deprecated int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
Definition: channel_layout.c:324
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:311
AVChannelLayout::u
union AVChannelLayout::@331 u
Details about which channels are present in this layout.
av_channel_layout_describe_bprint
int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, struct AVBPrint *bp)
bprint variant of av_channel_layout_describe().
Definition: channel_layout.c:736
av_channel_layout_extract_channel
attribute_deprecated uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
Get the channel with the given index in channel_layout.
Definition: channel_layout.c:369
AV_CHAN_SURROUND_DIRECT_LEFT
@ AV_CHAN_SURROUND_DIRECT_LEFT
Definition: channel_layout.h:74
av_channel_description_bprint
void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id)
bprint variant of av_channel_description().
Definition: channel_layout.c:116
AV_CHAN_TOP_BACK_RIGHT
@ AV_CHAN_TOP_BACK_RIGHT
Definition: channel_layout.h:67
av_get_channel_layout_channel_index
attribute_deprecated int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel)
Get the index of a channel in channel_layout.
Definition: channel_layout.c:337
AV_CHAN_STEREO_RIGHT
@ AV_CHAN_STEREO_RIGHT
See above.
Definition: channel_layout.h:71
AV_CHAN_BOTTOM_FRONT_LEFT
@ AV_CHAN_BOTTOM_FRONT_LEFT
Definition: channel_layout.h:80
AV_MATRIX_ENCODING_DOLBY
@ AV_MATRIX_ENCODING_DOLBY
Definition: channel_layout.h:244
av_get_channel_description
const attribute_deprecated char * av_get_channel_description(uint64_t channel)
Get the description of a given channel.
Definition: channel_layout.c:358
mask
static const uint16_t mask[17]
Definition: lzw.c:38
av_channel_layout_describe
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
Definition: channel_layout.c:782
AVChannelCustom
An AVChannelCustom defines a single channel within a custom order layout.
Definition: channel_layout.h:265
AV_MATRIX_ENCODING_NB
@ AV_MATRIX_ENCODING_NB
Definition: channel_layout.h:250
AV_CHAN_UNKNOWN
@ AV_CHAN_UNKNOWN
Channel contains data, but its position is unknown.
Definition: channel_layout.h:87
AV_CHANNEL_ORDER_UNSPEC
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
Definition: channel_layout.h:112
av_channel_layout_from_mask
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
Definition: channel_layout.c:395
AV_CHAN_SIDE_RIGHT
@ AV_CHAN_SIDE_RIGHT
Definition: channel_layout.h:60
av_channel_layout_index_from_string
int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout, const char *name)
Get the index in a channel layout of a channel described by the given string.
Definition: channel_layout.c:876
av_channel_layout_standard
const AVChannelLayout * av_channel_layout_standard(void **opaque)
Iterate over all standard channel layouts.
Definition: channel_layout.c:981
AV_MATRIX_ENCODING_DPLIIX
@ AV_MATRIX_ENCODING_DPLIIX
Definition: channel_layout.h:246
AV_CHAN_TOP_SIDE_LEFT
@ AV_CHAN_TOP_SIDE_LEFT
Definition: channel_layout.h:77
AV_CHAN_TOP_SIDE_RIGHT
@ AV_CHAN_TOP_SIDE_RIGHT
Definition: channel_layout.h:78
AVMatrixEncoding
AVMatrixEncoding
Definition: channel_layout.h:242
AV_MATRIX_ENCODING_DOLBYHEADPHONE
@ AV_MATRIX_ENCODING_DOLBYHEADPHONE
Definition: channel_layout.h:249
AV_CHANNEL_ORDER_AMBISONIC
@ AV_CHANNEL_ORDER_AMBISONIC
The audio is represented as the decomposition of the sound field into spherical harmonics.
Definition: channel_layout.h:148
AV_CHAN_TOP_BACK_CENTER
@ AV_CHAN_TOP_BACK_CENTER
Definition: channel_layout.h:66
AV_CHAN_BOTTOM_FRONT_RIGHT
@ AV_CHAN_BOTTOM_FRONT_RIGHT
Definition: channel_layout.h:81
av_get_channel_layout
attribute_deprecated uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
Definition: channel_layout.c:243
AV_CHAN_TOP_CENTER
@ AV_CHAN_TOP_CENTER
Definition: channel_layout.h:61
index
int index
Definition: gxfenc.c:89
AV_CHAN_FRONT_RIGHT_OF_CENTER
@ AV_CHAN_FRONT_RIGHT_OF_CENTER
Definition: channel_layout.h:57
AV_CHAN_FRONT_RIGHT
@ AV_CHAN_FRONT_RIGHT
Definition: channel_layout.h:51
AV_CHAN_FRONT_CENTER
@ AV_CHAN_FRONT_CENTER
Definition: channel_layout.h:52
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:301
AV_MATRIX_ENCODING_NONE
@ AV_MATRIX_ENCODING_NONE
Definition: channel_layout.h:243
AV_CHAN_LOW_FREQUENCY
@ AV_CHAN_LOW_FREQUENCY
Definition: channel_layout.h:53
AV_CHAN_BACK_RIGHT
@ AV_CHAN_BACK_RIGHT
Definition: channel_layout.h:55
AV_CHAN_SIDE_LEFT
@ AV_CHAN_SIDE_LEFT
Definition: channel_layout.h:59
AV_CHAN_AMBISONIC_END
@ AV_CHAN_AMBISONIC_END
Definition: channel_layout.h:104
attribute_deprecated
#define attribute_deprecated
Definition: attributes.h:104
av_channel_description
int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel)
Get a human readable string describing a given channel.
Definition: channel_layout.c:130
AV_CHAN_TOP_FRONT_RIGHT
@ AV_CHAN_TOP_FRONT_RIGHT
Definition: channel_layout.h:64
attributes.h
AV_CHANNEL_ORDER_NATIVE
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
Definition: channel_layout.h:118
AV_CHAN_FRONT_LEFT_OF_CENTER
@ AV_CHAN_FRONT_LEFT_OF_CENTER
Definition: channel_layout.h:56
AV_CHAN_UNUSED
@ AV_CHAN_UNUSED
Channel is empty can be safely skipped.
Definition: channel_layout.h:84
av_channel_layout_compare
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
Definition: channel_layout.c:938
av_channel_layout_default
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
Definition: channel_layout.c:968
layout
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
Definition: filter_design.txt:18
AVChannel
AVChannel
Definition: channel_layout.h:47
av_channel_layout_from_string
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
Initialize a channel layout from a given string description.
Definition: channel_layout.c:408
AV_CHAN_SURROUND_DIRECT_RIGHT
@ AV_CHAN_SURROUND_DIRECT_RIGHT
Definition: channel_layout.h:75
av_channel_name
int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel)
Get a human readable string in an abbreviated form describing a given channel.
Definition: channel_layout.c:101
AVChannelCustom::name
char name[16]
Definition: channel_layout.h:267
AV_CHAN_STEREO_LEFT
@ AV_CHAN_STEREO_LEFT
Stereo downmix.
Definition: channel_layout.h:69
version.h
av_bprint_channel_layout
attribute_deprecated void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout)
Append a description of a channel layout to a bprint buffer.
Definition: channel_layout.c:281
av_channel_layout_check
int av_channel_layout_check(const AVChannelLayout *channel_layout)
Check whether a channel layout is valid, i.e.
Definition: channel_layout.c:912
AV_CHAN_BACK_CENTER
@ AV_CHAN_BACK_CENTER
Definition: channel_layout.h:58
av_channel_from_string
enum AVChannel av_channel_from_string(const char *name)
This is the inverse function of av_channel_name().
Definition: channel_layout.c:145
AV_CHAN_NONE
@ AV_CHAN_NONE
Invalid channel index.
Definition: channel_layout.h:49
AVChannelCustom::opaque
void * opaque
Definition: channel_layout.h:268
AV_CHANNEL_ORDER_CUSTOM
@ AV_CHANNEL_ORDER_CUSTOM
The channel order does not correspond to any other predefined order and is stored as an explicit map.
Definition: channel_layout.h:125
AVChannelLayout::opaque
void * opaque
For some private data of the user.
Definition: channel_layout.h:358
AV_CHAN_LOW_FREQUENCY_2
@ AV_CHAN_LOW_FREQUENCY_2
Definition: channel_layout.h:76
av_channel_layout_subset
uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout, uint64_t mask)
Find out what channels from a given set are present in a channel layout, without regard for their pos...
Definition: channel_layout.c:994
AV_CHAN_TOP_BACK_LEFT
@ AV_CHAN_TOP_BACK_LEFT
Definition: channel_layout.h:65
AV_MATRIX_ENCODING_DOLBYEX
@ AV_MATRIX_ENCODING_DOLBYEX
Definition: channel_layout.h:248
av_channel_layout_channel_from_string
enum AVChannel av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout, const char *name)
Get a channel described by the given string.
Definition: channel_layout.c:831
av_channel_layout_index_from_channel
int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout, enum AVChannel channel)
Get the index of a given channel in a channel layout.
Definition: channel_layout.c:842
av_channel_layout_uninit
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
Definition: channel_layout.c:636
AV_CHAN_BACK_LEFT
@ AV_CHAN_BACK_LEFT
Definition: channel_layout.h:54
AV_CHAN_BOTTOM_FRONT_CENTER
@ AV_CHAN_BOTTOM_FRONT_CENTER
Definition: channel_layout.h:79
av_channel_layout_copy
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
Definition: channel_layout.c:643
AV_CHAN_TOP_FRONT_CENTER
@ AV_CHAN_TOP_FRONT_CENTER
Definition: channel_layout.h:63
AV_CHAN_WIDE_RIGHT
@ AV_CHAN_WIDE_RIGHT
Definition: channel_layout.h:73
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_CHAN_TOP_FRONT_LEFT
@ AV_CHAN_TOP_FRONT_LEFT
Definition: channel_layout.h:62
AV_MATRIX_ENCODING_DPLIIZ
@ AV_MATRIX_ENCODING_DPLIIZ
Definition: channel_layout.h:247
AV_CHAN_AMBISONIC_BASE
@ AV_CHAN_AMBISONIC_BASE
Range of channels between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END represent Ambisonic compon...
Definition: channel_layout.h:101
av_get_extended_channel_layout
attribute_deprecated int av_get_extended_channel_layout(const char *name, uint64_t *channel_layout, int *nb_channels)
Return a channel layout and the number of channels based on the specified name.
Definition: channel_layout.c:259
AV_CHAN_FRONT_LEFT
@ AV_CHAN_FRONT_LEFT
Definition: channel_layout.h:50
av_channel_name_bprint
void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id)
bprint variant of av_channel_name().
Definition: channel_layout.c:87
AVChannelCustom::id
enum AVChannel id
Definition: channel_layout.h:266
channel
channel
Definition: ebur128.h:39
av_get_default_channel_layout
attribute_deprecated int64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
Definition: channel_layout.c:329
AV_MATRIX_ENCODING_DPLII
@ AV_MATRIX_ENCODING_DPLII
Definition: channel_layout.h:245