summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-10-23 14:47:18 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-11-06 11:49:17 +0000
commit9800e9d1204174eeabff4c8c0a3b14c1f1657828 (patch)
treec69bda2c70c04125e3e115c1a47ce3b70a97de2a /tests
parent2a77249b1954f0c57ab9de41cf96345b9e575ee7 (diff)
VideoOutput: Introduce flushMode property
Added flushMode property to QML VideoOutput element to define what should be shown when flush is requested. Takes affect only for QDeclarativeVideoRendererBackend and when QSGVideoItemSurface is already started. Flushing (passing empty video frame to the surface) is usually performed when EndOfMedia or playback is stopped. Which caused disappearing the content and blinking if playlist is used. Using this property now possible to define what frame (last, first or empty) should be shown when playback is stopped or finished. By default shows empty frame (clears the video output). To show a frame it requires to keep QVideoFrame and thus its data. Task-number: QTBUG-37301 Task-number: QTBUG-49446 Change-Id: I3be5309217b9f543da804e3b616dee9d97fba65f Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
index 707a01512..3059a4641 100644
--- a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
@@ -106,6 +106,7 @@ public slots:
private slots:
void fillMode();
+ void flushMode();
void orientation();
void surfaceSource();
void sourceRect();
@@ -161,6 +162,7 @@ void tst_QDeclarativeVideoOutput::initTestCase()
}
Q_DECLARE_METATYPE(QDeclarativeVideoOutput::FillMode)
+Q_DECLARE_METATYPE(QDeclarativeVideoOutput::FlushMode)
tst_QDeclarativeVideoOutput::tst_QDeclarativeVideoOutput()
: m_mappingComponent(0)
@@ -199,6 +201,24 @@ void tst_QDeclarativeVideoOutput::fillMode()
delete videoOutput;
}
+void tst_QDeclarativeVideoOutput::flushMode()
+{
+ QQmlComponent component(&m_engine);
+ component.setData(m_plainQML, QUrl());
+
+ QObject *videoOutput = component.create();
+ QVERIFY(videoOutput != 0);
+
+ QSignalSpy propSpy(videoOutput, SIGNAL(flushModeChanged()));
+
+ QCOMPARE(videoOutput->property("flushMode").value<QDeclarativeVideoOutput::FlushMode>(), QDeclarativeVideoOutput::EmptyFrame);
+ QCOMPARE(propSpy.count(), 0);
+
+ videoOutput->setProperty("flushMode", QVariant(int(QDeclarativeVideoOutput::FirstFrame)));
+ QCOMPARE(videoOutput->property("fillMode").value<QDeclarativeVideoOutput::FlushMode>(), QDeclarativeVideoOutput::FirstFrame);
+ QCOMPARE(propSpy.count(), 1);
+}
+
void tst_QDeclarativeVideoOutput::orientation()
{
QQmlComponent component(&m_engine);