119 return (int64_t)1 << i;
120 i = strtol(name, &end, 10);
121 if (end - name == name_len ||
122 (end + 1 - name == name_len && *end ==
'c'))
124 layout = strtoll(name, &end, 0);
125 if (end - name == name_len)
126 return FFMAX(layout, 0);
133 const char *name_end = name + strlen(name);
134 int64_t
layout = 0, layout_single;
136 for (n = name; n < name_end; n = e + 1) {
137 for (e = n; e < name_end && *e !=
'+' && *e !=
'|'; e++);
141 layout |= layout_single;
151 if (nb_channels <= 0)
161 snprintf(buf, buf_size,
"%d channels", nb_channels);
162 if (channel_layout) {
165 for (i = 0, ch = 0; i < 64; i++) {
166 if ((channel_layout & (UINT64_C(1) << i))) {
182 return av_popcount64(channel_layout);
187 switch(nb_channels) {
203 if (!(channel_layout & channel) ||
206 channel_layout &= channel - 1;
215 for (i = 0; i < 64; i++)
216 if ((1ULL<<i) & channel)
228 for (i = 0; i < 64; i++) {
229 if ((1ULL << i) & channel_layout && !index--)
uint64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
#define AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_4POINT1
#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 FF_ARRAY_ELEMS(a)
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_5POINT0
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
Get the channel with the given index in channel_layout.
#define AV_CH_LAYOUT_HEXAGONAL
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_5POINT1
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
#define AV_CH_LAYOUT_QUAD
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
#define AV_CH_LAYOUT_6POINT0_FRONT
audio channel layout utility functions
#define AV_CH_LAYOUT_STEREO_DOWNMIX
#define AV_CH_LAYOUT_3POINT1
static const struct @124 channel_layout_map[]
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_6POINT1_BACK
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_OCTAGONAL
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
#define AV_CH_LAYOUT_7POINT1_WIDE
common internal and external API header
#define AV_CH_LAYOUT_2POINT1
static uint64_t get_channel_layout_single(const char *name, int name_len)
static const char *const channel_names[]
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
#define AV_CH_LAYOUT_6POINT1_FRONT
#define AV_CH_LAYOUT_MONO
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.