diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-08-25 16:18:20 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-28 13:43:50 +0000 |
commit | 652dfbd5295d32b3f3fb95a1a5eb25e7972ef5f3 (patch) | |
tree | 7758f79896b82c5dd6d04de78b1ad5058a4fec12 /tests | |
parent | 95b4f69d2219eee8d818d0de7ae941ab6342895e (diff) |
Remove some dead code relating to color correction in QVideoWidget
This isn't supported in 6.2, get rid of the dead code.
Change-Id: Ie2af81d0b74f16a126c718d09368ee04774809cf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1083861fd1534d28858dca552784c7daa9d3bd54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/unit/mockbackend/qmockvideosink.h | 13 | ||||
-rw-r--r-- | tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp | 240 |
2 files changed, 0 insertions, 253 deletions
diff --git a/tests/auto/unit/mockbackend/qmockvideosink.h b/tests/auto/unit/mockbackend/qmockvideosink.h index 9f6b5ff16..187160f3c 100644 --- a/tests/auto/unit/mockbackend/qmockvideosink.h +++ b/tests/auto/unit/mockbackend/qmockvideosink.h @@ -63,23 +63,10 @@ public: explicit QMockVideoSink(QVideoSink *parent) : QPlatformVideoSink(parent) {} - void setWinId(WId) override {} - void setRhi(QRhi * /*rhi*/) override {} - void setDisplayRect(const QRect &) override {} - - void setFullScreen(bool) override {} - QSize nativeSize() const override { return videoSize; } - void setAspectRatioMode(Qt::AspectRatioMode) override {} - - void setBrightness(float) override {} - void setContrast(float) override {} - void setHue(float) override {} - void setSaturation(float) override {} - void setVideoSize(QSize s) { videoSize = s; } protected: QSize videoSize = QSize(640, 480); diff --git a/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp b/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp index ef8bf3105..dbe378bd8 100644 --- a/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp @@ -95,74 +95,6 @@ void tst_QVideoWidget::nullObject() widget.setAspectRatioMode(Qt::IgnoreAspectRatio); QCOMPARE(widget.aspectRatioMode(), Qt::IgnoreAspectRatio); - -#if 0 - { - QSignalSpy spy(&widget, SIGNAL(brightnessChanged(float))); - - widget.setBrightness(1); - QCOMPARE(widget.brightness(), 1); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), 1.); - - widget.setBrightness(1); - QCOMPARE(widget.brightness(), 1); - QCOMPARE(spy.count(), 1); - - widget.setBrightness(-1.2); - QCOMPARE(widget.brightness(), -1.); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), -1.); - } { - QSignalSpy spy(&widget, SIGNAL(contrastChanged(float))); - - widget.setContrast(1.); - QCOMPARE(widget.contrast(), 1.); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), 1.); - - widget.setContrast(1.); - QCOMPARE(widget.contrast(), 1.); - QCOMPARE(spy.count(), 1); - - widget.setContrast(-1.2); - QCOMPARE(widget.contrast(), -1.); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), -1.); - } { - QSignalSpy spy(&widget, SIGNAL(hueChanged(float))); - - widget.setHue(1.); - QCOMPARE(widget.hue(), 1.); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), 1.); - - widget.setHue(1.); - QCOMPARE(widget.hue(), 1.); - QCOMPARE(spy.count(), 1); - - widget.setHue(-1.2); - QCOMPARE(widget.hue(), -1.); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), -1.); - } { - QSignalSpy spy(&widget, SIGNAL(saturationChanged(float))); - - widget.setSaturation(1.); - QCOMPARE(widget.saturation(), 1.); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), 1.); - - widget.setSaturation(1.); - QCOMPARE(widget.saturation(), 1.); - QCOMPARE(spy.count(), 1); - - widget.setSaturation(-1.2); - QCOMPARE(widget.saturation(), -1.); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), -1.); - } -#endif } @@ -316,178 +248,6 @@ void tst_QVideoWidget::fullScreen() QCOMPARE(spy.count(), 5); } -#if 0 -void tst_QVideoWidget::color_data() -{ - QTest::addColumn<float>("controlValue"); - QTest::addColumn<float>("value"); - QTest::addColumn<float>("expectedValue"); - - QTest::newRow(".12") - << 0.f - << .12f - << .12f; - QTest::newRow("-.56") - << .87f - << -.56f - << -.56f; - QTest::newRow("100") - << .32f - << 1.f - << 1.f; - QTest::newRow("12.94") - << 0.f - << 12.94f - << 1.f; - QTest::newRow("-1.02") - << .34f - << -1.02f - << -1.00f; -} - -void tst_QVideoWidget::brightness() -{ - QFETCH(float, controlValue); - QFETCH(float, value); - QFETCH(float, expectedValue); - - QMediaPlayer player; - QtTestVideoWidget widget; - player.setVideoOutput(&widget); - widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); - - // Test that values start at their default - QCOMPARE(widget.brightness(), 0); - - QSignalSpy spy(&widget, SIGNAL(brightnessChanged(float))); - - // Test the video widget sets the brightness value, bounded if necessary and emits a changed - // signal. - widget.setBrightness(value); - QCOMPARE(widget.brightness(), expectedValue); - QCOMPARE(widget.videoSink()->brightness(), expectedValue); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), expectedValue); - - // Test the changed signal isn't emitted if the value is unchanged. - widget.setBrightness(value); - QCOMPARE(widget.brightness(), expectedValue); - QCOMPARE(widget.videoSink()->brightness(), expectedValue); - QCOMPARE(spy.count(), 1); - - // Test the changed signal is emitted if the brightness is changed internally. - widget.videoSink()->setBrightness(controlValue); - QCOMPARE(widget.brightness(), controlValue); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), controlValue); -} - -void tst_QVideoWidget::contrast() -{ - QFETCH(float, controlValue); - QFETCH(float, value); - QFETCH(float, expectedValue); - - QMediaPlayer player; - QtTestVideoWidget widget; - player.setVideoOutput(&widget); - - QCOMPARE(widget.contrast(), 0); - - widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); - QCOMPARE(widget.contrast(), 0); - - QSignalSpy spy(&widget, SIGNAL(contrastChanged(float))); - - widget.setContrast(value); - QCOMPARE(widget.contrast(), expectedValue); - QCOMPARE(widget.videoSink()->contrast(), expectedValue); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), expectedValue); - - widget.setContrast(value); - QCOMPARE(widget.contrast(), expectedValue); - QCOMPARE(widget.videoSink()->contrast(), expectedValue); - QCOMPARE(spy.count(), 1); - - widget.videoSink()->setContrast(controlValue); - QCOMPARE(widget.contrast(), controlValue); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), controlValue); -} - -void tst_QVideoWidget::hue() -{ - QFETCH(float, controlValue); - QFETCH(float, value); - QFETCH(float, expectedValue); - - QMediaPlayer player; - QtTestVideoWidget widget; - player.setVideoOutput(&widget); - - QCOMPARE(widget.hue(), 0); - - widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); - QCOMPARE(widget.hue(), 0); - - QSignalSpy spy(&widget, SIGNAL(hueChanged(float))); - - widget.setHue(value); - QCOMPARE(widget.hue(), expectedValue); - QCOMPARE(widget.videoSink()->hue(), expectedValue); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), expectedValue); - - widget.setHue(value); - QCOMPARE(widget.hue(), expectedValue); - QCOMPARE(widget.videoSink()->hue(), expectedValue); - QCOMPARE(spy.count(), 1); - - widget.videoSink()->setHue(controlValue); - QCOMPARE(widget.hue(), controlValue); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), controlValue); -} - -void tst_QVideoWidget::saturation() -{ - QFETCH(float, controlValue); - QFETCH(float, value); - QFETCH(float, expectedValue); - - QMediaPlayer player; - QtTestVideoWidget widget; - player.setVideoOutput(&widget); - - QCOMPARE(widget.saturation(), 0); - widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); - QCOMPARE(widget.saturation(), 0); - - QSignalSpy spy(&widget, SIGNAL(saturationChanged(float))); - - widget.setSaturation(value); - QCOMPARE(widget.saturation(), expectedValue); - QCOMPARE(widget.videoSink()->saturation(), expectedValue); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.value(0).value(0).toFloat(), expectedValue); - - widget.setSaturation(value); - QCOMPARE(widget.saturation(), expectedValue); - QCOMPARE(widget.videoSink()->saturation(), expectedValue); - QCOMPARE(spy.count(), 1); - - widget.videoSink()->setSaturation(controlValue); - QCOMPARE(widget.saturation(), controlValue); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.value(1).value(0).toFloat(), controlValue); -} -#endif - static const uchar rgb32ImageData[] = { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, |