From patchwork Wed Sep 25 09:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51837 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9548:0:b0:48e:c0f8:d0de with SMTP id t8csp359039vqk; Wed, 25 Sep 2024 03:29:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWS8tM20Y47x4sWRmME6WSGGL7U2esMh6uuDIWJv1IPanS3fuQQNY2X7woiUWa6FAvAsV4UxJP2IWsB0UtFkt84@gmail.com X-Google-Smtp-Source: AGHT+IHQLZgtU+FUN6JIiZ0sE6C7uiEVYSMe/R5xAUC3fsAh82cpEfVIR1OwtEAhnxtqWcEKhKGH X-Received: by 2002:a05:6512:b03:b0:52c:9383:4c16 with SMTP id 2adb3069b0e04-538704986bamr1245029e87.22.1727260161979; Wed, 25 Sep 2024 03:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727260161; cv=none; d=google.com; s=arc-20240605; b=OVhdP+3xbWMNQn5j4pkLapm2stey2D+mBFfQARTw96ys3HAed47/9OK1kkUlWwTdwX AxlzcA9oH9QSH3HjJXE9X1zn042elgcA8FGCoYu5XZ0Aj13bB1OYqaOssf7p8FDLkkM0 xDBtE/jlqckPeEAwjj0yYF0kvx1OJ6tS4DkKGSML21mokvIuesEx0BYIjea3/CBD4Wqo mdZrESgaUZgxQW31ZDbzRtSq+JTp7PcgMVRHDxN0g0Qci+J9Ztrrh3hmpUsc3cRBKO45 fsy/+N3zLHFi8ZFhXUSyKN248uHVZ7qowUGm49V8skGrOy90L2lbO7kWpbPj8EdFYQ74 8ooQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=vVyA3e5FJmqCK3JxZI6/WBvV32q2cPsg50B2v1wNK2g=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=LyHh+LKgxyMIungzP2LiT2+dO/Old2BqsPYN8to/XYiGK27F3MJBGqHUb+UXUUgTYR UmssiuboPIiXV8J7u1g3j8P1p3G/aszhOQWYn1p4vol6+gaDtsWzR+3cXAzZDyTtXpkA YfQ2Ni4OcV3Th51QZnWSusvXnwG+Q2zlKpt0pmUTyTYRZaL1wa8lJZ7QssyY1rJ7D9mA dfBEfDNEWu0lKxS78JIsfSCcb7pH0LFYe6r+34j5SDUZ+JRI/UN43+FLIeHwZ7dwaj58 1LJvepceWDj2Jkwiwr7EbJvZrsJnNSDb5pZ27VF8AdR+v9yOy9u7XL1LXyv7KpE5WTPC tbpw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=DIoB27Oe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a93930be2d7si233302266b.397.2024.09.25.03.29.21; Wed, 25 Sep 2024 03:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=DIoB27Oe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 888D768DCA3; Wed, 25 Sep 2024 12:40:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8350F68DB05 for ; Wed, 25 Sep 2024 12:39:48 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=DIoB27Oe; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D9D6C4E1E for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id iAXZzn6jhfyb for ; Wed, 25 Sep 2024 11:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727257179; bh=3byktY4JXMSlpJR6Uisgr3UJ+5cwNjLRJCNdDwc6byM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DIoB27Oe1BTjlXKcpreqXdPV4TXBUzyg8RrbfPcMJHxFvO58yuPtOKofYYDUCPTZK CIL2SDYF7gMluk5Z4kJzCUv46bBLazh9zlVSlnhVxdezekds2LT69sys+gqwm7w8gG d5aMJUPDQiPO9gnjl40mzF4t0AA7jDrUnJZ+ZBHS872candnGbJKPvdyv4nO60E7jG F0lCosF4it823p8kU1PVqos8S+Fxhqk7NutikOW20dr1iLcyaW+zlaKQvDsjyDy3Of azJ4xd8UWhjWb/P3K8QjOyP9pbWmQwPE5KvC+wIIW6gVr37d1H6tkdOC2ChnUxZd1l uE1a2OEzNy0XQ== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id A66454E29 for ; Wed, 25 Sep 2024 11:39:39 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 289CF3A19EA for ; Wed, 25 Sep 2024 11:39:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2024 11:39:07 +0200 Message-ID: <20240925093919.22929-10-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240925093919.22929-1-anton@khirnov.net> References: <20240925093919.22929-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/22] lavfi/avf_a3dscope: switch to query_func2() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: OyssnCjzaWgZ Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/avf_a3dscope.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavfilter/avf_a3dscope.c b/libavfilter/avf_a3dscope.c index dd08990512..18f647e8a6 100644 --- a/libavfilter/avf_a3dscope.c +++ b/libavfilter/avf_a3dscope.c @@ -73,30 +73,21 @@ static const AVOption a3dscope_options[] = { AVFILTER_DEFINE_CLASS(a3dscope); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; int ret; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -352,7 +343,7 @@ const AVFilter ff_avf_a3dscope = { .activate = activate, FILTER_INPUTS(audio3dscope_inputs), FILTER_OUTPUTS(audio3dscope_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &a3dscope_class, .process_command = ff_filter_process_command, };