From patchwork Fri Feb 9 14:53:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 46135 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp982228pzc; Fri, 9 Feb 2024 06:54:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4shUsMEH5lXVC0kfW6sd3V5R1hWyy7HAKiSkL4t7OQtnPGQpo928rRfzmex6E7IBwg0Mb X-Received: by 2002:a17:906:74d:b0:a38:1673:682a with SMTP id z13-20020a170906074d00b00a381673682amr1441866ejb.32.1707490457466; Fri, 09 Feb 2024 06:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707490457; cv=none; d=google.com; s=arc-20160816; b=tmeVtD52FDEvA2pL0lrtAOvK4oYRGr4LTSuERYoJlKiG+D1jlli0/+viv7OiHZvWPH /GXYV7cfgWYbT2Iith/leHhDJTHvxwxOd4r5OeJDGWwEBr7Lz1dQwz3wtRTYrh1Pt2Ce nDli86hP9w/9Fv60Yvszc/Mx01wj8ogeooN3aFpDySzLy3Kr75VIK06yghtPz4pnKv6A F4RxHJmB4HJv13tBGSGJDDGjS3TP+qLe83tnS/vNi1UyfwASl0xmAsCUNIenE99rsMNF fM+qUBPsUIFiPippi9cwjIDCpbE5D3jzi5r7+ZiDfOFmAA9etd+sSs4nwza2MdoEHO1d uxWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=Ib8ukFvex5RPfHn4exZTxk8msZS00Mof48+KLDhS1No=; fh=MPns3DnIUr8wDc9ThMFndWAXrvqLgNiC8BqJLvmC/O8=; b=ugeykVg8IFVwG3fedqvPO8aa6HhKGfC1OI/F5GO4NEHGfhw71m9KNh27rjS8fqpJlw rpoimlaKbdAllycEfo+E2uFY42nxUDYc3zURRP/KqRjtWgXP4wI2uvUf0wfg66L+a2mR OQfYdJF9W+gUQfECi4K60VqXmVLCVofI+D8cv1H6C4jLbxdnT07RXFTM6nq9V+XRZYwj xcy3AKL+vafpVYcn+OpsGOFRKfkySrU/BMfIqTO/PojImvBcN8MdoKRnQ06ofSQMYWEI 5cSGt1UynjaP+hGlEM8JB1frJtf2JLibpJ+46+uGvUHnsRoV/6MuZ2Gfk+oQROUJvOO6 dRfw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=JHcgKYHQ; 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 X-Forwarded-Encrypted: i=1; AJvYcCWRHxfF7V1pP0VE52+ZbvONjfG/I8AD1c1QmxU4SzHiVcH/wTLa8NNXqQZgW8814blJKBmU6Y7XPmtlsi2ATajX0Sncr/zqNOw+YmSVi6Nuok44abntdS9vtmK9/ZrPFrOdsgrJjxuA+1BxuF4Gp/ZKc/yDRqBlHpXJoHja4slxD4qixGTZKOapB/nKb1SJNMpJJ9KXb7QKm9etq2Tchcfr71Fgs73JdC2HK8jBClgKVSedpvfFtdyWFZH+61OIU/gS2Lu+9K/Gd0OQUFc/LOf9clAHrUCwGTNIzsc1U3DjY8o/vQThU/hOxoXFP5HI2sVh44Zlu0O035g1JmB5YG4evdsZgwTo8gxLcIX5fXW8+rCxtq0NuG+PzG/5zddvq7BzqitZlBomaQT//NakxJWvhhRjajNQu5l/zllGWiN13K9VKLl6/qwrWJCc2hL797/BBmO3peSYSw5iyqaR83RrFePam4jlbVjoLlohvuKlA6wBFQV2X4f8YXG3lo1UHDBVWBiwGl4orzhSudY5Avvzf9Pv1JDp/wHErnchA7GgP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u (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id lc15-20020a170906f90f00b00a361240236esi901369ejb.777.2024.02.09.06.54.17; Fri, 09 Feb 2024 06:54:17 -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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=JHcgKYHQ; 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 36C0A68D0F2; Fri, 9 Feb 2024 16:54:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15E8868CD10 for ; Fri, 9 Feb 2024 16:53:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1707490434; bh=oWo/MFovr5dom++3eGO7WcyJlMl2DL2Xmd16ULRTP7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JHcgKYHQMa99rJWP3SAWaFexnvKZrfJ+Ar3ZLFGfxhSTGPv3nXs+Adbde1kYF5Dq4 ABLRuOiK7suGaeGy95yXT5vmc+BUDGeZ+GxA6St6yUayveaBLme6KVRty2EwbXTZym 93J++ckwzkxmDTh0HbqH9k7QUcngU9geCuqkA0Oo= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id C619341818; Fri, 9 Feb 2024 15:53:54 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Feb 2024 15:53:46 +0100 Message-ID: <20240209145349.104511-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209145349.104511-1-ffmpeg@haasn.xyz> References: <20240209145349.104511-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0ahFUw6/3vRv 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(); + + ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, hw_device); if (ret < 0) goto fail;