diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-06-08 10:42:03 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-06-10 14:33:49 +0200 |
commit | 3d909ba8ac0f43af6d70830a5c95df3e741f1221 (patch) | |
tree | 7802b0c29b6dc19c65640e8d46f8dad70c148786 /src/qtmultimediaquicktools/qsgvideonode_texture.cpp | |
parent | 22ae5eec6314b59c8a969b743a9c05fb184cc9b2 (diff) |
Quick: Allow to build with -no-opengl
Change-Id: I927998b9ffa80a324636855c5dcc92cb57e9d520
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp')
-rw-r--r-- | src/qtmultimediaquicktools/qsgvideonode_texture.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp index f96d2caf3..7b819511a 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp @@ -49,9 +49,19 @@ QList<QVideoFrame::PixelFormat> QSGVideoNodeFactory_Texture::supportedPixelForma QAbstractVideoBuffer::HandleType handleType) const { QList<QVideoFrame::PixelFormat> pixelFormats; + + QList<QAbstractVideoBuffer::HandleType> types; + auto rhi = QSGRhiSupport::instance(); - auto metalEnabled = rhi->isRhiEnabled() && rhi->rhiBackend() == QRhi::Metal && handleType == QAbstractVideoBuffer::MTLTextureHandle; - if (handleType == QAbstractVideoBuffer::GLTextureHandle || metalEnabled) { + auto metalEnabled = rhi->isRhiEnabled() && rhi->rhiBackend() == QRhi::Metal; + if (metalEnabled) + types.append(QAbstractVideoBuffer::MTLTextureHandle); + +#if QT_CONFIG(opengl) + types.append(QAbstractVideoBuffer::GLTextureHandle); +#endif + + if (types.contains(handleType)) { pixelFormats.append(QVideoFrame::Format_RGB565); pixelFormats.append(QVideoFrame::Format_RGB32); pixelFormats.append(QVideoFrame::Format_ARGB32); |