diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-03-23 12:59:28 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-06 08:11:32 +0000 |
commit | 33d4ef6367ad49c40ec77af69ab1165989a65064 (patch) | |
tree | 22b6b757dcf77315da29a7c89a400b3e49457999 /src/qtmultimediaquicktools/qsgvideonode_texture.cpp | |
parent | f2841b24e351ab14fe35d617948d951bee609236 (diff) |
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 <lars.knoll@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp')
-rw-r--r-- | src/qtmultimediaquicktools/qsgvideonode_texture.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
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<QVideoFrame::PixelFormat> QSGVideoNodeFactory_Texture::supportedPixelFormats( - QVideoFrame::HandleType handleType) const + QVideoFrame::HandleType) const { QList<QVideoFrame::PixelFormat> pixelFormats; - QList<QVideoFrame::HandleType> 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; |