summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
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 /src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
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 'src/qtmultimediaquicktools/qdeclarativevideooutput.cpp')
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index 3c6a6f9c5..fccab54ab 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -878,4 +878,28 @@ void QDeclarativeVideoOutput::_q_invalidateSceneGraph()
m_backend->invalidateSceneGraph();
}
+/*!
+ \qmlproperty enumeration QtMultimedia::VideoOutput::flushMode
+
+ Set this property to define what \c VideoOutput should show
+ when playback is finished or stopped.
+
+ \list
+ \li EmptyFrame - clears video output.
+ \li FirstFrame - shows the first valid frame.
+ \li LastFrame - shows the last valid frame.
+ \endlist
+
+ The default flush mode is EmptyFrame.
+*/
+
+void QDeclarativeVideoOutput::setFlushMode(FlushMode mode)
+{
+ if (m_flushMode == mode)
+ return;
+
+ m_flushMode = mode;
+ emit flushModeChanged();
+}
+
QT_END_NAMESPACE