Commit 33449b17 authored by Nicolas George's avatar Nicolas George

audioconvert: add av_get_channel_description().

parent cc554704
......@@ -219,6 +219,17 @@ const char *av_get_channel_name(uint64_t channel)
return NULL;
}
const char *av_get_channel_description(uint64_t channel)
{
int i;
if (av_get_channel_layout_nb_channels(channel) != 1)
return NULL;
for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++)
if ((1ULL<<i) & channel)
return channel_names[i].description;
return NULL;
}
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
{
int i;
......
......@@ -180,6 +180,14 @@ uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
*/
const char *av_get_channel_name(uint64_t channel);
/**
* Get the description of a given channel.
*
* @param channel a channel layout with a single channel
* @return channel description on success, NULL on error
*/
const char *av_get_channel_description(uint64_t channel);
/**
* @}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment