From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id CEDF148157 for ; Fri, 9 Feb 2024 17:12:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 37C3268D048; Fri, 9 Feb 2024 19:12:25 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 55C5E68C4F1 for ; Fri, 9 Feb 2024 19:12:19 +0200 (EET) Authentication-Results: mail0.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=VMEzIQow; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0B7C1240DA9; Fri, 9 Feb 2024 18:12:19 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id yco5id_j_OVj; Fri, 9 Feb 2024 18:12:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1707498738; bh=Yr3ys8QXtCBXIQMx8cI1UdR7QFsA6J8PKi5zdTs8Uvo=; h=Subject:From:To:Cc:In-Reply-To:References:Date:From; b=VMEzIQowarUAVdmntCNICDnwPVq0PwZaNIx2yImamuV4/+RdNkLHgs+xLvF3itLAt DDNf4zG8VlBOoFZXctzGyrJAaioYp4pimoqNvAWRBZ//HgBxXbyBe3a6/ZJjaBKXqc BYdCM1ELhkdvupPcYExRi9YPcwDyaJMNBCTJb5oNYTkfu1w0+HPbRRkMIZ5SMyk3v/ VHqApkUyRMvYdPinMzeH/9nNECGbgbvGYqsNcKPT8StSzk4triye8ExCX5VKq1cEPG o0sb385RICfU8yqONqIiiUSelibctqOWw32qdsDC6Ap8WZqaMWUoS6VWArBzXAmBmi pnhyf3ccGZwlQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 7246F240177; Fri, 9 Feb 2024 18:12:18 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 534971601B9; Fri, 9 Feb 2024 18:12:18 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240209145349.104511-2-ffmpeg@haasn.xyz> References: <20240209145349.104511-1-ffmpeg@haasn.xyz> <20240209145349.104511-2-ffmpeg@haasn.xyz> Mail-Followup-To: FFmpeg development discussions and patches , Niklas Haas Date: Fri, 09 Feb 2024 18:12:18 +0100 Message-ID: <170749873831.8914.6028886677274528210@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph 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 Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Niklas Haas (2024-02-09 15:53:46) > From: Niklas Haas > > Otherwise, filters that depend on a hw_device_ctx being present at > init() time would fail configuring under the semantics outlined in the > previous commit. > --- > fftools/ffmpeg_filter.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > index 38ddd1963a..46e1d790e7 100644 > --- a/fftools/ffmpeg_filter.c > +++ b/fftools/ffmpeg_filter.c > @@ -931,6 +931,7 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch) > > AVFilterInOut *inputs, *outputs; > AVFilterGraph *graph; > + AVBufferRef *hw_device; > int ret = 0; > > fgp = allocate_array_elem(&filtergraphs, sizeof(*fgp), &nb_filtergraphs); > @@ -961,7 +962,9 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch) > return AVERROR(ENOMEM);; > graph->nb_threads = 1; > > - ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, NULL); > + hw_device = hw_device_for_filter(); This function may be called before any decoders are opened, and if I'm reading the code right, opening decoders may creat new globally available devices which are then returned from hw_device_for_filter(). It should probably be ok to cache the device you get here in FilterGraphPriv to ensure you always use the same device. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".