From patchwork Wed Sep 25 09:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51819 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp335302vqk; Wed, 25 Sep 2024 02:40:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVagGs0oWSljtNykpknm78N76FJDu/RWsw5WRW46HbOVZdQAROJ2kGfnf7Sbkgf8gIBm1patggN7jNhKX6TGPGb@gmail.com X-Google-Smtp-Source: AGHT+IHdnqABHAWiUKXVRu20dlZc8O2sGKpcKzJCzx/k0zte6q1S7209hEMrCfFtVzePRgjeB962 X-Received: by 2002:a05:651c:554:b0:2f7:58bc:f49d with SMTP id 38308e7fff4ca-2f904a6fb1fmr14652641fa.0.1727257235077; Wed, 25 Sep 2024 02:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257235; cv=none; d=google.com; s=arc-20240605; b=c76X2s8sH6A+Nuq8meSrf/otFL+PdqcXBH2SbQsq41QeyLJtrI58r57YmCUdaA7Gzc Y8znMPiK/7dPaGw+lEjEINV3UviJYKaqwm4jQpwLAONh8hLdZvgd/TU6gfmflqog474m cSo8IdUIxlMMboHPIHcB3uSt8d0WOVO0qSvpDuTmww02OT+HaV6Q8OE5m4AXZV2vKeup yIG8gbAM+yFaRSRuIu0qHQgqPtkctxmynkkRHR7s/2262b/rhMStrjC4E2XMpNRgqV3y /RJrIkcWdIXfUUbjZogTlwwAxcfJtu/Sb1Evjud3x/Z476EFzNSmv3C9HEZVjhQdlHpg l7LA== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=OP/R1+UoKONdUCrLMO5H9/9iN73Mqxp+G2yNpbi5EpQ=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=h4VV2f19z6+HyvAqA/t9F8SwSTm+hKU/JVz/ERNOAT/9vkOKJWWTSuFKkBrLhpsPYT +01ZNU1U1KVQy5Ks/JumMV93ou1lA0Uc8sYjUIHU0HOuBQ/ceVjYwyx5ZoUeZaQeOT2x lUwGQ1I11e9kDtpzm2Qj7PjASlg3AGitVdNg7lT1yKCGFDw7ed5eSupgl/xDPZwI0W72 c+ntV8OJRTc3Wb+v9pLe/JmwGGYyFK9pZ0kzQ/SFpA0Bl9mtjeaO/9BXfy9njGdW0bhV 17g68aZu1hZ6MotulsK5J6G180D4knjZbPLmizinJipJUh5TlPPViavRvfeylvFq3vSP OBpA==; 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=PKJ4cjll; 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 38308e7fff4ca-2f8d28b4c83si9276611fa.464.2024.09.25.02.40.34; Wed, 25 Sep 2024 02:40:35 -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=PKJ4cjll; 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 5CAB168DB65; Wed, 25 Sep 2024 12:39:53 +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 A91FF68DA1F 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=PKJ4cjll; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3E2764E07 for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id ZJ2EJf8eBrvi for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=3N2iCMyRDmkD7XpHWvY4lF+WdPd4S9i1VDfsQKGKXu8=; h=From:To:Subject:Date:From; b=PKJ4cjll7Gdc7H2i/38GIY/8Cwdzw2DJHPnh0aUE6pUE9rrskGOYeuQYRlBRM+DOo myw7hHm9XqvlEPI2axFnjz24MmrN1y5MDiGzjwEpr4SCV7QvVgrw+KQtxrRIIq/Qdp 2V8xGXm00w87O5aADgDFmtkh5DDJrOwQCfeS3+X2OVIjla1PxeVrRdhoRp3IBLh6O2 NkUHc2BCGQHAqo+F8zIMjS1PJ/EhTiDFpg9LqZ1nV8XRrKZmzB7KpnwrVwyIig2cwJ nnm22JmUz7dVpZ10YhKwxPlOg83oYGRq9e0jLOEc7GIxVBwO/oFw9F6eYr0WnwJ3q1 48y3AeqSVsNrg== 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 225384E08 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 B574B3A03CA 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:58 +0200 Message-ID: <20240925093919.22929-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/22] lavfi/asrc_afdelaysrc: 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: bgmjX3t4PMHL --- libavfilter/asrc_afdelaysrc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/asrc_afdelaysrc.c b/libavfilter/asrc_afdelaysrc.c index c235f0c27a..cb6f236ba6 100644 --- a/libavfilter/asrc_afdelaysrc.c +++ b/libavfilter/asrc_afdelaysrc.c @@ -80,22 +80,24 @@ static int activate(AVFilterContext *ctx) return ff_filter_frame(outlink, frame); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AFDelaySrcContext *s = ctx->priv; + const AFDelaySrcContext *s = ctx->priv; AVChannelLayout chlayouts[] = { s->chlayout, { 0 } }; int sample_rates[] = { s->sample_rate, -1 }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, 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 config_output(AVFilterLink *outlink) @@ -146,5 +148,5 @@ const AVFilter ff_asrc_afdelaysrc = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(afdelaysrc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; 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, }; 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, }; From patchwork Wed Sep 25 09:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51829 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp346808vqk; Wed, 25 Sep 2024 03:04:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUb7ovGaZzK1OsOWH6WqCkN6vmLhkVYU4DtDZHXe9wjZEqN+07Xn2DyNs7rVty6fIjMQZPXyuPtMHhkWGsyEvzN@gmail.com X-Google-Smtp-Source: AGHT+IFf8jIdVnERCTcnFuXNEUcYjDOerCnqn4l3umoHEwyozurBhvCIiaZttjibXgwz3FSTq9/D X-Received: by 2002:a05:6512:3ba9:b0:52f:c27b:d572 with SMTP id 2adb3069b0e04-53877565047mr1095613e87.59.1727258662659; Wed, 25 Sep 2024 03:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258662; cv=none; d=google.com; s=arc-20240605; b=U5cc4s7SamGgdzSUidDv5qIJ/Md6Csvv60W76AgDfVAWNM94M+QQZ4FUkuwaH4A/R1 SmfKfdL+2V4kZevladoJltb8/cq5H1bJa6VsKDd9VQ0V7O2AM1n5+0gpV33PmT2W3qWO +rGQSTB0w9rKPzzyulsPt/A/e6EE4O3Wd6URtEPFM3BYXG7md/AB4NYDdcdc6jz+IKh5 FP/5yIjRzRbWt4cGdSIb5PjM1RGNW7Rf8K84O/Y2DLgb9WnI3/KzrT8ya1edDQhLbInC yINa5iiYZDiRaNWZ6q5lbuq6rspT5QN+4GrL0omrd7V9qEGVxxKwZm68YcWFd+QlHgoU yZMA== 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=oe7yrRkZTMOjuKBFfLjQphw/ZhYjrgW+RfeMFqXnDOk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=QzXKGpkoKDMdGmC7kHVv0sJmNjBVsDvCRw+IO2l8K18PRncI+QstXUnHakctO3iesF kdkEBKKckC0y9JC+SLjtqXGV5fB7Ip1mb6QFxqW6RxbcAnvTYqVUgg8Wq8fRSwB43hDP kbdNXBFXsT5gm2DvCkZMPY3a39QwDepYYHJEh0KQY+BI2qYdp/1Xfha7nEYtj5y4uyu3 A4T1ZcpYaABvV0x80z5zwMCHhnPRtg1x99oY9cio5BrSK/1uCoBfHMNlqWEihWPRA+A1 y5/21hF3v9FbMPzn9WsKXkayYVis6U8+44NyOZME8820nI4nAgpi6elgO1t5i2yntNyL gzxw==; 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=e2hRB6hz; 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-a93931153f7si224507266b.836.2024.09.25.03.04.22; Wed, 25 Sep 2024 03:04:22 -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=e2hRB6hz; 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 6FADD68DAF3; Wed, 25 Sep 2024 12:39:54 +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 0762F68DA2B for ; Wed, 25 Sep 2024 12:39:43 +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=e2hRB6hz; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id A20E44E0B for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Fzl-HhdZzmsY 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=l9m4X1NhIRcJgaMUrdTa7ERMDl7Vz6fqPY9m/btF4/4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e2hRB6hzOZX/dyLwoI6dsOGtV7HWRqUYn3V9aDZMEGmIuXX3zOfdXyReuW99hPRaO OtX87WON77DGR2lrnd8A3U7C7vOwAxDVEaBcdxbnB2pYtlWp5p2XRQzzgkk0tHyqvc s6907cn3O+wlA/Ta3m6pvcpvHZ+L6W//ZNrFKZmF6Qvj5Od0U46oQpl3zZ3rrmphor G2Jnqnv+SiEruSlYvk6b2UGRVnOfq4Ca4hf2OtZTQLQRY4mzZn70FDbqOVum1dHq2p tFivxi/tV4jLa9gIj9fswXSRUZ/0Z6KYRDqoJXAUOMAY4JcQvpEOMvEFWAHLxuW8TL VWIuWsI8DryDg== 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 23AC94E09 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 D868A3A0F02 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:01 +0200 Message-ID: <20240925093919.22929-4-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 04/22] lavfi/asrc_anullsrc: 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: mYzip3Tnbc9V Also, drop a redundant call that also happens implicitly in generic code. --- libavfilter/asrc_anullsrc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c index 3249cc33ad..d8fd5e7c06 100644 --- a/libavfilter/asrc_anullsrc.c +++ b/libavfilter/asrc_anullsrc.c @@ -61,18 +61,20 @@ static const AVOption anullsrc_options[]= { AVFILTER_DEFINE_CLASS(anullsrc); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ANullContext *null = ctx->priv; + const ANullContext *null = ctx->priv; const AVChannelLayout chlayouts[] = { null->ch_layout, { 0 } }; int sample_rates[] = { null->sample_rate, -1 }; int ret; - if ((ret = ff_set_common_formats (ctx, ff_all_formats (AVMEDIA_TYPE_AUDIO))) < 0 || - (ret = ff_set_common_samplerates_from_list(ctx, sample_rates)) < 0) + ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); + if (ret < 0) return ret; - return ff_set_common_channel_layouts_from_list(ctx, chlayouts); + return ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, chlayouts); } static av_cold int config_props(AVFilterLink *outlink) @@ -124,7 +126,7 @@ const AVFilter ff_asrc_anullsrc = { .priv_size = sizeof(ANullContext), .inputs = NULL, FILTER_OUTPUTS(avfilter_asrc_anullsrc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .activate = activate, .priv_class = &anullsrc_class, }; From patchwork Wed Sep 25 09:39:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51820 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp335445vqk; Wed, 25 Sep 2024 02:40:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUQ1RdJIQDqQDto28fIsMT3PbFcurgEZ0LJowqhNmS29l1IIYr9Lv0xXVvk5nYh0Z8G5KAIPifYn0unTUHgJuzy@gmail.com X-Google-Smtp-Source: AGHT+IEaiKLYYRCrVQmgjHK91/QELcnWFCyKMX0DMUQepOAzf8LtB7GamfWacHPwTX0r0PofGHhi X-Received: by 2002:a2e:b8d4:0:b0:2f7:7be8:fd89 with SMTP id 38308e7fff4ca-2f915fc08b3mr20935791fa.6.1727257256347; Wed, 25 Sep 2024 02:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257256; cv=none; d=google.com; s=arc-20240605; b=CMtXRcp9WnOSBIlYKIlBELf1/VydH/q8cVKJ0YDwizuRNIaKug6eXqZbB1HQ0HW/FZ b8BvzkxTLz0eakSHRYGux2BN9rK5ifd6meQuXbosZBXI8Z8YK6RKBbHfSZZpvEN94Xwx O2lQ82RY6y1TxARXop91YZkm/MljcbuoLEmHtkyylvRFoR4cQdXxUvyZD5WOBaKB8X+r Tq9LuIAvLwvRQIyQR7mx1EVcPFe7tYgwU1SrAnasFAZrHtaiHuCn1p8hCNUvOtDV7FXM KWB9DS2KztQyVujbm12AoKAC7LPjlOyT8n+QG74GYbpjyjpHanVvlZ5wK90v6cXffPBr iNPg== 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=lavT3h40Ifn6N3MthqI7S6C2kETlCtpbQPAfGyLVaj0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=M9leHzQqTVPU4MU/G7wBVNbAlBwZqALg2qrhRjkjVLVkxhUrjiLy+hg9R3yecyCDbs KwflCvoqhRWXXPQwzXfmDqf9/UDvHPkadpJ2WoKW0wOZKIdU7DTVYkzhxCPry7E2c3ZA c3diL5lyqk8Jyc5gp/7HrqwcsrNqMgyaBHuwd4B2/nBczLqkaj/CmR73V3d0SyQWU9Qa lUMIyIVGp/7a22hunE+L0m9Fl8MK+I/YCcnwOWdby7lTHOnkL5NR7kY6IftWdMCjLGOX kVys040tpKtrONXZJ6gADmEosDetyv4cGExXfBLQlD/PmigjRb8F4SJO00Il+IMkEnnY 06XA==; 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="d1D/6KeZ"; 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 38308e7fff4ca-2f8d288dc9esi9539181fa.229.2024.09.25.02.40.55; Wed, 25 Sep 2024 02:40:56 -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="d1D/6KeZ"; 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 8210768DBB5; Wed, 25 Sep 2024 12:39:55 +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 1F05668DA58 for ; Wed, 25 Sep 2024 12:39:48 +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=d1D/6KeZ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D15594E19 for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Gqq9IvNhXDSg for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=1zJIiIPNnKVa14AXAVHbQ78y3/ZufULDqQQutSW8BdM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d1D/6KeZPqHM4TCEs0PxQoYLAtgR4vAFAesiFrr/CyVensEhbM35NcKm8KfWTIYyx 4cAIWaJhGkEKxzxQQzLWCEpeSKJvpV1QYqJIOUYt7zrmWTl8ZeJxM28g1beyW9Yhws JJr/84Uyg/hDfYG9Z9GEiAjTbPI6MJQx5vcp3zdYKNtbDjBtGpCctMCIFzx0gu6CCi jQyXS/zPVoCnU17tgIa9sonOIn5eqMaTRqnimvxW/E5sE/P3iGPnug72iMXexlnGIc +ZXdHAWJss+6PfCosopLWDdWUVwRfEPzmKMDfH/IYL+eTyOZnaStx01ZrOZcP3j4LK WbNOGLAyLhfuw== 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 2C89E4E0A 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 E42763A0F41 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:02 +0200 Message-ID: <20240925093919.22929-5-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 05/22] lavfi/asrc_flite: 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: mXbK90crbfU8 --- libavfilter/asrc_flite.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/libavfilter/asrc_flite.c b/libavfilter/asrc_flite.c index 5962bf55bb..1bbd329177 100644 --- a/libavfilter/asrc_flite.c +++ b/libavfilter/asrc_flite.c @@ -255,24 +255,35 @@ static av_cold void uninit(AVFilterContext *ctx) av_audio_fifo_free(flite->fifo); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - FliteContext *flite = ctx->priv; + const FliteContext *flite = ctx->priv; + + static const enum AVSampleFormat formats[] = { + AV_SAMPLE_FMT_S16, + AV_SAMPLE_FMT_NONE, + }; + int sample_rates[] = { flite->sample_rate, -1 }; + AVChannelLayout layouts[2] = { + { .nb_channels = 0 }, + }; + int ret; - AVFilterChannelLayouts *chlayouts = NULL; - AVFilterFormats *sample_formats = NULL; - AVFilterFormats *sample_rates = NULL; - AVChannelLayout chlayout = { 0 }; + av_channel_layout_default(&layouts[0], flite->nb_channels); - av_channel_layout_default(&chlayout, flite->nb_channels); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + if (ret < 0) + return ret; - if ((ret = ff_add_channel_layout (&chlayouts , &chlayout )) < 0 || - (ret = ff_set_common_channel_layouts (ctx , chlayouts )) < 0 || - (ret = ff_add_format (&sample_formats, AV_SAMPLE_FMT_S16 )) < 0 || - (ret = ff_set_common_formats (ctx , sample_formats )) < 0 || - (ret = ff_add_format (&sample_rates , flite->sample_rate )) < 0 || - (ret = ff_set_common_samplerates (ctx , sample_rates )) < 0) + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); + if (ret < 0) + return ret; + + ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); + if (ret < 0) return ret; return 0; @@ -348,6 +359,6 @@ const AVFilter ff_asrc_flite = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(flite_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &flite_class, }; From patchwork Wed Sep 25 09:39:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51818 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp335205vqk; Wed, 25 Sep 2024 02:40:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSLC8mbXQgjkMlzw7yz/dj2kD9fQggPqgYuxY+HfeuWkNKPH246gQHpuZmdjZ+lhurkVGqPayb6vBAJ/bNqox2@gmail.com X-Google-Smtp-Source: AGHT+IFZ8ZqoOc1u64qeZXfSan0qHNZfAhr+Nrk+bb2pgiRScD73M45NMOtDi+wSUHqAp3pUX40U X-Received: by 2002:a2e:4c0a:0:b0:2f3:f7cf:2f01 with SMTP id 38308e7fff4ca-2f91ca999aemr9450651fa.41.1727257223950; Wed, 25 Sep 2024 02:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257223; cv=none; d=google.com; s=arc-20240605; b=CJlYLLRJx6zErCk1tuLndi4qM9K9VDsxv+lRnyRICPJOu0hG0iUE3sFs8dtqsMwFs2 yp2x+shUfGyjMHNOqnZDcMUSL9zXqrE2cHS1hIvwLwtvU4jj2P8NHQPGfhLGJ1PN4sw2 A2SuBiBSVfS60dF946tx9Trq9BlslJoa/BlEINK/Y4AcKGDpAK3igEJcJhpoHMCa41Uh r+9troG+5gnhRuWP/KHT08GKxjBrSyO77n06qSZoiX69eXyKJdGClo/KRAK8NbkuVueU ZU/C5SHrhSWkgvexSVe+a322rTkwAao1kqebJb+tluU8PHu+JiqX+KkKy+NAxWKyqUYi Nm0w== 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=oeMbuA9m0rs/dZNa5R1DlSbpAufZXab7FwXeUL969pY=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=bPgx7qldk3fd/0HuSsbOqJnCtKh1HDJ74A3nxikfzUkZBxylcYBoyKBkB9+fPO27bp 63SLjBO/5/i2P+Sw1F5hbJq/i7yiU9pw8szVTh4IQkPVwMjpH3dOnWNeM8JF/dG989YO bzyYVNJBFdf9UltfjZFsd0Q+T1jOFe0KP8AufikbLKsBFwqK+6Lzl5TwXGntakZ5UsgW 4LVCL4C+ub0TZmuIqN/Z1lP/CdWsVaIXR1RxyqDym1ZFluj/6zl8IvDg4BZaCBVA328S ihaZbVM/aUoB7NVwPM6TfccIh1fLYHRBNqkm9uyxdP+7cDIwQjxe/Z6Qy3GOQevCnP9w gUBA==; 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=pkSIlye6; 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 38308e7fff4ca-2f8d28c468csi10329581fa.632.2024.09.25.02.40.23; Wed, 25 Sep 2024 02:40:23 -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=pkSIlye6; 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 2F2A468DAE4; Wed, 25 Sep 2024 12:39:52 +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 E0E7F68DA44 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=pkSIlye6; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 872814E08 for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id nYiKzGkP-dag for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=IGauJsFsdESnCQIptx8xFhv3vggm4mcGPHQPbNQ1KRU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pkSIlye6PKFNOm2sbxUlkF1JuswX6JcTid1itDjxKdKLOBT1cCHslJnP73Xe6XQCd D+hYn4sbMaH89Lq0deTuIgQBu7v5KwWuyOJvR5qYqlVgXaQOILXfMoA9NxJ1UNXU4E XJu8i/eDEhQmOHEKhlpucx1Ix2xGFtE8GX5oyhwUcmGRyJhvw47i7PX4OIbRTRZ58r IRkaYUtKWhmjEQZWoRFtAnI0MzpwYayvMxIoA8PVnC+aG87E+m2F76PvYV2rUFnnSy rnhg5dAy9ytOr+G3v0F/CcnQntqr6ZkK2Rs7oaaX6OMVrgZ5d4yKIWnxPP4cck2gVr Wz/WzL1lsjZog== 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 3DB1C4E0B 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 EF8433A0F6F 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:03 +0200 Message-ID: <20240925093919.22929-6-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 06/22] lavfi/asrc_hilbert: 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: si+3B+JO+jFG --- libavfilter/asrc_hilbert.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libavfilter/asrc_hilbert.c b/libavfilter/asrc_hilbert.c index e38af7123b..3cf5e8728e 100644 --- a/libavfilter/asrc_hilbert.c +++ b/libavfilter/asrc_hilbert.c @@ -75,7 +75,9 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->taps); } -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { HilbertContext *s = ctx->priv; static const AVChannelLayout chlayouts[] = { AV_CHANNEL_LAYOUT_MONO, { 0 } }; @@ -84,15 +86,15 @@ static av_cold int query_formats(AVFilterContext *ctx) 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 av_cold int config_props(AVFilterLink *outlink) @@ -168,6 +170,6 @@ const AVFilter ff_asrc_hilbert = { .priv_size = sizeof(HilbertContext), .inputs = NULL, FILTER_OUTPUTS(hilbert_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &hilbert_class, }; From patchwork Wed Sep 25 09:39:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51823 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp338976vqk; Wed, 25 Sep 2024 02:49:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhALIOVNQzrdRNXopuTMOm4FYiWNmNnNb0x/OAJ+B2QnEOwCVDIebHUdpfuqfJMiGwr4uT3EWHuhhHQ3rHRjRV@gmail.com X-Google-Smtp-Source: AGHT+IHOoYQ3dVLE6UJSd7JujAHCv7LiyWU1TahQBGUHiZnuwv9cKcoERPwIv5TKVqEjZk/CN4Rb X-Received: by 2002:a05:6512:1383:b0:530:ab86:1e with SMTP id 2adb3069b0e04-5387048b8d3mr1379332e87.6.1727257761701; Wed, 25 Sep 2024 02:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257761; cv=none; d=google.com; s=arc-20240605; b=hEqd0OYQRaox09oPCkuohqnzeeLJrJnAIBgfC2nWqVU/NEHmm5kbPhSmfOTC6iFAyd mYv/POcBJ2idZEUOMmeaS5As8OWacbHzqsL+vUPcaoWkb/9nZuZf5UvJcQb1qCpou0sp fwFDNZazTjafIf7AJJs0IP3Jg/focoD9/n7xNVOkyFIq9PfXUhpFy/Bn8CvZMpGVV2UW srv6gyQnD7qwBfurLwkY1uxKoC4XG8gJe+cjCvCFCL2fYvG/UBsGdm0g+CKoMlS48Yy2 n8pQoxXrVzPOvMKmMqTprGVEVU1itQYxZa1F3mFs+azWIgtvjxx3LXNW8iGk9txE6PZq netQ== 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=2+m2ncZyJpIkVfZevIPFWLUySk3fxoGOsLcyIzkKS2Y=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=GW/9DZpBJoA9eB0c4lqiOW8o7e5OEljswqbVtodNUPDWWkKOifrRIrtSPo3xyvzOFj KbbVcIBMbjwQgYlA/uijsakR7h/yW2sSk7fUODJydcv5ZRUaHWEZtc9/Dnq1WVl/4Qet gAFORNvTljKkr+HMTma1iC9lMtR1dImr16qv+Cuuq8Gch889P0jTNcy1LFGb/r/+yMuQ GSrIPchc1JwGh8ZBSerXBAB+zR48vMMzVLNpeWytD6OogNhppxpx/LUyvK1T8IIphraf tZekdi63TI9UrhcweQZf4LwxxCfDj+OIiSU2mgFNebfIpwtxpzHAM8+T9t6JI/ZZI4XC e8UQ==; 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="ga9h/+Td"; 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 4fb4d7f45d1cf-5c5cf4e59a6si2274366a12.672.2024.09.25.02.49.21; Wed, 25 Sep 2024 02:49:21 -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="ga9h/+Td"; 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 95D1568DC34; Wed, 25 Sep 2024 12:39:58 +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 1EC9568DA56 for ; Wed, 25 Sep 2024 12:39:48 +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=ga9h/+Td; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 20BDA4E09 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 8QXQ_eXfJRmI for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=QIGhG8eeJFBbkKzj5j3S/VpBYAVZEvcUbkl//Zu6XYc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ga9h/+Td/hivdq7M7XXsJdPEPG7Kuw1GIMqo/Uy+ycjJDlP+Xvc1rIPv1ICgpnduX 48zdJC+6jEnbIaD1VATJ/WNJ8AEieoX+NMRywV+1ED/QtlgqFn2BBcu60Wcsx4TDi3 zF+wrf+xok2uLPShW6sCvJfl8MpCO+uW4Zx3ZJJaKYCzT+kUSfdvcpYkBswpDpxrjG ccRpD+EZjwcyfzETPsCf1H5DztXjRgXOIinLr/aJRJtuXdSeoNn7Q8T89E3WKxpc0i Vpj53YOQPs3xkmUcTzM92Qbqu3JKG4aqkcONdHzsMS5nufT281Q2IdZya/QAE+HSC5 AS7is5hQNCO9w== 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 44E7A4E11 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 0611D3A164C for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:04 +0200 Message-ID: <20240925093919.22929-7-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 07/22] lavfi/asrc_sinc: 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: Xf5FrXpak7x/ --- libavfilter/asrc_sinc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c index 94046f76b9..22b031a60d 100644 --- a/libavfilter/asrc_sinc.c +++ b/libavfilter/asrc_sinc.c @@ -74,22 +74,24 @@ static int activate(AVFilterContext *ctx) return ff_filter_frame(outlink, frame); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - SincContext *s = ctx->priv; + const SincContext *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 float *make_lpf(int num_taps, float Fc, float beta, float rho, @@ -428,5 +430,5 @@ const AVFilter ff_asrc_sinc = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(sinc_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; From patchwork Wed Sep 25 09:39:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51821 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp354577vqk; Wed, 25 Sep 2024 03:19:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWJWm5iJAR1ZgFr6Jv54z5jJ4aaY0FwpYnI3mn3G/oxfeNPFKfm7w0tP5IrTK6xjtAXEXxJbZBFeNbTP244zIeA@gmail.com X-Google-Smtp-Source: AGHT+IEfei7DgTMMbGyevGpmbrK93RlHaIGtnQAx97u9cOmnp2p6V2pec+VBGGsKFew5TGzhqCrY X-Received: by 2002:a05:6512:e9a:b0:52c:e086:7953 with SMTP id 2adb3069b0e04-5387048ab5emr1256408e87.4.1727259558599; Wed, 25 Sep 2024 03:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727259558; cv=none; d=google.com; s=arc-20240605; b=HTaWsbYuiMIpsn1W421zTbdCJbQjImlJtAkwF7i8aOiWJ8Q8a818NL6tghnAqywlY3 z+BEf6OZqONMutm3jVJFemQpL7iFiUQiMFSyvRZQUIGKS1nu2Ly/ysNX8h5gndsHI54p 3F8LRNnOdD+Qe6E+24pVf13GAr6uDBb7akwtcJSo3Q2aopw+pSGESTu85V6Z242W54Mn 7KzdOHjulie5CtH0RseFEsTYvJk+UjZlTu5wLiqooUeXRWozagNg8jGxOnr11xkvkvQ6 uo2hdr2TyP/hc/nk6noZWjFqR/Ky4Dah5Xixzm5Yq7jkU0TqoUN2E+KRK/HNkXgDLRvb vHFA== 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=tYfdTAxQt3luInurgZZwnn8cNzvXgRvuWdjmcl6WM0o=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=gEsudKhNlpuUPVGfCUFiKHERRZ8yP7IL8kZP/uCyE1FFEXwQjm4sJf49os3lH40MN9 QoEKI8peh4lF0J3Bs5JvH/8FEtzhhNN3oYVsDPiV4+TdE5JC1FUupwvtEYQn9O/UfXwh u0lvlkTBfohn5yKxEmqtyC5tyPrxGi2KjMC78c+k2Gn7bmJQLSqLHde8rURg1IhzLxRz aF8T/zOpZqLdXkWMLlYqdnHNo+GgISfXqafexqpEH9QGBWlKLkDTy/Zh9y58413O9s62 K5MdujhhZH2ZUWydKOdte3NdsxuanXPYp0kgh/1nWhQ4IUinekXYD/oDp/nCVQjKJbyr eJ6g==; 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=JSno0udE; 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 4fb4d7f45d1cf-5c5cf4dc810si2172750a12.490.2024.09.25.03.19.17; Wed, 25 Sep 2024 03:19:18 -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=JSno0udE; 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 555AF68DA4D; Wed, 25 Sep 2024 12:40:07 +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 4CEA168DB1B for ; Wed, 25 Sep 2024 12:39:48 +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=JSno0udE; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 96AFB4E12 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id GaELdMOSNzYN for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=rLSEeJlJi1+cWYZxB/CvsdMU6QkX0p3JBiwpO2QW1Vk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JSno0udEe3Bob66E5AySYLO+Oi4Z+JgN8W+oPgwbAzFx2wehfi0Wl+84ZrUSHq/do L1CKZyYTg88dIA8ZXY3I/QEMW/JU2cTYZ5I/WDAqoxmHxT+mfDcDb8SgUrGKEo2oBv wu6K/GLLNSiW76dHH+WNHrOjzWflt2t0VfqLRDFo0v/oDEyb6vi6Ux+QXm4C5sAfs1 IM6JrlN140NQurAEMlIE8pLaRldUNy/nRGmQlxqepbc5TogHc2D+oMA0BWf+BpXnH+ HSBL9/oKvQfUZFC/eEbBOY9K88n//Ic8IY3Qwc4DYhWr8wPLiCGOaiSZSDl/jtwg7I Y+mvizyfXFSLQ== 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 44B3D4E0C 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 112CC3A17BA for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:05 +0200 Message-ID: <20240925093919.22929-8-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 08/22] lavfi/asrc_sine: 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: x+0kH0ByWWRb --- libavfilter/asrc_sine.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index 2e444ba196..96b603dd26 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -178,22 +178,24 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&sine->sin); } -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - SineContext *sine = ctx->priv; + const SineContext *sine = ctx->priv; static const AVChannelLayout chlayouts[] = { AV_CHANNEL_LAYOUT_MONO, { 0 } }; int sample_rates[] = { sine->sample_rate, -1 }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, 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 av_cold int config_props(AVFilterLink *outlink) @@ -271,6 +273,6 @@ const AVFilter ff_asrc_sine = { .priv_size = sizeof(SineContext), .inputs = NULL, FILTER_OUTPUTS(sine_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &sine_class, }; From patchwork Wed Sep 25 09:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51839 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp388523vqk; Wed, 25 Sep 2024 04:24:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQl/xDkoPGNZOfgSHtNoHI31FS5xUENDyn1kJzRBSxJBYP6QM8W5vv9M/0NqCYZsmUH5GauUKNIRsu54NsRC39@gmail.com X-Google-Smtp-Source: AGHT+IHQjGgrVODOogiZkMovMWMv8n3Zdx/caQuaOY2pm8qR97/JsOC4wPADp8dgZywYVIOjfLnT X-Received: by 2002:a05:6512:1283:b0:52c:ccb3:71f7 with SMTP id 2adb3069b0e04-5385117dbe5mr912701e87.9.1727263460720; Wed, 25 Sep 2024 04:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727263460; cv=none; d=google.com; s=arc-20240605; b=ZwShBzm2iaqiEapgRh5dOjdWSE43ZfryhkcIFdSiqRGwBmhN7j/YdX34WIEz3rz2Tf K0XS/8MBkGy34NvLzHPV40XB4jIIVhCdDFwn1Jwqtkd1CiIcaF+7MOYEMtOOw33mtD65 StKIvI+qYQ5NUqObziWy7qAdphKXOclj1xjkSlPWXRT911FglxOup8zzE6lEnF5/X9lt TbHPLoWyEhDZjPq1jsRmQG0XdZg5au5NUNFCHbIN8gHhkAyJpkR+6AO0l5gOX3e/x2Me PZf7OT3T+BTydJoX/YiURwVbQKag/7molRjP5Iapt1dUE512N8vmSk6VEZoBVyE+ae5A 67CA== 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=GnFHqV7TyC8RwumG5VX+Op5q5JvdpqsUiikEqbXEF08=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=UNv0XLCJQTHCVXIv6uLnsfFDccloMZyY+7pIyT9K26hFAB5Kqivcqi5aOGy7pwi1oG RQjzInzJ9howFJvBvKoeh83h/idQTaqTVJAJ7kUPrSuJ3ZjHmTGz8gouvrHWiAockvhx k2QHJHIE2y2ROXGTqq4C7GZm06lEBh29jpRxckLSKuiPXhxhrxlNH4LlkTlLbHHLmkQk qf/RvX73EqmjTrZqBivGwQysmeFp75S/I4MZC5XpSgvTu32+MwNeEex2jGXZ5jsiF6mm f2tK5/H7zhbJse7BENGyHHEl8KjmLUcs0IsJ7l7+3DnYa4lg6WiM5DPdGWq0NS8ZGMxQ hcAg==; 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=AueTPYZa; 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 2adb3069b0e04-537a8646249si1063055e87.338.2024.09.25.04.24.20; Wed, 25 Sep 2024 04:24:20 -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=AueTPYZa; 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 6BADC68DB45; Wed, 25 Sep 2024 12:40:02 +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 55C2A68DB63 for ; Wed, 25 Sep 2024 12:39:48 +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=AueTPYZa; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id DA6224E14 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id TvTaUTITd9zt for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=3tzPvvjNTjGuEbwvRTC9VXru7HRs8m6jk+5WFZkjFbU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AueTPYZaSrDftNPMLOi+BMrXYp3gglWxZfzljTcGkdgC08Zs9aqs2IczfVAi56F0N M/xGgjCUgRlRJu22kGnUWDvupJPYr0AKZ7ZCfGvOje3LTWFctwq+6DiXDDIRB0XDQ9 tFAwkORKBT0rHmr8ZVPwpqwFWe1ZZ+skrI5t6TGeTT6Vd73UJ7f+2aOiRPohS1+lxV Y8VImTbaT+hNbnSrUyrS+SDrgYHrDs4uGf94FEE0w/GT0QUZgF+An0vhxjCeejOJUG HxPLYl8dhr2k24a2sdMBcdQBsx9IXLyL6bW9sVsZVNfS+9OXVdGRhwCPUyGprViy0I aWFcw3ygP5Xew== 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 44C504E0F 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 1CE753A19A6 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:06 +0200 Message-ID: <20240925093919.22929-9-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 09/22] lavfi/*_vaapi: switch 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: q4+uGjI1FXgp Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/vaapi_vpp.c | 17 ++++++----------- libavfilter/vaapi_vpp.h | 4 +++- libavfilter/vf_deinterlace_vaapi.c | 2 +- libavfilter/vf_drawbox_vaapi.c | 2 +- libavfilter/vf_misc_vaapi.c | 4 ++-- libavfilter/vf_pad_vaapi.c | 2 +- libavfilter/vf_procamp_vaapi.c | 2 +- libavfilter/vf_scale_vaapi.c | 2 +- libavfilter/vf_tonemap_vaapi.c | 2 +- libavfilter/vf_transpose_vaapi.c | 2 +- 10 files changed, 18 insertions(+), 21 deletions(-) diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c index 0179977af4..9be076fadb 100644 --- a/libavfilter/vaapi_vpp.c +++ b/libavfilter/vaapi_vpp.c @@ -26,22 +26,17 @@ #include "formats.h" #include "vaapi_vpp.h" -int ff_vaapi_vpp_query_formats(AVFilterContext *avctx) +int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - enum AVPixelFormat pix_fmts[] = { + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }; int err; - if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), - &avctx->inputs[0]->outcfg.formats)) < 0) - return err; - if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), - &avctx->outputs[0]->incfg.formats)) < 0) - return err; - - if ((err = ff_set_common_all_color_spaces(avctx)) < 0 || - (err = ff_set_common_all_color_ranges(avctx)) < 0) + err = ff_set_common_formats_from_list2(avctx, cfg_in, cfg_out, pix_fmts); + if (err < 0) return err; return 0; diff --git a/libavfilter/vaapi_vpp.h b/libavfilter/vaapi_vpp.h index 6764ab0c39..0919fbbce3 100644 --- a/libavfilter/vaapi_vpp.h +++ b/libavfilter/vaapi_vpp.h @@ -67,7 +67,9 @@ void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx); void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx); -int ff_vaapi_vpp_query_formats(AVFilterContext *avctx); +int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out); void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx); diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c index 0478d6daef..35e68d6e17 100644 --- a/libavfilter/vf_deinterlace_vaapi.c +++ b/libavfilter/vf_deinterlace_vaapi.c @@ -425,7 +425,7 @@ const AVFilter ff_vf_deinterlace_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(deint_vaapi_inputs), FILTER_OUTPUTS(deint_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &deint_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_drawbox_vaapi.c b/libavfilter/vf_drawbox_vaapi.c index 5b4f23066f..aa18f2fd39 100644 --- a/libavfilter/vf_drawbox_vaapi.c +++ b/libavfilter/vf_drawbox_vaapi.c @@ -364,6 +364,6 @@ const AVFilter ff_vf_drawbox_vaapi = { .uninit = &drawbox_vaapi_uninit, FILTER_INPUTS(drawbox_vaapi_inputs), FILTER_OUTPUTS(drawbox_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_misc_vaapi.c b/libavfilter/vf_misc_vaapi.c index 3717a21930..981fcc878d 100644 --- a/libavfilter/vf_misc_vaapi.c +++ b/libavfilter/vf_misc_vaapi.c @@ -249,7 +249,7 @@ const AVFilter ff_vf_denoise_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(misc_vaapi_inputs), FILTER_OUTPUTS(misc_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &denoise_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; @@ -262,7 +262,7 @@ const AVFilter ff_vf_sharpness_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(misc_vaapi_inputs), FILTER_OUTPUTS(misc_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &sharpness_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_pad_vaapi.c b/libavfilter/vf_pad_vaapi.c index f45e503141..478b89d117 100644 --- a/libavfilter/vf_pad_vaapi.c +++ b/libavfilter/vf_pad_vaapi.c @@ -278,6 +278,6 @@ const AVFilter ff_vf_pad_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(pad_vaapi_inputs), FILTER_OUTPUTS(pad_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_procamp_vaapi.c b/libavfilter/vf_procamp_vaapi.c index be3cdae8bb..a9e589f1b6 100644 --- a/libavfilter/vf_procamp_vaapi.c +++ b/libavfilter/vf_procamp_vaapi.c @@ -247,7 +247,7 @@ const AVFilter ff_vf_procamp_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(procamp_vaapi_inputs), FILTER_OUTPUTS(procamp_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &procamp_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c index 41f119bb55..65db05c23d 100644 --- a/libavfilter/vf_scale_vaapi.c +++ b/libavfilter/vf_scale_vaapi.c @@ -299,7 +299,7 @@ const AVFilter ff_vf_scale_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(scale_vaapi_inputs), FILTER_OUTPUTS(scale_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &scale_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_tonemap_vaapi.c b/libavfilter/vf_tonemap_vaapi.c index b1cc03709a..62e251224c 100644 --- a/libavfilter/vf_tonemap_vaapi.c +++ b/libavfilter/vf_tonemap_vaapi.c @@ -567,7 +567,7 @@ const AVFilter ff_vf_tonemap_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(tonemap_vaapi_inputs), FILTER_OUTPUTS(tonemap_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &tonemap_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff --git a/libavfilter/vf_transpose_vaapi.c b/libavfilter/vf_transpose_vaapi.c index 4976958be1..d49c44b9d1 100644 --- a/libavfilter/vf_transpose_vaapi.c +++ b/libavfilter/vf_transpose_vaapi.c @@ -280,7 +280,7 @@ const AVFilter ff_vf_transpose_vaapi = { .uninit = &ff_vaapi_vpp_ctx_uninit, FILTER_INPUTS(transpose_vaapi_inputs), FILTER_OUTPUTS(transpose_vaapi_outputs), - FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats), + FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats), .priv_class = &transpose_vaapi_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; From patchwork Wed Sep 25 09:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51837 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp359039vqk; Wed, 25 Sep 2024 03:29:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWS8tM20Y47x4sWRmME6WSGGL7U2esMh6uuDIWJv1IPanS3fuQQNY2X7woiUWa6FAvAsV4UxJP2IWsB0UtFkt84@gmail.com X-Google-Smtp-Source: AGHT+IHQLZgtU+FUN6JIiZ0sE6C7uiEVYSMe/R5xAUC3fsAh82cpEfVIR1OwtEAhnxtqWcEKhKGH X-Received: by 2002:a05:6512:b03:b0:52c:9383:4c16 with SMTP id 2adb3069b0e04-538704986bamr1245029e87.22.1727260161979; Wed, 25 Sep 2024 03:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727260161; cv=none; d=google.com; s=arc-20240605; b=OVhdP+3xbWMNQn5j4pkLapm2stey2D+mBFfQARTw96ys3HAed47/9OK1kkUlWwTdwX AxlzcA9oH9QSH3HjJXE9X1zn042elgcA8FGCoYu5XZ0Aj13bB1OYqaOssf7p8FDLkkM0 xDBtE/jlqckPeEAwjj0yYF0kvx1OJ6tS4DkKGSML21mokvIuesEx0BYIjea3/CBD4Wqo mdZrESgaUZgxQW31ZDbzRtSq+JTp7PcgMVRHDxN0g0Qci+J9Ztrrh3hmpUsc3cRBKO45 fsy/+N3zLHFi8ZFhXUSyKN248uHVZ7qowUGm49V8skGrOy90L2lbO7kWpbPj8EdFYQ74 8ooQ== 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=vVyA3e5FJmqCK3JxZI6/WBvV32q2cPsg50B2v1wNK2g=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=LyHh+LKgxyMIungzP2LiT2+dO/Old2BqsPYN8to/XYiGK27F3MJBGqHUb+UXUUgTYR UmssiuboPIiXV8J7u1g3j8P1p3G/aszhOQWYn1p4vol6+gaDtsWzR+3cXAzZDyTtXpkA YfQ2Ni4OcV3Th51QZnWSusvXnwG+Q2zlKpt0pmUTyTYRZaL1wa8lJZ7QssyY1rJ7D9mA dfBEfDNEWu0lKxS78JIsfSCcb7pH0LFYe6r+34j5SDUZ+JRI/UN43+FLIeHwZ7dwaj58 1LJvepceWDj2Jkwiwr7EbJvZrsJnNSDb5pZ27VF8AdR+v9yOy9u7XL1LXyv7KpE5WTPC tbpw==; 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=DIoB27Oe; 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-a93930be2d7si233302266b.397.2024.09.25.03.29.21; Wed, 25 Sep 2024 03:29:21 -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=DIoB27Oe; 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 888D768DCA3; Wed, 25 Sep 2024 12:40:12 +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 8350F68DB05 for ; Wed, 25 Sep 2024 12:39:48 +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=DIoB27Oe; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D9D6C4E1E for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id iAXZzn6jhfyb for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=3byktY4JXMSlpJR6Uisgr3UJ+5cwNjLRJCNdDwc6byM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DIoB27Oe1BTjlXKcpreqXdPV4TXBUzyg8RrbfPcMJHxFvO58yuPtOKofYYDUCPTZK CIL2SDYF7gMluk5Z4kJzCUv46bBLazh9zlVSlnhVxdezekds2LT69sys+gqwm7w8gG d5aMJUPDQiPO9gnjl40mzF4t0AA7jDrUnJZ+ZBHS872candnGbJKPvdyv4nO60E7jG F0lCosF4it823p8kU1PVqos8S+Fxhqk7NutikOW20dr1iLcyaW+zlaKQvDsjyDy3Of azJ4xd8UWhjWb/P3K8QjOyP9pbWmQwPE5KvC+wIIW6gVr37d1H6tkdOC2ChnUxZd1l uE1a2OEzNy0XQ== 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 A66454E29 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 289CF3A19EA for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:07 +0200 Message-ID: <20240925093919.22929-10-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 10/22] lavfi/avf_a3dscope: switch 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: OyssnCjzaWgZ Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_a3dscope.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavfilter/avf_a3dscope.c b/libavfilter/avf_a3dscope.c index dd08990512..18f647e8a6 100644 --- a/libavfilter/avf_a3dscope.c +++ b/libavfilter/avf_a3dscope.c @@ -73,30 +73,21 @@ static const AVOption a3dscope_options[] = { AVFILTER_DEFINE_CLASS(a3dscope); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -352,7 +343,7 @@ const AVFilter ff_avf_a3dscope = { .activate = activate, FILTER_INPUTS(audio3dscope_inputs), FILTER_OUTPUTS(audio3dscope_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &a3dscope_class, .process_command = ff_filter_process_command, }; From patchwork Wed Sep 25 09:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51835 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp359012vqk; Wed, 25 Sep 2024 03:29:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUgy3J58JkYNciTy/O+ae4SeoyskYMfsWC8FcQw8S2xRbNdkNCu5D+IxVnMex83YsAhhn7B+OLh8WuyFNRgZ8oW@gmail.com X-Google-Smtp-Source: AGHT+IHv2wPTsPCKfhNhTo6FZiacOedPs6DQTTANJHHASfoYufyTymj/ts3u7pFwFtAlsBTjPNkQ X-Received: by 2002:a05:6512:239a:b0:52f:df:db40 with SMTP id 2adb3069b0e04-53877566141mr1437861e87.56.1727260158107; Wed, 25 Sep 2024 03:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727260158; cv=none; d=google.com; s=arc-20240605; b=WC9OjrzB7L/fqx9jThineL34wZCmy0+M04r/5cs8Sj+qcB7t8vOhpLiX+gG6c1+agY 6RZ+fsjNr40SmegwxAusXiu0pvVLpuw4gCMa0waP3g6DhvuXwEFcu9Qesy6iBxhQ5svL Bj6YXYBobUHAMFUSZE8d4p5gRvVZxj7E4LKJOEjB4PUSy8yav29m273rcNYuYIFJwCQY PSn22F+t9gelCCWi8CResFow8G4wVbMEkUSntouzof8MVv7rf44IxxdUTfLV0FrbRcSJ G7DxJrkUw+p37WVXabzE/dPH44t5be4EERDUNLKDFSA0oMmUg13hi1pWMbrNOLlFn957 4C+A== 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=TNzImYof6+FKjta1BmPficyexrK8jjdIoTuF6jQ3KnA=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=KCziHbfYHiZW29ExveJwPtANsr3eJd8Z3vqcOEsFC1Eerej4hUr4k0a2GPooVBFycf qN75Ozn8ePUIm5kswJSAkbCA2+oZtL/Tn0Vb++BiY1r+MvdVc3oXfN3OgBj2FP0QzG/c 8B697npATV7bWJSijwmOTPHuwTS23ufLJxYBIuh/G+iPxt5B5WsBH1nMykClalaKKRhR ML27cdLZYnISIEZHrVVyR7EmAMgoJctAFd5gs2UhXiNaFL18uY7q8Cxf3JQNAKnmWoPc 8VIGyXuDHFaUuckqT9npUMR0bUF8LIX3MlVzmKphRAL6I/td7Ns7u06+HPhaeC8Heb2I 7Hxw==; 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=QIoslkEI; 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 2adb3069b0e04-537a85e1377si1171883e87.112.2024.09.25.03.29.17; Wed, 25 Sep 2024 03:29:18 -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=QIoslkEI; 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 A536D68DC23; Wed, 25 Sep 2024 12:39:59 +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 254C368DA5D for ; Wed, 25 Sep 2024 12:39:48 +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=QIoslkEI; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 4E7934E13 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id c08hmwi1g_B0 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=70AUisiCAts5GAb+X+dBmWBkeD/HP5xTZ/6Ljvshh7Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QIoslkEI6o2RPgNuL1DYejFYoQiwEEX3XJknUiCkSbZYq2Df6w6N0jVsK86YjgVMi wZzyQ8Lr/xh3LACmm4n2xz65IOFWS7mLmUtqh5n9WTCOmdlIFKCgH+zEmsIUJ5U8JB tNWXj9Tuwh8aZsAEQQhMHu+NmkLQUbI8kvO7TSEc0AFCrKsXxKpbpr07CQnT6I88yi +ayOcOCAQxKpNtlZRgy4NC0Wy+CTdYLzhvID2W3DJUrvCe/dxAfBJ/zDD8+EXckx08 HIvoQvT0Y7A3e3yLYVoEw3mxYtNl+lQkA2rwEX5jT3YOwcnoIxJ7Hg6lVfUccs7FWa qh52UO4NOvzZg== 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 4E1594E12 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 345913A1A1B for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:08 +0200 Message-ID: <20240925093919.22929-11-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 11/22] lavfi/avf_abitscope: switch 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: b2wO6U+aGDLp Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_abitscope.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/libavfilter/avf_abitscope.c b/libavfilter/avf_abitscope.c index 30ed7d95e3..6d3a40d8d0 100644 --- a/libavfilter/avf_abitscope.c +++ b/libavfilter/avf_abitscope.c @@ -65,12 +65,11 @@ static const AVOption abitscope_options[] = { AVFILTER_DEFINE_CLASS(abitscope); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S64P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, @@ -79,21 +78,11 @@ static int query_formats(AVFilterContext *ctx) int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if (!layouts) - return AVERROR(ENOMEM); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -322,7 +311,7 @@ const AVFilter ff_avf_abitscope = { .priv_size = sizeof(AudioBitScopeContext), FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .uninit = uninit, .activate = activate, .priv_class = &abitscope_class, From patchwork Wed Sep 25 09:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51822 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp338966vqk; Wed, 25 Sep 2024 02:49:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8cKXn+xNlQylOmEa+VYZOEwPSiuwP3ut+sf9dFYqi2ZS/hs/08a1uncyj7fdnkpRQ0jJ6iPaQ7ZxhUzQCleav@gmail.com X-Google-Smtp-Source: AGHT+IFpi/3Ot3QspsYvTcP4qEV00lSpJCbF0Hsc//zfwJSon2TG4bIpl133DDXOD/XBysAnFr2Q X-Received: by 2002:a2e:be9c:0:b0:2ee:52f4:266 with SMTP id 38308e7fff4ca-2f915fc0a38mr19508511fa.3.1727257760380; Wed, 25 Sep 2024 02:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727257760; cv=none; d=google.com; s=arc-20240605; b=URh6M5mXDYkB2NL6SJMLopf39R2SFoyXfBpuv5lx6yPvslLrtvX1KdhDLSFpRYCZsC 0NdRU0S9VMrMJwAdTjL74iAq+2BOUKd/pyeweX9GmhHLbKiIRz0WMnLLrAJiaHLud9vh hvIOtigzrnIXNhoD2AjhWZ5Ssi7iexFXehuP1HYrd7PESwzbrRGgdAsChBaELja81mKZ 2wYv8HKA6Q8VeWv4VY3q7HA7cdYozzkhEg6ZZzc1qKE8kN3ig3jmpHMo8Uh+mMKBje1j XPimP7Rg/ChLq6QrTW+mNoE/Dwt0oWhh5fgrnZMxjilqdLfqp3RDLSU54vX1VnbGO0+Q 0RIw== 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=958PZ2vqVABot84d4IAmnlmseMwgF6Z3y6EA0yTiI+4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=B4CpsmZXvhGL5nohqLRiycd3a+qEJDt08fk7pFbLRTWyFi+grSLRfd0jBRDSVD1PyQ q7I8yDnduF/5u6To4gHqXth31SVTnJgnt7x9ZRgp8kro91KDMw/Bs3ZsQvl0Zv28YvQZ bDaOwB0UV0mJqsUxHBHis0Pe3geIUYe9mzlIiw712gP3SUT3lPVVil96GJjx0gluEBjo CY7nlMZQqQXvwHRvKMSLvM/g0k3mJFaV1GmaFsXf02OYR5cjccZMNyQ0Yu17h0wkEAcs t9WEH4+v9WKxMsmc40/zwDWtt5l6TfY2rGJ9f+oogTOWEwb+oqPt4IA4ytTKWgRNLEjP tqVg==; 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=jPAXzRzB; 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 38308e7fff4ca-2f8d282f518si10112611fa.72.2024.09.25.02.49.19; Wed, 25 Sep 2024 02:49:20 -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=jPAXzRzB; 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 2C8A168DC6E; Wed, 25 Sep 2024 12:40:06 +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 491A068DB18 for ; Wed, 25 Sep 2024 12:39:48 +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=jPAXzRzB; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6E75C4E11 for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id kGoNC5taOXHz for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=Z7BT0BzHhvFFfEzzjGO711yxsgcaiK337SQFRLQpTI4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jPAXzRzBbXA8UtsMpFs09hyFesRvyOKsQm+svtbjM6/9oU2r224z8cpgYEMj7+VEN XYMTsiDQ2CC9klKjk9GaP2ozdo9dkqiZzMwf5WXbEmjPrfuAe6bXk+A8hIx2lkbbdq tL6R0J26BzbYqmSX4si/b554Rp6RXzqC98yLA7ulu3uX2ewukRRI/V3x1BOB29Sgvk ovOARk9UlO3Y1NHpyYMgyyPIR5j5b5BstSoSAZywrQYtu+uC3urV6RTiEcqnfbHQzP kcONdG+wD4nxpl5uYoJK0naDhIkI0g8Z2hA4I6LZ/UIKWQTlRKru/+0nFVLkZE9oDu V2csCHMnOob1Q== 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 528484E16 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 4006B3A1A81 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:09 +0200 Message-ID: <20240925093919.22929-12-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 12/22] lavfi/avf_ahistogram: switch 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: xG4IHDFGCXaU Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_ahistogram.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c index b77307f137..baa95c0539 100644 --- a/libavfilter/avf_ahistogram.c +++ b/libavfilter/avf_ahistogram.c @@ -92,28 +92,21 @@ static const AVOption ahistogram_options[] = { AVFILTER_DEFINE_CLASS(ahistogram); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; int ret = AVERROR(EINVAL); formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || - (layouts = ff_all_channel_counts()) == NULL || - (ret = ff_channel_layouts_ref (layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -509,6 +502,6 @@ const AVFilter ff_avf_ahistogram = { .activate = activate, FILTER_INPUTS(ahistogram_inputs), FILTER_OUTPUTS(ahistogram_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &ahistogram_class, }; From patchwork Wed Sep 25 09:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51830 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp346817vqk; Wed, 25 Sep 2024 03:04:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmX/ss9Kojw594lUAifFBdYzMFmdr+O/ZYgAZtk/ki6GllDZS5DN8QHPpKCELpbhL8ckP54zfe/WwVVhkisXQS@gmail.com X-Google-Smtp-Source: AGHT+IHCL7sWJrYzk3eVS/yJWZUkOkDQqu2xWtTSADvcvPVGwTnXVVnvSf6+r0TH4PUK9okMTeo3 X-Received: by 2002:a05:6402:51c6:b0:5c7:18a6:32d with SMTP id 4fb4d7f45d1cf-5c718a60829mr4979898a12.7.1727258663436; Wed, 25 Sep 2024 03:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258663; cv=none; d=google.com; s=arc-20240605; b=Omoa8szwWiPV/ssmctXpVIbGGPAnEp0DO0NXg9+CPHkJX4litLdERu9RkMfAbZ80K7 Op+ea9PwOHTjcCONAVeAnQnjYtkncJcjyPr6LubgBRlkKQRjj24VqQ/KLLYoaISKRHkn Otj2ha8uoB7HmeT3q1tZQBLkz6qC8oUa43PDl6wtxnE/ctcP404LRdcN1NjD2xz6ktB/ OQ0F60AbnfOgyQfXciZvnvlnj595Gz0YQBD4UKE/sW1GVTaUqZmuHFUL38008BxukfHu gQvEVu+O3vQvgvqML3Fd17VN7Bq/qKwCz2Yg950VtUNDY4XmScotCwJkpix+G49Os2C5 2yvA== 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=GNQbPXt4iJwHpoyXVP3aifZPPFldEAqBOAXL4MLpjdU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=JFJitTsjGC1O8d/0JP+oqwCzBUk7YM6/EJqA9R78Ad0taxC8JxZKToKBu3UO8h7QaU dkNTOBeOp/oqAV6BaNBBRHZMdd3FzzsxCzm/qpQhYxXAaVke/nMrSyfMQ4y5nVBe9Mld L7jy/ZeUwLGYhPnVSNBTlR/Uo+Bwh9INZAl2jeZVy64X7zvQmCxGqxes04wt0agI5N2S U/yVe0FJ2iVBHasfi5ukPCV+CFva5mY8+Vyf1ZszdOQx388xcCSdb0uHWIkUhBvLcH3D 7lrLNI82rWZIcSwqPqsy97wzg9UJAyeVZx2h1DnnpGuaNXFr4euGsdpHzhkqq5IPHmyo CEtQ==; 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=pTA23gou; 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 4fb4d7f45d1cf-5c5cf4de1cbsi2210575a12.605.2024.09.25.03.04.21; Wed, 25 Sep 2024 03:04:23 -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=pTA23gou; 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 A0DFD68DC28; Wed, 25 Sep 2024 12:39:56 +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 1EB8768DA4D for ; Wed, 25 Sep 2024 12:39:48 +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=pTA23gou; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 014DB4E0A for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id fPfZ0oywTxj6 for ; Wed, 25 Sep 2024 11:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=0yR9ku+/qwjPoCaZGO9hdpoFWOdg42fxLaqHDhlXg/c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pTA23goulvhFeG6hwAK0IH2oCbrVlAwMhFXoJs8MBlKFxJ/bSbqCxeCt4co0aD7CD HExz0TA94iX/qWTHzQpKyGHPwNU34Mdmfk0Pi01OnfuNj6vxir1w2VCM6P4rQoydl7 0N3ZAyc657y1OvRmJ+WNCsrJlzZCpvyyc2Xjx5P6vZUnrWZHWlVNuf8pXeyQYUatNr 9bIlGa70dKDgxRX55Ec2rkE83SjtvZBilXQ22FklC7a6c7ZZAYRGqLN1pUqKeHnVM2 9NLBZOJ2g4yZ1vTRHGBxeu46Nh1DojY08cPRom1rzVSp+Mlk3HgyRvMgO9xPx4Ugv3 eqLYd/4OT5Dtw== 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 556C94E18 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 4BCC73A1B33 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:10 +0200 Message-ID: <20240925093919.22929-13-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 13/22] lavfi/avf_aphasemeter: switch 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: KKqxs1PWIdF2 Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_aphasemeter.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c index fe0968c974..adcfcb3c5a 100644 --- a/libavfilter/avf_aphasemeter.c +++ b/libavfilter/avf_aphasemeter.c @@ -90,35 +90,32 @@ static const AVOption aphasemeter_options[] = { AVFILTER_DEFINE_CLASS(aphasemeter); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioPhaseMeterContext *s = ctx->priv; + const AudioPhaseMeterContext *s = ctx->priv; AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layout = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; + static const AVChannelLayout layouts[] = { + AV_CHANNEL_LAYOUT_STEREO, + { .nb_channels = 0 }, + }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || - (ret = ff_formats_ref (formats, &outlink->incfg.formats )) < 0 || - (ret = ff_add_channel_layout (&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO )) < 0 || - (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0 || - (ret = ff_channel_layouts_ref (layout , &outlink->incfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0 || + (ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 || - (ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + if (ret < 0) return ret; if (s->do_video) { - AVFilterLink *outlink = ctx->outputs[1]; - formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0) return ret; } @@ -440,7 +437,7 @@ const AVFilter ff_avf_aphasemeter = { FILTER_INPUTS(inputs), .activate = activate, .outputs = NULL, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &aphasemeter_class, .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, }; From patchwork Wed Sep 25 09:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51834 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp354601vqk; Wed, 25 Sep 2024 03:19:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXRNq/+ioVO1CLqaG3hAjme/dfftRJHIHvvEgdGM7S+j35lVNiDJwNcyrE6sfwD6LC4yEkI0Gy5vDpumfzGwOKb@gmail.com X-Google-Smtp-Source: AGHT+IEGwHD0gkEKfjuIVAbESAkulMrA+/okxS8YVWNkaT94+il2CE6TmTOQLbbf8kakEqmFRlHw X-Received: by 2002:a2e:be93:0:b0:2f7:a759:72a3 with SMTP id 38308e7fff4ca-2f952244a1emr6342711fa.24.1727259560989; Wed, 25 Sep 2024 03:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727259560; cv=none; d=google.com; s=arc-20240605; b=k5PxJ2Hkv4S6IV2J6hXqlJjNdKwNON1GTVLihju2enwIi9qXxOQHoC4ytto5ci0d1X mSO7cu2+zG2/tLy/lKnCfBIIM1fvOzvzcC8eCIEkgbtruzRmOjJ+pn28nBu9ZqPMEwMn /ZJocU2RzhgWR7M2dRvehQnSPLVdUUNPRaD95gabnRqYmruOOEoyvIBry0oaU3k1a5yj JCGqtNQqbTnuIJZ9VGkvm1TNi2iE8TJN2WWQdxGjXwJhaQ9ps5RGSO3wDbocUYX8OFDB p0qd1YdhebUrhHanL+ZrqJiWrAnirrHCkWJANZm+aNyIXDEYw4mbzaQ6Jj5Knu6Oe40t fFiw== 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=mQ5zt02KnqI758j75dXT8tsnhbspZzbtF2IfT9I1hkc=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=KVNDz5Zv+5MpPjgFnTVvHpOLKcIHmtcN8bjBaNNgymOMatRx+o4I65+mcTnOIqVz8i /MOuniqKZDIu6IkB9oq/4+zjTFB1IfmN+mMtML++Ypci55ucSFTeNXWKUpe3itYACuAN RVvsqZ/+isHDmMlz9CKBaxCaTRF7bnUhZGpc45rZLd1xIDVe0pjm8p3sUpgSuXxA5dAB /DjuJpWfeh+zIPp9phN8Czdp0cfeJU805Z/vQGi4VX6BmbNHmAGK6VG4ToDNQu5JaHNI bl6ltJp+vaYkz+7khrHNki/HK99n53291rl+kv0lpPbGR63fBLgjJb5qvaXEkaGTcGTu nVYw==; 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=ao0YGuvS; 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 38308e7fff4ca-2f8d288e67esi9668461fa.216.2024.09.25.03.19.20; Wed, 25 Sep 2024 03:19:20 -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=ao0YGuvS; 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 1CF6068DC85; Wed, 25 Sep 2024 12:40:10 +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 67BD768DB73 for ; Wed, 25 Sep 2024 12:39:48 +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=ao0YGuvS; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 362404E0F for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id wT5FQTFZfCBe for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=aNeYYretcDkt6vId+DmLZtI6tW2t5g1Shwjj80ghHe4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ao0YGuvS0p33XP9uKpCWbfugnxgkF8d4S6cHMJQH/MmI5Oby3FzDKrCQICChjsdKl JVowBLOl0ipbXrZ0Ts02pfBO90gjmoQNKuXPQDR0TFGs1KBNdpl5FGE+9nEuG0u1Aa 0yE6wW6xqMGZUyFvoLUhECqOMTVdc37JnZmwsb3rTvzvYaorcVHc8xKgDSLCGX9PxR sRst9SkIlIpoTuuZrOiVe38G4v0kUu7jHnpriaPQ+niqlOHevSDSoLLrYCud6zytkA x/alkZHni41WkrNIep5JeJelZX3n1zYSJNDB4opY5M7Xn5tPxHF2PinN1QdJbP57kb InVKZb3yKIljQ== 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 664844E1E 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 577003A1DFD for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:11 +0200 Message-ID: <20240925093919.22929-14-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 14/22] lavfi/avf_avectorscope: switch 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: Am293bxcDhb5 Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_avectorscope.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c index 96bef32e2c..cfcedfda00 100644 --- a/libavfilter/avf_avectorscope.c +++ b/libavfilter/avf_avectorscope.c @@ -230,28 +230,29 @@ static int fade(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layout = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; + static const AVChannelLayout layouts[] = { + AV_CHANNEL_LAYOUT_STEREO, + { .nb_channels = 0 }, + }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || - (ret = ff_add_channel_layout (&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || - (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref (formats, &cfg_in[0]->formats )) < 0) return ret; - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + if (ret < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -493,7 +494,7 @@ const AVFilter ff_avf_avectorscope = { .activate = activate, FILTER_INPUTS(audiovectorscope_inputs), FILTER_OUTPUTS(audiovectorscope_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &avectorscope_class, .flags = AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command, From patchwork Wed Sep 25 09:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51828 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp343306vqk; Wed, 25 Sep 2024 02:59:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUB7OL18ykV0HyoxD3pUxJEKndLZFcXMi7rhsc36TwfLi/S+J7w1OFPwR5BwKCUTw975U4fJMWx/wOuOHtbE+Bi@gmail.com X-Google-Smtp-Source: AGHT+IGpaZ7ikZtAn5Sy9v+lbv9+9pcERfDBpRusRSBz+TnR72Ag5ZBZnMCZMD3yc+JEkp13JVub X-Received: by 2002:a17:907:1b08:b0:a8d:2624:1a87 with SMTP id a640c23a62f3a-a93a06be0f8mr88419166b.14.1727258364383; Wed, 25 Sep 2024 02:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258364; cv=none; d=google.com; s=arc-20240605; b=k9BgeVd8DDzb9G+o2ZS3uoaGB4NIUobbXt4pbTRHxv+ToUii4vBVkhmXl3CAa4E7kS ZJMJZJVIiF7ekQ3RwoUPDthiE//AFDHH8KNV8H7W2CT75npY2l23Ne18OrtCOtCyVOVD CIy6gf6jRb12EVLksF3jS6apC+VcOQWiicz7CkwFO+MNoBnZtUAPBbF0ZIbNktcZ6IU4 YPp2nD7sylJRqFw+52ACKswVSl1DkxXDTFv1itV8G5jQ98ki2cE6H9zavjxRj2Br/V3g Oq/5MNe5m+DE5p5HBVscdxrExJVR+5K5seOS11CId3zOwDHcE59KCe76ymnC/lOl1XOg zeSw== 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=TXRWYyliX3nekXuQdBZzvVcnxnYLMAWp6nUoHOUKBJ4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=ASqV3ZCO9ckd9R7FFoQZ7balAcujtnH8rHEmr/7CaP5KOoPkgpEgoDIleXCXeaR+Rk kFwxBn/qFy751imCXqF8VxDiKwbYSHgctQuR7zfPPp6RIOONeNRPxj+msNsV77Znk+Qo GktSFyZuh12nIkdfQ8BU6pnLFC6N4rvj2JgVj59FX6KACzahPPP6cThBnOV8SJRSl7aS VNfzu8ISPb0mENZwhoAcfoIjQkGfz2jWEKINl4BRqS0REpUwHBhioJ1EhKV2vT74PLmt CnesovwCoiHDKs5AzxpjQpEvVcHTIhV3OTQNS8+kpAgz6Mkg6NufuZWnncrdRywWoUwg xFow==; 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=a++PFetJ; 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-a93930be03esi230414866b.329.2024.09.25.02.59.24; Wed, 25 Sep 2024 02:59:24 -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=a++PFetJ; 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 A5D8068DC6D; Wed, 25 Sep 2024 12:40:04 +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 5257D68DB45 for ; Wed, 25 Sep 2024 12:39:48 +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=a++PFetJ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id E36D84E0C for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Wa-r6vs5rH7T for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=/TjiNr5JXRcCHPUA39ToAiNZs0vrFqEaiJapW7t2Kyg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a++PFetJ8YqsZwLZgVOFFaMZvUqQbM55F9oGEFu1g45HpazCT54+gvs94kupdviNG PEcZgdPEtKMQzWhdtEPqE5CTxAfDJYdvf7mYHPihNq4Zx1TcYuUxadqwREiW78iXTE JViwcmazfTInLlygV8k/6b3VMNmhJ4UJFDVdB88Lb6IJ3+wnvVJFRkfdlMaZVA+1jq 1dz0M54CgAngH9xaE2F6nEfT6ybrBuD34OzIHNKj6VE1FpqKkZoutWp57I3zsVYWpD EryYHViG5gJxXckQHBnaT7P2eT773m6OSdj8yiA5PQNYUtAWCTc7RlxA8/r6+O/HLU Fd12iVSzJxXZg== 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 662974E1B 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 6337F3A1E08 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:12 +0200 Message-ID: <20240925093919.22929-15-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 15/22] lavfi/avf_concat: switch 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: yCvpnAZOJj5c --- libavfilter/avf_concat.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c index 2a3d4c8b52..5a4319123f 100644 --- a/libavfilter/avf_concat.c +++ b/libavfilter/avf_concat.c @@ -72,9 +72,11 @@ static const AVOption concat_options[] = { AVFILTER_DEFINE_CLASS(concat); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ConcatContext *cat = ctx->priv; + const ConcatContext *cat = ctx->priv; unsigned type, nb_str, idx0 = 0, idx, str, seg; AVFilterFormats *formats, *rates = NULL; AVFilterChannelLayouts *layouts = NULL; @@ -87,25 +89,25 @@ static int query_formats(AVFilterContext *ctx) /* Set the output formats */ formats = ff_all_formats(type); - if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[idx]->formats)) < 0) return ret; if (type == AVMEDIA_TYPE_AUDIO) { rates = ff_all_samplerates(); - if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->incfg.samplerates)) < 0) + if ((ret = ff_formats_ref(rates, &cfg_out[idx]->samplerates)) < 0) return ret; layouts = ff_all_channel_layouts(); - if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->incfg.channel_layouts)) < 0) + if ((ret = ff_channel_layouts_ref(layouts, &cfg_out[idx]->channel_layouts)) < 0) return ret; } /* Set the same formats for each corresponding input */ for (seg = 0; seg < cat->nb_segments; seg++) { - if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[idx]->formats)) < 0) return ret; if (type == AVMEDIA_TYPE_AUDIO) { - if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->outcfg.samplerates)) < 0 || - (ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->outcfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref(rates, &cfg_in[idx]->samplerates)) < 0 || + (ret = ff_channel_layouts_ref(layouts, &cfg_in[idx]->channel_layouts)) < 0) return ret; } idx += ctx->nb_outputs; @@ -460,6 +462,6 @@ const AVFilter ff_avf_concat = { .outputs = NULL, .priv_class = &concat_class, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_DYNAMIC_OUTPUTS, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .process_command = process_command, }; From patchwork Wed Sep 25 09:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51827 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp343276vqk; Wed, 25 Sep 2024 02:59:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUnQMtYpvJWn1KGv6e4ITjZ2GZZod6UtZhxAyQVfX14s7dCA4XYowfnQG0gA219eaDlCWiszu7ADYM/1auUwJnM@gmail.com X-Google-Smtp-Source: AGHT+IETbBr5LHXb6umtBjLwBvK0dM1hK9EFtCOcCmPAOS5hlKNwoDaATEsZlJ482hQbz/TERQ2c X-Received: by 2002:a17:907:f75a:b0:a8d:446a:ded8 with SMTP id a640c23a62f3a-a93a03603bfmr200636466b.22.1727258361571; Wed, 25 Sep 2024 02:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258361; cv=none; d=google.com; s=arc-20240605; b=YHRw9K3Y7LrkT3qBGZNy/V1178Wpkpmdxo+5BMM60goMvtODRmKmEZjfiqlGj2kYBB N7/SQh8wx1Lyk+DABeJp5Ixe/MB4BuviVjnZOC9DM0yLWkaJtIF7pOzYDc12xa/KV6tf Ldhci2KxDQm8NvuAXRWg6HNacDwc6BMbkzPP8TdIsuoXmqfwhFCsNa7N0o7+3It3n/wx An2K9jKu8FYNK6IXFUbjxzOgYuQ1n8qVe+H3sm/+GIfccWRZNf8pZ+y5O+woiR9Oky3P dNbwWP6M6nKblvCxgo8DCpp26XARoD+L6LrWsTL4sHCwVGzcMtqZ/ifZT7UZKpT7imf3 5ZWg== 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=q67736wx9Xx3lggrdmZI3DoYEh4leoRk20M4i+Ld9Wo=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=OI3yFUcBXRhEtjv+fvrGcBI6drAc8BpT2iaTZti2r1jmHE7UXd8MpxAfyvZjTz2/W+ f+Tnm4/eODS73GRQkHYbZ2zsgHagkNXMwNatCpk+WDOZnXh1R8DJYgparHmBSpyX4exj SpAESaxlhh79NVTAGavH6cLa7RvbFR1eesi4ghwsWY/3XdH4zsWwOoQE793Y+4TIRjAJ JzRRyaVWMINwirM2y3hO6HUqxQSr38WVYEgdSl0QSQW/WTmUkZi7E33KkDMxuBcQphG3 ChUR6SZfB+yctXlTI/D6dbQCUrVZan0I7yv3lMaUJ3dO8eJuQMxovny6lPxIUy7OAJ5p bCGA==; 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=nEvUGttQ; 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-a939313bf2csi210048466b.909.2024.09.25.02.59.21; Wed, 25 Sep 2024 02:59:21 -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=nEvUGttQ; 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 B470B68DC60; Wed, 25 Sep 2024 12:40:03 +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 3B4E968DAF3 for ; Wed, 25 Sep 2024 12:39:48 +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=nEvUGttQ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 815F64E18 for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id XoV4V8YCYgnM for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=Hz9K1J1BeRV4feN+G+J8Ng14D7eLPmuMLO/yXbNLTvU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nEvUGttQ9Iz+PqanMGCQyEAFP9b4qkWCFKLZYNQH0UhysyI2F7P7dAuDeaCNj36eX imU5xGcsYsSGAyRr/QJbX8MVfGt3Gi3Ee+qv5DOL1CyT5vpMPo2kzj4eqMfi/IpchH ugE6M7gtONPL6aN2nKjjMn9TVb86PhxsHsK4E6VaObNyjjG231xwoK2Mdp3aZDesjN sZa4TkR1NzLkWTbzhGtfLY/OAfJ+wOi2h1s8A5aE+9plb72v1s7k2c5aTtJSXK25Bn poty9L7xGclwgUV0RdFIwyy1Ffin6H5Pq9NJY5k7mxvpD9V5UNXfWBg2SCxpN9JfSL 5gF9m5CTN1rDg== 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 6DED84E20 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 6EDE33A1E2B for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:13 +0200 Message-ID: <20240925093919.22929-16-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 16/22] lavfi/avf_showcqt: switch 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: SUM0sBAJi+rV Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showcqt.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c index 00f679bc9e..9633f36edb 100644 --- a/libavfilter/avf_showcqt.c +++ b/libavfilter/avf_showcqt.c @@ -1314,12 +1314,11 @@ static av_cold void uninit(AVFilterContext *ctx) common_uninit(ctx->priv); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, @@ -1331,20 +1330,16 @@ static int query_formats(AVFilterContext *ctx) /* set input audio formats */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; - layouts = ff_make_channel_layout_list(channel_layouts); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, channel_layouts); + if (ret < 0) return ret; /* set output video format */ formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -1612,6 +1607,6 @@ const AVFilter ff_avf_showcqt = { .priv_size = sizeof(ShowCQTContext), FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(showcqt_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showcqt_class, }; From patchwork Wed Sep 25 09:39:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51838 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp361576vqk; Wed, 25 Sep 2024 03:34:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWRhH+L5q6hbLWRbzj4gL5u/w9nnNDWIlhX6ZRsq/4X66Vux7OdL8qsgGTA1cncAXwwp9CTl7dBrxmYsvMqLTDm@gmail.com X-Google-Smtp-Source: AGHT+IHgtl3fuufIN6Cf1l6raY4JlJLlUlNWEqWMK/Re+O+NFGVaBi8XVuxGxxOw5TMeGyNwgEtH X-Received: by 2002:a05:6512:b8f:b0:533:3fc8:9ac0 with SMTP id 2adb3069b0e04-5387753227dmr1343975e87.34.1727260458826; Wed, 25 Sep 2024 03:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727260458; cv=none; d=google.com; s=arc-20240605; b=CpPsRDjHnAbZ/IaRrKrhkUWZAEnP89LTmvLWQWuMXMe9gREuTQRbZPnFioXDUUtBw5 G4vB5yjhI4O3VQ6Utlt9ebqp9cyC5P902/qH/098snB6BIGP2VIr02KXBQE62F/NxONS wg13keK8KfSDg/WMesvVt+W4CL2cEDfHBpSYUmov6jmMxtgnu4V4IBFA7Z8s3hYwUT2u EG/f0zpN+3Z4bIs2y9uwB3Tau9DzXePhV/E+5PA7smMaEHnwHULyHgLILFtJ5uwc0Xdy zgLR5IqSLCRvRwma+oAVUQNErYs/JG6Z6rLz/pDG3qzVDBHDoQVslpJiHgfN393cRotM KRmA== 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=CmW1RKBKDdn9mXmrmVrgMCAs4eITPY3wldjL1sAbRHc=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Cz+qU/78GHCmKMl1n2DwP8zWySCgkb4dIDJQlcEYWgSOM6Zj7gOkUTnvQkiUDwqDCm L43elq1T7ENB96e/4CaPmtrGdZh0A5rgVvqNOEHIWVSOoz7XO348EgAksZMXyv3vPlcW fk7pkRCPsDyLCX5GjUbAj7yt9mos2mgznO3cq3LG3NbFf10cHDcDRwxykaeCZDpP2qPC 6Yl3bsq79cmTPO4tUyTvhOtDoDzFa2tzV7s5fWkSIoVSWbRbA73jv8H+4PtV/oY4HQPw fWknKS1AbzOZp9A1Ji5cXzWThmhycN1601VNtY3X4wvD11gXld4bXwgOX3bNxG5iwzID NMNQ==; 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=GMA9evPS; 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-a93930be588si220173166b.284.2024.09.25.03.34.18; Wed, 25 Sep 2024 03:34:18 -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=GMA9evPS; 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 C66BB68DC4F; Wed, 25 Sep 2024 12:40:00 +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 3BA7768DB05 for ; Wed, 25 Sep 2024 12:39:48 +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=GMA9evPS; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id CB9704E20 for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id B6HwDUWY_7SM for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=AVtm85peAE3/3jog7c5db+P+aTISAUEdrCHnMqmmnNA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GMA9evPSvR4i09Ydt5oFrO1R4H8q37M3SNzOAoenNns6rp0/AkxD6guOA40HU0G2v 3KT4x5alQIGkf4e6Fbs1vj4MYus4du76lYb+gsi33wwEtsW+gQXM6wYFjtQ9h896Sk 0MJp6bAiUYHwL+VzCBAea6zeDfDb9BjFXRNevlYpKw8FCdYofO95dhb3sQPxYKvuDY YzdeoudoRASRfHqSjU4g5N3YDqQknD+dWz08vK2keZUaCoxZp2dDR5zX1SCRa0xpl/ 76DNN1qf6+Iv4YAPSNj42dFsnFgZLfAJVVoR63+yz+Xji8uuXR628WxnTiYW2Hielb 381ydFdX+0E0Q== 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 8D8484E25 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 7A9B13A1E95 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:14 +0200 Message-ID: <20240925093919.22929-17-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 17/22] lavfi/avf_showcwt: switch 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: NWbQLKsml1wX Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showcwt.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c index 760a07f2ff..dbb9fc7e2f 100644 --- a/libavfilter/avf_showcwt.c +++ b/libavfilter/avf_showcwt.c @@ -222,30 +222,21 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->fdsp); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -1334,7 +1325,7 @@ const AVFilter ff_avf_showcwt = { .priv_size = sizeof(ShowCWTContext), FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(showcwt_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .activate = activate, .priv_class = &showcwt_class, .flags = AVFILTER_FLAG_SLICE_THREADS, From patchwork Wed Sep 25 09:39:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51833 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp354598vqk; Wed, 25 Sep 2024 03:19:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXAUoSC4a9qlml8aNn4AVxNnrJ2/y1PlHMdA7aYkT4ZbjNuYzeweuAKfk4EQJbMRl2gNlCiPBFL1n/E5OPMkFUy@gmail.com X-Google-Smtp-Source: AGHT+IFqQTPcThHh93jX8J2BMltEMXYWr32RaFSaZJeSUPqsMlFieJgsf11reRf9qelLr7wBQUew X-Received: by 2002:a17:907:944e:b0:a86:96f5:fa81 with SMTP id a640c23a62f3a-a93a03e32c5mr221367366b.32.1727259560502; Wed, 25 Sep 2024 03:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727259560; cv=none; d=google.com; s=arc-20240605; b=ZlzHoJ5ZfEitxKzLrSz4dYDcuGf8yaWciiqd2ilFucpNCsIExkwc8gKFmgDyaBP5S/ 5eS0hR/7Ex2WboMQxEDZe1Xarpo0QzXsdEJ3PzX0wnh+aj82qheMTmisVOzstrzgU54F /6HUJFjbpBExVGdaYi7qoA2nvPt8yVsqe1YObY467UWebrnpOO/3EnsxKu91Xi1h9vLS HHd4e8QSWcB5pj+QK02M5GooFWSi+XVQhy9mH00HjBOwH3duMHqvke2G3ny6rfzR8F00 qVsBqfib832dm0gHNspy6vspXB/oAc4lau2yU8PZF8b5QoPMtW3mN+gcNqmES6bZyB+P NYFg== 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=Lx4JxF7qEfMyhObSuU8B1HT9L9JQhxQHDi2dVBPRKWk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=HaIT6qNsFE/PgIw0+aRfGqJVwLywMs+Z3z9nOIjOoesa075EWn9aCnlcs5uyZbUgLG RVR0O2mZni9U4zR2C/xEcvuuOqAHHBCeNc4/gut4CqVbt5R/SIjrfabbx8A2ZyWMStld mDujeT8bQVBPqujQBm+KyfvlVsR05Ws++P4eielTiICNIEw2MLUS+6VO74aT4gtS69ac 0CY/weuAgV5Y/hK8e5GQut9kGShtLX6QS6G1aCN5v1BYD8NULqQ00p8vbetf5RcVHtby oEwiah2sI/MLMn1//hBNQzL4Vq9WB3Www+t/Ezh9IQglQSQP4WlDJbM8qL1j7hmNANef d4zA==; 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="B/IfUkXW"; 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-a9392f2bbc4si212345266b.69.2024.09.25.03.19.20; Wed, 25 Sep 2024 03:19:20 -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="B/IfUkXW"; 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 A092B68DC7C; Wed, 25 Sep 2024 12:40:08 +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 4D79368DB2B for ; Wed, 25 Sep 2024 12:39:48 +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=B/IfUkXW; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6B2824E27 for ; Wed, 25 Sep 2024 11:39:45 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id V5CooFuxUDgR for ; Wed, 25 Sep 2024 11:39:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257180; bh=pr1EuiyMDTxPQ7LCYZCnRIRPVao8+lEX3/RuaKXJ1pI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=B/IfUkXWimVJ1j86mPGH25MIYVnqUvV8Nk3CyuW+pyc8botEotnxPXr0znTbnqWcm oVsBeSb2XHoCqJm98jKIPeHfr52PtU12qtXz7zVIVyc2tDNsi04DWEgOYyAKpElk7K BwRfGT99TYxsY1BKlY51x3qt8J+1BnKWMz309QtbxphIDY5kqxRAzwJsfQuPUTaUmL fTAxxuIXvoFa7r13Np8d+TQ1OOEfDdJhgZYIQ2PenO0cnbDfmtc0at8FecFZPTQ2/k gxpPYShUMShFltH+KlY8WzmKbuoXePY8Zfkl+mAlFX2Rz2HyKMnqZAIofrUgMwwopB mticpgmwK7Yvg== 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 170A44E2C for ; Wed, 25 Sep 2024 11:39:40 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 8641C3A20DC for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:15 +0200 Message-ID: <20240925093919.22929-18-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 18/22] lavfi/avf_showfreqs: switch 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: 1cKfAEo0k8T4 Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showfreqs.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c index da31b3215e..91e3a339e4 100644 --- a/libavfilter/avf_showfreqs.c +++ b/libavfilter/avf_showfreqs.c @@ -116,32 +116,23 @@ static const AVOption showfreqs_options[] = { AVFILTER_DEFINE_CLASS(showfreqs); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; int ret; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; /* set output video format */ formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -566,6 +557,6 @@ const AVFilter ff_avf_showfreqs = { .activate = activate, FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(showfreqs_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showfreqs_class, }; From patchwork Wed Sep 25 09:39:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51832 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp349616vqk; Wed, 25 Sep 2024 03:09:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUtkmfBwxJFm/THtK3FSK6skto1BGzdDk+hGyorjk4zQQOFmlgGJ+nR1HIUAtb4dUWDAWGdyH3yljSBOJUjl0Nr@gmail.com X-Google-Smtp-Source: AGHT+IEogsXSBWn54EeSQwVcVeKRDHFWC0tpA1V5b0kNkm/uJ/sUTpOwYVdcSILNUz42tR4bhJU4 X-Received: by 2002:a2e:4e02:0:b0:2f3:fae3:83a7 with SMTP id 38308e7fff4ca-2f91ca70fadmr9171771fa.43.1727258958312; Wed, 25 Sep 2024 03:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258958; cv=none; d=google.com; s=arc-20240605; b=BN7ZRBpxIl2Aivk4kzfE8RUvznt6umqnlWS83BCmx5rnetMYie9Vs6rcJkId59qwZY p+3gVS2efrO2pH1y5ajUxpPEV4HQZAyADv9qbxVQGYtGxCVOK6ykE2hqdgCGJdmmLuX9 TRW0B6otJlWfhkH7iJebUhfhbjCutXo71U1lVLpYGThrXfxa62BJOTbkgGnnPd+K9hD7 bVFLkfXVAr8sbrSf+VpGWEKYuhHMK/lyvSkpzIVlFcjarLIENl3ay8HkHI123H7KBe2y kkLuyQCc2qT0LSj1WLyEaFOEZl3LcwezOG2zDhlFc4YRTMVCYRylaxg8a6fAIIExe/wV IaHA== 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=O7QQmhaE7GJtRDdIWYJDKkgJc7/nhNYPbhfLUZwZmC4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=GO/7CKHl208xDqW94iNl2gLtgnVPwrO4tVJdI2ujH1C50Dyvq5Au86ClJiJMp0mQAm 9F+hrxt89OXH/a715UJRzACcxbEzRzke3UoV6XhV9AKPCR8bVKNxb9S/vetmRH6KSC2S mOvTQL3B8WfZRmztJmRLksNWtEuU30ao+vtQxyDF2b53GyjXcA3O9SgeQ9zjQLJjf3VC v3LIXLaeNr6j2tioz5j4nh7zNkwYqE6MWnxTPxBZDbxPrll4yvKI4NAzA95tiAk8IgsP fFWTPbq0sumfSESIUsYkmvYasYb5hKncAnYaDf6rUOR6QWdlUpMuD2/q9paNkDRXSVeV xGuA==; 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=NiAvkZ5H; 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 38308e7fff4ca-2f8d28b734bsi10501511fa.562.2024.09.25.03.09.17; Wed, 25 Sep 2024 03:09:18 -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=NiAvkZ5H; 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 82C2568DCBF; Wed, 25 Sep 2024 12:40:14 +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 8CFD668DAF3 for ; Wed, 25 Sep 2024 12:39:48 +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=NiAvkZ5H; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3414C4E25 for ; Wed, 25 Sep 2024 11:39:45 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id vAn53eZ2l-A8 for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=eBjBh6mB1wZMBSy2YNsyHvkkrIgkaYwVO6EhMJHXWLM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NiAvkZ5HTgK6S9bFeG/NTID+RITMbSI7lWOWjHOIEIFJhbXibuAMMxfD6nVSc1SYf Rlhzef1MJdw1F3cSeIEAnDsqOdGMAMvz79nzmU7PDxI4OmNk5Cgd9t0Ypvyhv2r9rK aig8efEZsH3dSgCzKMTkaTdslC5TJGa/xQCPu/dqa7HGTSH3kJkxUZlaMokqmS4gth 4Gi3042pqt3WRZK5MoLjBQAmP31sdKMytliZi4+3nrHgupGAs6f26ise6YFuiysOT9 fT+63NoE3MoUKF3wfcjYJ3Ke4VC3HcANGzpaq9jm6++y1CfldeOk5x0B3C/WiN+XKB OCMOL6bNmsf2w== 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 CCD444E2B 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 9210C3A2137 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:16 +0200 Message-ID: <20240925093919.22929-19-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 19/22] lavfi/avf_showspatial: switch 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: 9YrnWDM8ur/P Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showspatial.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libavfilter/avf_showspatial.c b/libavfilter/avf_showspatial.c index f7380f885a..285f2f1a81 100644 --- a/libavfilter/avf_showspatial.c +++ b/libavfilter/avf_showspatial.c @@ -80,28 +80,26 @@ static av_cold void uninit(AVFilterContext *ctx) av_audio_fifo_free(s->fifo); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layout = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GBRP, AV_PIX_FMT_NONE }; + static const AVChannelLayout layouts[] = { AV_CHANNEL_LAYOUT_STEREO, { .nb_channels = 0 } }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || - (ret = ff_add_channel_layout (&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || - (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + if (ret < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -330,7 +328,7 @@ const AVFilter ff_avf_showspatial = { .priv_size = sizeof(ShowSpatialContext), FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(showspatial_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .activate = spatial_activate, .priv_class = &showspatial_class, .flags = AVFILTER_FLAG_SLICE_THREADS, From patchwork Wed Sep 25 09:39:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51836 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp359018vqk; Wed, 25 Sep 2024 03:29:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYqf/bCKFsN+mZlFQ+dmzwH4Wly3nY7MQg/aA6nQK/hx6CSFPh7iVcSmSwidoS0sKLxZ3jwypzSNpXY5JVr6+Y@gmail.com X-Google-Smtp-Source: AGHT+IGAGjcMiys5qO4eWFb8jUKTc0+LZ9GtxCzo8sU/FZvGfzqJi/Sf6lXHPNnlcbomq6/e2nBO X-Received: by 2002:a17:906:7954:b0:a86:80ef:4fe5 with SMTP id a640c23a62f3a-a93a064827bmr142610166b.47.1727260159050; Wed, 25 Sep 2024 03:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727260159; cv=none; d=google.com; s=arc-20240605; b=iBLv3/DKoK2PnY7taUuUiiliJxEkHoEXBWxZqJP6u1h1N52aEryaxPWpEkLVmB97yd +3+BQPi83OzhyEkjRR3K2y+OvnX65GOhMkp1+oN7VWgm2WaHwqkyjsq9WfSPMphqIN2i tr9fx5/hhZviru8WhNXstghVbxndbWvx0PKa74QpiA2W+csMBuHkPcRZvWo5aTQAJqPR wui5qcsfNIGEw/IaffNxb+97iFtWTvSoBD6lI8twaUnHkPx1aJ1VCuKUU4v2a2x0RWQy 2PFw8h9CiLRd9Z3XLDRD20YOvTwj6GNckZSVHkTfxDBD5H0Kj/DR2YX1YdhqdzGwwiEF aToA== 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=XhvFwgeh3hnUW3ueL3xk/YTdbxM4GrvlLOeFf9y8IFc=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=FfGMhF7u888rSbPv4QHaa5e7aZxtH/ggOiyspI7NOYd3+LAAR9eIrOpNcA44tk8m4r 3TWQDQ6OAo0TiqC1HwCJPYpimut+xhOEV6p6nzgryQ2h1WqDVGJSNp1duah5VzSLYnIx qesLsYWGmDSEseRInHNJFghnOCFhELbzpB3WC9oC2VvD0kBkDfUNM+UWBg5ok1us5nOp YdvF90cstnHt/QBOS1PKixkklZqBtOD4+r5rdv5NfqRb58OOBf7uLfKQ86qcPlhmVwqq LHq8/A1qK82kOFhimC46GCEy36BC/84fts4QlSqUSEDaOXuFlubY4tY+czm0T89BHRCW T8Rw==; 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=UotwqQvN; 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-a93930be32csi219862266b.309.2024.09.25.03.29.18; Wed, 25 Sep 2024 03:29:19 -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=UotwqQvN; 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 6CF1968DC94; Wed, 25 Sep 2024 12:40:11 +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 6CF6768DA61 for ; Wed, 25 Sep 2024 12:39:48 +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=UotwqQvN; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 409154E16 for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id wihUjmGWok7L for ; Wed, 25 Sep 2024 11:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=UvvHMCnRkd6IyVAkS1sCKXYOcgsoPox12fOY6dQIyCY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UotwqQvN1hc+YxTprEy7FCYqHDCqfZbOnUVJuGLrUY3cCy0fYXUgWN0mGl2fLylGH ZnMxVQVdJeye9iq47KBhWc0ZtcMsze2U2NVOF6YO4gpuaN5YTnzsqMv6g2NZLjWbSe su7W3wqzQaaNACi+dnlOq0/Dysc3dQpOiWNawYM5R1C3uUTUGL6n0I3GXmAV0X3JpQ UIzbZJeuKexf02UAi21AoOH/5l7kHBs7yMo8scnA/LOBtWYlY6rYTfaNfUAzm+5Vbt WIudwxjUvP0bAUrblEZusDcmlSSNyI32Gohe1I1TEKzscy3EzzxPmuyU0q24uJnwN+ Evb/0stz2N57A== 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 7E5A24E23 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 9DD543A2191 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:17 +0200 Message-ID: <20240925093919.22929-20-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 20/22] lavfi/avf_showspectrum: switch 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: rr8w72/dS0xO Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showspectrum.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index 565f23c28b..c6594177eb 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -358,32 +358,23 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->frames); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; int ret; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; /* set output video format */ formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -1696,7 +1687,7 @@ const AVFilter ff_avf_showspectrum = { .priv_size = sizeof(ShowSpectrumContext), FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(showspectrum_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .activate = activate, .priv_class = &showspectrum_class, .flags = AVFILTER_FLAG_SLICE_THREADS, @@ -1883,7 +1874,7 @@ const AVFilter ff_avf_showspectrumpic = { .priv_size = sizeof(ShowSpectrumContext), FILTER_INPUTS(showspectrumpic_inputs), FILTER_OUTPUTS(showspectrumpic_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showspectrumpic_class, .flags = AVFILTER_FLAG_SLICE_THREADS, }; From patchwork Wed Sep 25 09:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51831 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp346876vqk; Wed, 25 Sep 2024 03:04:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU71ZVVa6OV1xcBO2fgHtIBWHkh3f0ELn/qaOBYMNLDw0ODmNmj5Czfhg3DLe/HN1uy1xMVZTC9EGuNoiNVHq8e@gmail.com X-Google-Smtp-Source: AGHT+IFBYjvZ1eIVbN+6D+1bci3wzgwbSrmkDWeErm2bHDyakwg+Oxib+FqcX7h1MYExxDCno6DF X-Received: by 2002:a17:907:3202:b0:a86:9107:4c2f with SMTP id a640c23a62f3a-a93a0632fa9mr254515266b.41.1727258669612; Wed, 25 Sep 2024 03:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258669; cv=none; d=google.com; s=arc-20240605; b=jjAs1CvgLSwksgbVISqweOc7AmBZd6mUfRIqayccmJlz/LkuVkcNrDA6jIY53sd8Np D0F6DkIakmlNetP0XORilxxy6mmEUjW/Tau1ZPM4N2wtkPz4Hj1FtQFTBJ7xgjFfLOOm YMw+8I/MSehls6PIlpE/OLx9v/gP1soxcp6Kt/gFjkuGSF6ibuSbr75RtlqLKwj1S6Fh pVI4wnWPmetJF9EVtN6lyw+K9IUF2nTHRZY+zI17CdkZyUS1Qfrnbzw6zRZONNOUJJI9 MDu+oNwWeQHUKwH5nQTkAyonBiMMEQLDHHR9hRzaHFyRY6tokS4qUw6cYgS+1CWYGaER B3lA== 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=Jykcs3Ge0ntQWfiYLCBiF6K7meVDZTs1MECz1aFWBzM=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=kqoGotefYYOE0oS7xwDxzk86f5qbFBHBaySLdNnQTngt//dCIzzVPdFnMdzbxgn58n s1sKu7aQz+VZRZ8bLxPnA1u7GQlv5C7CS6XIkSltJQJzgUuQFGed/BvL4rzD7f2TYY9f WPQB3kR2ZbWURuRFvDtb9wjFIJSHmkY5kRoOXg57/LuLCdnFjJsaUgpGW5SU7416dMYz EVa3X1LdxnZhnIERrN3n6IKJxLV6AnGXr7/B8mcAL92NSRufJlNHVkWnx4RKyCSe2tx1 i8siMhiOoFpOevLriD/4nsj287B7sKaWtgkNoQmpK+1Uemkoz1Lh/uzHlK5T05bHe2XZ VRMw==; 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=pW8Gvv64; 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-a9392f4e429si224597266b.254.2024.09.25.03.04.29; Wed, 25 Sep 2024 03:04:29 -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=pW8Gvv64; 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 8286E68DCB4; Wed, 25 Sep 2024 12:40:13 +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 85DC768DB63 for ; Wed, 25 Sep 2024 12:39:48 +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=pW8Gvv64; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 214854E23 for ; Wed, 25 Sep 2024 11:39:45 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id b8OkNStYtIfi for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=Zyyx7ButObAx02F9fQS2hcroP8Ok4Oeaq606ySbd3Jw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pW8Gvv64VZYB2uCPUfJOQU0XrPqaLtM4eV+PEy6zYH/R2sEtc8eLIGgBj6QyV6pgq 0m7xL2/BgUZvmuyr21KUK2Stpguu87G5yJHSMOrjHssSkTNQROVbnIFsUwbhcpNga6 l/NDLIbwZhdzl8bSp/ihzGZEnzWroNoJU6vgzNeKAgIdBv0LciJzH72SfOj8xKVHci XO7gXxVR6uqfW3ay/7f1aVgAfub4kplTbvlSsDXKKNE3us+IzHoOgwEwFGf/TShwFs StlpRenRU1FVkHritptKUX6UmPOYHc1hx8T75SwNXhpSNj1o2KcbrzRsWp+dgt8llb Rsw2cB14b8EFw== 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 CB77A4E2A 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 A98443A21B3 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:18 +0200 Message-ID: <20240925093919.22929-21-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 21/22] lavfi/avf_showvolume: switch 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: OVF08SodZHXC Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showvolume.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c index d26fc8841d..8caabf5376 100644 --- a/libavfilter/avf_showvolume.c +++ b/libavfilter/avf_showvolume.c @@ -110,30 +110,21 @@ static av_cold int init(AVFilterContext *ctx) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -520,6 +511,6 @@ const AVFilter ff_avf_showvolume = { .priv_size = sizeof(ShowVolumeContext), FILTER_INPUTS(showvolume_inputs), FILTER_OUTPUTS(showvolume_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showvolume_class, }; From patchwork Wed Sep 25 09:39:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51826 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp343255vqk; Wed, 25 Sep 2024 02:59:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUinNEXALNixJuTNIiqvnkfogmKs9k+Yc57VQfSGTuQ0+LSr50SfquhGv7yEux1YCtQ3oauqEnYOvU9kLj0KEPw@gmail.com X-Google-Smtp-Source: AGHT+IHs8Xf/XRygWrJ6csdQeORW/0Bl/AJBAqwudfs99YEsq7GWWEo7H0f8rT5S6JmCvDmlaNE3 X-Received: by 2002:a05:651c:1541:b0:2f7:acf5:1147 with SMTP id 38308e7fff4ca-2f91601023cmr13050921fa.23.1727258359148; Wed, 25 Sep 2024 02:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727258359; cv=none; d=google.com; s=arc-20240605; b=HE9EyVqxBFxKvULhWke/yh4lFbfrVYmaoRLfcOYrMaTjRoAdVywSm0Ctrm69uU5eiG D+tPTGhX051A7vop7r7q6SYx6n4FeHVVS9VsLhxo0n4oQFVVf8wRQV4LPFEQK5wE8QPI 6kmh0mrC+NFi/ULihXsQRucvqXAYUl0Hprvrksudp4KtFJohyIf6HL1fmnB1+kWxnTkm YKDa7IofsbfGbgZOYlsEdmjPZgnmNt8CVYaT7SZBWJUCQbdn04rQVNnl1Pi4VISEkDUE asLuHk4lHWzJfXlTv3aEAgiHVE9V2N+htdvUhxJv0WY85uJaM0zT4KclB2bU1e8PZ4R+ UeGw== 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=1adM64I96kldqGffR8tMUhw5z8xyYV5+DaXaKJX0NYg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=AYUouzGefqUqIT3TL/k++7mBWINM8OrRp0YLitd5u4wGZzS8f9Eb8aw32/hrD+yOzw SsMRawBC4xKrRYLg1SLcnci0I5Fguayhx+quNfUfB2GFpd9WOvbM/2/fzyF+/39Pc0FB wMG7igqJTf5MUvU5ZbL8pRHaAa4l8lwUJpV+VUKE3qNGOLsydzfkKjkyYXHZhFKKW6XO BUw5LSHB3ObTpYrou8ZoQOd7vWbZtmlj2TqAM6Ms/mC+h7MOucCXiFqKeBMkSADWGzSP GrxBhDadE+r/coYHJgO2rqjS72vB0T4AfiDUAnZUa/MbQczcrUTqXnrHuVIN2bBTlkQZ 78uQ==; 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=CNe6zObW; 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 38308e7fff4ca-2f8d283bd46si10260031fa.159.2024.09.25.02.59.18; Wed, 25 Sep 2024 02:59:19 -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=CNe6zObW; 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 96CEA68DC58; Wed, 25 Sep 2024 12:40:01 +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 3B9C568DAF5 for ; Wed, 25 Sep 2024 12:39:48 +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=CNe6zObW; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 8B6894E1B for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Dxfr3tXYMgeh for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=RsMkfzC0k1E6BvGOdc421wihiCSJ6YlB6bFjXOGr+Ig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CNe6zObWF2rnjHxebf3F443kFrCHFTIQBqkBrPbI1iDhY51MoEUM8/iXnKii3nnFR ncKxWXZ1++YQ8NRYkDz1FFhz2GIZXQ8e7Lr2jUi5+RkQkXDAME2a5Hevf8EZucTI/g xhXmIXkUK6aSKEU65mZib7TVqKXXe+i6DgOIHhQ6R6paEk5eWdmNDouj/ZeQseBG8D va3kj0w1UFsn+IidQmXvZCUDhgc6B738W5pgNaIN1sRW/DD6x0mNV38XW8Vhn79yc/ HOlM98sUveP0z/lyRt2L29XPfx2XSt5PqiBGnGa4n/wQL0Y44mh+gHMkfdBH82hfXn iHbSic/Kp2tzQ== 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 8DC634E27 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 B52D13A25C4 for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:19 +0200 Message-ID: <20240925093919.22929-22-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 22/22] lavfi/avf_showwaves: switch 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: cTqSgE4laVHV Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_showwaves.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 868e6a22d9..de73d8050f 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -155,32 +155,23 @@ static av_cold void uninit(AVFilterContext *ctx) } } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; int ret; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_layouts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; /* set output video format */ formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -814,7 +805,7 @@ const AVFilter ff_avf_showwaves = { FILTER_INPUTS(ff_audio_default_filterpad), .activate = activate, FILTER_OUTPUTS(showwaves_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showwaves_class, }; @@ -925,7 +916,7 @@ const AVFilter ff_avf_showwavespic = { .priv_size = sizeof(ShowWavesContext), FILTER_INPUTS(showwavespic_inputs), FILTER_OUTPUTS(showwavespic_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showwavespic_class, };