From patchwork Wed Sep 25 09:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51824 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp339032vqk; Wed, 25 Sep 2024 02:49:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWRUtQ47Jz70w8tI4/T2athh9cw9ur5f+EL2nFzCncUq85/mx1afjQhPLzXJRAN4mUoTjEBQZqRclmwtk6xRG+v@gmail.com X-Google-Smtp-Source: AGHT+IH4NcJqW1kCSHUBvMsSFzfJXtDBwd3xt9SUTr4xiuAK321R5rWwrwy4hxAITd60j1kgmmjS X-Received: by 2002:a17:907:e682:b0:a86:b762:52ec with SMTP id a640c23a62f3a-a93a05ebf35mr166309466b.51.1727257770088; Wed, 25 Sep 2024 02:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257770; cv=none; d=google.com; s=arc-20240605; b=LdEt317g3GVEfr3ugB4GkMCdDZ0oRhwpytb7IjddDr8HGwBMszBINUoBMwjWf51KPt fmFbd2pOl8HFA8+inSp4sX9RER0IXA1ge3G6IzOTVIwPUjWWPdHiYtHxpP8brgAhA6c8 TsMIh3gJcauwuXcbW95McrqaExszS233ttITbe4P/qMcky8FsILPucAStKplRtD8PgJY sFhfHWC7YA1zYJ+wWlMTddMyJYZJsmQimTPQWOn5q/FRAfMwcN0gowAo/ABENryLv2RP vlDGOkA5UmLX3nbpsHK61ASW6107cIletvtUd85I6tBZnMTcnvXz4UtRnzACWNCRS+yz C4Tw== 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=yE00TuoSKdGUk4xy8RIbh4dbxY/r++ViaITokTBOT/U=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=fyuaPHlUnK9NZmkSSVsPRy8F7dBScBwPfNKuIm6XalTePPNVp26CIFLgibLlmtQ4VO p9RHdap4jHM2O6/8I76IoKtmMCAa2fC9JIBlgvrG7fOT/KI1ajp0mLfpiiH5SFDA+H49 Sevs7HIrnOVuv/lOy+tTaGCF49HpzF0BOHGfVWHhfbzCUDQ8f2RIRIErlcnludOqO/xj sX56bkWIah16EYNrMSrJiO0sPqaObf0P5Wgh/R9bW0xeBVL+jHUIFp3JPZHXCVCTOgJP LNeQBBtc09AMSd3XuHILmduBUk/EuqMFmxpRLU5KOezROo9s7FtEjm8gP3Div85Uop1X MrKw==; 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=MFG7SzEV; 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-a93930be447si220773266b.429.2024.09.25.02.49.29; Wed, 25 Sep 2024 02:49:30 -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=MFG7SzEV; 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 1370868DA56; Wed, 25 Sep 2024 12:39:50 +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 A5A2E68DA16 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=MFG7SzEV; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3B0654E1A 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 xCjLRbPcGgg8 for ; Wed, 25 Sep 2024 11:39:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=VCCFiklJ9C9dgTMziNl+/RU+PeN2ack9OTqZXHJrM9E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MFG7SzEVV0VNTE00AypFbceiOS/+QHmUxH05XLNHcTKYUjtVqeAzZJfmmSvagBZvx Pu5iEMviYPUYz41Huod68dLCP8QZ6sYBWx7VUKasSr4qjvXOjqo+/YfwFXwDLyq9la t9pHg70/4lx0YoK0gSAtcYulmNnXpQ1q+od4BOzgqG9Bpg1RmKVX8QEDUbO9Zq0kgk dB4wbiFjaKscr1nVpF4FlWKkw0TlFqXNsRRCH0x6TcLrWr3F5IRKmx+8hvOPKF7T5j f+Ele5LHB7KXtVucDdG4jMXI3aID8YmedulhkZ2D/OkpFeiUak21fLQqzPdjo75RiP SpsTaPwPuHOAQ== 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 1DE344D9D 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 C24E93A086F for ; Wed, 25 Sep 2024 11:39:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:38:59 +0200 Message-ID: <20240925093919.22929-2-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 02/22] lavfi/asrc_afirsrc: 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: gBINt94HK2zV --- libavfilter/asrc_afirsrc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavfilter/asrc_afirsrc.c b/libavfilter/asrc_afirsrc.c index bc450ec822..0ea611d837 100644 --- a/libavfilter/asrc_afirsrc.c +++ b/libavfilter/asrc_afirsrc.c @@ -113,24 +113,26 @@ static av_cold void uninit(AVFilterContext *ctx) av_tx_uninit(&s->itx_ctx); } -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioFIRSourceContext *s = ctx->priv; + const AudioFIRSourceContext *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_FLT, 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 int parse_string(char *str, float **items, int *nb_items, int *items_size) @@ -304,7 +306,7 @@ const AVFilter ff_asrc_afirsrc = { .priv_size = sizeof(AudioFIRSourceContext), .inputs = NULL, FILTER_OUTPUTS(afirsrc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &afirsrc_class, }; @@ -585,6 +587,6 @@ const AVFilter ff_asrc_afireqsrc = { .priv_size = sizeof(AudioFIRSourceContext), .inputs = NULL, FILTER_OUTPUTS(afireqsrc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &afireqsrc_class, };