From patchwork Fri Oct 4 08:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 52022 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:938f:0:b0:48e:c0f8:d0de with SMTP id z15csp257599vqg; Fri, 4 Oct 2024 01:43:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9v/AA4odpXgZFcQl9vKx90h2f/pZWKtl+398jDfJvorEKs0ZcvwCtccRPHi8ma1QEO5XTn8pp3sTMxWqfMSdy@gmail.com X-Google-Smtp-Source: AGHT+IEttAL12ZLQ0iigmvzwpLpjpz4Z8kvpFDVyf4v97LRRUajl3dbd6aMp4Otv6US1+is++JS1 X-Received: by 2002:a05:6512:6c6:b0:539:94e2:a0ce with SMTP id 2adb3069b0e04-539ab9e7f85mr1203935e87.59.1728031432189; Fri, 04 Oct 2024 01:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728031432; cv=none; d=google.com; s=arc-20240605; b=ff7/18gdER5kf/VVnnMZOBlahVFupqQtn3sgZ+vMY+Zabn5K+dQOnAu61lx4zKCB2j hG5AeHfstoL+JYAFBlX8G6694TVTeDoB8QuOfpXyvpS5I1WN/EPEtqkQ3A/9ZPIqs58O 6wZngrE4yWOoRYssaG3pzQDCTU0IMjxxAadzTqGI3YpjDyNveAON8UQ1XAigH7JZHL/Q 1teoG7RVj/p90Lt+qBJ2mDT8CJReR7O7GXaLFqECdBnRwSIaDD4IIem6yFeIsvWngZNj 24p8hxXzTrTarSRW8jwRhlRBEPOFqx9uO7ZJUzt+8W9MQ0SkBN8p8ikxaKs8Pq+BOSjE fabg== 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=s01NvLosOxqw7ZH8r8QmO+Tuhd+Z5vSshhEvkLofI7U=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=InvKrA3jNUFKTeg+gkldCTHU3S1OSijhxjERdzKW0M2SEePqweUAZh6MIgqunvm/he FQYHPJrftLJeDxMjZTx4QYD9lfis9BU28BwZleaNoTuiZEQRTKkVjFW1h5mA7kUDJwk6 Ju1jhmA/ueSL/BEy1WiKmy+UuDulK7dNzL9T2samUvw5erP7sNTsJ7390Pzpj26qs386 wi0ySguuu6/6vL41wUx9e1EJAfXCOG8H1C6WEGdmqm55Sia0Of2GkINGHHcua1ZhJWQO zPQFweRsioLqMjkc5xEHn2eOgAQOaJ70x0GqD4YCWe6nvW+7T5QhJfFBSgaDSE+T/Ciu /1Eg==; 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=m0HO8+t3; 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-5c8ca4bbeccsi2070550a12.614.2024.10.04.01.43.51; Fri, 04 Oct 2024 01:43: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=m0HO8+t3; 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 75CCA68C74A; Fri, 4 Oct 2024 11:43:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F26AD68D9E2 for ; Fri, 4 Oct 2024 11:42:56 +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=m0HO8+t3; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D6B534E29 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 CTVcIWToyg7O 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=BDIShC5W3VjAyiCow1ipDUcG8CMVFLvLnffsORhiC1Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m0HO8+t3UavtZBtXa6dT8S9N72VDmb0DYqCI08XWeU5GuqwL3Qhfz0N1cr+c+2a1D F1TOK69iY+lSm1ImBGGq6ObskzALup4LQQxWhCRwL2eT84xOwZAV3RIjYePraIzBRO 87seVzqQDmnycLMj8uRS6+X69krsl0+U2XOC+wXw3qmaLfvhDc0jRE3ChuArUU/CNd nSO6HJ2fEIO1YgINBftXrh4JvlMVz747fO/GE2J+I2s/pqlaCCk9FYW+cS7raVuYNw DYE8bbbVTKDQL1FYAGmBuwnALjfjbbEYH70Taag+XiKlnT1lshl8h0dsgHknUCgk45 NDU38259kdqGA== 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 3CA364E2E 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 310E93A1A1B 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:26 +0200 Message-ID: <20241004084230.27419-16-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 16/20] lavfi/vf_fieldmatch: 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: EYi+wPWO04tB --- libavfilter/vf_fieldmatch.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index 9198c894f9..c3ff909b1b 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -908,9 +908,11 @@ static int activate(AVFilterContext *ctx) } } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - FieldMatchContext *fm = ctx->priv; + const FieldMatchContext *fm = ctx->priv; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, @@ -939,17 +941,17 @@ static int query_formats(AVFilterContext *ctx) if (!fmts_list) return AVERROR(ENOMEM); if (!fm->ppsrc) { - return ff_set_common_formats(ctx, fmts_list); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, fmts_list); } - if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_MAIN]->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(fmts_list, &cfg_in[INPUT_MAIN]->formats)) < 0) return ret; fmts_list = ff_make_format_list(unproc_pix_fmts); if (!fmts_list) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(fmts_list, &ctx->outputs[0]->incfg.formats)) < 0) + if ((ret = ff_formats_ref(fmts_list, &cfg_out[0]->formats)) < 0) return ret; - if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_CLEANSRC]->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(fmts_list, &cfg_in[INPUT_CLEANSRC]->formats)) < 0) return ret; return 0; } @@ -1080,7 +1082,7 @@ const AVFilter ff_vf_fieldmatch = { .uninit = fieldmatch_uninit, .inputs = NULL, FILTER_OUTPUTS(fieldmatch_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &fieldmatch_class, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, };