summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-09-04 12:37:12 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-10-24 14:27:11 +0200
commita6ae689d636bfcb170333f27cddb0375aeea1dbf (patch)
tree3ef0bdffa25a28f64ae510c845232ae3ffaae7d4
parent327e2c7a84e11420376a6257aeebed035d430833 (diff)
Build without OpenGL support
There is support for rendering video without OpenGL on most platforms although some features are unavailable as a result, so we can make sure that what is available can be used. Change-Id: I63938e8e4e8063fcc2064d0f9d8d5f10e0fb06f9 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp5
-rw-r--r--src/qtmultimediaquicktools/qtmultimediaquicktools.pro23
-rw-r--r--src/src.pro2
3 files changed, 18 insertions, 12 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index 18cf0e927..74c83246f 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -206,6 +206,7 @@ void QDeclarativeVideoOutput::setSource(QObject *source)
}
m_sourceType = MediaObjectSource;
+#if QT_CONFIG(opengl)
} else if (metaObject->indexOfProperty("videoSurface") != -1) {
// Make sure our backend is a QDeclarativeVideoRendererBackend
m_backend.reset();
@@ -219,6 +220,7 @@ void QDeclarativeVideoOutput::setSource(QObject *source)
m_source.data()->setProperty("videoSurface",
QVariant::fromValue<QAbstractVideoSurface*>(surface));
m_sourceType = VideoSurfaceSource;
+#endif
} else {
m_sourceType = NoSource;
}
@@ -247,12 +249,13 @@ bool QDeclarativeVideoOutput::createBackend(QMediaService *service)
}
}
}
-
+#if QT_CONFIG(opengl)
if (!backendAvailable) {
m_backend.reset(new QDeclarativeVideoRendererBackend(this));
if (m_backend->init(service))
backendAvailable = true;
}
+#endif
// QDeclarativeVideoWindowBackend only works when there is a service with a QVideoWindowControl.
// Without service, the QDeclarativeVideoRendererBackend should always work.
diff --git a/src/qtmultimediaquicktools/qtmultimediaquicktools.pro b/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
index bffdc6ec2..fd29ee5a4 100644
--- a/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
+++ b/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
@@ -16,20 +16,23 @@ PRIVATE_HEADERS += \
HEADERS += \
$$PRIVATE_HEADERS \
- qdeclarativevideooutput_render_p.h \
- qdeclarativevideooutput_window_p.h \
- qsgvideonode_yuv_p.h \
- qsgvideonode_rgb_p.h \
- qsgvideonode_texture_p.h
+ qdeclarativevideooutput_window_p.h
SOURCES += \
qsgvideonode_p.cpp \
qdeclarativevideooutput.cpp \
- qdeclarativevideooutput_render.cpp \
- qdeclarativevideooutput_window.cpp \
- qsgvideonode_yuv.cpp \
- qsgvideonode_rgb.cpp \
- qsgvideonode_texture.cpp
+ qdeclarativevideooutput_window.cpp
+
+qtConfig(opengl) {
+ SOURCES += qdeclarativevideooutput_render.cpp \
+ qsgvideonode_rgb.cpp \
+ qsgvideonode_yuv.cpp \
+ qsgvideonode_texture.cpp
+ HEADERS += qdeclarativevideooutput_render_p.h \
+ qsgvideonode_rgb_p.h \
+ qsgvideonode_yuv_p.h \
+ qsgvideonode_texture_p.h
+}
RESOURCES += \
qtmultimediaquicktools.qrc
diff --git a/src/src.pro b/src/src.pro
index 97a053379..1dc1015c6 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -16,7 +16,7 @@ src_plugins.subdir = plugins
src_plugins.depends = multimedia
-qtHaveModule(quick):qtConfig(opengl) {
+qtHaveModule(quick) {
src_qtmultimediaquicktools.subdir = qtmultimediaquicktools
src_qtmultimediaquicktools.depends = multimedia