summaryrefslogtreecommitdiffstats
path: root/src/multimediawidgets/qvideowidget.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-21 14:10:58 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-28 07:12:27 +0000
commit921e8a593d7a289f57a71f30698646edc2f2b444 (patch)
treeb3c86082dc62b42704bf92b186a6fb026e6c9c49 /src/multimediawidgets/qvideowidget.cpp
parent1caf848d3dabfe732cab702cdaf2e56016724861 (diff)
Re-enable tst_qvideowidget and fix most errors in the test
Change-Id: I77bf951d9e334d92b65d0f9f5c37c22033e91060 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/multimediawidgets/qvideowidget.cpp')
-rw-r--r--src/multimediawidgets/qvideowidget.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index 4e597a5af..eebda495b 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -112,6 +112,10 @@ QVideoWidget::QVideoWidget(QWidget *parent)
d_ptr->videoSink->setNativeWindowId(winId());
connect(d_ptr->videoSink, SIGNAL(newVideoFrame(const QVideoFrame &)), this, SLOT(_q_newFrame(const QVideoFrame &)));
+ connect(d_ptr->videoSink, &QVideoSink::brightnessChanged, this, &QVideoWidget::brightnessChanged);
+ connect(d_ptr->videoSink, &QVideoSink::contrastChanged, this, &QVideoWidget::contrastChanged);
+ connect(d_ptr->videoSink, &QVideoSink::hueChanged, this, &QVideoWidget::hueChanged);
+ connect(d_ptr->videoSink, &QVideoSink::saturationChanged, this, &QVideoWidget::saturationChanged);
}
/*!
@@ -201,7 +205,7 @@ float QVideoWidget::brightness() const
void QVideoWidget::setBrightness(float brightness)
{
Q_D(QVideoWidget);
-
+ d->videoSink->setBrightness(brightness);
float boundedBrightness = qBound(-1., brightness, 1.);
if (boundedBrightness == d->videoSink->brightness())
@@ -235,14 +239,7 @@ float QVideoWidget::contrast() const
void QVideoWidget::setContrast(float contrast)
{
Q_D(QVideoWidget);
-
- float boundedContrast = qBound(-1., contrast, 1.);
-
- if (boundedContrast == d->videoSink->contrast())
- return;
-
- d->videoSink->setContrast(boundedContrast);
- emit contrastChanged(boundedContrast);
+ d->videoSink->setContrast(contrast);
}
/*!
@@ -268,14 +265,7 @@ float QVideoWidget::hue() const
void QVideoWidget::setHue(float hue)
{
Q_D(QVideoWidget);
-
- float boundedHue = qBound(-1., hue, 1.);
-
- if (boundedHue == d->videoSink->hue())
- return;
-
- d->videoSink->setHue(boundedHue);
- emit hueChanged(boundedHue);
+ d->videoSink->setHue(hue);
}
/*!
@@ -301,14 +291,7 @@ float QVideoWidget::saturation() const
void QVideoWidget::setSaturation(float saturation)
{
Q_D(QVideoWidget);
-
- float boundedSaturation = qBound(-1., saturation, 1.);
-
- if (boundedSaturation == d->videoSink->saturation())
- return;
-
- d->videoSink->setSaturation(boundedSaturation);
- emit saturationChanged(boundedSaturation);
+ d->videoSink->setSaturation(saturation);
}
/*!