Skip to content

Commit

Permalink
avfilter/formats: Schedule avfilter_make_format64_list() for removal
Browse files Browse the repository at this point in the history
Despite its name, this function is not part of the public API, as
formats.h, the header containing its declaration, is a private header.
The formats API was once public API, but that changed long ago
(b74a1da, the commit scheduling it to
become private, is from 2012). That avfilter_make_format64_list() was
forgotten is probably a result of the confusion resulting from the
libav-ffmpeg split.

Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Aug 12, 2020
1 parent 2e0cf4d commit ae5026c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libavfilter/aeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/af_aresample.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int query_formats(AVFilterContext *ctx)

if(out_layout) {
int64_t layout_list[] = { out_layout, -1 };
out_layouts = avfilter_make_format64_list(layout_list);
out_layouts = ff_make_format64_list(layout_list);
} else
out_layouts = ff_all_channel_counts();

Expand Down
2 changes: 1 addition & 1 deletion libavfilter/asrc_afirsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/asrc_anoisesrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
3 changes: 1 addition & 2 deletions libavfilter/asrc_anullsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ static int query_formats(AVFilterContext *ctx)
int ret;

if ((ret = ff_set_common_formats (ctx, ff_all_formats (AVMEDIA_TYPE_AUDIO))) < 0 ||
(ret = ff_set_common_channel_layouts (ctx, avfilter_make_format64_list (chlayouts ))) < 0 ||
(ret = ff_set_common_samplerates (ctx, ff_make_format_list (sample_rates ))) < 0)
return ret;

return 0;
return ff_set_common_channel_layouts(ctx, ff_make_format64_list(chlayouts));
}

static int config_props(AVFilterLink *outlink)
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/asrc_hilbert.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/asrc_sinc.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/asrc_sine.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;

layouts = avfilter_make_format64_list(chlayouts);
layouts = ff_make_format64_list(chlayouts);
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/avf_showcqt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ static int query_formats(AVFilterContext *ctx)
if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0)
return ret;

layouts = avfilter_make_format64_list(channel_layouts);
layouts = ff_make_format64_list(channel_layouts);
if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0)
return ret;

Expand Down
9 changes: 8 additions & 1 deletion libavfilter/formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ AVFilterFormats *ff_make_format_list(const int *fmts)
return formats;
}

AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
AVFilterChannelLayouts *ff_make_format64_list(const int64_t *fmts)
{
MAKE_FORMAT_LIST(AVFilterChannelLayouts,
channel_layouts, nb_channel_layouts);
Expand All @@ -300,6 +300,13 @@ AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
return formats;
}

#if LIBAVFILTER_VERSION_MAJOR < 8
AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
{
return ff_make_format64_list(fmts);
}
#endif

#define ADD_FORMAT(f, fmt, unref_fn, type, list, nb) \
do { \
type *fmts; \
Expand Down
6 changes: 5 additions & 1 deletion libavfilter/formats.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define AVFILTER_FORMATS_H

#include "avfilter.h"
#include "version.h"

/**
* A list of supported formats for one end of a filter link. This is used
Expand Down Expand Up @@ -139,8 +140,11 @@ av_warn_unused_result
AVFilterChannelLayouts *ff_all_channel_counts(void);

av_warn_unused_result
AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
AVFilterChannelLayouts *ff_make_format64_list(const int64_t *fmts);

#if LIBAVFILTER_VERSION_MAJOR < 8
AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
#endif

/**
* A helper for query_formats() which sets all links to the same list of channel
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/src_movie.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static int movie_query_formats(AVFilterContext *ctx)
if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates)) < 0)
return ret;
list64[0] = c->channel_layout;
if ((ret = ff_channel_layouts_ref(avfilter_make_format64_list(list64),
if ((ret = ff_channel_layouts_ref(ff_make_format64_list(list64),
&outlink->in_channel_layouts)) < 0)
return ret;
break;
Expand Down

0 comments on commit ae5026c

Please sign in to comment.