diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-10-23 14:47:18 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-11-06 11:49:17 +0000 |
commit | 9800e9d1204174eeabff4c8c0a3b14c1f1657828 (patch) | |
tree | c69bda2c70c04125e3e115c1a47ce3b70a97de2a /src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h | |
parent | 2a77249b1954f0c57ab9de41cf96345b9e575ee7 (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/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h')
-rw-r--r-- | src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h index 465821cb1..894796dfb 100644 --- a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h +++ b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h @@ -79,9 +79,19 @@ class Q_MULTIMEDIAQUICK_EXPORT QDeclarativeVideoOutput : public QQuickItem Q_PROPERTY(QRectF sourceRect READ sourceRect NOTIFY sourceRectChanged) Q_PROPERTY(QRectF contentRect READ contentRect NOTIFY contentRectChanged) Q_PROPERTY(QQmlListProperty<QAbstractVideoFilter> filters READ filters); + Q_PROPERTY(FlushMode flushMode READ flushMode WRITE setFlushMode NOTIFY flushModeChanged) + Q_ENUMS(FlushMode) Q_ENUMS(FillMode) public: + + enum FlushMode + { + EmptyFrame, + FirstFrame, + LastFrame + }; + enum FillMode { Stretch = Qt::IgnoreAspectRatio, @@ -125,6 +135,9 @@ public: QQmlListProperty<QAbstractVideoFilter> filters(); + FlushMode flushMode() const { return m_flushMode; } + void setFlushMode(FlushMode mode); + Q_SIGNALS: void sourceChanged(); void fillModeChanged(QDeclarativeVideoOutput::FillMode); @@ -132,6 +145,7 @@ Q_SIGNALS: void autoOrientationChanged(); void sourceRectChanged(); void contentRectChanged(); + void flushModeChanged(); protected: QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; @@ -175,6 +189,7 @@ private: QScopedPointer<QDeclarativeVideoBackend> m_backend; QList<QAbstractVideoFilter *> m_filters; + FlushMode m_flushMode = EmptyFrame; }; QT_END_NAMESPACE |