From patchwork Sat Aug 8 14:01:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 21541 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BA625449249 for ; Sat, 8 Aug 2020 17:09:32 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A30C968B933; Sat, 8 Aug 2020 17:09:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 26EB768B663 for ; Sat, 8 Aug 2020 17:09:26 +0300 (EEST) Received: by mail-ej1-f65.google.com with SMTP id d6so4963351ejr.5 for ; Sat, 08 Aug 2020 07:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tVSF+aEUNirnOCrQUgcAAhJGg1qFHLWzrqGLRwwXWWc=; b=B9kZBPciGI9sZ8LcKKdsvU8dKJE2mfEwWOVdzOHpuZbA472/Q1aUJ58UI8Unr3n2um 6j5HHfh4qn5Q0FNYqlNrQWg58Acp6WZluL1nI9LAJmWxTdrV+9FDW10XbIqHabCcQr48 CsTAOsbqG8Ouja1v/bPjSYUpSP+NhN3YtiNsE0ikLFvcRehfvZRYrYdp40Tl1emUkh+6 DUEMMi8k1JyQ++W7sTnF9h9PP5pO4eOyb0grK5eVRFURxBl3kl5W2blcfqZAx9ySHYFA O+CYhxQN65pS0yEKaUwtgTYVuFsRrZ10Xu1xIT/Rew9tOfvsQMGUPwb0zU+PcKp1t/+I Z3Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tVSF+aEUNirnOCrQUgcAAhJGg1qFHLWzrqGLRwwXWWc=; b=p//ZRqnFgvsImdN9s3spYuyytR+9jp7teGAejDp62ebqic5BumlYq9pTwg5FtUH3A/ 2jJY2mJB0zbz7M//3L7c7ltxA4noyfHcvSFW6KB+Lq+x5wsFYQ+Z4kDV16ZaVZDhr4vH x85lRUgFn5ZKWPyskDLdDW4ebldo7hqvFuCQAofSv1TRIbuLmCq9W4Y4uBbykviVdtHU Gw6pFEGJFJIuS91bqw10u3NwwlahhBrYxt+J513SLyH64gfeeoQluS5B6YFEcXsSK2NE cwo8WdjS41Z3Ka2/1q9FkaHv1HWDmjD+iFRnL6BUtX16TYgxPsFNKdBnKOrH7Edaivn+ Ig8A== X-Gm-Message-State: AOAM530Ho4b1qmKjZcmen0E0hCwHz47L7r6H+MiAAWwZlXyDEfgXTa+N Dm20SohVQRO+XGC+etRkAwuO+yrs X-Google-Smtp-Source: ABdhPJyWoAZjWW2QBSfuu021ICe7y/aA6a+1g5mHxeDp2Gkju50wroXJkBx8AdFvZs3TvwIejInhAg== X-Received: by 2002:a17:906:9392:: with SMTP id l18mr13912479ejx.357.1596895765209; Sat, 08 Aug 2020 07:09:25 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc10296.dynamic.kabel-deutschland.de. [188.193.2.150]) by smtp.gmail.com with ESMTPSA id g21sm7618991edm.65.2020.08.08.07.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2020 07:09:24 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 Aug 2020 16:01:59 +0200 Message-Id: <20200808140202.586-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200808140202.586-1-andreas.rheinhardt@gmail.com> References: <20200808140202.586-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avfilter/formats: Schedule avfilter_make_format64_list() for removal X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 (b74a1da49db5ebed51aceae6cacc2329288a92c1, 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 --- libavfilter/aeval.c | 2 +- libavfilter/af_aresample.c | 2 +- libavfilter/asrc_afirsrc.c | 2 +- libavfilter/asrc_anoisesrc.c | 2 +- libavfilter/asrc_anullsrc.c | 3 +-- libavfilter/asrc_hilbert.c | 2 +- libavfilter/asrc_sinc.c | 2 +- libavfilter/asrc_sine.c | 2 +- libavfilter/avf_showcqt.c | 2 +- libavfilter/formats.c | 9 ++++++++- libavfilter/formats.h | 6 +++++- libavfilter/src_movie.c | 2 +- 12 files changed, 23 insertions(+), 13 deletions(-) diff --git a/libavfilter/aeval.c b/libavfilter/aeval.c index 855dc0009d..c7a8cd6550 100644 --- a/libavfilter/aeval.c +++ b/libavfilter/aeval.c @@ -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); diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index fb10bd1c33..b7b1b5ba3c 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -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(); diff --git a/libavfilter/asrc_afirsrc.c b/libavfilter/asrc_afirsrc.c index b90ffad57f..d8ba8f6a54 100644 --- a/libavfilter/asrc_afirsrc.c +++ b/libavfilter/asrc_afirsrc.c @@ -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); diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c index 7aa878707d..40ee077001 100644 --- a/libavfilter/asrc_anoisesrc.c +++ b/libavfilter/asrc_anoisesrc.c @@ -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); diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c index 52db61685d..7093f08275 100644 --- a/libavfilter/asrc_anullsrc.c +++ b/libavfilter/asrc_anullsrc.c @@ -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) diff --git a/libavfilter/asrc_hilbert.c b/libavfilter/asrc_hilbert.c index a51c676c6f..640dfe46f9 100644 --- a/libavfilter/asrc_hilbert.c +++ b/libavfilter/asrc_hilbert.c @@ -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); diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c index 24aeab6e7b..c3ecb864d1 100644 --- a/libavfilter/asrc_sinc.c +++ b/libavfilter/asrc_sinc.c @@ -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); diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index 3a87210b4b..6fe080efb6 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -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); diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c index 990db3143b..95efe72628 100644 --- a/libavfilter/avf_showcqt.c +++ b/libavfilter/avf_showcqt.c @@ -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; diff --git a/libavfilter/formats.c b/libavfilter/formats.c index bcc539bb38..48b27d0c53 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -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); @@ -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; \ diff --git a/libavfilter/formats.h b/libavfilter/formats.h index 708bee3ee8..ffe7a12d53 100644 --- a/libavfilter/formats.h +++ b/libavfilter/formats.h @@ -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 @@ -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 diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index 476b8d3d96..64d82e9df1 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -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;