summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-06-08 10:42:03 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-06-10 14:33:49 +0200
commit3d909ba8ac0f43af6d70830a5c95df3e741f1221 (patch)
tree7802b0c29b6dc19c65640e8d46f8dad70c148786 /src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
parent22ae5eec6314b59c8a969b743a9c05fb184cc9b2 (diff)
Quick: Allow to build with -no-opengl
Change-Id: I927998b9ffa80a324636855c5dcc92cb57e9d520 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp')
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index bdfa23dfb..02026a182 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -47,7 +47,10 @@
#include <private/qmediapluginloader_p.h>
#include <private/qsgvideonode_p.h>
+#if QT_CONFIG(opengl)
#include <QtGui/QOpenGLContext>
+#endif
+
#include <QtQuick/QQuickWindow>
#include <QtCore/QRunnable>
@@ -60,7 +63,6 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, videoNodeFactoryLoader,
QDeclarativeVideoRendererBackend::QDeclarativeVideoRendererBackend(QDeclarativeVideoOutput *parent)
: QDeclarativeVideoBackend(parent),
- m_glContext(0),
m_frameChanged(false)
{
m_surface = new QSGVideoItemSurface(this);
@@ -277,6 +279,7 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
QMutexLocker lock(&m_frameMutex);
+#if QT_CONFIG(opengl)
if (!m_glContext) {
m_glContext = QOpenGLContext::currentContext();
m_surface->scheduleOpenGLContextUpdate();
@@ -288,6 +291,7 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
obj->event(&ev);
}
}
+#endif
bool isFrameModified = false;
if (m_frameChanged) {
@@ -402,10 +406,12 @@ QRectF QDeclarativeVideoRendererBackend::adjustedViewport() const
return viewport;
}
+#if QT_CONFIG(opengl)
QOpenGLContext *QDeclarativeVideoRendererBackend::glContext() const
{
return m_glContext;
}
+#endif
void QDeclarativeVideoRendererBackend::present(const QVideoFrame &frame)
{
@@ -478,6 +484,7 @@ bool QSGVideoItemSurface::present(const QVideoFrame &frame)
return true;
}
+#if QT_CONFIG(opengl)
void QSGVideoItemSurface::scheduleOpenGLContextUpdate()
{
//This method is called from render thread
@@ -489,5 +496,6 @@ void QSGVideoItemSurface::updateOpenGLContext()
//Set a dynamic property to access the OpenGL context in Qt Quick render thread.
this->setProperty("GLContext", QVariant::fromValue<QObject*>(m_backend->glContext()));
}
+#endif
QT_END_NAMESPACE