From patchwork Fri Oct 4 08:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 52038 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:938f:0:b0:48e:c0f8:d0de with SMTP id z15csp281631vqg; Fri, 4 Oct 2024 02:39:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXxwZRlghIWAUccDAtWnxDy/w/NW/LefrXbJ1AQ0Jys9ou1MxDpvgnsdwYXJjAL8FgXjR+wvlcG5R4MXTV/et3p@gmail.com X-Google-Smtp-Source: AGHT+IGU6HuUXAxe/7NsfKcjBxhozK+1tAY9tfVwMC6K6W40pto6qMUt/DkfV79LbtVM9qYzHK6h X-Received: by 2002:a05:6402:2685:b0:5c4:14db:4a03 with SMTP id 4fb4d7f45d1cf-5c8d2eb4e4amr613914a12.8.1728034747946; Fri, 04 Oct 2024 02:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728034747; cv=none; d=google.com; s=arc-20240605; b=R/VcaTVxGi+9AwMYIziJ+STqb7Y+MLwl6VNp5qeZGoU4frrp8BjnMXm512FzpmB7LP lrtAQ6KCUcH2QwoBj35+NrxaMst44WLHlY4HJ9dqrdk3NSsv2pxA/DfVVYhJI3RfV28T rlc39hwOp5lytV6n03+BkoePq8g/OvBtWWR9YGauNW+g8+skHfbjkqpby9jKapJrXtBu QSzXJwkU0SdDei60AXb+lM1pbeSigK0QbsQF0G3lOGKXvrd+l/ubMikhAWd3EWQBTIox lcwPIqjFvTIIDy5AnFMaJtPFCP9eo4bKePRqwwIfnbmvQLpMTryXo4WsZwuaYkWQ5lO6 V2Vw== 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=kvO5NAh9OPXAY3rzdU6oeA7Prgu3rJ8S8thr5516caU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=X3IgPzxlqnbyaFnc6vR5ahXfgJKB0AZsEJBqAVTeIZsVazMbJdP+HLvRmigfDi91i8 mIHsvU2R8cT1cipBPVdLQz60TsGltX8Nr6WV4zSY4NWgMWcV732bzw484apdMK11/WU7 cCEJ0y28qV2ItyUnDrGTgRoV773Em3Qh58pFy70XIMHStIzr9bNPgbMKKRQ6hXs05+/4 mJW+rfmicpF6c+XAGfhd7JCqt1yEt38gHU5KAVGIT36DvFAhvDPoEk5E2WStmxdY3zJs iajIMxgVX98MKMygDYkYe0oKBMMlG7nBG7MNg78aIsTZuOredY3kX5pyeqd7faRvv7dV v14A==; 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="csXsE/X8"; 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-5c8ca47cc10si2079553a12.275.2024.10.04.02.39.06; Fri, 04 Oct 2024 02:39:07 -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="csXsE/X8"; 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 B56E068DB83; Fri, 4 Oct 2024 11:43: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 2E1CF68DA3F for ; Fri, 4 Oct 2024 11:42:57 +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=csXsE/X8; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 4038D4E1B for ; Fri, 4 Oct 2024 10:42:52 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id F-Iq9dB5UmN7 for ; Fri, 4 Oct 2024 10:42:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1728031370; bh=PxtuBkN2hDroLYKKKtWFMZ9furN3ZdMLlLoav4wkqrk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=csXsE/X8tQpOd8ZGM1go47tU+xttdZo/lArZtYl2aTU28/juHbs2OWB6Ihreavv7E M1uWcygyUPaaMpWiW2f2hGDEqih/7OqtJD+zT5KDEzEeIk/OmhgzO7XDzZDEu7IaR8 945aC4Yh2Q/vT8OjGhfbNajq0smRP5foB/4E9RrBERJVg4J1AfHBgyaSP+al1NVTfj AXOytKiQv5dHT7PsOFp6/9ULXPDEPDs7av46SGcIBJijqVies4MvNpSTZxYME/Rcfz 5nRrUSLdhzxnbnwDVnBqww7pJdvFmpWrzsBkNZ6vXGPAESth6CTxFHt+tNYl1yIKX8 m0GC8PkXDhg1Q== 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 115AB4E2A for ; Fri, 4 Oct 2024 10:42:50 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 0563E3A1A1B for ; Fri, 04 Oct 2024 10:42:50 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Oct 2024 10:42:22 +0200 Message-ID: <20241004084230.27419-12-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241004084230.27419-1-anton@khirnov.net> References: <20241004084230.27419-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/20] lavfi/vf_elbg: 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: 4Bxnzg8QpN4z --- libavfilter/vf_elbg.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_elbg.c b/libavfilter/vf_elbg.c index 453147ca33..5eb5ffed2f 100644 --- a/libavfilter/vf_elbg.c +++ b/libavfilter/vf_elbg.c @@ -85,9 +85,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) { - ELBGFilterContext *const elbg = ctx->priv; + const ELBGFilterContext *const elbg = ctx->priv; int ret; static const enum AVPixelFormat pix_fmts[] = { @@ -96,14 +98,14 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; if (!elbg->pal8) { - return ff_set_common_formats_from_list(ctx, pix_fmts); + return ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, pix_fmts); } else { static const enum AVPixelFormat pal8_fmt[] = { AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }; - if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0 || - (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->incfg.formats)) < 0) + if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &cfg_in[0]->formats)) < 0 || + (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &cfg_out[0]->formats)) < 0) return ret; } return 0; @@ -264,5 +266,5 @@ const AVFilter ff_vf_elbg = { .uninit = uninit, FILTER_INPUTS(elbg_inputs), FILTER_OUTPUTS(ff_video_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), };