diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-05-11 10:45:22 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-05-14 08:18:06 +0000 |
commit | b3af843cfcb6ab0dc8539614f03c2bba7ed98811 (patch) | |
tree | 22e2fa1380a1421b1e0326c6f44f92a21e0d42b2 /src/multimedia/video/qvideotexturehelper.cpp | |
parent | dec783a762bfde10a94e2860de7828a6b3f2bafc (diff) |
Make sure Qt Multimedia compiles against 6.1
To keep Qt Multimedia compiling against 6.1 will help
people that want to test the module using a released
version of Qt.
This disables usage of the P010 and P016 video formats
on gstreamer, as RHI doesn't yet support the texture
types we need to render them correctly.
Change-Id: I009f0b37951072b1d6e671dbdd4bb7b33767226a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia/video/qvideotexturehelper.cpp')
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 4ff64a3e4..70238a50c 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -193,7 +193,21 @@ static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = { QRhiTexture::R16, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, - +#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) + // Rendering of those formats pre 6.2 will be wrong, as RHI doesn't yet support the correct texture formats + // Format_P010 + { 2, 2, + [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, + { QRhiTexture::RG8, QRhiTexture::RGBA8, QRhiTexture::UnknownFormat }, + { { 1, 1 }, { 2, 2 }, { 1, 1 } } + }, + // Format_P016 + { 2, 2, + [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, + { QRhiTexture::RG8, QRhiTexture::RGBA8, QRhiTexture::UnknownFormat }, + { { 1, 1 }, { 2, 2 }, { 1, 1 } } + }, +#else // Format_P010 { 2, 2, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, @@ -206,7 +220,7 @@ static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, - +#endif // Format_Jpeg { 1, 0, [](int, int) { return 0; }, |