From 3d909ba8ac0f43af6d70830a5c95df3e741f1221 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Mon, 8 Jun 2020 10:42:03 +0200 Subject: Quick: Allow to build with -no-opengl Change-Id: I927998b9ffa80a324636855c5dcc92cb57e9d520 Reviewed-by: Laszlo Agocs --- src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp') 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 #include +#if QT_CONFIG(opengl) #include +#endif + #include #include @@ -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(m_backend->glContext())); } +#endif QT_END_NAMESPACE -- cgit v1.2.3