From 2f283527edc47c76c8f720d5d80d0d349fee41c6 Mon Sep 17 00:00:00 2001 From: Andrew Wason Date: Wed, 24 Jul 2024 19:25:09 -0400 Subject: [PATCH] Add splitscreen test. reorg fixtures --- tests/CMakeLists.txt | 1 + tests/fixtures | 2 +- tests/qml/{subtitles.qml => splitscreen.qml} | 23 ++++++++++++++++---- tests/qmltest.sh | 3 ++- tests/tst_encoder.cpp | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) rename tests/qml/{subtitles.qml => splitscreen.qml} (55%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 14614ef..bc30de8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -66,6 +66,7 @@ add_qml_test(NAME tst_qml_demo OUTPUTSPEC 15:320x180 QMLFILE demo.qml OUTPUTFILE add_qml_test(NAME tst_qml_async OUTPUTSPEC 15:320x180 QMLFILE async.qml OUTPUTFILE async.nut THRESHOLD 99.999) add_qml_test(NAME tst_qml_gl_transitions OUTPUTSPEC 15:320x240 QMLFILE gl-transitions.qml OUTPUTFILE gl-transitions.nut THRESHOLD 98.999) add_qml_test(NAME tst_qml_transformer OUTPUTSPEC 15:320x240 QMLFILE transformer.qml OUTPUTFILE transformer.nut THRESHOLD 99.999) +add_qml_test(NAME tst_qml_splitscreen OUTPUTSPEC 15:160x450 QMLFILE splitscreen.qml OUTPUTFILE splitscreen.nut THRESHOLD 99.999) # Label tests that require a GPU set_tests_properties(tst_qml_static tst_qml_animated tst_qml_video_clipstart tst_qml_multisink tst_qml_video_ad_insertion tst_qml_video_multieffect tst_qml_video_shadereffect tst_qml_sequence tst_qml_gl_transitions PROPERTIES LABELS GPU) \ No newline at end of file diff --git a/tests/fixtures b/tests/fixtures index fcb0a54..e2c6f03 160000 --- a/tests/fixtures +++ b/tests/fixtures @@ -1 +1 @@ -Subproject commit fcb0a54b67ce9d7afc65da6147976318b6b94b94 +Subproject commit e2c6f0388b3aaf526f26e3664881bc0f00d1deee diff --git a/tests/qml/subtitles.qml b/tests/qml/splitscreen.qml similarity index 55% rename from tests/qml/subtitles.qml rename to tests/qml/splitscreen.qml index 981f515..c24a949 100644 --- a/tests/qml/subtitles.qml +++ b/tests/qml/splitscreen.qml @@ -17,15 +17,30 @@ Item { VideoRenderer { id: topLeftVideo - transform: Translate { x: -topLeftVideo.width / 4 } - anchors.horizontalCenter: root.horizontalCenter + anchors.left: parent.left mediaClip: videoClip } VideoRenderer { id: bottomRightVideo - transform: Translate { x: bottomRightVideo.width / 4 } - anchors.horizontalCenter: root.horizontalCenter + anchors.right: parent.right anchors.top: topLeftVideo.bottom mediaClip: videoClip } + VideoRenderer { + id: fullVideo + transform: [ + Translate { + y: -fullVideo.height / 2 + }, + Scale { + origin.x: fullVideo.width / 2 + origin.y: fullVideo.height / 2 + xScale: 0.5 + yScale: 0.5 + } + ] + anchors.horizontalCenter: root.horizontalCenter + anchors.top: bottomRightVideo.bottom + mediaClip: videoClip + } } diff --git a/tests/qmltest.sh b/tests/qmltest.sh index eb91e4d..e2a1f62 100755 --- a/tests/qmltest.sh +++ b/tests/qmltest.sh @@ -9,6 +9,7 @@ usage="$0 : " BASE=${BASH_SOURCE%/*} FIXTURES=${BASE}/fixtures +FIXTURES_OUTPUT=${FIXTURES}/output/mediafx-qt ASSETS=${FIXTURES}/assets MEDIAFX=${1:?$usage} @@ -39,7 +40,7 @@ function stream_hashes { # If framehash is different, then pixel difference each frame. # threshold=2 is how much each pixel can differ # https://superuser.com/questions/1615310/how-to-use-ffmpeg-blend-difference-filter-mode-to-identify-frame-differences-bet -FIXTURE=${FIXTURES}/$(basename "${OUTPUT}") +FIXTURE=${FIXTURES_OUTPUT}/$(basename "${OUTPUT}") [ -f "${FIXTURE}.framehash" ] || exit 1 diff <(stream_hashes "${FIXTURE}.framehash" audio) <(stream_hashes "${OUTPUT}.framehash" audio) diff --git a/tests/tst_encoder.cpp b/tests/tst_encoder.cpp index f2b6bdc..1534869 100644 --- a/tests/tst_encoder.cpp +++ b/tests/tst_encoder.cpp @@ -105,7 +105,7 @@ private slots: QByteArray encodedData(encodedFile.readAll()); encodedFile.close(); - QString fixturePath = QFINDTESTDATA("fixtures/encoder.nut"); + QString fixturePath = QFINDTESTDATA("fixtures/output/mediafx-qt/encoder.nut"); QFile fixtureFile(fixturePath); QVERIFY(fixtureFile.open(QIODevice::ReadOnly)); QByteArray fixtureData(fixtureFile.readAll());