From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 001/281] Add a new channel layout API Date: Wed, 12 Jan 2022 22:49:23 -0300 Message-ID: <20220113015101.4-2-jamrial@gmail.com> (raw) In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> From: Anton Khirnov <anton@khirnov.net> The new API is more extensible and allows for custom layouts. More accurate information is exported, eg for decoders that do not set a channel layout, lavc will not make one up for them. Deprecate the old API working with just uint64_t bitmasks. Expanded and completed by Vittorio Giovara <vittorio.giovara@gmail.com> and James Almer <jamrial@gmail.com>. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com> --- libavutil/channel_layout.c | 629 ++++++++++++++++++++++++++++++++----- libavutil/channel_layout.h | 542 ++++++++++++++++++++++++++++++-- libavutil/version.h | 1 + 3 files changed, 1069 insertions(+), 103 deletions(-) diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index ac773a9e63..68b40cc37c 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -37,81 +37,151 @@ struct channel_name { }; static const struct channel_name channel_names[] = { - [0] = { "FL", "front left" }, - [1] = { "FR", "front right" }, - [2] = { "FC", "front center" }, - [3] = { "LFE", "low frequency" }, - [4] = { "BL", "back left" }, - [5] = { "BR", "back right" }, - [6] = { "FLC", "front left-of-center" }, - [7] = { "FRC", "front right-of-center" }, - [8] = { "BC", "back center" }, - [9] = { "SL", "side left" }, - [10] = { "SR", "side right" }, - [11] = { "TC", "top center" }, - [12] = { "TFL", "top front left" }, - [13] = { "TFC", "top front center" }, - [14] = { "TFR", "top front right" }, - [15] = { "TBL", "top back left" }, - [16] = { "TBC", "top back center" }, - [17] = { "TBR", "top back 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" }, - [35] = { "LFE2", "low frequency 2" }, - [36] = { "TSL", "top side left" }, - [37] = { "TSR", "top side right" }, - [38] = { "BFC", "bottom front center" }, - [39] = { "BFL", "bottom front left" }, - [40] = { "BFR", "bottom front right" }, + [AV_CHAN_FRONT_LEFT ] = { "FL", "front left" }, + [AV_CHAN_FRONT_RIGHT ] = { "FR", "front right" }, + [AV_CHAN_FRONT_CENTER ] = { "FC", "front center" }, + [AV_CHAN_LOW_FREQUENCY ] = { "LFE", "low frequency" }, + [AV_CHAN_BACK_LEFT ] = { "BL", "back left" }, + [AV_CHAN_BACK_RIGHT ] = { "BR", "back right" }, + [AV_CHAN_FRONT_LEFT_OF_CENTER ] = { "FLC", "front left-of-center" }, + [AV_CHAN_FRONT_RIGHT_OF_CENTER] = { "FRC", "front right-of-center" }, + [AV_CHAN_BACK_CENTER ] = { "BC", "back center" }, + [AV_CHAN_SIDE_LEFT ] = { "SL", "side left" }, + [AV_CHAN_SIDE_RIGHT ] = { "SR", "side right" }, + [AV_CHAN_TOP_CENTER ] = { "TC", "top center" }, + [AV_CHAN_TOP_FRONT_LEFT ] = { "TFL", "top front left" }, + [AV_CHAN_TOP_FRONT_CENTER ] = { "TFC", "top front center" }, + [AV_CHAN_TOP_FRONT_RIGHT ] = { "TFR", "top front right" }, + [AV_CHAN_TOP_BACK_LEFT ] = { "TBL", "top back left" }, + [AV_CHAN_TOP_BACK_CENTER ] = { "TBC", "top back center" }, + [AV_CHAN_TOP_BACK_RIGHT ] = { "TBR", "top back right" }, + [AV_CHAN_STEREO_LEFT ] = { "DL", "downmix left" }, + [AV_CHAN_STEREO_RIGHT ] = { "DR", "downmix right" }, + [AV_CHAN_WIDE_LEFT ] = { "WL", "wide left" }, + [AV_CHAN_WIDE_RIGHT ] = { "WR", "wide right" }, + [AV_CHAN_SURROUND_DIRECT_LEFT ] = { "SDL", "surround direct left" }, + [AV_CHAN_SURROUND_DIRECT_RIGHT] = { "SDR", "surround direct right" }, + [AV_CHAN_LOW_FREQUENCY_2 ] = { "LFE2", "low frequency 2" }, + [AV_CHAN_TOP_SIDE_LEFT ] = { "TSL", "top side left" }, + [AV_CHAN_TOP_SIDE_RIGHT ] = { "TSR", "top side right" }, + [AV_CHAN_BOTTOM_FRONT_CENTER ] = { "BFC", "bottom front center" }, + [AV_CHAN_BOTTOM_FRONT_LEFT ] = { "BFL", "bottom front left" }, + [AV_CHAN_BOTTOM_FRONT_RIGHT ] = { "BFR", "bottom front right" }, }; -static const char *get_channel_name(int channel_id) +static const char *get_channel_name(enum AVChannel channel_id) { - if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names)) + if ((unsigned) channel_id >= FF_ARRAY_ELEMS(channel_names) || + !channel_names[channel_id].name) return NULL; return channel_names[channel_id].name; } -static const struct { +void av_channel_name_bprint(AVBPrint *bp, enum AVChannel channel_id) +{ + av_bprint_clear(bp); + + if ((unsigned)channel_id < FF_ARRAY_ELEMS(channel_names)) + av_bprintf(bp, "%s", channel_names[channel_id].name); + else + av_bprintf(bp, "USR%d", channel_id); +} + +int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel_id) +{ + AVBPrint bp; + + if (!buf && buf_size) + return AVERROR(EINVAL); + + av_bprint_init_for_buffer(&bp, buf, buf_size); + av_channel_name_bprint(&bp, channel_id); + + return bp.len; +} + +void av_channel_description_bprint(AVBPrint *bp, enum AVChannel channel_id) +{ + av_bprint_clear(bp); + + if ((unsigned)channel_id < FF_ARRAY_ELEMS(channel_names)) + av_bprintf(bp, "%s", channel_names[channel_id].description); + else + av_bprintf(bp, "user %d", channel_id); +} + +int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel_id) +{ + AVBPrint bp; + + if (!buf && buf_size) + return AVERROR(EINVAL); + + av_bprint_init_for_buffer(&bp, buf, buf_size); + av_channel_description_bprint(&bp, channel_id); + + return bp.len; +} + +enum AVChannel av_channel_from_string(const char *str) +{ + int i; + char *endptr = (char *)str; + enum AVChannel id = AV_CHAN_NONE; + for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++) { + if (channel_names[i].name && !strcmp(str, channel_names[i].name)) + return i; + } + if (!strncmp(str, "USR", 3)) { + const char *p = str + 3; + id = strtol(p, &endptr, 0); + } + if (id >= 0 && !*endptr) + return id; + + return AV_CHAN_NONE; +} + +struct channel_layout_name { const char *name; - int nb_channels; - uint64_t layout; -} channel_layout_map[] = { - { "mono", 1, AV_CH_LAYOUT_MONO }, - { "stereo", 2, AV_CH_LAYOUT_STEREO }, - { "2.1", 3, AV_CH_LAYOUT_2POINT1 }, - { "3.0", 3, AV_CH_LAYOUT_SURROUND }, - { "3.0(back)", 3, AV_CH_LAYOUT_2_1 }, - { "4.0", 4, AV_CH_LAYOUT_4POINT0 }, - { "quad", 4, AV_CH_LAYOUT_QUAD }, - { "quad(side)", 4, AV_CH_LAYOUT_2_2 }, - { "3.1", 4, AV_CH_LAYOUT_3POINT1 }, - { "5.0", 5, AV_CH_LAYOUT_5POINT0_BACK }, - { "5.0(side)", 5, AV_CH_LAYOUT_5POINT0 }, - { "4.1", 5, AV_CH_LAYOUT_4POINT1 }, - { "5.1", 6, AV_CH_LAYOUT_5POINT1_BACK }, - { "5.1(side)", 6, AV_CH_LAYOUT_5POINT1 }, - { "6.0", 6, AV_CH_LAYOUT_6POINT0 }, - { "6.0(front)", 6, AV_CH_LAYOUT_6POINT0_FRONT }, - { "hexagonal", 6, AV_CH_LAYOUT_HEXAGONAL }, - { "6.1", 7, AV_CH_LAYOUT_6POINT1 }, - { "6.1(back)", 7, AV_CH_LAYOUT_6POINT1_BACK }, - { "6.1(front)", 7, AV_CH_LAYOUT_6POINT1_FRONT }, - { "7.0", 7, AV_CH_LAYOUT_7POINT0 }, - { "7.0(front)", 7, AV_CH_LAYOUT_7POINT0_FRONT }, - { "7.1", 8, AV_CH_LAYOUT_7POINT1 }, - { "7.1(wide)", 8, AV_CH_LAYOUT_7POINT1_WIDE_BACK }, - { "7.1(wide-side)", 8, AV_CH_LAYOUT_7POINT1_WIDE }, - { "octagonal", 8, AV_CH_LAYOUT_OCTAGONAL }, - { "hexadecagonal", 16, AV_CH_LAYOUT_HEXADECAGONAL }, - { "downmix", 2, AV_CH_LAYOUT_STEREO_DOWNMIX, }, - { "22.2", 24, AV_CH_LAYOUT_22POINT2, }, + AVChannelLayout layout; +}; + +static const struct channel_layout_name channel_layout_map[] = { + { "mono", AV_CHANNEL_LAYOUT_MONO }, + { "stereo", AV_CHANNEL_LAYOUT_STEREO }, + { "stereo", AV_CHANNEL_LAYOUT_STEREO_DOWNMIX }, + { "2.1", AV_CHANNEL_LAYOUT_2POINT1 }, + { "3.0", AV_CHANNEL_LAYOUT_SURROUND }, + { "3.0(back)", AV_CHANNEL_LAYOUT_2_1 }, + { "4.0", AV_CHANNEL_LAYOUT_4POINT0 }, + { "quad", AV_CHANNEL_LAYOUT_QUAD }, + { "quad(side)", AV_CHANNEL_LAYOUT_2_2 }, + { "3.1", AV_CHANNEL_LAYOUT_3POINT1 }, + { "5.0", AV_CHANNEL_LAYOUT_5POINT0_BACK }, + { "5.0(side)", AV_CHANNEL_LAYOUT_5POINT0 }, + { "4.1", AV_CHANNEL_LAYOUT_4POINT1 }, + { "5.1", AV_CHANNEL_LAYOUT_5POINT1_BACK }, + { "5.1(side)", AV_CHANNEL_LAYOUT_5POINT1 }, + { "6.0", AV_CHANNEL_LAYOUT_6POINT0 }, + { "6.0(front)", AV_CHANNEL_LAYOUT_6POINT0_FRONT }, + { "hexagonal", AV_CHANNEL_LAYOUT_HEXAGONAL }, + { "6.1", AV_CHANNEL_LAYOUT_6POINT1 }, + { "6.1(back)", AV_CHANNEL_LAYOUT_6POINT1_BACK }, + { "6.1(front)", AV_CHANNEL_LAYOUT_6POINT1_FRONT }, + { "7.0", AV_CHANNEL_LAYOUT_7POINT0 }, + { "7.0(front)", AV_CHANNEL_LAYOUT_7POINT0_FRONT }, + { "7.1", AV_CHANNEL_LAYOUT_7POINT1 }, + { "7.1(wide)", AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK }, + { "7.1(wide-side)", AV_CHANNEL_LAYOUT_7POINT1_WIDE }, + { "octagonal", AV_CHANNEL_LAYOUT_OCTAGONAL }, + { "hexadecagonal", AV_CHANNEL_LAYOUT_HEXADECAGONAL }, + { "downmix", AV_CHANNEL_LAYOUT_STEREO_DOWNMIX, }, + { "22.2", AV_CHANNEL_LAYOUT_22POINT2, }, }; +#if FF_API_OLD_CHANNEL_LAYOUT +FF_DISABLE_DEPRECATION_WARNINGS static uint64_t get_channel_layout_single(const char *name, int name_len) { int i; @@ -121,7 +191,7 @@ static uint64_t get_channel_layout_single(const char *name, int name_len) for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) { if (strlen(channel_layout_map[i].name) == name_len && !memcmp(channel_layout_map[i].name, name, name_len)) - return channel_layout_map[i].layout; + return channel_layout_map[i].layout.u.mask; } for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++) if (channel_names[i].name && @@ -189,8 +259,8 @@ void av_bprint_channel_layout(struct AVBPrint *bp, nb_channels = av_get_channel_layout_nb_channels(channel_layout); for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) - if (nb_channels == channel_layout_map[i].nb_channels && - channel_layout == channel_layout_map[i].layout) { + if (nb_channels == channel_layout_map[i].layout.nb_channels && + channel_layout == channel_layout_map[i].layout.u.mask) { av_bprintf(bp, "%s", channel_layout_map[i].name); return; } @@ -231,8 +301,8 @@ int av_get_channel_layout_nb_channels(uint64_t channel_layout) int64_t av_get_default_channel_layout(int nb_channels) { int i; for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) - if (nb_channels == channel_layout_map[i].nb_channels) - return channel_layout_map[i].layout; + if (nb_channels == channel_layout_map[i].layout.nb_channels) + return channel_layout_map[i].layout.u.mask; return 0; } @@ -287,7 +357,424 @@ int av_get_standard_channel_layout(unsigned index, uint64_t *layout, { if (index >= FF_ARRAY_ELEMS(channel_layout_map)) return AVERROR_EOF; - if (layout) *layout = channel_layout_map[index].layout; + if (layout) *layout = channel_layout_map[index].layout.u.mask; if (name) *name = channel_layout_map[index].name; return 0; } +FF_ENABLE_DEPRECATION_WARNINGS +#endif + +int av_channel_layout_from_mask(AVChannelLayout *channel_layout, + uint64_t mask) +{ + if (!mask) + return AVERROR(EINVAL); + + channel_layout->order = AV_CHANNEL_ORDER_NATIVE; + channel_layout->nb_channels = av_popcount64(mask); + channel_layout->u.mask = mask; + + return 0; +} + +int av_channel_layout_from_string(AVChannelLayout *channel_layout, + const char *str) +{ + int i; + int channels = 0, native = 1; + enum AVChannel highest_channel = AV_CHAN_NONE; + const char *dup = str; + char *end; + uint64_t mask = 0; + + /* channel layout names */ + for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) { + if (channel_layout_map[i].name && !strcmp(str, channel_layout_map[i].name)) { + *channel_layout = channel_layout_map[i].layout; + return 0; + } + } + + /* channel names */ + while (*dup) { + char *chname = av_get_token(&dup, "+"); + if (!chname) + return AVERROR(ENOMEM); + if (*dup) + dup++; // skip separator + for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++) { + if (channel_names[i].name && !strcmp(chname, channel_names[i].name)) { + if (i < highest_channel) + native = 0; // Not a native layout, use a custom one + highest_channel = i; + mask |= 1ULL << i; + break; + } + } + + if (i >= FF_ARRAY_ELEMS(channel_names)) { + char *endptr = chname; + enum AVChannel id = AV_CHAN_NONE; + + if (!strncmp(chname, "USR", 3)) { + const char *p = chname + 3; + id = strtol(p, &endptr, 0); + } + if (id < 0 || *endptr) { + native = 0; // Unknown channel name + channels = 0; + mask = 0; + av_free(chname); + break; + } + if (id > 63) + native = 0; // Not a native layout, use a custom one + else { + if (id < highest_channel) + native = 0; // Not a native layout, use a custom one + highest_channel = id; + mask |= 1ULL << id; + } + } + channels++; + av_free(chname); + } + if (mask && native) { + av_channel_layout_from_mask(channel_layout, mask); + return 0; + } + + /* custom layout of channel names */ + if (channels && !native) { + int idx = 0; + + channel_layout->u.map = av_calloc(channels, sizeof(*channel_layout->u.map)); + if (!channel_layout->u.map) + return AVERROR(ENOMEM); + + channel_layout->order = AV_CHANNEL_ORDER_CUSTOM; + channel_layout->nb_channels = channels; + + dup = str; + while (*dup) { + char *chname = av_get_token(&dup, "+"); + if (!chname) { + av_freep(&channel_layout->u.map); + return AVERROR(ENOMEM); + } + if (*dup) + dup++; // skip separator + for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++) { + if (channel_names[i].name && !strcmp(chname, channel_names[i].name)) { + channel_layout->u.map[idx++].id = i; + break; + } + } + if (i >= FF_ARRAY_ELEMS(channel_names)) { + const char *p = chname + 3; + channel_layout->u.map[idx++].id = strtol(p, NULL, 0); + } + av_free(chname); + } + + return 0; + } + + /* channel layout mask */ + if (!strncmp(str, "0x", 2) && sscanf(str + 2, "%"SCNx64, &mask) == 1) { + av_channel_layout_from_mask(channel_layout, mask); + return 0; + } + + errno = 0; + channels = strtol(str, &end, 10); + + /* number of channels */ + if (!errno && *end == 'c' && !*(end + 1) && channels >= 0) { + av_channel_layout_default(channel_layout, channels); + return 0; + } + + /* number of unordered channels */ + if (!errno && (!*end || (*end == 'C' && !*(end + 1)) || av_strnstr(str, "channels", strlen(str))) + && channels >= 0) { + channel_layout->order = AV_CHANNEL_ORDER_UNSPEC; + channel_layout->nb_channels = channels; + return 0; + } + + return AVERROR_INVALIDDATA; +} + +void av_channel_layout_uninit(AVChannelLayout *channel_layout) +{ + if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) + av_freep(&channel_layout->u.map); + memset(channel_layout, 0, sizeof(*channel_layout)); +} + +int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src) +{ + av_channel_layout_uninit(dst); + *dst = *src; + if (src->order == AV_CHANNEL_ORDER_CUSTOM) { + dst->u.map = av_malloc_array(src->nb_channels, sizeof(*dst->u.map)); + if (!dst->u.map) + return AVERROR(ENOMEM); + memcpy(dst->u.map, src->u.map, src->nb_channels * sizeof(*src->u.map)); + } + return 0; +} + +int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, + AVBPrint *bp) +{ + int i; + + av_bprint_clear(bp); + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_NATIVE: + for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) + if (channel_layout->u.mask == channel_layout_map[i].layout.u.mask) { + av_bprintf(bp, "%s", channel_layout_map[i].name); + return 0; + } + // fall-through + case AV_CHANNEL_ORDER_CUSTOM: + for (i = 0; i < channel_layout->nb_channels; i++) { + const char *ch_name = NULL; + enum AVChannel ch = AV_CHAN_NONE; + + if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM && + channel_layout->u.map[i].name[0]) + ch_name = channel_layout->u.map[i].name; + if (channel_layout->order == AV_CHANNEL_ORDER_NATIVE || !ch_name) { + ch = av_channel_layout_channel_from_index(channel_layout, i); + ch_name = get_channel_name(ch); + } + + if (i) + av_bprintf(bp, "+"); + if (ch_name) + av_bprintf(bp, "%s", ch_name); + else + av_bprintf(bp, "USR%d", ch); + } + if (channel_layout->nb_channels) + return 0; + // fall-through + case AV_CHANNEL_ORDER_UNSPEC: + av_bprintf(bp, "%d channels", channel_layout->nb_channels); + return 0; + default: + return AVERROR(EINVAL); + } +} + +int av_channel_layout_describe(const AVChannelLayout *channel_layout, + char *buf, size_t buf_size) +{ + AVBPrint bp; + int ret; + + if (!buf && buf_size) + return AVERROR(EINVAL); + + av_bprint_init_for_buffer(&bp, buf, buf_size); + ret = av_channel_layout_describe_bprint(channel_layout, &bp); + if (ret < 0) + return ret; + + return bp.len; +} + +enum AVChannel +av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, + unsigned int idx) +{ + int i; + + if (idx >= channel_layout->nb_channels) + return AV_CHAN_NONE; + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_CUSTOM: + return channel_layout->u.map[idx].id; + case AV_CHANNEL_ORDER_NATIVE: + for (i = 0; i < 64; i++) { + if ((1ULL << i) & channel_layout->u.mask && !idx--) + return i; + } + default: + return AV_CHAN_NONE; + } +} + +enum AVChannel +av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout, + const char *name) +{ + int channel, ret; + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_CUSTOM: + for (int i = 0; i < channel_layout->nb_channels; i++) { + if (channel_layout->u.map[i].name[0] && !strcmp(name, channel_layout->u.map[i].name)) + return channel_layout->u.map[i].id; + } + // fall-through + case AV_CHANNEL_ORDER_NATIVE: + channel = av_channel_from_string(name); + if (channel == AV_CHAN_NONE) + return channel; + ret = av_channel_layout_index_from_channel(channel_layout, channel); + if (ret < 0) + return AV_CHAN_NONE; + return channel; + } + + return AV_CHAN_NONE; +} + +int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout, + enum AVChannel channel) +{ + int i; + + if (channel == AV_CHAN_NONE) + return AVERROR(EINVAL); + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_CUSTOM: + for (i = 0; i < channel_layout->nb_channels; i++) + if (channel_layout->u.map[i].id == channel) + return i; + return AVERROR(EINVAL); + case AV_CHANNEL_ORDER_NATIVE: { + uint64_t mask = channel_layout->u.mask; + if (!(mask & (1ULL << channel))) + return AVERROR(EINVAL); + mask &= (1ULL << channel) - 1; + return av_popcount64(mask); + } + default: + return AVERROR(EINVAL); + } +} + +int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout, + const char *name) +{ + enum AVChannel ch; + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_CUSTOM: + for (int i = 0; i < channel_layout->nb_channels; i++) { + if (channel_layout->u.map[i].name[0] && !strcmp(name, channel_layout->u.map[i].name)) + return i; + } + // fall-through + case AV_CHANNEL_ORDER_NATIVE: + ch = av_channel_from_string(name); + if (ch == AV_CHAN_NONE) + return AVERROR(EINVAL); + return av_channel_layout_index_from_channel(channel_layout, ch); + } + + return AVERROR(EINVAL); +} + +int av_channel_layout_check(const AVChannelLayout *channel_layout) +{ + if (channel_layout->nb_channels <= 0) + return 0; + + switch (channel_layout->order) { + case AV_CHANNEL_ORDER_NATIVE: + return av_popcount64(channel_layout->u.mask) == channel_layout->nb_channels; + case AV_CHANNEL_ORDER_CUSTOM: + if (!channel_layout->u.map) + return 0; + for (int i = 0; i < channel_layout->nb_channels; i++) { + if (channel_layout->u.map[i].id == AV_CHAN_NONE) + return 0; + } + return 1; + case AV_CHANNEL_ORDER_UNSPEC: + return 1; + default: + return 0; + } +} + +int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1) +{ + int i; + + /* different channel counts -> not equal */ + if (chl->nb_channels != chl1->nb_channels) + return 1; + + /* if only one is unspecified -> not equal */ + if ((chl->order == AV_CHANNEL_ORDER_UNSPEC) != + (chl1->order == AV_CHANNEL_ORDER_UNSPEC)) + return 1; + /* both are unspecified -> equal */ + else if (chl->order == AV_CHANNEL_ORDER_UNSPEC) + return 0; + + /* can compare masks directly */ + if (chl->order != AV_CHANNEL_ORDER_CUSTOM && + chl->order == chl1->order) + return chl->u.mask != chl1->u.mask; + + /* compare channel by channel */ + for (i = 0; i < chl->nb_channels; i++) + if (av_channel_layout_channel_from_index(chl, i) != + av_channel_layout_channel_from_index(chl1, i)) + return 1; + return 0; +} + +void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels) +{ + int i; + for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) + if (nb_channels == channel_layout_map[i].layout.nb_channels) { + *ch_layout = channel_layout_map[i].layout; + return; + } + + ch_layout->order = AV_CHANNEL_ORDER_UNSPEC; + ch_layout->nb_channels = nb_channels; +} + +const AVChannelLayout *av_channel_layout_standard(void **opaque) +{ + uintptr_t i = (uintptr_t)*opaque; + const AVChannelLayout *ch_layout = NULL; + + if (i < FF_ARRAY_ELEMS(channel_layout_map)) { + ch_layout = &channel_layout_map[i].layout; + *opaque = (void*)(i + 1); + } + + return ch_layout; +} + +uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout, + uint64_t mask) +{ + uint64_t ret = 0; + int i; + + if (channel_layout->order == AV_CHANNEL_ORDER_NATIVE) + return channel_layout->u.mask & mask; + + for (i = 0; i < 64; i++) + if (mask & (1ULL << i) && av_channel_layout_index_from_channel(channel_layout, i) >= 0) + ret |= (1ULL << i); + + return ret; +} diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h index d39ae1177a..6356a9a38a 100644 --- a/libavutil/channel_layout.h +++ b/libavutil/channel_layout.h @@ -23,6 +23,10 @@ #define AVUTIL_CHANNEL_LAYOUT_H #include <stdint.h> +#include <stdlib.h> + +#include "version.h" +#include "attributes.h" /** * @file @@ -34,6 +38,71 @@ * @{ */ +enum AVChannel { + ///< Invalid channel index + AV_CHAN_NONE = -1, + AV_CHAN_FRONT_LEFT, + AV_CHAN_FRONT_RIGHT, + AV_CHAN_FRONT_CENTER, + AV_CHAN_LOW_FREQUENCY, + AV_CHAN_BACK_LEFT, + AV_CHAN_BACK_RIGHT, + AV_CHAN_FRONT_LEFT_OF_CENTER, + AV_CHAN_FRONT_RIGHT_OF_CENTER, + AV_CHAN_BACK_CENTER, + AV_CHAN_SIDE_LEFT, + AV_CHAN_SIDE_RIGHT, + AV_CHAN_TOP_CENTER, + AV_CHAN_TOP_FRONT_LEFT, + AV_CHAN_TOP_FRONT_CENTER, + AV_CHAN_TOP_FRONT_RIGHT, + AV_CHAN_TOP_BACK_LEFT, + AV_CHAN_TOP_BACK_CENTER, + AV_CHAN_TOP_BACK_RIGHT, + /** Stereo downmix. */ + AV_CHAN_STEREO_LEFT = 29, + /** See above. */ + AV_CHAN_STEREO_RIGHT, + AV_CHAN_WIDE_LEFT, + AV_CHAN_WIDE_RIGHT, + AV_CHAN_SURROUND_DIRECT_LEFT, + AV_CHAN_SURROUND_DIRECT_RIGHT, + AV_CHAN_LOW_FREQUENCY_2, + AV_CHAN_TOP_SIDE_LEFT, + AV_CHAN_TOP_SIDE_RIGHT, + AV_CHAN_BOTTOM_FRONT_CENTER, + AV_CHAN_BOTTOM_FRONT_LEFT, + AV_CHAN_BOTTOM_FRONT_RIGHT, + + /** Channel is empty can be safely skipped. */ + AV_CHAN_UNUSED = 64, + + /** Channel contains data, but its position is unknown. */ + AV_CHAN_UNKWNOWN = 128, +}; + +enum AVChannelOrder { + /** + * Only the channel count is specified, without any further information + * about the channel order. + */ + AV_CHANNEL_ORDER_UNSPEC, + /** + * The native channel order, i.e. the channels are in the same order in + * which they are defined in the AVChannel enum. This supports up to 63 + * different channels. + */ + AV_CHANNEL_ORDER_NATIVE, + /** + * The channel order does not correspond to any other predefined order and + * is stored as an explicit map. For example, this could be used to support + * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE) + * channels at arbitrary positions. + */ + AV_CHANNEL_ORDER_CUSTOM, +}; + + /** * @defgroup channel_masks Audio channel masks * @@ -46,41 +115,46 @@ * * @{ */ -#define AV_CH_FRONT_LEFT 0x00000001 -#define AV_CH_FRONT_RIGHT 0x00000002 -#define AV_CH_FRONT_CENTER 0x00000004 -#define AV_CH_LOW_FREQUENCY 0x00000008 -#define AV_CH_BACK_LEFT 0x00000010 -#define AV_CH_BACK_RIGHT 0x00000020 -#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 -#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 -#define AV_CH_BACK_CENTER 0x00000100 -#define AV_CH_SIDE_LEFT 0x00000200 -#define AV_CH_SIDE_RIGHT 0x00000400 -#define AV_CH_TOP_CENTER 0x00000800 -#define AV_CH_TOP_FRONT_LEFT 0x00001000 -#define AV_CH_TOP_FRONT_CENTER 0x00002000 -#define AV_CH_TOP_FRONT_RIGHT 0x00004000 -#define AV_CH_TOP_BACK_LEFT 0x00008000 -#define AV_CH_TOP_BACK_CENTER 0x00010000 -#define AV_CH_TOP_BACK_RIGHT 0x00020000 -#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. -#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. -#define AV_CH_WIDE_LEFT 0x0000000080000000ULL -#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL -#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL -#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL -#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL -#define AV_CH_TOP_SIDE_LEFT 0x0000001000000000ULL -#define AV_CH_TOP_SIDE_RIGHT 0x0000002000000000ULL -#define AV_CH_BOTTOM_FRONT_CENTER 0x0000004000000000ULL -#define AV_CH_BOTTOM_FRONT_LEFT 0x0000008000000000ULL -#define AV_CH_BOTTOM_FRONT_RIGHT 0x0000010000000000ULL +#define AV_CH_FRONT_LEFT (1ULL << AV_CHAN_FRONT_LEFT ) +#define AV_CH_FRONT_RIGHT (1ULL << AV_CHAN_FRONT_RIGHT ) +#define AV_CH_FRONT_CENTER (1ULL << AV_CHAN_FRONT_CENTER ) +#define AV_CH_LOW_FREQUENCY (1ULL << AV_CHAN_LOW_FREQUENCY ) +#define AV_CH_BACK_LEFT (1ULL << AV_CHAN_BACK_LEFT ) +#define AV_CH_BACK_RIGHT (1ULL << AV_CHAN_BACK_RIGHT ) +#define AV_CH_FRONT_LEFT_OF_CENTER (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER ) +#define AV_CH_FRONT_RIGHT_OF_CENTER (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER) +#define AV_CH_BACK_CENTER (1ULL << AV_CHAN_BACK_CENTER ) +#define AV_CH_SIDE_LEFT (1ULL << AV_CHAN_SIDE_LEFT ) +#define AV_CH_SIDE_RIGHT (1ULL << AV_CHAN_SIDE_RIGHT ) +#define AV_CH_TOP_CENTER (1ULL << AV_CHAN_TOP_CENTER ) +#define AV_CH_TOP_FRONT_LEFT (1ULL << AV_CHAN_TOP_FRONT_LEFT ) +#define AV_CH_TOP_FRONT_CENTER (1ULL << AV_CHAN_TOP_FRONT_CENTER ) +#define AV_CH_TOP_FRONT_RIGHT (1ULL << AV_CHAN_TOP_FRONT_RIGHT ) +#define AV_CH_TOP_BACK_LEFT (1ULL << AV_CHAN_TOP_BACK_LEFT ) +#define AV_CH_TOP_BACK_CENTER (1ULL << AV_CHAN_TOP_BACK_CENTER ) +#define AV_CH_TOP_BACK_RIGHT (1ULL << AV_CHAN_TOP_BACK_RIGHT ) +#define AV_CH_STEREO_LEFT (1ULL << AV_CHAN_STEREO_LEFT ) +#define AV_CH_STEREO_RIGHT (1ULL << AV_CHAN_STEREO_RIGHT ) +#define AV_CH_WIDE_LEFT (1ULL << AV_CHAN_WIDE_LEFT ) +#define AV_CH_WIDE_RIGHT (1ULL << AV_CHAN_WIDE_RIGHT ) +#define AV_CH_SURROUND_DIRECT_LEFT (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT ) +#define AV_CH_SURROUND_DIRECT_RIGHT (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT) +#define AV_CH_LOW_FREQUENCY_2 (1ULL << AV_CHAN_LOW_FREQUENCY_2 ) +#define AV_CH_TOP_SIDE_LEFT (1ULL << AV_CHAN_TOP_SIDE_LEFT ) +#define AV_CH_TOP_SIDE_RIGHT (1ULL << AV_CHAN_TOP_SIDE_RIGHT ) +#define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER ) +#define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT ) +#define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT ) +#if FF_API_OLD_CHANNEL_LAYOUT /** Channel mask value used for AVCodecContext.request_channel_layout to indicate that the user requests the channel order of the decoder output - to be the native codec channel order. */ + to be the native codec channel order. + @deprecated channel order is now indicated in a special field in + AVChannelLayout + */ #define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL +#endif /** * @} @@ -128,6 +202,167 @@ enum AVMatrixEncoding { AV_MATRIX_ENCODING_NB }; +/** + * @} + */ + +/** + * An AVChannelCustom defines a single channel within a custom order layout + * + * Unlike most structures in FFmpeg, sizeof(AVChannelCustom) is a part of the + * public ABI. + * + * No new fields may be added to it without a major version bump. + */ +typedef struct AVChannelCustom { + enum AVChannel id; + char name[16]; + void *opaque; +} AVChannelCustom; + +/** + * An AVChannelLayout holds information about the channel layout of audio data. + * + * A channel layout here is defined as a set of channels ordered in a specific + * way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an + * AVChannelLayout carries only the channel count). + * + * Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the + * public ABI and may be used by the caller. E.g. it may be allocated on stack + * or embedded in caller-defined structs. + * + * AVChannelLayout can be initialized as follows: + * - default initialization with {0}, followed by by setting all used fields + * correctly; + * - by assigning one of the predefined AV_CHANNEL_LAYOUT_* initializers; + * - with a constructor function, such as av_channel_layout_default(), + * av_channel_layout_from_mask() or av_channel_layout_from_string(). + * + * The channel layout must be unitialized with av_channel_layout_uninit() + * + * Copying an AVChannelLayout via assigning is forbidden, + * av_channel_layout_copy() must be used. instead (and its return value should + * be checked) + * + * No new fields may be added to it without a major version bump, except for + * new elements of the union fitting in sizeof(uint64_t). + */ +typedef struct AVChannelLayout { + /** + * Channel order used in this layout. + * This is a mandatory field. + */ + enum AVChannelOrder order; + + /** + * Number of channels in this layout. Mandatory field. + */ + int nb_channels; + + /** + * Details about which channels are present in this layout. + * For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be + * used. + */ + union { + /** + * This member must be used for AV_CHANNEL_ORDER_NATIVE. + * It is a bitmask, where the position of each set bit means that the + * AVChannel with the corresponding value is present. + * + * I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO + * is present in the layout. Otherwise it is not present. + * + * @note when a channel layout using a bitmask is constructed or + * modified manually (i.e. not using any of the av_channel_layout_* + * functions), the code doing it must ensure that the number of set bits + * is equal to nb_channels. + */ + uint64_t mask; + /** + * This member must be used when the channel order is + * AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each + * element signalling the presence of the AVChannel with the + * corresponding value in map[i].id. + * + * I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the + * i-th channel in the audio data. + * + * map[i].name may be filled with a 0-terminated string, in which case + * it will be used for the purpose of identifying the channel with the + * convenience functions below. Otherise it must be zeroed. + */ + AVChannelCustom *map; + } u; + + /** + * For some private data of the user. + */ + void *opaque; +} AVChannelLayout; + +#define AV_CHANNEL_LAYOUT_MONO \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 1, .u = { .mask = AV_CH_LAYOUT_MONO }} +#define AV_CHANNEL_LAYOUT_STEREO \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 2, .u = { .mask = AV_CH_LAYOUT_STEREO }} +#define AV_CHANNEL_LAYOUT_2POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 3, .u = { .mask = AV_CH_LAYOUT_2POINT1 }} +#define AV_CHANNEL_LAYOUT_2_1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 3, .u = { .mask = AV_CH_LAYOUT_2_1 }} +#define AV_CHANNEL_LAYOUT_SURROUND \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 3, .u = { .mask = AV_CH_LAYOUT_SURROUND }} +#define AV_CHANNEL_LAYOUT_3POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 4, .u = { .mask = AV_CH_LAYOUT_3POINT1 }} +#define AV_CHANNEL_LAYOUT_4POINT0 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 4, .u = { .mask = AV_CH_LAYOUT_4POINT0 }} +#define AV_CHANNEL_LAYOUT_4POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 5, .u = { .mask = AV_CH_LAYOUT_4POINT1 }} +#define AV_CHANNEL_LAYOUT_2_2 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 4, .u = { .mask = AV_CH_LAYOUT_2_2 }} +#define AV_CHANNEL_LAYOUT_QUAD \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 4, .u = { .mask = AV_CH_LAYOUT_QUAD }} +#define AV_CHANNEL_LAYOUT_5POINT0 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 5, .u = { .mask = AV_CH_LAYOUT_5POINT0 }} +#define AV_CHANNEL_LAYOUT_5POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 6, .u = { .mask = AV_CH_LAYOUT_5POINT1 }} +#define AV_CHANNEL_LAYOUT_5POINT0_BACK \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 5, .u = { .mask = AV_CH_LAYOUT_5POINT0_BACK }} +#define AV_CHANNEL_LAYOUT_5POINT1_BACK \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 6, .u = { .mask = AV_CH_LAYOUT_5POINT1_BACK }} +#define AV_CHANNEL_LAYOUT_6POINT0 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 6, .u = { .mask = AV_CH_LAYOUT_6POINT0 }} +#define AV_CHANNEL_LAYOUT_6POINT0_FRONT \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 6, .u = { .mask = AV_CH_LAYOUT_6POINT0_FRONT }} +#define AV_CHANNEL_LAYOUT_HEXAGONAL \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 6, .u = { .mask = AV_CH_LAYOUT_HEXAGONAL }} +#define AV_CHANNEL_LAYOUT_6POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 7, .u = { .mask = AV_CH_LAYOUT_6POINT1 }} +#define AV_CHANNEL_LAYOUT_6POINT1_BACK \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 7, .u = { .mask = AV_CH_LAYOUT_6POINT1_BACK }} +#define AV_CHANNEL_LAYOUT_6POINT1_FRONT \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 7, .u = { .mask = AV_CH_LAYOUT_6POINT1_FRONT }} +#define AV_CHANNEL_LAYOUT_7POINT0 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 7, .u = { .mask = AV_CH_LAYOUT_7POINT0 }} +#define AV_CHANNEL_LAYOUT_7POINT0_FRONT \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 7, .u = { .mask = AV_CH_LAYOUT_7POINT0_FRONT }} +#define AV_CHANNEL_LAYOUT_7POINT1 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 8, .u = { .mask = AV_CH_LAYOUT_7POINT1 }} +#define AV_CHANNEL_LAYOUT_7POINT1_WIDE \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 8, .u = { .mask = AV_CH_LAYOUT_7POINT1_WIDE }} +#define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 8, .u = { .mask = AV_CH_LAYOUT_7POINT1_WIDE_BACK }} +#define AV_CHANNEL_LAYOUT_OCTAGONAL \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 8, .u = { .mask = AV_CH_LAYOUT_OCTAGONAL }} +#define AV_CHANNEL_LAYOUT_HEXADECAGONAL \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 16, .u = { .mask = AV_CH_LAYOUT_HEXAGONAL }} +#define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 2, .u = { .mask = AV_CH_LAYOUT_STEREO_DOWNMIX }} +#define AV_CHANNEL_LAYOUT_22POINT2 \ + { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 24, .u = { .mask = AV_CH_LAYOUT_22POINT2 }} + +struct AVBPrint; + +#if FF_API_OLD_CHANNEL_LAYOUT /** * Return a channel layout id that matches name, or 0 if no match is found. * @@ -144,7 +379,10 @@ enum AVMatrixEncoding { * AV_CH_* macros). * * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7" + * + * @deprecated use av_channel_layout_from_string() */ +attribute_deprecated uint64_t av_get_channel_layout(const char *name); /** @@ -158,7 +396,9 @@ uint64_t av_get_channel_layout(const char *name); * @param[out] nb_channels number of channels * * @return 0 on success, AVERROR(EINVAL) if the parsing fails. + * @deprecated use av_channel_layout_from_string() */ +attribute_deprecated int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels); /** @@ -167,23 +407,31 @@ int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, i * * @param buf put here the string containing the channel layout * @param buf_size size in bytes of the buffer + * @deprecated use av_channel_layout_describe() */ +attribute_deprecated void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); -struct AVBPrint; /** * Append a description of a channel layout to a bprint buffer. + * @deprecated use av_channel_layout_describe() */ +attribute_deprecated void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout); /** * Return the number of channels in the channel layout. + * @deprecated use AVChannelLayout.nb_channels */ +attribute_deprecated int av_get_channel_layout_nb_channels(uint64_t channel_layout); /** * Return default channel layout for a given number of channels. + * + * @deprecated use av_channel_layout_default() */ +attribute_deprecated int64_t av_get_default_channel_layout(int nb_channels); /** @@ -194,20 +442,28 @@ int64_t av_get_default_channel_layout(int nb_channels); * * @return index of channel in channel_layout on success, a negative AVERROR * on error. + * + * @deprecated use av_channel_layout_index_from_channel() */ +attribute_deprecated int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel); /** * Get the channel with the given index in channel_layout. + * @deprecated use av_channel_layout_channel_from_index() */ +attribute_deprecated uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); /** * Get the name of a given channel. * * @return channel name on success, NULL on error. + * + * @deprecated use av_channel_name() */ +attribute_deprecated const char *av_get_channel_name(uint64_t channel); /** @@ -215,7 +471,9 @@ const char *av_get_channel_name(uint64_t channel); * * @param channel a channel layout with a single channel * @return channel description on success, NULL on error + * @deprecated use av_channel_description() */ +attribute_deprecated const char *av_get_channel_description(uint64_t channel); /** @@ -226,9 +484,229 @@ const char *av_get_channel_description(uint64_t channel); * @param[out] name name of the layout * @return 0 if the layout exists, * <0 if index is beyond the limits + * @deprecated use av_channel_layout_standard() */ +attribute_deprecated int av_get_standard_channel_layout(unsigned index, uint64_t *layout, const char **name); +#endif + +/** + * Get a human readable string in an abbreviated form describing a given channel, + * or "?" if not found. + * This is the inverse function of @ref av_channel_from_string(). + * + * @param buf pre-allocated buffer where to put the generated string + * @param buf_size size in bytes of the buffer. + * @return amount of bytes needed to hold the output string, or a negative AVERROR + * on failure. If the returned value is bigger than buf_size, then the + * string was truncated. + */ +int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel); + +/** + * bprint variant of av_channel_name(). + */ +void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id); + +/** + * Get a human readable string describing a given channel, or "?" if not found. + * + * @param buf pre-allocated buffer where to put the generated string + * @param buf_size size in bytes of the buffer. + * @return amount of bytes needed to hold the output string, or a negative AVERROR + * on failure. If the returned value is bigger than buf_size, then the + * string was truncated. + */ +int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel); + +/** + * bprint variant of av_channel_description(). + */ +void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id); + +/** + * This is the inverse function of @ref av_channel_name(). + * + * @return the channel with the given name + * AV_CHAN_NONE when name does not identify a known channel + */ +enum AVChannel av_channel_from_string(const char *name); + +/** + * Initialize a native channel layout from a bitmask indicating which channels + * are present. + * + * @param channel_layout the layout structure to be initialized + * @param mask bitmask describing the channel layout + * + * @return 0 on success + * AVERROR(EINVAL) for invalid mask values + */ +int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask); + +/** + * Initialize a channel layout from a given string description. + * The input string can be represented by: + * - the formal channel layout name (returned by av_channel_layout_describe()) + * - single or multiple channel names (returned by av_channel_name() + * or concatenated with "+") + * - a hexadecimal value of a channel layout (eg. "0x4") + * - the number of channels with default layout (eg. "5c") + * - the number of unordered channels (eg. "4", "4C", or "4 channels") + * + * @param channel_layout input channel layout + * @param str string describing the channel layout + * @return 0 channel layout was detected, AVERROR_INVALIDATATA otherwise + */ +int av_channel_layout_from_string(AVChannelLayout *channel_layout, + const char *str); + +/** + * Get the default channel layout for a given number of channels. + * + * @param channel_layout the layout structure to be initialized + * @param nb_channels number of channels + */ +void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels); + +/** + * Iterate over all standard channel layouts. + * + * @param opaque a pointer where libavutil will store the iteration state. Must + * point to NULL to start the iteration. + * + * @return the standard channel layout or NULL when the iteration is + * finished + */ +const AVChannelLayout *av_channel_layout_standard(void **opaque); + +/** + * Free any allocated data in the channel layout and reset the channel + * count to 0. + * + * @param channel_layout the layout structure to be uninitialized + */ +void av_channel_layout_uninit(AVChannelLayout *channel_layout); + +/** + * Make a copy of a channel layout. This differs from just assigning src to dst + * in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM. + * + * @note the destination channel_layout will be always uninitialized before copy. + * + * @param dst destination channel layout + * @param src source channel layout + * @return 0 on success, a negative AVERROR on error. + */ +int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src); + +/** + * Get a human-readable string describing the channel layout properties. + * The string will be in the same format that is accepted by + * @ref av_channel_layout_from_string(). + * + * @param channel_layout channel layout to be described + * @param buf pre-allocated buffer where to put the generated string + * @param buf_size size in bytes of the buffer. + * @return amount of bytes needed to hold the output string, or a negative AVERROR + * on failure. If the returned value is bigger than buf_size, then the + * string was truncated. + */ +int av_channel_layout_describe(const AVChannelLayout *channel_layout, + char *buf, size_t buf_size); + +/** + * bprint variant of av_channel_layout_describe(). + * + * @return 0 on success, or a negative AVERROR value on failure. + */ +int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, + struct AVBPrint *bp); + +/** + * Get the channel with the given index in a channel layout. + * + * @param channel_layout input channel layout + * @return channel with the index idx in channel_layout on success or + * AV_CHAN_NONE on failure (if idx is not valid or the channel order is + * unspecified) + */ +enum AVChannel +av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx); + +/** + * Get the index of a given channel in a channel layout. In case multiple + * channels are found, only the first match will be returned. + * + * @param channel_layout input channel layout + * @return index of channel in channel_layout on success or a negative number if + * channel is not present in channel_layout. + */ +int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout, + enum AVChannel channel); + +/** + * Get the index in a channel layout of a channel described by the given string. + * In case multiple channels are found, only the first match will be returned. + * + * This function accepts channel names in the same format as + * @ref av_channel_from_string(). + * + * @param channel_layout input channel layout + * @return a channel index described by the given string, or a negative AVERROR + * value. + */ +int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout, + const char *name); + +/** + * Get a channel described by the given string. + * + * This function accepts channel names in the same format as + * @ref av_channel_from_string(). + * + * @param channel_layout input channel layout + * @return a channel described by the given string, or a negative AVERROR value. + */ +int av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout, + const char *name); + +/** + * Find out what channels from a given set are present in a channel layout, + * without regard for their positions. + * + * @param channel_layout input channel layout + * @param mask a combination of AV_CH_* representing a set of channels + * @return a bitfield representing all the channels from mask that are present + * in channel_layout + */ +uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout, + uint64_t mask); + +/** + * Check whether a channel layout is valid, i.e. can possibly describe audio + * data. + * + * @param channel_layout input channel layout + * @return 1 if channel_layout is valid, 0 otherwise. + */ +int av_channel_layout_check(const AVChannelLayout *channel_layout); + +/** + * Check whether two channel layouts are semantically the same, i.e. the same + * channels are present on the same positions in both. + * + * If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the other is + * not, they are considered to be unequal. If both are AV_CHANNEL_ORDER_UNSPEC, + * they are considered equal iff the channel counts are the same in both. + * + * @param chl input channel layout + * @param chl1 input channel layout + * @return 0 if chl and chl1 are equal, 1 if they are not equal. A negative + * AVERROR code if one or both are invalid. + */ +int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1); /** * @} diff --git a/libavutil/version.h b/libavutil/version.h index 953aac9d94..4da667b923 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -110,6 +110,7 @@ #define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) /** * @} -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-01-13 1:52 UTC|newest] Thread overview: 337+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-13 1:49 [FFmpeg-devel] [PATCH 000/281 v3] New " James Almer 2022-01-13 1:49 ` James Almer [this message] 2022-01-13 14:08 ` [FFmpeg-devel] [PATCH 001/281] Add a new " Lynne 2022-01-16 11:27 ` Nicolas George 2022-01-16 22:54 ` Marton Balint 2022-01-17 13:22 ` James Almer 2022-01-17 20:18 ` Marton Balint 2022-01-17 20:27 ` James Almer 2022-01-17 13:53 ` Nicolas George 2022-01-17 13:54 ` James Almer 2022-01-17 13:56 ` Nicolas George 2022-01-17 14:02 ` James Almer 2022-01-17 16:50 ` Nicolas George 2022-01-17 16:52 ` James Almer 2022-01-17 16:54 ` Nicolas George 2022-01-17 16:57 ` James Almer 2022-01-17 17:55 ` Nicolas George 2022-01-17 13:32 ` James Almer 2022-01-17 13:51 ` Nicolas George 2022-01-17 14:12 ` James Almer 2022-01-17 16:48 ` Nicolas George 2022-01-17 16:50 ` James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 002/281] fate: add a channel_layout API test James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 003/281] lavu: support AVChannelLayout AVOptions James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 004/281] lavc: deprecate channel count/layout changing side data James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 005/281] avframe: switch to the new channel layout API James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 006/281] avcodecpar: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 007/281] lavf: add a temporary compat layer for the channel layout API change James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 008/281] lavf: convert the generic layer to the new channel layout James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 009/281] 3dostr: convert to new channel layout API James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 010/281] 4xm: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 011/281] aa: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 012/281] aax: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 013/281] ace: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 014/281] acm: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 015/281] act: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 016/281] adp: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 017/281] ads: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 018/281] adxdec: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 019/281] aea: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 020/281] afc: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 021/281] aiff: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 022/281] aixdec: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 023/281] alsa: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 024/281] alp: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 025/281] amr: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 026/281] amv: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 027/281] apc: " James Almer 2022-01-26 13:41 ` Anton Khirnov 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 028/281] ape: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 029/281] apm: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 030/281] aptxdec: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 031/281] argo: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 032/281] ast: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 033/281] au: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 034/281] avr: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 035/281] bethsoftvid: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 036/281] bfi: " James Almer 2022-01-13 1:49 ` [FFmpeg-devel] [PATCH 037/281] bink: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 038/281] bit: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 039/281] bmv: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 040/281] boa: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 041/281] brstm: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 042/281] caf: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 043/281] cdxl: " James Almer 2022-01-26 13:53 ` Anton Khirnov 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 044/281] codec2: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 045/281] dash: " James Almer 2022-01-26 13:56 ` Anton Khirnov 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 046/281] dcstr: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 047/281] derf: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 048/281] dhav: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 049/281] dtshddec: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 050/281] dsicin: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 051/281] dshow: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 052/281] dss: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 053/281] dsfdec: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 054/281] dv: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 055/281] eac: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 056/281] electronicarts: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 057/281] epafdec: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 058/281] flac: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 059/281] flic: " James Almer 2022-01-27 7:46 ` Anton Khirnov 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 060/281] flv: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 061/281] framehash: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 062/281] fsb: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 063/281] fwse: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 064/281] g722: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 065/281] g723_1: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 066/281] g726: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 067/281] g729: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 068/281] gdv: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 069/281] genh: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 070/281] gsm: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 071/281] gxf: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 072/281] hca: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 073/281] hcom: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 074/281] hls_sample_encryption: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 075/281] idcin: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 076/281] idroq: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 077/281] iff: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 078/281] ifv: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 079/281] ilbc: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 080/281] imx: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 081/281] ircam: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 082/281] ipmovie: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 083/281] iss: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 084/281] jack: port " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 085/281] jvdec: convert " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 086/281] kvag: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 087/281] avdevice/lavfi: " James Almer 2022-01-13 1:50 ` [FFmpeg-devel] [PATCH 088/281] libcdio: port " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 089/281] lvf: convert " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 090/281] lxfdec: " James Almer 2022-01-27 15:19 ` Tomas Härdin 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 091/281] matroska: " James Almer 2022-01-21 19:52 ` Andreas Rheinhardt 2022-01-21 20:20 ` James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 092/281] mca: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 093/281] mm: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 094/281] mmf: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 095/281] moflex: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 096/281] mov: " James Almer 2022-01-28 10:08 ` Anton Khirnov 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 097/281] movenc-test: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 098/281] mp3: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 099/281] mpc: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 100/281] mpc8: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 101/281] mpeg: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 102/281] mpegenc: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 103/281] mpegtsenc: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 104/281] msf: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 105/281] mtaf: " James Almer 2022-01-13 1:55 ` [FFmpeg-devel] [PATCH 106/281] musx: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 107/281] mvdec: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 108/281] mvi: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 109/281] mxf: " James Almer 2022-01-19 19:06 ` Tomas Härdin 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 110/281] mxg: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 111/281] nistspheredec: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 112/281] nspdec: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 113/281] nsvdec: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 114/281] nutdec: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 115/281] nuv: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 116/281] ogg: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 117/281] oma: " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 118/281] oss: port " James Almer 2022-01-13 1:56 ` [FFmpeg-devel] [PATCH 119/281] paf: convert " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 089/281] lvf: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 120/281] pcm: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 121/281] pmp: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 122/281] pp_bnk: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 123/281] psxstr: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 124/281] pvf: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 125/281] qcp: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 126/281] r3d: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 127/281] rawenc: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 128/281] redspark: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 129/281] riff: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 130/281] rl2: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 131/281] rm: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 132/281] rpl: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 133/281] rsd: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 134/281] rso: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 135/281] rtp: " James Almer 2022-01-28 14:15 ` Anton Khirnov 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 136/281] sbg: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 137/281] scd: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 138/281] sdp: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 139/281] sdr2: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 140/281] sds: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 141/281] sdx: " James Almer 2022-01-13 1:57 ` [FFmpeg-devel] [PATCH 142/281] segafilm: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 143/281] sga: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 144/281] sierravmd: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 145/281] siff: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 146/281] smacker: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 147/281] smjpegenc: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 148/281] smoothstreaming: " James Almer 2022-01-13 1:58 ` [FFmpeg-devel] [PATCH 149/281] smush: " James Almer 2022-01-13 1:59 ` [FFmpeg-devel] [PATCH 089/281] lvf: " James Almer 2022-01-13 1:59 ` [FFmpeg-devel] [PATCH 150/281] sol: " James Almer 2022-01-13 1:59 ` [FFmpeg-devel] [PATCH 151/281] sox: " James Almer 2022-01-13 1:59 ` [FFmpeg-devel] [PATCH 152/281] svag: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 153/281] svs: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 154/281] swf: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 155/281] tak: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 156/281] thp: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 157/281] tiertexseq: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 158/281] tmv: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 159/281] tta: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 160/281] uncodedframecrcenc: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 161/281] vag: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 162/281] vividas: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 163/281] vivo: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 164/281] voc: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 165/281] vpk: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 166/281] vqf: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 167/281] wav: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 168/281] wc3movie: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 169/281] westwood: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 170/281] wtv: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 171/281] wv: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 172/281] xa: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 173/281] xmv: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 174/281] xwma: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 175/281] yop: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 176/281] wsd: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 177/281] wve: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 178/281] xvag: " James Almer 2022-01-13 2:00 ` [FFmpeg-devel] [PATCH 179/281] lavf: drop the channel layout compat layer for old-style (de)muxers James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 180/281] lavc: switch to the new channel layout API James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 181/281] 8svx: convert to " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 182/281] aac: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 183/281] ac3: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 184/281] adpcm: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 185/281] adx: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 186/281] alac: " James Almer 2022-02-09 9:40 ` Anton Khirnov 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 187/281] als: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 188/281] amr: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 189/281] aptx: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 190/281] atrac1: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 191/281] atrac3: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 192/281] atrac3plus: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 193/281] atrac9: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 194/281] apedec: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 195/281] audiotoolbox: " James Almer 2022-02-21 14:22 ` Anton Khirnov 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 196/281] binkaudio: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 197/281] bmvaudio: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 198/281] cng: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 199/281] cook: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 200/281] dca: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 201/281] dolby_e: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 202/281] dpcm: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 203/281] dsd: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 204/281] dsicinav: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 205/281] dss_sp: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 206/281] dst: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 207/281] dvaudio: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 208/281] evrc: " James Almer 2022-01-13 2:02 ` [FFmpeg-devel] [PATCH 209/281] fastaudio: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 210/281] ffwavesynth: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 211/281] flac: " James Almer 2022-02-23 10:24 ` Anton Khirnov 2022-02-23 11:51 ` James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 212/281] g722: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 213/281] g723_1: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 214/281] g726: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 215/281] g729: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 216/281] gsmdec: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 217/281] hca: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 218/281] hcom: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 219/281] ilbc: " James Almer 2022-01-13 2:04 ` [FFmpeg-devel] [PATCH 220/281] imc: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 221/281] interplayacm: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 222/281] libcelt: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 223/281] libcodec2: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 224/281] libfdk-aac: " James Almer 2022-02-25 11:18 ` Anton Khirnov 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 225/281] libilbc: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 226/281] libgsm: " James Almer 2022-02-25 11:20 ` Anton Khirnov 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 227/281] libmp3lame: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 228/281] libopencore-amr: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 229/281] libopus: " James Almer 2022-02-25 11:46 ` Anton Khirnov 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 230/281] libshine: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 231/281] libspeexdec: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 232/281] libtwolame: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 233/281] libvo-amrwbenc: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 234/281] libvorbis: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 235/281] mace: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 236/281] metasound: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 237/281] mf: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 238/281] mlp: " James Almer 2022-01-13 2:05 ` [FFmpeg-devel] [PATCH 239/281] mpc7: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 240/281] mpc8: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 241/281] mpegaudio: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 242/281] nellymoser: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 243/281] on2avc: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 244/281] opus: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 245/281] pafaudio: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 246/281] pcm: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 247/281] qcelpdec: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 248/281] qdmc: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 249/281] qdm2: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 250/281] ra144: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 251/281] ra288: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 252/281] ralf: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 253/281] roqaudioenc: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 254/281] s302m: " James Almer 2022-01-13 2:06 ` [FFmpeg-devel] [PATCH 255/281] sbc: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 256/281] shorten: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 257/281] sipr: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 258/281] siren: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 259/281] smacker: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 260/281] sonic: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 261/281] speex: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 262/281] tak: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 263/281] truespeech: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 264/281] tta: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 265/281] twinvq: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 266/281] vima: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 267/281] vmdaudio: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 268/281] vorbis: " James Almer 2022-01-13 2:07 ` [FFmpeg-devel] [PATCH 269/281] wavpack: " James Almer 2022-03-07 10:42 ` Anton Khirnov 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 270/281] wma: " James Almer 2022-03-07 10:26 ` Anton Khirnov 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 271/281] ws-snd1: " James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 272/281] lavc: drop temporary compat wrappers for channel layout API change James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 273/281] lavf: Add non diegetic stream disposition flag James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 274/281] swresample: convert to new channel layout API James Almer 2022-01-19 17:20 ` Andreas Rheinhardt 2022-01-19 17:29 ` James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 275/281] avfilter: " James Almer 2022-02-14 15:49 ` Anton Khirnov 2022-02-15 11:50 ` Anton Khirnov 2022-02-15 12:27 ` James Almer 2022-02-15 12:34 ` Anton Khirnov 2022-02-15 18:52 ` James Almer 2022-02-16 18:15 ` Anton Khirnov 2022-02-18 13:07 ` James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 276/281] avdevice/lavfi: remove call to deprecated function av_buffersink_get_channel_layout() James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 277/281] ffmpeg: convert to new channel layout-API James Almer 2022-01-13 18:29 ` Michael Niedermayer 2022-01-13 18:40 ` James Almer 2022-01-13 19:44 ` James Almer 2022-01-15 13:47 ` Michael Niedermayer 2022-01-15 16:04 ` James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 278/281] ffprobe: " James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 279/281] channel_layout: add support for Ambisonic James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 280/281] opus: export mapping family 2 (Ambisonic) as Ambisonic layout James Almer 2022-01-13 2:09 ` [FFmpeg-devel] [PATCH 281/281] mov: Implement spatial audio support James Almer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220113015101.4-2-jamrial@gmail.com \ --to=jamrial@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git