James Almer: > Signed-off-by: James Almer <jamr...@gmail.com> > --- > diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c > index b59d798f29..35b03078c8 100644 > --- a/libavutil/channel_layout.c > +++ b/libavutil/channel_layout.c > @@ -214,190 +214,6 @@ static const struct channel_layout_name > channel_layout_map[] = { > { "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; > - char *end; > - int64_t layout; > - > - 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.u.mask; > - } > - for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++) > - if (channel_names[i].name && > - strlen(channel_names[i].name) == name_len && > - !memcmp(channel_names[i].name, name, name_len)) > - return (int64_t)1 << i; > - > - errno = 0; > - i = strtol(name, &end, 10); > - > - if (!errno && (end + 1 - name == name_len && *end == 'c')) > - return av_get_default_channel_layout(i); > - > - errno = 0; > - layout = strtoll(name, &end, 0); > - if (!errno && end - name == name_len) > - return FFMAX(layout, 0); > - return 0; > -} > - > -uint64_t av_get_channel_layout(const char *name) > -{ > - const char *n, *e; > - const char *name_end = name + strlen(name); > - int64_t layout = 0, layout_single; > - > - for (n = name; n < name_end; n = e + 1) { > - for (e = n; e < name_end && *e != '+' && *e != '|'; e++); > - layout_single = get_channel_layout_single(n, e - n); > - if (!layout_single) > - return 0; > - layout |= layout_single; > - } > - return layout; > -} > - > -int av_get_extended_channel_layout(const char *name, uint64_t* > channel_layout, int* nb_channels) > -{ > - int nb = 0; > - char *end; > - uint64_t layout = av_get_channel_layout(name); > - > - if (layout) { > - *channel_layout = layout; > - *nb_channels = av_get_channel_layout_nb_channels(layout); > - return 0; > - } > - > - nb = strtol(name, &end, 10); > - if (!errno && *end == 'C' && *(end + 1) == '\0' && nb > 0 && nb < 64) { > - *channel_layout = 0; > - *nb_channels = nb; > - return 0; > - } > - > - return AVERROR(EINVAL); > -} > - > -void av_bprint_channel_layout(struct AVBPrint *bp, > - int nb_channels, uint64_t channel_layout) > -{ > - int i; > - > - if (nb_channels <= 0) > - 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].layout.nb_channels && > - channel_layout == channel_layout_map[i].layout.u.mask) { > - av_bprintf(bp, "%s", channel_layout_map[i].name); > - return; > - } > - > - av_bprintf(bp, "%d channels", nb_channels); > - if (channel_layout) { > - int i, ch; > - av_bprintf(bp, " ("); > - for (i = 0, ch = 0; i < 64; i++) { > - if ((channel_layout & (UINT64_C(1) << i))) { > - const char *name = get_channel_name(i); > - if (name) { > - if (ch > 0) > - av_bprintf(bp, "+"); > - av_bprintf(bp, "%s", name); > - } > - ch++; > - } > - } > - av_bprintf(bp, ")"); > - } > -} > - > -void av_get_channel_layout_string(char *buf, int buf_size, > - int nb_channels, uint64_t channel_layout) > -{ > - AVBPrint bp; > - > - av_bprint_init_for_buffer(&bp, buf, buf_size); > - av_bprint_channel_layout(&bp, nb_channels, channel_layout); > -} > - > -int av_get_channel_layout_nb_channels(uint64_t channel_layout) > -{ > - return av_popcount64(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].layout.nb_channels) > - return channel_layout_map[i].layout.u.mask; > - return 0; > -} > - > -int av_get_channel_layout_channel_index(uint64_t channel_layout, > - uint64_t channel) > -{ > - if (!(channel_layout & channel) || > - av_get_channel_layout_nb_channels(channel) != 1) > - return AVERROR(EINVAL); > - channel_layout &= channel - 1; > - 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);
This function is now unused after this patch and needs to be removed as well. > - 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; > - > - if (av_get_channel_layout_nb_channels(channel_layout) <= index) > - return 0; > - > - for (i = 0; i < 64; i++) { > - if ((1ULL << i) & channel_layout && !index--) > - return 1ULL << i; > - } > - return 0; > -} > - > -int av_get_standard_channel_layout(unsigned index, uint64_t *layout, > - const char **name) > -{ > - if (index >= FF_ARRAY_ELEMS(channel_layout_map)) > - return AVERROR_EOF; > - 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) > { _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".