Browse Source

audioconvert: add av_get_channel_description().

tags/n1.0
Nicolas George 13 years ago
parent
commit
33449b1776
2 changed files with 19 additions and 0 deletions
  1. +11
    -0
      libavutil/audioconvert.c
  2. +8
    -0
      libavutil/audioconvert.h

+ 11
- 0
libavutil/audioconvert.c View File

@@ -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;


+ 8
- 0
libavutil/audioconvert.h View File

@@ -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