audioconvert: add av_get_channel_description().

pull/28/head
Nicolas George 13 years ago
parent cc55470472
commit 33449b1776
  1. 11
      libavutil/audioconvert.c
  2. 8
      libavutil/audioconvert.h

@ -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);
/**
* @}
*/

Loading…
Cancel
Save