From patchwork Wed Mar 2 18:40:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 34587 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp4904425nkx; Wed, 2 Mar 2022 10:41:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0YHrrDjhEvBaqrWc8J6BjmGN9wPYm3DATS3u3m1X3xirJkgZ6ik6ciOsDTySjtCRYhotD X-Received: by 2002:a17:906:1be1:b0:6ce:b0a8:17d with SMTP id t1-20020a1709061be100b006ceb0a8017dmr23447432ejg.413.1646246481626; Wed, 02 Mar 2022 10:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646246481; cv=none; d=google.com; s=arc-20160816; b=J0OcgopyWTsoPsizMktXg+5WfvKCf2ezXZ4OSHp3OP3o41zJlnMy9S1RzG2mzhy/Le RzC3xztbrhBQHCq7ARd071tSAmZJo3SJhqJo6NHFN2aUyBapo2/dk68GkiOdmg7wsnNJ 2KIIUU1IY2IHO3DEzwMiJCtClS+R4Hcv0utM/YH5mhGxMI4pOIAac4Pqe1Yvo9ZWBxna 6mUG8jcRjSdXX2UkrvWvAwPyBTlmYRZcJxEXc0lFcJULAXL6gAwnL/gxbN5x+26GNIGJ Ier7SjDob1gC7FEFiIgBpsVzyhGYRhj2rezvN6MVV7U0n5P8TruAn4aPiQMR/mzmxyBw zXtg== 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=a0+s+ecMsb+Mq0Eg56J4KrFwxAwBoHh1j1mdwu49m2I=; b=r/EemTLktwoVn/xelr3rwTY3Q9dudic2AWkoZAs9r+a6QOqcEsLlHepX+na/O1GhNV 9mK5klOXiP0cC5a3cu9udNJUVlC62NAJn8XHUj+YewwzgTwbq7ppzE0TcPy3sIGXz0wl whA8PTbi04HM/PjqllPNxe8IWo10vmQ1nfIgRjYaKtQW2kuu75//kU5vGtjS3si6cVKp Yg4EH9tkEYq5HOS5+t0kGZNKzaAoZII9Oy2gCsJdPerVtVAiJtXgjGROcR/MNAVaV3X6 IdOkt4A0LVxXgNzANwD+1FfrsySgJBUcD1rk+3mv58cMa1DU0SiB+fG8x5rITdPFrXkL CvNg== 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 g21-20020a170906869500b006c55cd84a72si9405817ejx.446.2022.03.02.10.41.20; Wed, 02 Mar 2022 10:41:21 -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 7EF4F68B320; Wed, 2 Mar 2022 20:40:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68BB268B327 for ; Wed, 2 Mar 2022 20:40:26 +0200 (EET) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 222IePYi010663 for ; Wed, 2 Mar 2022 19:40:25 +0100 Received: by phare.normalesup.org (Postfix, from userid 1001) id 8E116EB5BC; Wed, 2 Mar 2022 19:40:25 +0100 (CET) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Mar 2022 19:40:23 +0100 Message-Id: <20220302184023.285022-5-george@nsup.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220302184023.285022-1-george@nsup.org> References: <20220302184023.285022-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Wed, 02 Mar 2022 19:40:25 +0100 (CET) Subject: [FFmpeg-devel] [PATCH 5/5] tests: add coverage for libavfilter's format negotiation 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: J86FSu0BEg2u Signed-off-by: Nicolas George --- tests/Makefile | 1 + tests/fate-run.sh | 4 ++++ tests/fate/libavfilter.mak | 9 +++++++++ tests/ref/fate/libavfilter-negotiation-alpha | 20 ++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/fate/libavfilter.mak create mode 100644 tests/ref/fate/libavfilter-negotiation-alpha This is not to be the only test, I intend to cover all the logic in pick_format() and the logic in swap_*(). But I would rather have you have a quick look at the makefile hackery before writing too many tests that would need changing. diff --git a/tests/Makefile b/tests/Makefile index c4c31ae871..2bff4b339d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -157,6 +157,7 @@ include $(SRC_PATH)/tests/fate/imf.mak include $(SRC_PATH)/tests/fate/indeo.mak include $(SRC_PATH)/tests/fate/libavcodec.mak include $(SRC_PATH)/tests/fate/libavdevice.mak +include $(SRC_PATH)/tests/fate/libavfilter.mak include $(SRC_PATH)/tests/fate/libavformat.mak include $(SRC_PATH)/tests/fate/libavutil.mak include $(SRC_PATH)/tests/fate/libswresample.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index fbfc0a925d..82d40f5ebc 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -509,6 +509,10 @@ venc_data(){ run tools/venc_data_dump${EXECSUF} ${file} ${stream} ${frames} ${threads} ${thread_type} } +lavfi_dump(){ + run ffmpeg${PROGSUF}${EXECSUF} -lavfi_dump -lavfi "$@" -f null - +} + null(){ : } diff --git a/tests/fate/libavfilter.mak b/tests/fate/libavfilter.mak new file mode 100644 index 0000000000..692f1d4960 --- /dev/null +++ b/tests/fate/libavfilter.mak @@ -0,0 +1,9 @@ +# avfiltergraph.c : pick_format() : video / don't lose alpha +FATE_LIBAVFILTER_NEGOTIATION_VIDEO += fate-libavfilter-negotiation-alpha +fate-libavfilter-negotiation-alpha: CMD = lavfi_dump testsrc2=d=0,format=rgba,scale,format=yuv444p/yuva444p + +FATE_LIBAVFILTER-$(call ALLYES, TESTSRC2_FILTER FORMAT_FILTER SCALE_FILTER) += $(FATE_LIBAVFILTER_NEGOTIATION_VIDEO) + +fate-libavfilter: $(FATE_LIBAVFILTER) $(FATE_LIBAVFILTER-yes) +fate-libavfilter-negotiation: $(FATE_LIBAVFILTER_NEGOTIATION) $(FATE_LIBAVFILTER_NEGOTIATION-yes) +FATE_FFMPEG += $(FATE_LIBAVFILTER-yes) diff --git a/tests/ref/fate/libavfilter-negotiation-alpha b/tests/ref/fate/libavfilter-negotiation-alpha new file mode 100644 index 0000000000..00175f65cb --- /dev/null +++ b/tests/ref/fate/libavfilter-negotiation-alpha @@ -0,0 +1,20 @@ +Dump of complex filter graph #0: + +Filter: Parsed_testsrc2_0 (testsrc2) + out 0: default → Parsed_format_1.0:default [320x240 1:1 rgba] + +Filter: Parsed_format_1 (format) + in 0: default ← Parsed_testsrc2_0.0:default [320x240 1:1 rgba] + out 0: default → Parsed_scale_2.0:default [320x240 1:1 rgba] + +Filter: Parsed_scale_2 (scale) + in 0: default ← Parsed_format_1.0:default [320x240 1:1 rgba] + out 0: default → Parsed_format_3.0:default [320x240 1:1 yuva444p] + +Filter: Parsed_format_3 (format) + in 0: default ← Parsed_scale_2.0:default [320x240 1:1 yuva444p] + out 0: default → out_0_0.0:default [320x240 1:1 yuva444p] + +Filter: out_0_0 (buffersink) + in 0: default ← Parsed_format_3.0:default [320x240 1:1 yuva444p] +