From patchwork Wed Sep 25 09:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51825 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp339056vqk; Wed, 25 Sep 2024 02:49:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCajkytskedo5puRNwFSvrJ76dNUNBoLcZ9JqJzoYP1WFNvpfJpcOItoOMpAsjM7+sWbqG8L9noIKn4RCjWYKW@gmail.com X-Google-Smtp-Source: AGHT+IE5NcRShQilKYjIUgTwclZ61Bv+rGocHBU8eEvAy70J5fTzqbnF1pTalj2WoLkAua8wB+vM X-Received: by 2002:a17:906:4789:b0:a80:f840:9004 with SMTP id a640c23a62f3a-a93a032007amr182064466b.12.1727257772477; Wed, 25 Sep 2024 02:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257772; cv=none; d=google.com; s=arc-20240605; b=c1V6dTm9+9eDu+TshQhK6D/3PWaD3Vagm2JgA7IDz+OK6itmuNEOpRJ6615hUjL0eC gdW/K7gXtLXiW3AM+YwoJfPNsYZFRDqxVWTFQtbFJzS6D4s0EGBsAGH5ScKiCkyBA/jM Bu0Gedki73eHCsoV9ubEKR2v0QDNighWBYfiriJXWvTMNhTxIuO/6c5Pszdyx7u1mslZ /NB3ekFwIgsjeUXM8CQDgbNp4cHFxH1djtNbE10v3UjO/GqB9fz1ZXlFjbo8uIDlehW3 73sJzRNBkUMVdIE6tlUaWEpzuyhGmdhlRyE104lTU2zo+k5NByPtYvQugULiZohrhteY GUsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=Q16yGhswujCGkDR5sj6/DhdM+l9pEqIHxHqqGM83jpE=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=lU/u7ueDsa8tHbdFIKRTwFxAvLrtOtbmH/uzxunPbG81BQLgSav8lEb1HRi9lpCbmr Yt9qwUUaoxyREkLARJKrbsl023KJButx0G9D6jSUhowQPPAjC+7d5C6/nIQ2IpBxhVCt HC+0iNphp8hMI2RnyjBEIbmNcwhAwFyW5jisIRkkSwmXCcDJCLRHM8CwCgIUzNkx17iV z0lOfshcDLfQDTtMnKhexHDHdqn0euiL5zvkqCYCcPyqJzdb0azhpoMAT7PI1EELzLZM IdbxdnwkbO9pIzpSkaHvtlLScfvPvtKg8QD+zY7feKHP1zmwXWBqnCflGQ0HAY9zIyag TEyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=XKs46LTx; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a93930ec735si216450166b.609.2024.09.25.02.49.31; Wed, 25 Sep 2024 02:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=XKs46LTx; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B5EF68D900; Wed, 25 Sep 2024 12:39:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC32868DA2B for ; Wed, 25 Sep 2024 12:39:42 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=XKs46LTx; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id BB12A4DEE for ; Wed, 25 Sep 2024 11:39:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 1XE5AvbycK_4 for ; Wed, 25 Sep 2024 11:39:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=YHzrg8DHapZa2Hjd8S+1kKxpN/xL+b5rp2oG1q8hcUI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XKs46LTxhOCqPfmhm70eYRLQ1Tb22HyqJhaNy/oNdSSFpA2f3UkwfE6VGzf/SaMw+ m5Et9Yey4bV4oibng0YL7JKQ9jDSkaF5rEYPb0X34d/X5Qacqizsmvvd0YHSS3YCHw YkjSC9ke1ZCKi41rg81QIX8US1juALgYTOLoqdHx+xmzr/z7b4DmjLTrkoh+K4uE3j Bezy3Bqg4vXvBglMA3FSeCY9k4YO8JmCJeF/ZAUJUoRpQJhxPGLv8kRtbf+sZyElI8 uVpiwB6zk4CHbAuR73ciw5mnWD/BnLl2NK8tSExwaHj0r6jnUW0yK2MQVe7wGN3man rg12SEsxYJ11w== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 205204E07 for ; Wed, 25 Sep 2024 11:39:39 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id CD52A3A0998 for ; Wed, 25 Sep 2024 11:39:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:00 +0200 Message-ID: <20240925093919.22929-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240925093919.22929-1-anton@khirnov.net> References: <20240925093919.22929-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/22] lavfi/asrc_anoisesrc: convert to query_func2() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xY+iVZYWlB14 --- libavfilter/asrc_anoisesrc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c index a67b2abe9c..0206fd69ce 100644 --- a/libavfilter/asrc_anoisesrc.c +++ b/libavfilter/asrc_anoisesrc.c @@ -83,24 +83,26 @@ static const AVOption anoisesrc_options[] = { AVFILTER_DEFINE_CLASS(anoisesrc); -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ANoiseSrcContext *s = ctx->priv; + const ANoiseSrcContext *s = ctx->priv; static const AVChannelLayout chlayouts[] = { AV_CHANNEL_LAYOUT_MONO, { 0 } }; int sample_rates[] = { s->sample_rate, -1 }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE }; - int ret = ff_set_common_formats_from_list(ctx, sample_fmts); + int ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); if (ret < 0) return ret; - ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, chlayouts); if (ret < 0) return ret; - return ff_set_common_samplerates_from_list(ctx, sample_rates); + return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); } static double white_filter(double white, double *buf) @@ -244,6 +246,6 @@ const AVFilter ff_asrc_anoisesrc = { .inputs = NULL, .activate = activate, FILTER_OUTPUTS(anoisesrc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &anoisesrc_class, };