mirror of https://git.videolan.org/git/ffmpeg.git
audioconvert: include the description of channels in the library.
This commit is contained in:
parent
8a6d673eff
commit
cc55470472
|
@ -28,38 +28,43 @@
|
||||||
#include "audioconvert.h"
|
#include "audioconvert.h"
|
||||||
#include "bprint.h"
|
#include "bprint.h"
|
||||||
|
|
||||||
static const char * const channel_names[] = {
|
struct channel_name {
|
||||||
[0] = "FL", /* front left */
|
const char *name;
|
||||||
[1] = "FR", /* front right */
|
const char *description;
|
||||||
[2] = "FC", /* front center */
|
};
|
||||||
[3] = "LFE", /* low frequency */
|
|
||||||
[4] = "BL", /* back left */
|
static const struct channel_name channel_names[] = {
|
||||||
[5] = "BR", /* back right */
|
[0] = { "FL", "front left" },
|
||||||
[6] = "FLC", /* front left-of-center */
|
[1] = { "FR", "front right" },
|
||||||
[7] = "FRC", /* front right-of-center */
|
[2] = { "FC", "front center" },
|
||||||
[8] = "BC", /* back-center */
|
[3] = { "LFE", "low frequency" },
|
||||||
[9] = "SL", /* side left */
|
[4] = { "BL", "back left" },
|
||||||
[10] = "SR", /* side right */
|
[5] = { "BR", "back right" },
|
||||||
[11] = "TC", /* top center */
|
[6] = { "FLC", "front left-of-center" },
|
||||||
[12] = "TFL", /* top front left */
|
[7] = { "FRC", "front right-of-center" },
|
||||||
[13] = "TFC", /* top front center */
|
[8] = { "BC", "back center" },
|
||||||
[14] = "TFR", /* top front right */
|
[9] = { "SL", "side left" },
|
||||||
[15] = "TBL", /* top back left */
|
[10] = { "SR", "side right" },
|
||||||
[16] = "TBC", /* top back center */
|
[11] = { "TC", "top center" },
|
||||||
[17] = "TBR", /* top back right */
|
[12] = { "TFL", "top front left" },
|
||||||
[29] = "DL", /* downmix left */
|
[13] = { "TFC", "top front center" },
|
||||||
[30] = "DR", /* downmix right */
|
[14] = { "TFR", "top front right" },
|
||||||
[31] = "WL", /* wide left */
|
[15] = { "TBL", "top back left" },
|
||||||
[32] = "WR", /* wide right */
|
[16] = { "TBC", "top back center" },
|
||||||
[33] = "SDL", /* surround direct left */
|
[17] = { "TBR", "top back right" },
|
||||||
[34] = "SDR", /* surround direct right */
|
[29] = { "DL", "downmix left" },
|
||||||
|
[30] = { "DR", "downmix right" },
|
||||||
|
[31] = { "WL", "wide left" },
|
||||||
|
[32] = { "WR", "wide right" },
|
||||||
|
[33] = { "SDL", "surround direct left" },
|
||||||
|
[34] = { "SDR", "surround direct right" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *get_channel_name(int channel_id)
|
static const char *get_channel_name(int channel_id)
|
||||||
{
|
{
|
||||||
if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names))
|
if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names))
|
||||||
return NULL;
|
return NULL;
|
||||||
return channel_names[channel_id];
|
return channel_names[channel_id].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
|
@ -107,9 +112,9 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
|
||||||
return channel_layout_map[i].layout;
|
return channel_layout_map[i].layout;
|
||||||
}
|
}
|
||||||
for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++)
|
for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++)
|
||||||
if (channel_names[i] &&
|
if (channel_names[i].name &&
|
||||||
strlen(channel_names[i]) == name_len &&
|
strlen(channel_names[i].name) == name_len &&
|
||||||
!memcmp(channel_names[i], name, name_len))
|
!memcmp(channel_names[i].name, name, name_len))
|
||||||
return (int64_t)1 << i;
|
return (int64_t)1 << i;
|
||||||
i = strtol(name, &end, 10);
|
i = strtol(name, &end, 10);
|
||||||
if (end - name == name_len ||
|
if (end - name == name_len ||
|
||||||
|
|
Loading…
Reference in New Issue