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;
109 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
125 if (channel_names[i].name &&
126 strlen(channel_names[i].name) == name_len &&
127 !memcmp(channel_names[i].name, name, name_len))
128 return (int64_t)1 << i;
129 i = strtol(name, &end, 10);
131 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
133 if (end - name == name_len ||
134 (end + 1 - name == name_len && *end ==
'c')) {
136 if (end - name == name_len) {
138 "Single channel layout '%.*s' is interpreted as a number of channels, "
139 "switch to the syntax '%.*sc' otherwise it will be interpreted as a "
140 "channel layout number in a later version\n",
141 name_len, name, name_len, name);
147 if ((end + 1 - name == name_len && *end ==
'c'))
149 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
153 layout = strtoll(name, &end, 0);
154 if (end - name == name_len)
155 return FFMAX(layout, 0);
159 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
166 const char *name_end = name + strlen(name);
167 int64_t
layout = 0, layout_single;
169 for (n = name; n < name_end; n = e + 1) {
170 for (e = n; e < name_end && *e !=
'+' && *e !=
'|'; e++);
171 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
178 layout |= layout_single;
183 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
195 if (nb_channels <= 0)
206 if (channel_layout) {
209 for (i = 0, ch = 0; i < 64; i++) {
210 if ((channel_layout & (UINT64_C(1) << i))) {
235 return av_popcount64(channel_layout);
249 if (!(channel_layout & channel) ||
252 channel_layout &= channel - 1;
261 for (i = 0; i < 64; i++)
262 if ((1ULL<<i) & channel)
273 if ((1ULL<<i) & channel)
274 return channel_names[i].description;
285 for (i = 0; i < 64; i++) {
286 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_LOG_WARNING
Something somehow does not look correct.
#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[]
#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
static uint64_t get_channel_layout_single(const char *name, int name_len, int compat)
#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 const struct @185 channel_layout_map[]
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
uint64_t ff_get_channel_layout(const char *name, int compat)
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