summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
index de7b8efd9..f96d2caf3 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qsgvideonode_texture_p.h"
#include "qsgvideotexture_p.h"
+#include <private/qsgrhisupport_p.h>
#include <QtQuick/qsgmaterial.h>
#include <QtCore/qmutex.h>
#include <QtMultimedia/private/qtmultimediaglobal_p.h>
@@ -48,8 +49,9 @@ QList<QVideoFrame::PixelFormat> QSGVideoNodeFactory_Texture::supportedPixelForma
QAbstractVideoBuffer::HandleType handleType) const
{
QList<QVideoFrame::PixelFormat> pixelFormats;
-
- if (handleType == QAbstractVideoBuffer::GLTextureHandle) {
+ auto rhi = QSGRhiSupport::instance();
+ auto metalEnabled = rhi->isRhiEnabled() && rhi->rhiBackend() == QRhi::Metal && handleType == QAbstractVideoBuffer::MTLTextureHandle;
+ if (handleType == QAbstractVideoBuffer::GLTextureHandle || metalEnabled) {
pixelFormats.append(QVideoFrame::Format_RGB565);
pixelFormats.append(QVideoFrame::Format_RGB32);
pixelFormats.append(QVideoFrame::Format_ARGB32);