summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools
diff options
context:
space:
mode:
Diffstat (limited to 'src/qtmultimediaquicktools')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture.cpp6
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture_p.h2
-rw-r--r--src/qtmultimediaquicktools/qsgvideotexture.cpp3
-rw-r--r--src/qtmultimediaquicktools/qtmultimediaquicktools.pro2
4 files changed, 6 insertions, 7 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);
diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture_p.h b/src/qtmultimediaquicktools/qsgvideonode_texture_p.h
index 12685dd24..d7348473e 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_texture_p.h
+++ b/src/qtmultimediaquicktools/qsgvideonode_texture_p.h
@@ -68,7 +68,7 @@ public:
return m_format.pixelFormat();
}
QAbstractVideoBuffer::HandleType handleType() const override {
- return QAbstractVideoBuffer::GLTextureHandle;
+ return m_format.handleType();
}
void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags) override;
diff --git a/src/qtmultimediaquicktools/qsgvideotexture.cpp b/src/qtmultimediaquicktools/qsgvideotexture.cpp
index 0723543ed..bdefbc32f 100644
--- a/src/qtmultimediaquicktools/qsgvideotexture.cpp
+++ b/src/qtmultimediaquicktools/qsgvideotexture.cpp
@@ -166,9 +166,6 @@ void QSGVideoTexturePrivate::updateRhiTexture(QRhi *rhi, QRhiResourceUpdateBatch
QRhiTextureUploadDescription desc({ entry });
resourceUpdates->uploadTexture(m_texture.data(), desc);
}
- if (q->hasMipmaps())
- resourceUpdates->generateMips(m_texture.data());
-
}
void QSGVideoTexture::commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates)
diff --git a/src/qtmultimediaquicktools/qtmultimediaquicktools.pro b/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
index a2451e6e2..82e3e463f 100644
--- a/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
+++ b/src/qtmultimediaquicktools/qtmultimediaquicktools.pro
@@ -1,6 +1,6 @@
TARGET = QtMultimediaQuick
-QT = core quick multimedia-private
+QT = core quick multimedia-private quick-private
CONFIG += internal_module
PRIVATE_HEADERS += \