From 33d4ef6367ad49c40ec77af69ab1165989a65064 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 23 Mar 2021 12:59:28 +0100 Subject: Remove the handle type from QVideoSurfaceFormat This is a property of the individual QVideoFrame, and doesn't belong here. Change-Id: I85f180ff46023f6a48ef856a356d9c45c3f6be1b Reviewed-by: Lars Knoll Reviewed-by: Doris Verria --- .../qsgvideonode_texture.cpp | 29 ++++++---------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp') diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp index 58a903065..0a52f06c4 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp @@ -46,38 +46,25 @@ QT_BEGIN_NAMESPACE QList QSGVideoNodeFactory_Texture::supportedPixelFormats( - QVideoFrame::HandleType handleType) const + QVideoFrame::HandleType) const { QList pixelFormats; - QList types; - - auto rhi = QSGRhiSupport::instance(); - auto metalEnabled = rhi->isRhiEnabled() && rhi->rhiBackend() == QRhi::Metal; - if (metalEnabled) - types.append(QVideoFrame::MTLTextureHandle); - -#if QT_CONFIG(opengl) - types.append(QVideoFrame::GLTextureHandle); -#endif - - if (types.contains(handleType)) { - pixelFormats.append(QVideoFrame::Format_RGB565); - pixelFormats.append(QVideoFrame::Format_RGB32); - pixelFormats.append(QVideoFrame::Format_ARGB32); - pixelFormats.append(QVideoFrame::Format_BGR32); - pixelFormats.append(QVideoFrame::Format_BGRA32); + pixelFormats.append(QVideoFrame::Format_RGB565); + pixelFormats.append(QVideoFrame::Format_RGB32); + pixelFormats.append(QVideoFrame::Format_ARGB32); + pixelFormats.append(QVideoFrame::Format_BGR32); + pixelFormats.append(QVideoFrame::Format_BGRA32); #if !QT_CONFIG(gpu_vivante) - pixelFormats.append(QVideoFrame::Format_ABGR32); + pixelFormats.append(QVideoFrame::Format_ABGR32); #endif - } return pixelFormats; } QSGVideoNode *QSGVideoNodeFactory_Texture::createNode(const QVideoSurfaceFormat &format) { - if (supportedPixelFormats(format.handleType()).contains(format.pixelFormat())) + if (supportedPixelFormats(QVideoFrame::NoHandle).contains(format.pixelFormat())) return new QSGVideoNode_Texture(format); return nullptr; -- cgit v1.2.3