From patchwork Mon Sep 2 13:50: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: 51316 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839305vqb; Mon, 2 Sep 2024 06:59:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXNRTKu9yPTqsturciT+pwgstdTgzjjwsg1wb7XRJ9X3ZmgBklVXsKQSuactwdmKCHyYBlyIJzvYwjhyEAZeMz6@gmail.com X-Google-Smtp-Source: AGHT+IF/7b/QRjFSIiXvlGcjCPxrGvzco2ifrgShCqlU5R6m6a4CaTMZtSzlTWgR7JHk0aPDEcvO X-Received: by 2002:a17:907:6d07:b0:a83:a86a:549a with SMTP id a640c23a62f3a-a89a345749bmr371319566b.1.1725285551053; Mon, 02 Sep 2024 06:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285551; cv=none; d=google.com; s=arc-20240605; b=K94o6wYoSalpbXTrjtoFjTlUQjCbpxY5jR/yxtoEry1JXnL4YMrPYogaqottu3zL81 gf89pTpqz4IN/Z6YefMN2+3G/cxnfWuqFBsgjhvGKYQlVT7cCM9yWBZPZLKgROpT/09i H9RD/Vj0lCvM9unC4ZnVWMm70UCmKFLB5fJEqw3q6uR9APRyYj09Rh4oOJf6ed+Dk834 V+OPxVJ4MiN8nKyU+Fyyn7CpuwLpuBdrK33AVGG0UIdSIhdHX1/TDy/HupvQtE8OJyMQ QEML0Jl7h3+YvAmodZhDYCC4jhRPhfSH4uk9radSRJn+8kCk9itxOGadR9Wz25zV7f0I MbPQ== 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=dqraxw4uX9M8/ZSZVjfotO21e/XWd9HAxiWogX4PMT4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Rd2PNaCoqoUDwILbodIp5OUSdUSDRLjtif7tlEDweWtIqbAYhQslP+tsf0haV+d7SG xHs4pFbEjhiemE1GjKT5sMAffehcj5i231BVv/hXM5KpQnFzFVqf4IBgdAPNnAQhNdB4 0Nw4NrBHh5EbAGCcBa1yuOCpLzgyNtuCFgXYdwuNXNboLIJ8d0G7MypBC2989rGhkXqP h4j3vXvRdIRbmFQhXLXMbLqokRE9PijVCIpqVSU/OYPVRR1fLTiBFXSLQ69bvt7YhEnj sulEsakgTnwItkXu9SdRI+zy3I6svi3Mp2y9J7C1LIHP3nTlNL0ol0n5i0NL6FtmQr77 Mhgw==; 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=DuA1n43G; 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-a8988fa24bdsi700834466b.233.2024.09.02.06.59.10; Mon, 02 Sep 2024 06:59:11 -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=DuA1n43G; 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 6C3E168E000; Mon, 2 Sep 2024 16:50:47 +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 94C6268DF02 for ; Mon, 2 Sep 2024 16:50:40 +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=DuA1n43G; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id AFF724E11 for ; Mon, 2 Sep 2024 15:50:39 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id kgQld5PsTbp3 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=bn51BT+q5p8DDZZoQBTnSBdT/qGRkO5jmPodMlZdnqg=; h=From:To:Subject:Date:From; b=DuA1n43G5mWOx2nOCyxzuOwEVOSU6fxKlAKJAj3nDj+K3LSM8wdOlhAnXzFpkwruX KMLPUC3Mdf/1PUVbRWhjSo9/58x0se2DaIZ5+zcHhw9i/lOErWz+p+zfP1JoDNej5u lQZe5PqwIKlZGu8Pvd/iuBUFsjYYViPLIz+VxF+h2M1i1vjp7MgBFklKYo4AOsxZZB WaaTXvtNIAev6BFWCj43A8S86iL0Ei9QPsaeybZeCs3g0Z/1mHPZ5epIZZhyzLPOnY 8ZPEzJffqdazg7PiFKrClDNEy7pYQD/yV5kJuStaHFrXs4LRToTLR2Ldx08y7lSowo lk3gWJegnUmSg== 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 15816EFE for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 974153A0183 for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:01 +0200 Message-ID: <20240902135013.13803-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/13] lavfi/af_agate: 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: Z1nQCBN1ydsG Drop redundant ff_set_common_all_channel_counts() / ff_set_common_all_samplerates() calls, since those happen implicitly in generic code. --- libavfilter/af_agate.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c index d725485950..09655b7f82 100644 --- a/libavfilter/af_agate.c +++ b/libavfilter/af_agate.c @@ -310,26 +310,28 @@ static int activate(AVFilterContext *ctx) return 0; } -static int scquery_formats(AVFilterContext *ctx) +static int scquery_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE }; - int ret = ff_channel_layouts_ref(ff_all_channel_counts(), - &ctx->inputs[1]->outcfg.channel_layouts); + int ret; + + /* Generic code will link the channel properties of the main input and the + * output; it won't touch the second input as its channel_layouts is already + * set. */ + ret = ff_channel_layouts_ref(ff_all_channel_counts(), + &cfg_in[1]->channel_layouts); if (ret < 0) return ret; - /* This will link the channel properties of the main input and the output; - * it won't touch the second input as its channel_layouts is already set. */ - if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) + if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts)) < 0) return ret; - if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); + return 0; } static int scconfig_output(AVFilterLink *outlink) @@ -385,7 +387,7 @@ const AVFilter ff_af_sidechaingate = { .uninit = uninit, FILTER_INPUTS(sidechaingate_inputs), FILTER_OUTPUTS(sidechaingate_outputs), - FILTER_QUERY_FUNC(scquery_formats), + FILTER_QUERY_FUNC2(scquery_formats), .process_command = ff_filter_process_command, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, }; From patchwork Mon Sep 2 13:50: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: 51310 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1835215vqb; Mon, 2 Sep 2024 06:51:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWv7OiyBtiCh+ob9/G9Aki+WyN0zCbYBI8Nbol/+uD1j8yt1cKqH3ukYQdoLNO33G4ecrISNKf6pMU39teBs4xG@gmail.com X-Google-Smtp-Source: AGHT+IH8IXtVObVV40PzITgdMEAOKlppyAJqIhHwdKmOZrwhxZou13r39gPTLgJqxf8QO3JsMBIs X-Received: by 2002:a05:651c:2211:b0:2ef:1c03:73e6 with SMTP id 38308e7fff4ca-2f61e09b9d7mr35947961fa.5.1725285084895; Mon, 02 Sep 2024 06:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285084; cv=none; d=google.com; s=arc-20240605; b=eZDAj3DRJP258McpWBMvS5lmLrXZLcVkXCsgaOhZ6nO4BAfch8ehn38wQ09CYQj4iM tRVZHgElXhmwp1QjB/kh1z22FHzqZkjplq7YjlsG/u1M/W+SEbJL3WgRX616rhfizmdM AUgkmpNr0u9jYrGZuGxY9kB6GW0qbZPujHHir4c8MmdxQl8HVMgLaFT+3QmBB/uXPjPh xdR99pQ52WiFNKmx/PJmRsfOhZPg2kKEc9GyqR9V4TIH7hwZpkXFvUnTMvZqi+dIO0Ra 4wRyia1OwKPefPxobIY3Y1Nj4bDMo1cdeVRqISihCDEu5RAT+Rovl60VhElkCTDvKwgX 2Z/Q== 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=6WOJ5zUFlD38+4ULZ2WeVPQFrrma2s++tt6VD/Hbt4w=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=RGQ8WWeQkXShiIzPCVC5QzrSzuHM5zVi7Z68xNvGKiKn6sRw96oVBCwtG7hngVrl6R xlOsuMFRbjX9oKPzVi1Xx3xrjMjUiVEWOD0jJsidYnD8jEqTxREtwkCEyVtmWD5fv63K 8cI7lUy1hEngwn6fT6H2bZFOQjQ/rM9H6LFdD8GIWi186QSczNe20/URS3ERWf7NtL0s HzlC6EfWtbHxeoslgLD3rHExGQDaLnCX5hYmrRlszXWG+y+nRJrBVwUKWwvKYVnoEV3Y VCz6jfAgNtzxjSYNLGklZZMEfx2wj4IiwD3qAiwP9ygNOmVuHqTLTnP/tvnFH0dT+ET3 gaeg==; 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=V4dk+bye; 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-5c2435e10aasi4083237a12.267.2024.09.02.06.51.24; Mon, 02 Sep 2024 06:51: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=V4dk+bye; 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 81AB568E0BE; Mon, 2 Sep 2024 16:50:49 +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 9B11968DF1A for ; Mon, 2 Sep 2024 16:50:40 +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=V4dk+bye; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1EF1DEFE for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id aCX32oyAOW1z for ; Mon, 2 Sep 2024 15:50:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=b9YeoMFnIw9/c+gPJk2miti5Ss126dMvaUcaRfNJUfY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=V4dk+byenfZj1196tH2PVvziHiwJhojLlS4SmiO5+q+OaWiHwQ8pehI5oGKbhPObV 3USva4itFV5edQ/O8W56F4yR4aiib1G2wRh+yyDuSZA/KEmcFQO7A87d3NKOJQDJX/ VMr7uUvLOfZFiTB2XuDT1/+07OaPfiTpk8tfsTiFoxudsR3C0xnVu3+R4WF/1vmVJg jUW75rUzNHNFHocD4P2kaEMdynjpqIklfj0rubx96tMGErWJIGKCUzf+Htant+iDnV SS+4WytMT7HfB9Qv9EzuzPFF2KSSv7b4bCRbtfQegMTUOG+zOItUhlUwry11OGcCha pKAmo3jWMuOWQ== 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 1A9E44DDB for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A40A03A04A7 for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:02 +0200 Message-ID: <20240902135013.13803-2-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/13] lavfi/af_aiir: 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: KmoPnq/q9+2x Drop redundant ff_set_common_all_channel_counts() / ff_set_common_all_samplerates() calls, since those happen implicitly in generic code. --- libavfilter/af_aiir.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 462fa4666e..dfeeb34c9b 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -78,9 +78,11 @@ typedef struct AudioIIRContext { int (*iir_channel)(AVFilterContext *ctx, void *arg, int ch, int nb_jobs); } AudioIIRContext; -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioIIRContext *s = ctx->priv; + const AudioIIRContext *s = ctx->priv; AVFilterFormats *formats; enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, @@ -93,23 +95,17 @@ static int query_formats(AVFilterContext *ctx) int ret; if (s->response) { - AVFilterLink *videolink = ctx->outputs[1]; - formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0) return ret; } - ret = ff_set_common_all_channel_counts(ctx); - if (ret < 0) - return ret; - sample_fmts[0] = s->sample_format; - ret = ff_set_common_formats_from_list(ctx, sample_fmts); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); if (ret < 0) return ret; - return ff_set_common_all_samplerates(ctx); + return 0; } #define IIR_CH(name, type, min, max, need_clipping) \ @@ -1572,7 +1568,7 @@ const AVFilter ff_af_aiir = { .init = init, .uninit = uninit, FILTER_INPUTS(inputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_SLICE_THREADS, }; From patchwork Mon Sep 2 13:50: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: 51309 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1835095vqb; Mon, 2 Sep 2024 06:51:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOjfLdtkYIRaHgWFanvH7XQPsL1cwA1Uv3DcCEyroZw8c2wS7Ve7O0MnPujgiOT9DRROAW+a6mEUGmy1Hdd6kL@gmail.com X-Google-Smtp-Source: AGHT+IHuczU+qLdMdvWOgcoE/oBK+a0dG+mVX2TQXKRac56d+FPUynJXgp3ho+Ktn8OC6aofG4le X-Received: by 2002:a05:6512:3b99:b0:52c:e1cd:39be with SMTP id 2adb3069b0e04-53546af5268mr8018635e87.8.1725285074734; Mon, 02 Sep 2024 06:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285074; cv=none; d=google.com; s=arc-20240605; b=Bppaams8xGnjmOUPOoDgeEzXDIwN77ZSY8opmwrminRhNmqSFwMA2sHKeIv7+UQ3ms 69UaWIQcG5N4jEpzxdBTtlZaj4C1kfXvtt5UQUva5ceKOC3rOvOYPWWX2041xV3WFUvq 3Ptx0wHW3gPOSqB2nv9LT0aA2UChw9z7JVveb0dIEQ80C10eqVWyKgSK1qIZLzJQxUYF 2BHyhrKqPChaObCB9E5l/la1Z+N2IAoHsdpMwx8wpBvacFLKrCeMjn7LWrx+ZNFRqHxj 6wFzsBIUvjVjYaTOrW4HKdaQDGTRNyoLKDsy3CZsU27QrtgbAOAflX2FzrXZJH5dx67d CeBw== 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=+8QbHG953SU/TXEPu6UXp5QyDu0OebjKRI2wLx/xhec=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=DvgCOkQgVoG67SHBXQKT4Dup4FRj9W4JP6VAWn1CQmoq/+M7pT8Fo2TfhihbmsE9DD qPfjaB2q/+oX0EQMlIj1C/utsZ0i9DPVuq1SFblorAcIxvj5oJgTvpyH3nrSIBgclMX+ KBYitgNyngV/KHjwE4uBC3VyReY4SRxsPD3kypDJM5SuPqL++rVxlA9Zsq0/6Cqqsuil DDktgFrGjcybSlyKIt5s1fNV2UDRqm0x2PM1RBRoxrM2esmgEjA9XJiyJatAmj9H7sAj HGBxGQIIvb+gC1ka8AUATbkNYMvH4Llhef+s7X5frbUMyIXNXLWXfdPWYV8kNu9i0vkw YDnQ==; 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=hzU5z1AE; 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-a89be2aeecasi392154766b.388.2024.09.02.06.51.14; Mon, 02 Sep 2024 06:51:14 -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=hzU5z1AE; 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 7C37068DF4C; Mon, 2 Sep 2024 16:50:48 +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 97FBE68DF07 for ; Mon, 2 Sep 2024 16:50:40 +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=hzU5z1AE; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 237684DDE for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id AQtvOcYrGL5u for ; Mon, 2 Sep 2024 15:50:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=tHPVwwYMWdbQV47ihOBwrBGuRNnoLfkaXARUWZGKwkc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hzU5z1AEtN9QkWiOXYy4pz+k40SP6iX+oxhJTHSb0HIGKl7Z9CxgI1ITrdPqo39LU oC65rpbjFvAfyqrWD7FFRzSOCyQqxfluO2yV7ICN9eG0UE6trKixv6CSlczYibZP2t RHsvNXpa6fg1c30e/8RNM5OaLYcQjAR0ymG2W7fpxPS1RbUuqh9tTMkr3nX3wBmjeE p9Ywvk171LustaTA4NYEVlaGZFOdcTuK7NyI8p9yOu8J0qiqd9rSXOwMQ3PwhG2AXZ nc1+KzC+B8lWA4LTuPiTwVS8bV/quiMLm/91Er3+Rh5lilZQE+BkzD8BhHVosKF22+ KG8D7t5zvFQIg== 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 180CA4DD0 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id AF1043A181F for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:03 +0200 Message-ID: <20240902135013.13803-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/13] lavfi/af_anequalizer: 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: ljo19TQ1NKa8 Also, simplify code and drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_anequalizer.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c index fdc9404857..26e9c3cdd7 100644 --- a/libavfilter/af_anequalizer.c +++ b/libavfilter/af_anequalizer.c @@ -217,13 +217,11 @@ 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) { - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; - AudioNEqualizerContext *s = ctx->priv; - AVFilterFormats *formats; - AVFilterChannelLayouts *layouts; + const AudioNEqualizerContext *s = ctx->priv; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, @@ -232,25 +230,13 @@ static int query_formats(AVFilterContext *ctx) int ret; if (s->draw_curves) { - AVFilterLink *videolink = ctx->outputs[1]; - formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0) + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, pix_fmts); + if (ret < 0) return 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) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0 || - (ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts)) < 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_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); + if (ret < 0) return ret; return 0; @@ -775,7 +761,7 @@ const AVFilter ff_af_anequalizer = { .uninit = uninit, FILTER_INPUTS(inputs), .outputs = NULL, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .process_command = process_command, .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | From patchwork Mon Sep 2 13:50: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: 51315 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839304vqb; Mon, 2 Sep 2024 06:59:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXfzm/YcIBPlrruPDX9isRxPRDGutopVfRRbV/U3sovcLEyn1893wVAPAg3KO59UIAAJApywkeUbwFCxW1TGXR5@gmail.com X-Google-Smtp-Source: AGHT+IH/C2uDZXBG4MzRGhQU1I5DM4M7etVxDnQD6bs9KkY5ln+MG08ICVzSz5a4iNSTwq1YpFkw X-Received: by 2002:a2e:a988:0:b0:2f3:d032:4489 with SMTP id 38308e7fff4ca-2f6443fae63mr958871fa.8.1725285550986; Mon, 02 Sep 2024 06:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285550; cv=none; d=google.com; s=arc-20240605; b=iqkQYV9vCYiq9sCjpL98JSbo6eiU7Ytxx6toZp5uyW9Eyz6oPpbUArwyLZ8HvHyT66 YPbRkzkDXHmkAoZ8QZb1BH5aIOms2+y6e9hNw4u+drAGyIaSObX6+MSGWyqOsbmnvldh G+rFuHf9BNHjtStDdOi7+kooOMUT20SdwQNiQlBAlQhGRNmB53DUGUyFmuhIKJPJDQu3 z4APhO3YEZuqrMD9LMpB/d/L/3LxU5SiSVDe18y2RUfvIJNF2qEQEORJNHkgvPwBS3E/ wtkdNZKT1wakTNbV9ci2m2V9yvryK4xJC6R04bCn4Dh/a6jvh7igHnZSYt+pU+BNH+N7 dTDw== 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=SWh57OjqA6F/O3b+1p1NAguVq1q1x5ZTzQl9FLyzjB4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=WX6K7ChFfPSRF1yEjLw6EmiBSBsdVu85HOdDocby2lv2cSqpVazPHecWsTi1TZYzci hF3K9oHbWRip5jL7GbFeGUsnAQ5r31o3b2c1ADZx5nDcXmX5DeX5eW8u9xHbyzRljqS8 MpIJAUgmh6sB+2hYyHW8E1Fa2af1VhWX5K3L8dnNo37yRalPPR4z14lidU151k4PnA3p kuVYHuQSbQ5ZwxfgB/31szDdf3pqbsIkqH+f/9qjmIDT+bijjNlJTWXrLuaL2Cce0hDE L/u0JBy5AS4C9/QadLKisJzluo+X8AGQMAk9LAyDz2iXt+HhMZbzy3b9FVgLKxeWLk+J A7RQ==; 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=Y3Dq5ziv; 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-5c226c706aasi7320029a12.28.2024.09.02.06.59.10; Mon, 02 Sep 2024 06:59:10 -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=Y3Dq5ziv; 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 605A468DE80; Mon, 2 Sep 2024 16:50: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 1502068E089 for ; Mon, 2 Sep 2024 16:50:46 +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=Y3Dq5ziv; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id A79D14DFC for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id EztjaTkLSc1s for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=neFQZKEhqyoTEO+tSeJZFuXivT/gV2cWw4IeoiAsOSA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y3Dq5zivyz71pDTfOSK6CRjqfOnWVXDhZd4YcUktIyxHWVXB8sL2kWA52h9Jvdlhf e/8yv+7av+htWVQ7IHe0Q6QEPPRpp00IyonKMSFYVUzSxKOynnhsgJhQDf3C8cu2Up 6CaM5sytxwICmwCQW/mkmfIr0gdI0wplq80Ay8lv9uQb4eq2dMKRBBJHx/C0G79k82 +x/ekwFNFk7oh4tfBue8BrpUloRInfjtYexSrH9O02sO9CrSACyS2slCN3lqrAS28J nm7dNOQsMAe0IKPMmqUMWc5HpdCRqAOzhcokZXfyoTkZrtepcTCOjq7tkCMed6rlyY dzoGjrCnbVz2g== 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 79D9C4E02 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id BA1CF3A1F24 for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:04 +0200 Message-ID: <20240902135013.13803-4-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/13] lavfi/af_anlms: 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: QJ0VU3o/z1dS Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_anlms.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c index 1764b01072..4e83a0501d 100644 --- a/libavfilter/af_anlms.c +++ b/libavfilter/af_anlms.c @@ -87,9 +87,11 @@ static const AVOption anlms_options[] = { AVFILTER_DEFINE_CLASS_EXT(anlms, "anlm(f|s)", anlms_options); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioNLMSContext *s = ctx->priv; + const AudioNLMSContext *s = ctx->priv; static const enum AVSampleFormat sample_fmts[3][3] = { { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }, { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -97,13 +99,11 @@ static int query_formats(AVFilterContext *ctx) }; int ret; - if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) + if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, + sample_fmts[s->precision])) < 0) return ret; - if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); + return 0; } static int activate(AVFilterContext *ctx) @@ -277,7 +277,7 @@ const AVFilter ff_af_anlmf = { .activate = activate, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command, From patchwork Mon Sep 2 13:50: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: 51308 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1834874vqb; Mon, 2 Sep 2024 06:50:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUzlEqHxsuKwq3vbt0eS77umPAalLAHRID8FanymOM+UvPBPeovNS2nsTnTN7FOSlgfXBlIF3u9u8jDB+JFXSL/@gmail.com X-Google-Smtp-Source: AGHT+IFACpnIQmsx56VHy7JQgZiVHvS8JQobUzkkLFfIUIa652p/9PauP+wYbg8Ccuq2HXaokjLo X-Received: by 2002:a05:6402:5512:b0:5be:d687:9e6c with SMTP id 4fb4d7f45d1cf-5c21eda0f51mr13063491a12.36.1725285052194; Mon, 02 Sep 2024 06:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285052; cv=none; d=google.com; s=arc-20240605; b=Z5qp8oSk5Z/WtiPHTKSvL1Szn65n91bxoENlXMzoh4tUHt7v2IzOyFrvx/U04YtBj7 mSOY7Q28nKIrBV/qJg+YsnAuhKC+4VKXhu7h/9UzCLuAi6ZbFJLwrblIaC5yxsPPbi9f 7ylAJo805yHUaFg5k+2dMIHZtIYU46Mh8626GyrRBv5kkyA+YTaS30GEMxUQimul/fS8 37Jx4VMXb1+99F6rcxt3IuxiDjHrdSOTk3gneQ6fuIFJzRjIUy+E/2vqBoj07103pPgr 0aY8DLzj6DO71QVOukQXgmY4Kl/Qd0Y4oTqB5hSSHAuj/kcChlznqAbR56bABln8hutB TqSA== 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=4aKfivMbutAHkaGXQly4YmcDCLiACFxGTTEbzTgx640=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=iKv3tBwRvbcZi8S7ioEA4RZ7vrgONtW6FPQubAT6k67KDh4YVFcGEC1fHP5QwmMFVx Q631z9P2RDbnLlXjBk/vcI/YdV3aiULZ8JMubGlt3EW88kiery0FUrkUH3KzwLYessys i+auX/kAjXdeGC1DzkSySDdPXe0mQ0V+whh13XZdeIZgJ2nwd80X+deqY/6DoSpbR37t r/e/XUhm213sYGVpNjr06epKMZ76k+3EVoFh3yCRX4bMgfyyEBnxn5kyh3jHvE5BeaEn xzqv2urTu4T+r5ZjRdG5Th5LRRXmkwyw2k0zvN0f9F8c2ssEwUVawE+CjWrsX6DXAV+5 uo4g==; 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=EkfLfsOF; 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-5c256ee329csi2024806a12.621.2024.09.02.06.50.50; Mon, 02 Sep 2024 06:50:52 -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=EkfLfsOF; 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 70B6768E0B6; Mon, 2 Sep 2024 16:50:46 +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 91BBF68DF01 for ; Mon, 2 Sep 2024 16:50:40 +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=EkfLfsOF; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id ACDBD4E0B for ; Mon, 2 Sep 2024 15:50:39 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id locYFqQUL2tn for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=TXpfO7nv2q02rfrgpd2/omlqkbDxSDPpefAZJ4oIkcM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EkfLfsOFjVwkVA0lOCTjuSFe/u2CFyd+0Jnh8ISx9FQqGmf8xOEysgEon7TySl4yx PWSpMxvrWN9umECPf46Nw7oeHszjEmS68hXpYk68Zr3OKUEFtwDu7A3Kbcd8nXuxMK aDWOVnDArUxNGI9mEUDIaY+AFzctVbVa/kz6u7pkyzdB1V1KkpjluIZW1n5hMFhpOL INUb4l6L4SwaYIW2cxstiNL6gotLUNcnURrWMMEkiboLjxs9b/4J80ExzD2JtBk4PK z0Z0L+ZH4bT9z157EPhyHoFXiDSVgOyt0TKZtB0DdWYWlecF7a/PZFdPpm4PZL5xGW h/E07Zggfu2oA== 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 1CB224DDE for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C5D3E3A20DB for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:05 +0200 Message-ID: <20240902135013.13803-5-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/13] lavfi/af_apulsator: 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: ynDEBXDjAZZS Also, simplify code, and drop a redundant call that also happens implicitly in generic code. --- libavfilter/af_apulsator.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/libavfilter/af_apulsator.c b/libavfilter/af_apulsator.c index 4487bec956..8e01cd6feb 100644 --- a/libavfilter/af_apulsator.c +++ b/libavfilter/af_apulsator.c @@ -185,19 +185,30 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return ff_filter_frame(outlink, out); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AVFilterChannelLayouts *layout = NULL; - AVFilterFormats *formats = NULL; + static const enum AVSampleFormat formats[] = { + AV_SAMPLE_FMT_DBL, + AV_SAMPLE_FMT_NONE, + }; + static const AVChannelLayout layouts[] = { + (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, + (AVChannelLayout){ .nb_channels = 0 }, + }; + int ret; - if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 || - (ret = ff_set_common_formats (ctx , formats )) < 0 || - (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || - (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); + if (ret < 0) return ret; - return ff_set_common_all_samplerates(ctx); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + if (ret < 0) + return ret; + + return 0; } static int config_input(AVFilterLink *inlink) @@ -245,5 +256,5 @@ const AVFilter ff_af_apulsator = { .priv_class = &apulsator_class, FILTER_INPUTS(inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; From patchwork Mon Sep 2 13:50: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: 51314 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839291vqb; Mon, 2 Sep 2024 06:59:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzjxteEY3NBFptKcqFzUz8sFFqSWr72nkn8cOQr5cT7siPda7nMVPRNPkwcG9b66HtorjJv9sdH4daxUdsDsHY@gmail.com X-Google-Smtp-Source: AGHT+IEa2WX+sjeCJ12nJcCUG+Vq0EVzx/GTQeemkknz7ZaF9F3l+3uE3rJFshNPF95Y/EIxngIy X-Received: by 2002:a05:6512:3a8b:b0:533:3f6c:f8a8 with SMTP id 2adb3069b0e04-5353eba3f2amr5194265e87.6.1725285549680; Mon, 02 Sep 2024 06:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285549; cv=none; d=google.com; s=arc-20240605; b=MtAk6UWvmhULnZhJUkVrsHgLlhpiLkM6KGrSj37+E1dp/lz59NyvtJZjjlcUJWonQs K+CaaIKPvRo5iTQ97Ub31ng8vcxiKqBAkbCdFr5HC4jZptVxSuaf+T1+lcVRJEWr+toP 4TCstfLP+U8ckyLiLILYEtc8OF2U1HfQPPtiizN1rXYH5w+1mF+Ohmf1iN5EMSuYHYIA TifJVneeFx+m+/WxIYDZ7B2CYQBzCa952aA0jEyJrhyDZzT9vq8nLXdi/4/7pyep6diq 5M2Ox0YH5VMjiCuut21Ha/st4FurY2l/30vN6I0KwlF4oYnzGc7QHOxpHIopurAY5ZNx xg1g== 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=OqQukhERJYq/X6ipSPG9h1CXxP0isNcC+PlBq3nxQjE=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=jRo/RN2ktmwjh2hg7M+SqiBKIw7kpSiWMKKTspsTvQRMcmergy1Sl2g+KQGJbN6PWw JiSOXOIA/Sldk4QI51cH3y4Vmfy98xv10/Qgp1N1mCno4zvPkPkg+K6uluq/V3JdrdaO fMMopB5qsy0j8p093RjwEGTAz9cB3ZSyeOm2NWwcNiZCy/LP4oddJ0oM0JhewNM7Ry2C v4VoElR4Mj3xnG9OA60el/3iR8Tj+Tn923hFYVml9WngkKFGGv7xFist4uTkc6NG+0ny CTC8ZbKWz616meoY5NB/skDquvmLu5azBitbSLPhIKQXnXEFWpESpsnVAdktp8dMVPXZ EIYA==; 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="iK18/hru"; 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-53540842df5si3406649e87.554.2024.09.02.06.59.09; Mon, 02 Sep 2024 06:59:09 -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="iK18/hru"; 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 B81E368E0CD; Mon, 2 Sep 2024 16:50: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 DC57768DF5C for ; Mon, 2 Sep 2024 16:50:40 +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=iK18/hru; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 7BD774DD0 for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 2sME9qq3yHkO for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=z/ulvhAlaQhBCjslFNoosNMZ9t4jtpzRBARuOb2mxz0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iK18/hrukUh6g3pJpjyy8fUHZKQCAyFKod6zX+Goeh1kDMWrXltcHopjAsXT0LsoS PJv35Rs7xHKW32pyBcZwYoLtc+lxjWeemdAC9eoFKOCQ5tg2nQT6ce4o/jjeaFq5iB P+lbc7wXEEpiaynH8rkIiKsx5eSs3+KRsPE9w0wSSx3ESUZ7Sv9qcjBJscKOssDe4M WKjy5wlnzdcTJwcaW5rxMZYa23UAuqiniHTn8nmnp1GMBCPnAF9CBHujoTfJSEqPUW zTKbRxW/En0+wD7xBvXd3zaqASer9r3zg2zv4y4tTsS713qdo5mEAzMxXquNsJVN0M pR+0dZqhjk/1g== 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 3C1454DE1 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D19023A25AA for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:06 +0200 Message-ID: <20240902135013.13803-6-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/13] lavfi/af_aresample: 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: tuhr1761VodH --- libavfilter/af_aresample.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 2a67b06260..9ee4082c0c 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -63,16 +63,15 @@ static av_cold void uninit(AVFilterContext *ctx) swr_free(&aresample->swr); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AResampleContext *aresample = ctx->priv; + const AResampleContext *aresample = ctx->priv; enum AVSampleFormat out_format; AVChannelLayout out_layout = { 0 }; int64_t out_rate; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; - AVFilterFormats *in_formats, *out_formats; AVFilterFormats *in_samplerates, *out_samplerates; AVFilterChannelLayouts *in_layouts, *out_layouts; @@ -84,15 +83,15 @@ static int query_formats(AVFilterContext *ctx) av_opt_get_int(aresample->swr, "osr", 0, &out_rate); in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); - if ((ret = ff_formats_ref(in_formats, &inlink->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(in_formats, &cfg_in[0]->formats)) < 0) return ret; in_samplerates = ff_all_samplerates(); - if ((ret = ff_formats_ref(in_samplerates, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(in_samplerates, &cfg_out[0]->samplerates)) < 0) return ret; in_layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(in_layouts, &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_channel_layouts_ref(in_layouts, &cfg_in[0]->channel_layouts)) < 0) return ret; if(out_rate > 0) { @@ -102,7 +101,7 @@ static int query_formats(AVFilterContext *ctx) out_samplerates = ff_all_samplerates(); } - if ((ret = ff_formats_ref(out_samplerates, &outlink->incfg.samplerates)) < 0) + if ((ret = ff_formats_ref(out_samplerates, &cfg_out[0]->samplerates)) < 0) return ret; if(out_format != AV_SAMPLE_FMT_NONE) { @@ -110,7 +109,7 @@ static int query_formats(AVFilterContext *ctx) out_formats = ff_make_format_list(formatlist); } else out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); - if ((ret = ff_formats_ref(out_formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(out_formats, &cfg_out[0]->formats)) < 0) return ret; av_opt_get_chlayout(aresample->swr, "ochl", 0, &out_layout); @@ -121,7 +120,7 @@ static int query_formats(AVFilterContext *ctx) out_layouts = ff_all_channel_counts(); av_channel_layout_uninit(&out_layout); - return ff_channel_layouts_ref(out_layouts, &outlink->incfg.channel_layouts); + return ff_channel_layouts_ref(out_layouts, &cfg_out[0]->channel_layouts); } @@ -372,5 +371,5 @@ const AVFilter ff_af_aresample = { .priv_class = &aresample_class, FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(aresample_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; From patchwork Mon Sep 2 13:50: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: 51319 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1847525vqb; Mon, 2 Sep 2024 07:09:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZFa0ofWbrG8ipyrg6nS9n8a0CqWW2rN5+peL6/4tkrOn+GQwFPHen8/p50jvY4d0/LDiU5u5wsImvyRPMe2Ud@gmail.com X-Google-Smtp-Source: AGHT+IGzQ1Qt1ItpAyJlz/08pW3qrZDZLQT5Wkymw1hOKsukRBNqaNreWOAkLDJrOKV0caFhQAF2 X-Received: by 2002:a05:6402:42d5:b0:5c2:552c:f3bc with SMTP id 4fb4d7f45d1cf-5c2552cf445mr3299048a12.25.1725286150804; Mon, 02 Sep 2024 07:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725286150; cv=none; d=google.com; s=arc-20240605; b=MPXM+LjsfcDXerMqtoiQR2vXXpG6aU0g0MqTXeOWf/e7quPVJH15CkxoG6y3XlNbkc mc7LD2h0xmaV7fHrpMuQdH0kP0G95LRYZHt8c9f6TKaBE3oLIb9ovaUHARICn6XT2bDV gbjliVFZyUD1xb7CBKzus9y3AnM2NestbWugcEzl30nFW2HgPWDlOoa+YSeLZZxC+VAO deuWE0IghlEnnkudePV/H5HP0VTONAHaNf1eSFywEQFHBxK9PHUXRIs7b5KnBSqAuGL2 bko88B2kZu0jYV+InBgaPVeRnLShXztdJlfJb1twF3N5gTDJ/3l3g2XIub5bWAvTbzQ8 9MuA== 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=P9D477bWxvLcFTVpojmm1rpUaxGpI5U2e1SKXmqkp94=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=DG8OVIPVZH1tgbHWfZotTsNiLSkzZWRkQhYhuFpUc8OG5BbtlBeqQmfvajMSWnCWhI 0XTDz+AAt019DDB3YqfRP07FZLN0pnuq/niad3v8t4Kr36vxGtK0buU3gtRz1kisY1UY slNLbJ35r5V+ViPVqtzUJfNgNt9Zjhs2V3fVXYd0u0FN2nC2R0gFb6q6mDtWI1USZcgx I1LEw5EqAjjMlbrt7VLfI9YPrB8uEy/Rzv0pQQnnBTrZVNyws99aRtmmFxeSXlxoNENJ y98c5ZdhYyru/BTtBuB0vBeQHLds5OGCaelkUiiHrrQWizs+kksk14JRRfnIUxLITVbf Xj9Q==; 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=Tdzb4FTv; 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-5c24511e104si4011650a12.48.2024.09.02.07.09.09; Mon, 02 Sep 2024 07:09:10 -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=Tdzb4FTv; 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 C633E68E0DA; Mon, 2 Sep 2024 16:50: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 0272F68DF10 for ; Mon, 2 Sep 2024 16:50:45 +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=Tdzb4FTv; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 782114E0F for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id oXLCyAMmMSt9 for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=1hbEQxOCjylFefmVtl9uhnxvG/HmVY4mss/OIUT6wQw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tdzb4FTv9k/ILvws+wLDI4QuWSkhF/x/2G4DhIZw0dQ9QZPb9zVx7KGPvruchQX6m SCKmFHpCGJCy/MjGmDH99+t0XLmeqTkdO1SCBVKBFY6l9cVA2PbyAD5yYz5QIJ2GVl f8KO3Uo07YZ1lx6asj0fiyMncG5fx9MimzgZQa9zVQ9r8wV5eoFczQ/8VpAw6zTDh/ gvUVIvsUhiWeNFxnQJm6PlxGwE0rETH0t535eJz8TZgxQD1vEaQh99HIwAMOyT1fl2 LJWH0MocESQwCKMrbFeUQGZ89xlqYxMK4c/2JZ3id6XZVBVaW+MwTtMX2gpWtCOtr9 WjiFfWhD1EZ2A== 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 4F3D64DE2 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id DCEE73A2B5B for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:07 +0200 Message-ID: <20240902135013.13803-7-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/13] lavfi/af_arls: 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: HNrwbBubjrdz Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_arls.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_arls.c b/libavfilter/af_arls.c index de50da6473..3f182454e4 100644 --- a/libavfilter/af_arls.c +++ b/libavfilter/af_arls.c @@ -84,9 +84,11 @@ static const AVOption arls_options[] = { AVFILTER_DEFINE_CLASS(arls); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioRLSContext *s = ctx->priv; + const AudioRLSContext *s = ctx->priv; static const enum AVSampleFormat sample_fmts[3][3] = { { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }, { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -94,13 +96,11 @@ static int query_formats(AVFilterContext *ctx) }; int ret; - if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) + if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, + sample_fmts[s->precision])) < 0) return ret; - if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); + return 0; } static int activate(AVFilterContext *ctx) @@ -291,7 +291,7 @@ const AVFilter ff_af_arls = { .activate = activate, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command, From patchwork Mon Sep 2 13:50: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: 51317 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839338vqb; Mon, 2 Sep 2024 06:59:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUQXrPIQoZoHxzhbh3cciEBAvoVweGvwvMUnzwlijF0g4GhcCtEu771WjqkY0gHziV8HUKQ8dsIcSztoO3n7r/k@gmail.com X-Google-Smtp-Source: AGHT+IGkNlAsz7E7ACIu2URAjGF+eKxr81JDe5RSbVKBP6v00bopn/7mfTM5hNh8CRqOPbJptMU0 X-Received: by 2002:a05:6512:3350:b0:534:543e:1895 with SMTP id 2adb3069b0e04-53546bab3damr5004316e87.39.1725285555178; Mon, 02 Sep 2024 06:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285555; cv=none; d=google.com; s=arc-20240605; b=PVVzheGJk5EEDePF6mBTfYh3raNn0Fw0TktpbU/v5xzGj0sNTHPDCvEetmem6P4BT+ O1xkJoT4RHMz9NFndWrvYsMtrt/6Yc83zzwps1qvf6vNv/nbeSS2+dugVF4FKTaodvil SZQSCxoYqKvKpFzQTCBd/A95vSv4D6ojEiPiTBHoXXezAWWYh62a22sw3YWy5kmARt1k WpLsXfWR9i5/LorsaBkh8bSLiVqYAaxLQ89KmyDpKkgcivnubjJ24Dt4M5jiKMx7Y61q VSA4ti4BwVPL9xi2VufUyBJO10Y1F++aNV/sn2+K/oPSWR/aMU6MgMmU2DpGRwb8wNgL owrw== 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=sxlhOulX84O/0NL9UpgvFhnsq3vMMdOr9V8mqz4Hb+4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=EtCSENoYInU9OgWOiaAq2x/umEhjytpZxo8maouiNbT9nYdXSmIiMiqe97J+egZ4mz jaGJEVrTX+LNlIsANmG1FMgPBrO//bcxJGcY3R839mHXsa8eLQhquxk9KEGKj6dFO2fv lDIFG3vy5c2zLKOKojU4YqLtC1H0c3x6W7hx5VP9KSD2ZreT4XoAnEAv+2JYFhvu2hAq m2Y+jXzatdgSHAPxmmq4oShyqfRqjNnV+iplrkXXT9OofXM/UvsCj2sj54YLmNNSr9cl lDAqexok7umMAE0D32W8eXyy9v/kFBgxIIHgpthMmUMEKBdecuPucLNn0OggtCAQpRzO YVuQ==; 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=CMJdBj3s; 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-535407d89dasi3540048e87.247.2024.09.02.06.59.14; Mon, 02 Sep 2024 06:59:15 -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=CMJdBj3s; 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 D3F4268E0EE; Mon, 2 Sep 2024 16:50:57 +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 0571768DFB7 for ; Mon, 2 Sep 2024 16:50:45 +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=CMJdBj3s; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D19D24DDB for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id abGpccv8i9eE for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=5n8RZpgBNt5R4C411g4u+oyMxkgHRmnQ4xP4nuiLk/E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CMJdBj3smtbUsRGsBt9l85R9rDmB5Zxrpd9nrxi2nQV1H/eBBj0c60lEPVMucHOB9 faLAGqIYUoPgYijdXjzYyM+gWAlf2A1FLHe3wKI7rsuI+RiHZBzUdYbQNOOb1MNEaG mZEGcg5jI3AD8M4QYGp7mLF95re1FGOmf3yepKeKoz+aOADXzJ8kL+/vQkgPl32BVn Gwp9Hf7h3+KWx3dKX8L1lckPCV1psenWmZ20ogi2q0nfaYCIatEpW1RPVrZJfj5JsW eiE2zyCQ4H2Y8WdxGhVVHlMsXu85U1rMhXkAZdUOvF0WPfBogxIKZPbdcUERGACKdr ENmxlqyVm5t0A== 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 4F6A14DFA for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id E80563A2B60 for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:08 +0200 Message-ID: <20240902135013.13803-8-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/13] lavfi/af_arnndn: 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: n6dLqp9RGbX8 Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_arnndn.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c index b29af87df9..3c2ae6370d 100644 --- a/libavfilter/af_arnndn.c +++ b/libavfilter/af_arnndn.c @@ -327,7 +327,9 @@ static int rnnoise_model_from_file(FILE *f, RNNModel **rnn) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, @@ -335,15 +337,11 @@ static int query_formats(AVFilterContext *ctx) }; int ret, sample_rates[] = { 48000, -1 }; - ret = ff_set_common_formats_from_list(ctx, sample_fmts); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); if (ret < 0) return ret; - ret = ff_set_common_all_channel_counts(ctx); - 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_input(AVFilterLink *inlink) @@ -1608,7 +1606,7 @@ const AVFilter ff_af_arnndn = { .uninit = uninit, FILTER_INPUTS(inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, .process_command = process_command, From patchwork Mon Sep 2 13:50: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: 51311 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1835381vqb; Mon, 2 Sep 2024 06:51:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVeqsZQMDGFNFxNwocIqBQEhLcIaaDtDuMH8Oki8BUuwljvVRara29tuu8YUX4dQlPsIDMHYwcj/MGZYHQ6eds7@gmail.com X-Google-Smtp-Source: AGHT+IHOHOkRO0aLFM017P46ODqgIVcQqxGwgpNdjHZVd6dgEdJvjIfEcrRvDSggAYhQtvRFe1u1 X-Received: by 2002:a2e:be9b:0:b0:2ef:315c:67e1 with SMTP id 38308e7fff4ca-2f61e09bee8mr39887361fa.4.1725285105000; Mon, 02 Sep 2024 06:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285104; cv=none; d=google.com; s=arc-20240605; b=egmGZ+XNaqwM+hbs4VYUFG8RiVrq7UxxfD2asC04mDAfKAD68SZsZrCvn4ZTrMTdm5 ka9b7EZT5X2PClam7GnwW70dT8AL2gDf11xDx18Dt3Yr5jj/I7npcIXBOMNjJwuqr9er 7BAjQwgzmU+YztteBFQIv/6v1rqZ/rzHNZjI7Ss4SkclnHgAwu1eIz/doDlzWT9RiuPN TbfINO38KNX55sQv2E/zLafoz6yrr3jkmgeVt+BvZoHYoz9PlIp6I5c4HLDVzhh8DrJN iNNBd7WNniI2VxRZVmtvyUMw4RfJ0xRwCtxjLOdMlbowedrv8Fy8tzfmGN+y0vJo8Kat OWTA== 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=qHGBzPdMf/dV2DSfgij6LHNOwcFPufVOYYcvfVVL7Hg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=TTLbXUiomPYyzlzyaAFxuVxV00+ODaGuMHgK6g8NYC+jBnxzJpe+YZn8NdrZGk5xUT tX+Nqnd3LfVHKLW1IcN0JNQ2LdeAHaAT1WVzaq1X59x5U6yc7cAPuExg/ldaKAdDEoTj j67cBf6ZPACWGgZ2K8Ymqm8kkTKirFw6uKizobLuvtrIvFm3XQP2l7ZLQB3fkH42WBGL Zy2rRGeGSM4ikkSw/JmtAfQ1nRBIRzxkb+NW9SPu10np35jOiVhiPBMt1GGr4cvn6SGr bRLAmUyxmD2u2HAjIrx12wyEjh5uRDeC5f39MuEjSFWM9fvi+80mlyNywBfRHUlIsanL Incw==; 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=DkuUZXMp; 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-2f615181c5csi32129911fa.558.2024.09.02.06.51.44; Mon, 02 Sep 2024 06:51:44 -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=DkuUZXMp; 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 59B0968E0D4; Mon, 2 Sep 2024 16:50: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 02C7468DF4C for ; Mon, 2 Sep 2024 16:50:45 +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=DkuUZXMp; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D288A4E0C for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id jiT3iWzpD_MG for ; Mon, 2 Sep 2024 15:50:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=TxMv3CUoBrH1Xew7hCb8OJNn9ivff2FR8YZoUZfyTRM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DkuUZXMpE6V0m+7KhWn7pVt7HBFytAIorrKvz+6P353n+BjwxLsenlnJtBjnjNGrx T+ng7NJzCD4/Noqqydou0fbMjn7rF/dFktF7k/d++kaaYKZc4bYQ4hSY/R5ZkI976j uT+uYSh7cgsHuDmUk6b6e6V5ZdseVssvxLIqBRTM7m9Z5ZQ+9vyT+Nfh0CdDYhJI0Q 1lZ6p/zEd4OOGWOQZgIJ0H+VJPye5BMtfLZDUK+GeB2Wvl04mumVJmRuXSiKOC+T5g EUJxOUqm+oe2a0ewqGEQKozxHY0NGvJ5VChQOJk3Q/gBlkPnzRBq/uh8uQJ3jyHD7m 71xa997YGhrMg== 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 4F5D94DE4 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id F3B993A2BDD for ; Mon, 02 Sep 2024 15:50:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:09 +0200 Message-ID: <20240902135013.13803-9-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/13] lavfi/af_asetrate: 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: bFgBhnhxM2GH Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_asetrate.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavfilter/af_asetrate.c b/libavfilter/af_asetrate.c index 80f76fbb70..061edebdf0 100644 --- a/libavfilter/af_asetrate.c +++ b/libavfilter/af_asetrate.c @@ -47,23 +47,19 @@ static const AVOption asetrate_options[] = { AVFILTER_DEFINE_CLASS(asetrate); -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ASetRateContext *sr = ctx->priv; + const ASetRateContext *sr = ctx->priv; int ret, sample_rates[] = { sr->sample_rate, -1 }; - if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0) - return ret; - - if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) - return ret; - if ((ret = ff_formats_ref(ff_all_samplerates(), - &ctx->inputs[0]->outcfg.samplerates)) < 0) + &cfg_in[0]->samplerates)) < 0) return ret; return ff_formats_ref(ff_make_format_list(sample_rates), - &ctx->outputs[0]->incfg.samplerates); + &cfg_out[0]->samplerates); } static av_cold int config_props(AVFilterLink *outlink) @@ -122,7 +118,7 @@ const AVFilter ff_af_asetrate = { .priv_size = sizeof(ASetRateContext), FILTER_INPUTS(asetrate_inputs), FILTER_OUTPUTS(asetrate_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &asetrate_class, .flags = AVFILTER_FLAG_METADATA_ONLY, }; From patchwork Mon Sep 2 13:50: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: 51318 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1847465vqb; Mon, 2 Sep 2024 07:09:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlh0ANQn3XYmr/OwK/Gaq+IUC17bxzN4/PD/Be20scV7hjd2XdRxH6rnPkMlpcAkOdd7amzjqQ38S6HD0rbMHC@gmail.com X-Google-Smtp-Source: AGHT+IFESY0Hg9T7munh5I2jcGEG0qUYo5WORVckmGzOCS6ShGLiEtVFaD7T9LXP9cd1K23mzI0o X-Received: by 2002:a05:651c:2224:b0:2ef:27fa:1fc4 with SMTP id 38308e7fff4ca-2f61e023ef4mr33197171fa.1.1725286145995; Mon, 02 Sep 2024 07:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725286145; cv=none; d=google.com; s=arc-20240605; b=LhcVFe5//ckkNpjGdzlwg2haqrnodfVlYnwGT8MPcyDq7VYG1xulcVwv5IoDGDiI08 OAhDBjU/Z3tpL4V3OHyiJH5W6KC+kB0t7PeXNgTKBys+kegRBq4fxEg2pYNfyS3A9A8+ aiZtgL7LEhubj2EcvsQTUwFjGvwZ8Cgk+YV6ODh7czcJD6MLtcIOKPR2FLkQyygQ6wSR V/y+UO11iomgJw3L8XlAb16nMAQOdydByJXqEmlFOAQ0QAcjpSnQQr071QJLq/Z9yu4s uVfopQeQtXVs7MrFgILQO6j5c5wLDf6aQVnW6fTR3FrZolWTYcWuC+c8xYqWaZV6hU6N 3Qig== 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=0c6ytD1/7t7e9q61rMTU5OgyHo7jMcN4Zg0D4EniH9E=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=jsO1PwATTmczyrRYGn2+IdySj1sl0oq69vonrQQPpb67qhAfTPQpOg5X9/1bqs2Pz4 6bnvGO338U5UTxmaSi96DelfupfPnJ1MgX/1MtrrMaGYaSQ3VcX0t9b1bk3N1NqAfxyT A+R4XjI6OzUnEai2wMS0vA6FEhxVcAf2pj8rVQxMenoao/sBQxF7BPJmCocz1stOyebw DqANfnZro8I55TrRHpxkpN49w0EUV3XiWXYP9oC1nryNvNv3I+JftmifFwrx+ngOON7N WGxmAy1lx0wxplGIYuXKoufP9YqSj4tpP2jH7cAirLQx+7XapDm0em37ahM9ZWKtRvIH jyQg==; 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=gibqTNal; 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-2f61517358bsi31022621fa.475.2024.09.02.07.09.05; Mon, 02 Sep 2024 07:09:05 -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=gibqTNal; 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 3E09068E0E2; Mon, 2 Sep 2024 16:50: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 0355868DFB5 for ; Mon, 2 Sep 2024 16:50:45 +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=gibqTNal; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 4C8B94DFA for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Boux5a0TWO4p for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=lYcxG4ODnDn46zeXn+DLt7FtYpqrcMnSNfn6TckkSes=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gibqTNal0362lwkHT2gFzc1SwUVULg3CeBebk7QR6XdmrAI/4ebFpRxbvuJgjFHQ3 96YEiWXtIHTk9iDAZCnBJarvjrlSVNFSUBsgttf4quNkW7dnTPqgH7CaspaSEZIi5e cstAh9L9O5b5GMTaK+ajc2rtYcxBGzWvlZcD3StIzwUvZmQaZUZ9JKfyKMrtSECbNv 5kGBhnL2CySWKb0bJ0vsJ1K5QL5MMwLuklvkmmbwTSpr5XslBNE3wCuSTrNhvRFu8e Nj09Zi9ORdAMqHXONYAB7XaR0m8P+VfVskYIHAjEbqBuRRByq3x9sCKzQ0z4vN4W+s knJuBD4FdQG1w== 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 4F6394DF1 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 0B69A3A2C76 for ; Mon, 02 Sep 2024 15:50:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:10 +0200 Message-ID: <20240902135013.13803-10-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/13] lavfi/af_asr: 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: gjYWwgeFnNeY Also, simplify code. --- libavfilter/af_asr.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/libavfilter/af_asr.c b/libavfilter/af_asr.c index e19b7c3be2..26963222fd 100644 --- a/libavfilter/af_asr.c +++ b/libavfilter/af_asr.c @@ -122,20 +122,33 @@ static av_cold int asr_init(AVFilterContext *ctx) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ASRContext *s = ctx->priv; + static const enum AVSampleFormat formats[] = { + AV_SAMPLE_FMT_S16, + AV_SAMPLE_FMT_NONE, + }; + static const AVChannelLayout layouts[] = { + (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, + (AVChannelLayout){ .nb_channels = 0 }, + }; + + const ASRContext *s = ctx->priv; int sample_rates[] = { s->rate, -1 }; int ret; - AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layout = NULL; + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); + if (ret < 0) + return ret; - if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_S16 )) < 0 || - (ret = ff_set_common_formats (ctx , formats )) < 0 || - (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO )) < 0 || - (ret = ff_set_common_channel_layouts (ctx , layout )) < 0 || - (ret = ff_set_common_samplerates_from_list(ctx, sample_rates )) < 0) + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); + 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; @@ -170,5 +183,5 @@ const AVFilter ff_af_asr = { .flags = AVFILTER_FLAG_METADATA_ONLY, FILTER_INPUTS(asr_inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; From patchwork Mon Sep 2 13:50: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: 51313 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839251vqb; Mon, 2 Sep 2024 06:59:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVresCx6mr5EPMfDXzh6aysyRpEccP7cbDs95qvhSPHKaYXQJST5bL/qmAcM2PPdb3aGQRkZ/XnHHDQWfOdNzR2@gmail.com X-Google-Smtp-Source: AGHT+IG++PDnSWaCaSgCjIWq4t2i4uorIfspipWTfMnzmmODTfeHRWvpPj1K5PA22QFi+WWcso5f X-Received: by 2002:a2e:b88b:0:b0:2f0:1fd5:2f29 with SMTP id 38308e7fff4ca-2f6290445femr42648281fa.19.1725285545628; Mon, 02 Sep 2024 06:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285545; cv=none; d=google.com; s=arc-20240605; b=Bne5HImNzuiBRun3rYOVcX98OAupaAftXMqBpspqA++0vYevUxTc+/mhuzi7uOZIaf XsxMWDwlh/AQTJ5/g327VO38LOdQ67ToMEoPr8zR7oAxl0IKZhXjLfq+wUpzPFP+eo3S a949u0pFE8Et9yNPM1AIAQZ1UgfxWLCsThdMRxho0eQ/rE8+55dVKFs9cGw37qmF8iC8 SZeAnszBSIdWuuHbBQNwFP9Y1bQTuojd1vFRGvUQ1cxx41eaOAhv5DhA9g4whyRAsJEc Jce3C5mRP9pzHeDzv5JdZ68fEOnh8p2X+g/PfxA/WhsR/05lUUAZhKgThwLdPc1WKPdl mi1Q== 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=OHPvT3dvCRQXaOI9M5IiM5wGodexXjV0Hfygzuz2An4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=TjJEyDx3hp3fDCRI7YidGgze6+cNhllzqPkKmgyuCCcZs0j7Rnx0wbMkmFrVdrBQ+4 ZdZaco9BUWcZ6JEqjgRbPdCLnfBeD5OBZcHi9dofltn+7DEfAfDwye2lAdoP9d0Dise9 9NXJpCQlefQPzKhUGAK5V96A/hK8XAGfuTGrzv+pW12NEtPB14egMhidd7ZyYyOIbmkW mExi2ZL/N8I2AAG2o+WnUdqKJV50IPWM2VF/Tu1wJMA/S9f/ZYYWzUSQyoxklpcygE4l mTMmjyXV87qRWmNhCcREuEsRjVEzMaOxqDirpVpWrmr3C6/AXBT2tT7TLhFcP67EDldQ lQSg==; 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=soXuLh5F; 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-5c24fcd8fd5si2836327a12.426.2024.09.02.06.59.05; Mon, 02 Sep 2024 06:59:05 -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=soXuLh5F; 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 5FCE068E0E8; Mon, 2 Sep 2024 16:50: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 0A0E268DFF9 for ; Mon, 2 Sep 2024 16:50:46 +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=soXuLh5F; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 4A4A14DE1 for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id fcUUSTClhRUU for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=i93OLyUSqQM1Q3dwCsCR5phS96chooBsgKGWDunRXDE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=soXuLh5F1pn4jVEfQ4PTUqAme+Z/IeaDyM7j46T1KHV3UUgPcWzJurSoFqAw9M2LU lMWIf+vhjIuCpU0HBmA9Vk2f6om572o2NwArxqj00xQ0qQH+xV68IRMyg/gdPa423s ybGUqX2539F3iZpziK//Ge0GIQOe11WzzaLfZsN8pVDB7upK9Ha53cFJfizoD3Mhyz lfL7+isrTOZNfEYpDpQgVdSOS7pJiASMTumliEJL0KVfqPELsLcMOrwJejn0YVLnTy VPnwR3IykZHgLt4NwXRn+I0URocnSCkjMb0FD4DdHXCdWZv62VZn/aKXk49p5P8UAl vNlP9jo8escUQ== 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 6CA684DFC for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 16F633A2CD0 for ; Mon, 02 Sep 2024 15:50:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:11 +0200 Message-ID: <20240902135013.13803-11-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/13] lavfi/af_biquads: 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: eRnMkfyXaTxg Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_biquads.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c index 784782f14d..dc7f19d7ea 100644 --- a/libavfilter/af_biquads.c +++ b/libavfilter/af_biquads.c @@ -154,9 +154,11 @@ typedef struct BiquadsContext { void *cache, int *clip, int disabled); } BiquadsContext; -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - BiquadsContext *s = ctx->priv; + const BiquadsContext *s = ctx->priv; static const enum AVSampleFormat auto_sample_fmts[] = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, @@ -169,9 +171,7 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_NONE }; const enum AVSampleFormat *sample_fmts_list = sample_fmts; - int ret = ff_set_common_all_channel_counts(ctx); - if (ret < 0) - return ret; + int ret; switch (s->precision) { case 0: @@ -190,11 +190,11 @@ static int query_formats(AVFilterContext *ctx) sample_fmts_list = auto_sample_fmts; break; } - ret = ff_set_common_formats_from_list(ctx, sample_fmts_list); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts_list); if (ret < 0) return ret; - return ff_set_common_all_samplerates(ctx); + return 0; } #define BIQUAD_FILTER(name, type, ftype, min, max, need_clipping) \ @@ -1463,7 +1463,7 @@ const AVFilter ff_af_##name_ = { \ .uninit = uninit, \ FILTER_INPUTS(ff_audio_default_filterpad), \ FILTER_OUTPUTS(outputs), \ - FILTER_QUERY_FUNC(query_formats), \ + FILTER_QUERY_FUNC2(query_formats), \ .process_command = process_command, \ .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, \ } From patchwork Mon Sep 2 13:50: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: 51312 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1839221vqb; Mon, 2 Sep 2024 06:59:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW5AGEN6CFobXrpx7QT8stCmOxm9eTKbLHTLNncks4uQ10LBjzeYb2nGa9aL1hPWyoQd6nGP3HF6zOCn8siW47H@gmail.com X-Google-Smtp-Source: AGHT+IE23JYb+a9B7WHU4KF3xv7yMHIAR66saepcE4mKpFIzq7PbP5Sr6JpaYeYoSD9Mr2hWQk/A X-Received: by 2002:a05:6512:2393:b0:52e:9beb:bc09 with SMTP id 2adb3069b0e04-53546b057ccmr3796541e87.3.1725285542833; Mon, 02 Sep 2024 06:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725285542; cv=none; d=google.com; s=arc-20240605; b=Gd3cykWxbJtFus/tZQdEHQvtp6KpVgOoFOINeXW2SZL5f5WwrDfG7shgz3tb83jm4e 2lXr9gwmOc2nLx9JVK1mqpptzZecDFMVMtyL820rH75DPtuuP9WmKjuXtSbbs7BLvhyl 66lIUG877xp24nodDy0n79vFSOVs1nHRKxIZdbPHXCO1kfu3dZ8jHtGLfkxgk2zR+iS5 XlBLD1tGWRYIo/rqDOHnvRWUi9ONg98Zdsk8hdZ/k2tjgj5BxWq4QnKxA3e3XZownEZK /hGx2b/LwouPv12aFUjuP584teIwnNmB1139iGlgH6yDe65Lviw9c55ZgbM1hwprfILU ehOg== 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=lVqhKlGJKNv1LqVI8XVIBLbnTTtT+jEyUxAGoiDwKco=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=eR/X42c3ls/J0c9y4bzQOXIqavKGr15kZtAjLFTpDXC2MI+07kKtGXaFtOYKV1qqaz kSwiCvX/ZNzZeEjo/76VYqM4/G9ZGbD4nvuLRlooUekTbo4thxizOu3IGvkHUPgfX8wF kXcn/3fLyTR0UDm0zDuZ+Z2Ad6tywD1csWZdYN7lr2Dc0qvhZMRCQSsrbc4LXQaEAmKA vZoGbrMfPXYbMdy49QmB7e+6Bdlt2huVQLMV5hYyDjTb6mYeoNKWQ7fZTdZDIJ1E0eb9 tqTZ2n4kSeTLMkpsv1zoF82zeD2RyFl2QmkNCo+ZOQfxb598W1pB2T7t0SH/HvTe+kYZ Z5Gw==; 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=rXqzTYAT; 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-5354084879fsi3276587e87.592.2024.09.02.06.59.02; Mon, 02 Sep 2024 06:59:02 -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=rXqzTYAT; 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 90BBA68E0F8; Mon, 2 Sep 2024 16:51: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 1967B68DF02 for ; Mon, 2 Sep 2024 16:50:46 +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=rXqzTYAT; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id F250E4DE4 for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id em7C2Z5G2nH3 for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=B3ImL1yHxBG3efrJZ+S3zwVYdA8y8xmKT1uJBLj5t1A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rXqzTYATEOVLY1CY5bQ7E2UmXa+kD3tBf3nRFmtWUp79JGh/Qc7BqaESROlOnM/qQ kD8iW3omTzeoBD1UpPsLfulztDG6Q6HNppm4F1wrvbSXxcc3/de6JybwHNnggeJHlF +iytBtoS+RoN8g3n/c2RhPVSy8F9iwouRU6x602wM9LXKdHFLEflHNqn8OTN7Ggx4Q c1qX0kLTPRYaSg13aSt6KUcCOd6X40tEIOd9vugFp3ArF5bfHNh/CFMAO+z24v9/Iv MxCCMOTD4nh7Sv1fbo2vnmLLNZyTHvDnTM3dUeHdoWpQvTVo7Ug9qy2m0p185/lGXh zNJzgHPcGB+mA== 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 810404E07 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 22BE13A2DB3 for ; Mon, 02 Sep 2024 15:50:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:12 +0200 Message-ID: <20240902135013.13803-12-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/13] lavfi/af_bs2b: 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: W3U0V28aLGCq Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_bs2b.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_bs2b.c b/libavfilter/af_bs2b.c index d6a974051e..de2c30fede 100644 --- a/libavfilter/af_bs2b.c +++ b/libavfilter/af_bs2b.c @@ -90,9 +90,14 @@ static av_cold void uninit(AVFilterContext *ctx) bs2b_close(bs2b->bs2bp); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AVFilterChannelLayouts *layouts = NULL; + static const AVChannelLayout layouts[] = { + (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, + (AVChannelLayout){ .nb_channels = 0 }, + }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8, @@ -104,17 +109,15 @@ static int query_formats(AVFilterContext *ctx) }; int ret; - if (ff_add_channel_layout(&layouts, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO) != 0) - return AVERROR(ENOMEM); - ret = ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); if (ret < 0) return ret; - ret = ff_set_common_formats_from_list(ctx, sample_fmts); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); if (ret < 0) return ret; - return ff_set_common_all_samplerates(ctx); + return 0; } static int filter_frame(AVFilterLink *inlink, AVFrame *frame) @@ -211,5 +214,5 @@ const AVFilter ff_af_bs2b = { .uninit = uninit, FILTER_INPUTS(bs2b_inputs), FILTER_OUTPUTS(bs2b_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; From patchwork Mon Sep 2 13:50: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: 51322 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1885271vqb; Mon, 2 Sep 2024 08:09:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGmtyIssk/4pUdOOngc2iLlwNtbvuqex11msfIAofkx2p0H/cIFd8bBgk8IuE9JurpAD95OPWiTrEDWKR5uflm@gmail.com X-Google-Smtp-Source: AGHT+IFueBDpF4Mi2vnshvkufXiBdoaB27e09GarBrPaHEIVkgtah6eJTPKuy7UBQR8aLXi2LNkx X-Received: by 2002:a2e:a544:0:b0:2f6:1d35:1491 with SMTP id 38308e7fff4ca-2f61e034afbmr93635141fa.15.1725289744536; Mon, 02 Sep 2024 08:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725289744; cv=none; d=google.com; s=arc-20240605; b=flBC6jTj5hVU2/dAWbtbSSTrOeRbjTbVUZPuyYanqxW+E/3jRiJIwbOU7YK81jpHZp ndEqEmx25AHY3l8zt6GGENdin0BXCRLPMDYNtEbny3b/G93eBCoSauE8topUxfF83xNH ht9WEr7ieEJZkEsBiYYh4oS2IrdZcGXXOFX2OnaFz9hBWhNpUCvB3LT1fCLziA81GHZS yRIYlsp3A5I87MLKCvEEYIduFlFw1EjThkXI8hfENOvaZdXeVxbrtPAQKIWIusgeVRlZ r0n6JLZcfv25QKE8R8pXqrfSbzXQ0mwZ+dwp2tYkE+1ekHU7lA+KRz0DMTMge2+qqJnF e89g== 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=Oxnek7WDLIYZmqM5dV+PXFyetMtDtS+chBT7lFqgx+o=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=S6I4CvKhN4yOuaTWQpCBMCOinbbNXgKcM5ZYmeDVjpRCydJLVSTAz/w9MsmrQ8B+dK NJ6WbeIRFl/IFtLxqvBhUmzu5mJqBO8s+Fz9w66HFpo/ldbf3aBO88Ttkq43Qyv32xSo v3iPWUfTXoMcZ2z/LEAMCDH5gZG6Q6bhlH8ODbLSDuNoBuEmjQL3K1BMGuzXhhNgyc67 X4aOXU+jOISpkaYwhD6uFmB6U0pmCYb8OT+7LXmGe50KOedfDM6SQq9gbFiEEGO0xKEj 4apwdKLq5K6IYoSTScfGtnzcarQXz+o7anvOozathcIegeM7hJrASnfOAcwotGwS2cei O1gg==; 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="UbgbPf/f"; 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-5c226d6eb75si7490412a12.644.2024.09.02.08.09.04; Mon, 02 Sep 2024 08:09:04 -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="UbgbPf/f"; 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 00F5768E0FE; Mon, 2 Sep 2024 16:51: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 0D07668DF01 for ; Mon, 2 Sep 2024 16:50:46 +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=UbgbPf/f; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id A76994DE2 for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id a_OD6LYUJbDW for ; Mon, 2 Sep 2024 15:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725285038; bh=W99EBUceqNFz2mjwKu7h41QPqcjhQIrhXogOBnStmu0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UbgbPf/fnQACwwcya7Ekwj+6vuT1IPcefG3rkrZyD2VC3Klx+YH/hCiybNe9JLbo6 qOhiSLaGSM5dg5VrYXPMKRl/Y8/jJpOW0+noYGFrEvDEZ/lTRgYECC8WMH4QfApyZd q+nn4BptNAbeJjFC2XKywc0bOQIEMldLmu51vyNJ4aBpBSih6qeYzdvQgtiFuempoI xiNoY1I1ZAgRPcr8R0pVWvdier/ymgbiMUIkOZMFnc8UlZzxObJTDBQDj8vMUuH/mJ 5ySAX9Dg/wxzpEktM8Q1NI1VMUnNVUfSqyVfId8XzJd93/m/Te1GduqVNHEmcEPByf qAHTtlgY8OkEg== 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 81B804E08 for ; Mon, 2 Sep 2024 15:50:38 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 2E8063A2DB4 for ; Mon, 02 Sep 2024 15:50:32 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2024 15:50:13 +0200 Message-ID: <20240902135013.13803-13-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240902135013.13803-1-anton@khirnov.net> References: <20240902135013.13803-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/13] lavfi/af_channelmap: 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: iHNceNkysv9q Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/af_channelmap.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 8d65fb3cd2..3f02a7fd8f 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -321,21 +321,28 @@ static av_cold int channelmap_init(AVFilterContext *ctx) return 0; } -static int channelmap_query_formats(AVFilterContext *ctx) +static int channelmap_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - ChannelMapContext *s = ctx->priv; + const ChannelMapContext *s = ctx->priv; AVFilterChannelLayouts *channel_layouts = NULL; + int ret; - if ((ret = ff_set_common_formats (ctx, ff_planar_sample_fmts())) < 0 || - (ret = ff_set_common_all_samplerates(ctx )) < 0 || - (ret = ff_add_channel_layout(&channel_layouts, &s->output_layout)) < 0 || - (ret = ff_channel_layouts_ref(channel_layouts, - &ctx->outputs[0]->incfg.channel_layouts)) < 0) + ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts()); + if (ret < 0) return ret; - return ff_channel_layouts_ref(ff_all_channel_counts(), - &ctx->inputs[0]->outcfg.channel_layouts); + ret = ff_add_channel_layout(&channel_layouts, &s->output_layout); + if (ret < 0) + return ret; + + ret = ff_channel_layouts_ref(channel_layouts, &cfg_out[0]->channel_layouts); + if (ret < 0) + return ret; + + return 0; } static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) @@ -425,5 +432,5 @@ const AVFilter ff_af_channelmap = { .priv_class = &channelmap_class, FILTER_INPUTS(avfilter_af_channelmap_inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(channelmap_query_formats), + FILTER_QUERY_FUNC2(channelmap_query_formats), };