summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-09-06 12:52:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-07 09:26:59 +0000
commitb12cf35db60a0c320316b291ede216e483e8b393 (patch)
tree7e5fc58c13e29f8ee32ed9a692f9650ff835f47f /tests
parent408f5672af4dddd5c2a1f5a0a45c467809d8ff72 (diff)
API fix: Give QVideoSink a videoFrame property
Gives a more consistent API with a videoFrameChanged() signal instead of a newVideoFrame() signal. Add setters and getters for videoFrame and subtitleText. Change-Id: Ib6bb27b76cbf195dcc83eb00bca080ffd64ef538 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Samuel Mira <samuel.mira@qt.io> (cherry picked from commit 5c88c2f110c94b202554063d81ad696ff29bd307) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp2
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp2
-rw-r--r--tests/auto/integration/qquickvideooutput/tst_qquickvideooutput.cpp4
-rw-r--r--tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp6
-rw-r--r--tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index 27e0687a4..f4f0741c2 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -95,7 +95,7 @@ public:
: formatMismatch(0),
cameraFormat(format)
{
- connect(this, &QVideoSink::newVideoFrame, this, &TestVideoFormat::checkVideoFrameFormat);
+ connect(this, &QVideoSink::videoFrameChanged, this, &TestVideoFormat::checkVideoFrameFormat);
}
void setCameraFormatToTest(const QCameraFormat &format)
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index 36983b308..2f87f257e 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -107,7 +107,7 @@ public:
explicit TestVideoSink(bool storeFrames = true)
: m_storeFrames(storeFrames)
{
- connect(this, &QVideoSink::newVideoFrame, this, &TestVideoSink::addVideoFrame);
+ connect(this, &QVideoSink::videoFrameChanged, this, &TestVideoSink::addVideoFrame);
}
public Q_SLOTS:
diff --git a/tests/auto/integration/qquickvideooutput/tst_qquickvideooutput.cpp b/tests/auto/integration/qquickvideooutput/tst_qquickvideooutput.cpp
index 29b575f82..519fc6944 100644
--- a/tests/auto/integration/qquickvideooutput/tst_qquickvideooutput.cpp
+++ b/tests/auto/integration/qquickvideooutput/tst_qquickvideooutput.cpp
@@ -48,7 +48,7 @@ void presentDummyFrame(QVideoSink *sink, const QSize &size)
QVideoFrameFormat format(size, QVideoFrameFormat::Format_ARGB8888_Premultiplied);
QVideoFrame frame(format);
- sink->newVideoFrame(frame);
+ sink->setVideoFrame(frame);
// Have to spin an event loop or two for the surfaceFormatChanged() signal
qApp->processEvents();
@@ -295,7 +295,7 @@ void tst_QQuickVideoOutput::paintSurface()
QCOMPARE(frame.mappedBytes(0), 64);
memcpy(frame.bits(0), rgb32ImageData, 64);
frame.unmap();
- surface->newVideoFrame(frame);
+ surface->setVideoFrame(frame);
}
void tst_QQuickVideoOutput::sourceRect()
diff --git a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
index b9cbfeb7c..583115f99 100644
--- a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
+++ b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
@@ -246,7 +246,7 @@ void tst_QGraphicsVideoItem::nativeSize()
QVideoFrameFormat format(frameSize, QVideoFrameFormat::Format_ARGB8888);
format.setViewport(viewport);
QVideoFrame frame(format);
- item.videoSink()->newVideoFrame(frame);
+ item.videoSink()->setVideoFrame(frame);
QCoreApplication::processEvents();
QCOMPARE(item.nativeSize(), nativeSize);
@@ -373,7 +373,7 @@ void tst_QGraphicsVideoItem::boundingRect()
QVideoFrameFormat format(frameSize, QVideoFrameFormat::Format_ARGB8888);
QVideoFrame frame(format);
- item.videoSink()->newVideoFrame(frame);
+ item.videoSink()->setVideoFrame(frame);
QCoreApplication::processEvents();
QCOMPARE(item.boundingRect(), expectedRect);
@@ -406,7 +406,7 @@ void tst_QGraphicsVideoItem::paint()
memcpy(frame.bits(0), rgb32ImageData, frame.mappedBytes(0));
frame.unmap();
- sink->newVideoFrame(frame);
+ sink->setVideoFrame(frame);
QVERIFY(item->waitForPaint(1));
}
diff --git a/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp b/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp
index dbe378bd8..ec8119481 100644
--- a/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp
+++ b/tests/auto/unit/multimediawidgets/qvideowidget/tst_qvideowidget.cpp
@@ -271,7 +271,7 @@ void tst_QVideoWidget::paint()
frame.unmap();
auto *sink = widget.videoSink();
- emit sink->newVideoFrame(frame);
+ emit sink->setVideoFrame(frame);
QCoreApplication::processEvents(QEventLoop::AllEvents);
}