summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp')
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index fad92bc5f..a45350fdc 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -62,12 +62,6 @@ QDeclarativeVideoBackend::QDeclarativeVideoBackend(QDeclarativeVideoOutput *pare
: q(parent),
m_frameChanged(false)
{
- m_sink = new QVideoSink(q);
- m_sink->setRhi(QQuickWindowPrivate::get(q->window())->rhi);
- qRegisterMetaType<QVideoSurfaceFormat>();
- QObject::connect(m_sink, SIGNAL(newVideoFrame(const QVideoFrame &)),
- q, SLOT(_q_newFrame(const QVideoFrame &)), Qt::QueuedConnection);
-
// Prioritize the plugin requested by the environment
QString requestedVideoNode = QString::fromLatin1(qgetenv("QT_VIDEONODE"));
@@ -324,6 +318,13 @@ QSGNode *QDeclarativeVideoBackend::updatePaintNode(QSGNode *oldNode,
QVideoSink *QDeclarativeVideoBackend::videoSink() const
{
+ if (!m_sink) {
+ m_sink = new QVideoSink(q);
+ m_sink->setRhi(QQuickWindowPrivate::get(q->window())->rhi);
+ qRegisterMetaType<QVideoSurfaceFormat>();
+ QObject::connect(m_sink, SIGNAL(newVideoFrame(const QVideoFrame &)),
+ q, SLOT(_q_newFrame(const QVideoFrame &)), Qt::QueuedConnection);
+ }
return m_sink;
}