mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 16:50:01 +00:00
audioconvert: add a function for getting the name of a single channel.
This commit is contained in:
parent
406b257de9
commit
5df320e167
@ -202,3 +202,14 @@ int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
|||||||
channel_layout &= channel - 1;
|
channel_layout &= channel - 1;
|
||||||
return av_get_channel_layout_nb_channels(channel_layout);
|
return av_get_channel_layout_nb_channels(channel_layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *av_get_channel_name(uint64_t channel)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
if (av_get_channel_layout_nb_channels(channel) != 1)
|
||||||
|
return NULL;
|
||||||
|
for (i = 0; i < 64; i++)
|
||||||
|
if ((1ULL<<i) & channel)
|
||||||
|
return get_channel_name(i);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -155,6 +155,13 @@ uint64_t av_get_default_channel_layout(int nb_channels);
|
|||||||
int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
||||||
uint64_t channel);
|
uint64_t channel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of a given channel.
|
||||||
|
*
|
||||||
|
* @return channel name on success, NULL on error.
|
||||||
|
*/
|
||||||
|
const char *av_get_channel_name(uint64_t channel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user