From patchwork Thu Nov 23 19:14:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44768 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bca6:b0:181:818d:5e7f with SMTP id fx38csp801911pzb; Thu, 23 Nov 2023 11:19:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCRVVU/YurekjZqpVYWCxVF+gUM2XgEkhpxGtcugqpQ4ivZk1yC701iKME7LJnwstSFoZt X-Received: by 2002:a17:906:7388:b0:a03:7d93:71c7 with SMTP id f8-20020a170906738800b00a037d9371c7mr199756ejl.4.1700767160654; Thu, 23 Nov 2023 11:19:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700767160; cv=none; d=google.com; s=arc-20160816; b=dxGrpvZ4fl7Q5cT6GMitNsmBSQmIBJIGux6pCPqD1zDCleJ3t9j9DmYU/2ih9llb/Z JCAggno856X2yh09wNEjBw9On21IR0pHRH5HMuaFG/vFD+VwSQpQDm1qRIm5hJ6/kK2R K2cwtprauq1jvO2U32ssJRvqUFariSPXunVYjVUSCF1rKG2kaQ1+SLKXGe0eCUj8cRpO xJ5zkRbz/1JiJbpSMf41KlWSbjbL4c5Bd+A4gnRghqlc/OAAQK6x+vAxCvf0+OgSXiJ8 H8MJQT+pCVtkbUA7D1iD9w563/N0wyUkLrPAfNLnhQoqA5HXV4JmcqhjxT+ChtxUsYVQ 8/8Q== 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=MfN6Y/LKDGQejGd+zRPm5qcsufP+ddRpTIB+IsPuqQk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=PIWUEY4Is2BFilL62PlfFdfNALS+9jCgdNhc2+gopirXYml3FPkL5iC3uXa6n4awb+ LHioIJz+35Vdlh2//PJseIXIlu8TRzRsmzRfEv9i9vXfeJUYKAWIb4zp65v/bGp1DuoK wy8EFV+LL5fUEOHY4XS3wy0aAQOQggeLc59Gm7CAXOg7tJUw8yblJuLuVGmsVbvGTXTx E0RUxYwDrgFo2LGgEzxvuHTOx8OYugVZVOZVWPP/Vk4hVb5fCu9i3iwRx0Cnj87Ob1+G Glquw3ul/sXHnzKTtDWTkqsCsQ9s69S+auO4n34ad8gqh+ZlpBO5eZDYjgoljzcdQHZs /IMw== 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 g7-20020a170906594700b009fc962abe89si1020106ejr.432.2023.11.23.11.19.20; Thu, 23 Nov 2023 11:19:20 -0800 (PST) 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 1A91F68CEF0; Thu, 23 Nov 2023 21:18:57 +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 9F9A768CBFA for ; Thu, 23 Nov 2023 21:18:16 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3CBE714AB for ; Thu, 23 Nov 2023 20:18:16 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id MUVYuK4PBQ2I for ; Thu, 23 Nov 2023 20:18:16 +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 3987514CE for ; Thu, 23 Nov 2023 20:18:15 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 17E983A05C4 for ; Thu, 23 Nov 2023 20:18:15 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Nov 2023 20:14:58 +0100 Message-ID: <20231123191524.11296-5-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123191524.11296-2-anton@khirnov.net> References: <20231123191524.11296-2-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/13] 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: atYTl1VRcKad 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 b6fbc5b195..f942c97c40 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;