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 B10A34613E for ; Wed, 7 Jun 2023 08:51:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 585C268BA0E; Wed, 7 Jun 2023 11:51:50 +0300 (EEST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6F2EE68014E for ; Wed, 7 Jun 2023 11:51:44 +0300 (EEST) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5149e65c218so1085370a12.2 for ; Wed, 07 Jun 2023 01:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686127904; x=1688719904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lt1nHzG0vZ6jI4Je3K5/FHDgDxgoULoKSDUP6DQb39g=; b=Y9/8NhHU7CIrnmukx1qgPnp5IEElw4xPPkJ7Nw+oPoY7/NqaQDSOnSpnAwhiJc2TWA dkXGcAGrSUD7CrJlrXBpNrFRn3J+h4rxvVDY7/EVxLIwMAkwA6Vfxx1YjuZG5348VTOS YVZPS/PTqJphzxaSghN02cInOYRzbeagPzN6h3WVh38v6Hy0v0eXar/jqpzuff9fIIGu dZ2BJqfzbcgXNPy/GCdAjhP20JstIaX0o0aBqQU8kN4W4YhULsSfBjekk0mXIKh2Uf/c pU82AnTbZITDuVROhMtqSqSBx+8XXEDfVNdMC6lTsllEt0BgOcgcbV+0WfQDUkgrGgRN vbSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686127904; x=1688719904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lt1nHzG0vZ6jI4Je3K5/FHDgDxgoULoKSDUP6DQb39g=; b=ZyVc3NNjk9TJsUf4k9GnfMyrMg3IdW4JLLxkjmjqWcHXrOJJpidOE27h6t5PP++hvz ugwaxccbWZmoRoRLW82UZcsQO0CXc5gifpqnoye+FTjA0lrQdb1q3QmV/NIZcLEP3q9Q BxbvOx7yjI2jfcgQZ5qRz4XeywgzP0LhfZDasxbOiCVX9FFRTtPWUwddGUV41a9VDE0i DA2BwPFg1csSGe+Qz9H/YuaPAoflDqWFD5UnaeNaUa0y+nzmO36Q1pBTg/0JFaaPbMe6 Gc1ILZ+V3Vx270lW9CDSyiQjZ5SwILDHMAEMAUmD27PcaKf7Z5YfRHAcNj2Gnh8kLhzx JzVQ== X-Gm-Message-State: AC+VfDzu7Sxshu9XeUFe7u56PShj7m+yT1J2thnxGZxFkIjjJvObL+3S LKQs7QjsjYetlMcwI6CmSJMA/DDJde8= X-Google-Smtp-Source: ACHHUZ4Eb2XHhkFQt1XSoUex/nFYTUTQaTgZdmFFrQ8evmncH0D2Tqk7stzakqnk2C+JlUVDII40CQ== X-Received: by 2002:aa7:cc98:0:b0:516:4098:66f4 with SMTP id p24-20020aa7cc98000000b00516409866f4mr3774814edt.18.1686127903556; Wed, 07 Jun 2023 01:51:43 -0700 (PDT) Received: from [192.168.178.30] (dynamic-2a01-0c23-64e0-b200-e9e1-d979-3571-7044.c23.pool.telefonica.de. [2a01:c23:64e0:b200:e9e1:d979:3571:7044]) by smtp.gmail.com with ESMTPSA id p12-20020a05640210cc00b005169f9365c3sm274374edu.20.2023.06.07.01.51.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 01:51:43 -0700 (PDT) From: Marvin Scholz To: FFmpeg development discussions and patches Date: Wed, 07 Jun 2023 10:51:42 +0200 X-Mailer: MailMate (1.14r5964) Message-ID: <7FA80446-9AA0-44CF-8135-10A06C4722E5@gmail.com> In-Reply-To: <20230425072620.512-5-tong1.wu@intel.com> References: <20230425072620.512-1-tong1.wu@intel.com> <20230425072620.512-5-tong1.wu@intel.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v5 5/5] lavfi/format: add a hwmap auto conversion filter 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 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: On 25 Apr 2023, at 9:26, Tong Wu wrote: > When two formats lists cannot be merged, a scale filter is > auto-inserted. However, when it comes to hardware map, we have to > manually add a hwmap filter to do the conversion. This patch introduces > an auto hwmap filter to do the hwmap conversion automatically. > Thanks for trying to improve this! I've recently done quite a bit of experimentation with hardware filters and at least for the Cuda - Vulkan - Cuda case, hwmap was useless, and I was told I need to use hwupload instead, so I wonder what cases this would help with? I just fear that, especially given the bad error messages hwmap gives, this will just implicitly insert it because it seemingly works but then just fail to actually do the job and give an absolutely indescriptive error to the user for a filter they did not even insert themselves. > Signed-off-by: Tong Wu > --- > libavfilter/avfiltergraph.c | 3 ++- > libavfilter/formats.c | 4 ++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c > index 8af0467bc5..b2b627ad6a 100644 > --- a/libavfilter/avfiltergraph.c > +++ b/libavfilter/avfiltergraph.c > @@ -402,7 +402,8 @@ static int insert_auto_filter(AVFilterContext **convert, AVFilterGraph *graph, > AVFilterContext *ctx; > AVFilterLink *inlink, *outlink; > char inst_name[30]; > - const char *opts = FF_FIELD_AT(char *, neg->conversion_filters[conv_step].conversion_opts_offset, *graph); > + const char *opts = neg->conversion_filters[conv_step].conversion_opts_offset == 0 ? NULL : > + FF_FIELD_AT(char *, neg->conversion_filters[conv_step].conversion_opts_offset, *graph); > const char *name = neg->conversion_filters[conv_step].conversion_filter; > > if (!(filter = avfilter_get_by_name(name))) { > diff --git a/libavfilter/formats.c b/libavfilter/formats.c > index c8e20e5b20..fee10fa0ee 100644 > --- a/libavfilter/formats.c > +++ b/libavfilter/formats.c > @@ -331,6 +331,10 @@ static const AVFilterFormatsFilter filters_video[] = { > .conversion_filter = "scale", > .conversion_opts_offset = offsetof(AVFilterGraph, scale_sws_opts), > }, > + { > + .conversion_filter = "hwmap", > + .conversion_opts_offset = 0, > + } > }; > > static const AVFilterFormatsFilter filters_audio[] = { > -- > 2.39.1.windows.1 > > _______________________________________________ > 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". _______________________________________________ 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".