40 [0] = {
"FL",
"front left" },
41 [1] = {
"FR",
"front right" },
42 [2] = {
"FC",
"front center" },
43 [3] = {
"LFE",
"low frequency" },
44 [4] = {
"BL",
"back left" },
45 [5] = {
"BR",
"back right" },
46 [6] = {
"FLC",
"front left-of-center" },
47 [7] = {
"FRC",
"front right-of-center" },
48 [8] = {
"BC",
"back center" },
49 [9] = {
"SL",
"side left" },
50 [10] = {
"SR",
"side right" },
51 [11] = {
"TC",
"top center" },
52 [12] = {
"TFL",
"top front left" },
53 [13] = {
"TFC",
"top front center" },
54 [14] = {
"TFR",
"top front right" },
55 [15] = {
"TBL",
"top back left" },
56 [16] = {
"TBC",
"top back center" },
57 [17] = {
"TBR",
"top back right" },
58 [29] = {
"DL",
"downmix left" },
59 [30] = {
"DR",
"downmix right" },
60 [31] = {
"WL",
"wide left" },
61 [32] = {
"WR",
"wide right" },
62 [33] = {
"SDL",
"surround direct left" },
63 [34] = {
"SDR",
"surround direct right" },
64 [35] = {
"LFE2",
"low frequency 2" },
71 return channel_names[channel_id].
name;
121 if (channel_names[i].name &&
122 strlen(channel_names[i].name) == name_len &&
123 !memcmp(channel_names[i].name, name, name_len))
124 return (int64_t)1 << i;
127 i = strtol(name, &end, 10);
129 if (!errno && (end + 1 - name == name_len && *end ==
'c'))
133 layout = strtoll(name, &end, 0);
134 if (!errno && end - name == name_len)
135 return FFMAX(layout, 0);
142 const char *name_end = name + strlen(name);
143 int64_t
layout = 0, layout_single;
145 for (n = name; n < name_end; n = e + 1) {
146 for (e = n; e < name_end && *e !=
'+' && *e !=
'|'; e++);
150 layout |= layout_single;
160 if (nb_channels <= 0)
171 if (channel_layout) {
174 for (i = 0, ch = 0; i < 64; i++) {
175 if ((channel_layout & (UINT64_C(1) << i))) {
200 return av_popcount64(channel_layout);
214 if (!(channel_layout & channel) ||
217 channel_layout &= channel - 1;
226 for (i = 0; i < 64; i++)
227 if ((1ULL<<i) & channel)
238 if ((1ULL<<i) & channel)
239 return channel_names[i].description;
250 for (i = 0; i < 64; i++) {
251 if ((1ULL << i) & channel_layout && !index--)
#define AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_4POINT1
#define AV_CH_LAYOUT_HEXADECAGONAL
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define AV_CH_LAYOUT_6POINT1
#define AV_CH_LAYOUT_6POINT0
#define AV_CH_LAYOUT_SURROUND
static const char * get_channel_name(int channel_id)
#define AV_CH_LAYOUT_7POINT0_FRONT
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_7POINT0
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_5POINT0
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
int av_get_standard_channel_layout(unsigned index, uint64_t *layout, const char **name)
Get the value and name of a standard channel layout.
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
static av_cold int end(AVCodecContext *avctx)
#define AV_CH_LAYOUT_HEXAGONAL
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
#define AVERROR_EOF
End of file.
#define AV_CH_LAYOUT_5POINT1
static const struct channel_name channel_names[]
static const struct @192 channel_layout_map[]
#define AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_6POINT0_FRONT
audio channel layout utility functions
#define AV_CH_LAYOUT_STEREO_DOWNMIX
#define AV_CH_LAYOUT_3POINT1
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_6POINT1_BACK
#define FF_ARRAY_ELEMS(a)
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.
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.
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_OCTAGONAL
int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel)
Get the index of a channel in channel_layout.
#define AV_CH_LAYOUT_7POINT1_WIDE
common internal and external API header
#define AV_CH_LAYOUT_2POINT1
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
Get the channel with the given index in channel_layout.
static uint64_t get_channel_layout_single(const char *name, int name_len)
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
int64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
#define AV_CH_LAYOUT_6POINT1_FRONT
const char * av_get_channel_description(uint64_t channel)
Get the description of a given channel.
#define AV_CH_LAYOUT_MONO