diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-13 10:09:11 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-16 11:00:32 +0000 |
commit | 919d33f108f3cd54b4d36d873bda63eb22cfcfd5 (patch) | |
tree | 3d4e547486fdf2cf78b499b1f0315f84a4fbe1c9 /src/multimedia/video/qvideotexturehelper.cpp | |
parent | 1306531589d45a96a39db6e37706c30bf38934db (diff) |
Remove QVideoFrame(QImage) constructor
It doesn't make a lot of sense and only ever worked for some
image formats. In addition, it's never used except for some auto tests.
Change-Id: I6a32eabca8c36646ffc11d728e9cdf9b2f74d758
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video/qvideotexturehelper.cpp')
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 84 |
1 files changed, 58 insertions, 26 deletions
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 706844022..77ad98f3e 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -45,135 +45,167 @@ namespace QVideoTextureHelper static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = { // Format_Invalid - { 0, + { 0, 0, + [](QSize) { return 0; }, { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat}, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_ARGB32 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_ARGB32_Premultiplied - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_RGB32 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_BGRA32 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_BGRA32_Premultiplied - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_ABGR32 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_BGR32 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_AYUV444 - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_AYUV444_Premultiplied - { 1, + { 1, 4, + [](QSize s) { return 4*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_YUV420P - { 3, + { 3, 1, + [](QSize s) { return 3*s.width()*s.height() / 2; }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_YUV422P - { 3, + { 3, 1, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, { { 1, 1 }, { 2, 1 }, { 2, 1 } } }, // Format_YV12 - { 3, + { 3, 1, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_UYVY - { 1, + { 1, 2, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 2, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_YUYV - { 1, + { 1, 2, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 2, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_NV12 - { 2, + { 2, 1, + [](QSize s) { return 3*s.width()*s.height() / 2; }, { QRhiTexture::R8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_NV21 - { 2, + { 2, 1, + [](QSize s) { return 3*s.width()*s.height() / 2; }, { QRhiTexture::R8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_IMC1 - { 3, + { 3, 1, + [](QSize s) { + // IMC1 requires that U and V components are aligned on a multiple of 16 lines + return s.width()*((s.height()*3/2 + 15) & ~15 + s.height()/2); + }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_IMC2 - { 2, + { 2, 1, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 2 }, { 1, 1 } } }, // Format_IMC3 - { 3, + { 3, 1, + [](QSize s) { + // IMC3 requires that U and V components are aligned on a multiple of 16 lines + return s.width()*((s.height()*3/2 + 15) & ~15 + s.height()/2); + }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_IMC4 - { 2, + { 2, 1, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 2 }, { 1, 1 } } }, // Format_Y8 - { 1, + { 1, 1, + [](QSize s) { return s.width()*s.height(); }, { QRhiTexture::R8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_Y16 - { 1, + { 1, 2, + [](QSize s) { return 2*s.width()*s.height(); }, { QRhiTexture::R16, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_P010 - { 2, + { 2, 2, + [](QSize s) { return 3*s.width()*s.height(); }, { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_P016 - { 2, + { 2, 2, + [](QSize s) { return 3*s.width()*s.height(); }, { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_Jpeg - { 1, + { 1, 0, + [](QSize) { return 0; }, { QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } } |