From patchwork Sat Nov 4 07:56:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44507 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3aa6:b0:181:818d:5e7f with SMTP id d38csp336284pzh; Sat, 4 Nov 2023 02:22:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELkHQkNqOvy51KILnkY5LtPIQPgW/kEzPFLVME4wsA31ncRq2Fk1ozNU4nfEfSzQYUiwYI X-Received: by 2002:a17:907:78b:b0:9d3:8d1e:cf0 with SMTP id xd11-20020a170907078b00b009d38d1e0cf0mr8393786ejb.54.1699089769362; Sat, 04 Nov 2023 02:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699089769; cv=none; d=google.com; s=arc-20160816; b=Gz1rczhztE8nG2dqasNPKzeFjSvGlwhRLakXtzwVVYaXEuHnk5AL9cOlkaRJq4RrO+ j0IuVzA3X7hIbPqIuVywj96qdwijZid/i+2EGHEQ0KWazfeHvjIo/UXMPYoB7MMV+m5b kXqErBWw660XheI4zoUu8KVVwDmST8rHUtxru+OO/ubmcrVsPKVJNZDoztP2sDSo2ERQ jnkJqaqyI0KGPmRlX9oQ+JzVsaaXqWv3p0OAnwbBmfp+l3oYfZHXRNDpQ9+GltpIOEp9 Jr2BDyFmVXXt+vmcbSs7K/E2N9abodd6knxYdiooGwi8mJ/k9wQQnIYC0pQnVNSv+Cf+ j/bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:delivered-to; bh=XJAc9vuFtXAQyz+71+GJYYqnUWUR+1PgBi3BGj5qYTc=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=OXSLzDLA+uoKMgiiZSr3QRZLC0xrVYg/wFEFurWA1kIP+6Wz0yqnwBM79RWO97wr0k tFTBQI8YckNSJ3JvcEQYiY2ooR3KCsLfR4xvhqO89puuGWE2626N7RM3IcDW+JaHr+ym C/1Y/31qAfMbBe/uC6MjMB9MItTsAi2y/oSjqLnkWM33mOLXHmLg7b8e+JHOmGRD+M8l swZ1v66GsGfgLnotZI8LJL4sLNiZ+RY1hXghAvvrQLKpnd+aPz55Tirb3LtLHdo++LPv CEr9AHVpfPitWb9NYRIhJMm+aNW00csUvDFP8nwP/r/madoNDeX2xjf9lhVrV69/Bf44 zPXw== ARC-Authentication-Results: i=1; mx.google.com; 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 s1-20020a17090699c100b00991e6951c1bsi1922488ejn.423.2023.11.04.02.22.48; Sat, 04 Nov 2023 02:22:49 -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; 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 2A02968CE7C; Sat, 4 Nov 2023 11:22:01 +0200 (EET) 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 30CFF68CDA9 for ; Sat, 4 Nov 2023 11:21:55 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 5520410FE for ; Sat, 4 Nov 2023 10:21:50 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id DKOOWVhDjrBJ for ; Sat, 4 Nov 2023 10:21:50 +0100 (CET) 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 A31C01114 for ; Sat, 4 Nov 2023 10:21:47 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 75AC23A100C for ; Sat, 4 Nov 2023 10:21:40 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Nov 2023 08:56:18 +0100 Message-ID: <20231104092125.10213-10-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231104092125.10213-1-anton@khirnov.net> References: <20231104092125.10213-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/24] fftools/ffmpeg_filter: track input/output index in {Input, Output}FilterPriv 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: il2YHmI4ciG9 Will be useful in following commits. --- fftools/ffmpeg_filter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index d48974581b..4edf634b26 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -74,6 +74,8 @@ static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg) typedef struct InputFilterPriv { InputFilter ifilter; + int index; + AVFilterContext *filter; InputStream *ist; @@ -162,6 +164,8 @@ typedef struct FPSConvContext { typedef struct OutputFilterPriv { OutputFilter ofilter; + int index; + AVFilterContext *filter; /* desired output stream properties */ @@ -594,6 +598,7 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg) ofilter = &ofp->ofilter; ofilter->graph = fg; ofp->format = -1; + ofp->index = fg->nb_outputs - 1; ofilter->last_pts = AV_NOPTS_VALUE; return ofilter; @@ -787,6 +792,7 @@ static InputFilter *ifilter_alloc(FilterGraph *fg) if (!ifp->frame) return NULL; + ifp->index = fg->nb_inputs - 1; ifp->format = -1; ifp->fallback.format = -1;