diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-04 17:29:27 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-08 12:19:04 +0000 |
commit | eef8a2079639e5c35dc74fafe656b0d0ef504f9a (patch) | |
tree | b0fb8cdba389cf242880c48564bbbe094ffb893b /src/multimedia/video | |
parent | 74c7dc45ed4b79843260e4e16d808987de1aacc8 (diff) |
Remove the plane width code from the shaders
This wasn't used at all. We always assume plane texture
coords are correct. If anything else should be required,
it can be fixed in a special shader.
Change-Id: Idfdd428fc5a267f6ad68683b369fb95f5e42d918
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video')
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index ed3742b47..e57e2f615 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -324,9 +324,6 @@ static QMatrix4x4 colorMatrix(QVideoSurfaceFormat::YCbCrColorSpace colorSpace) QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &transform, float opacity) { - static constexpr float pw[3] = {}; - const float *planeWidth = pw; - switch (format.pixelFormat()) { case QVideoSurfaceFormat::Format_Invalid: case QVideoSurfaceFormat::Format_Jpeg: @@ -359,40 +356,24 @@ QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &tran return buf; } case QVideoSurfaceFormat::Format_AYUV444: - case QVideoSurfaceFormat::Format_AYUV444_Premultiplied: { - static constexpr float pw[] = { 1, 0, 0 }; - planeWidth = pw; - break; - } + case QVideoSurfaceFormat::Format_AYUV444_Premultiplied: case QVideoSurfaceFormat::Format_YUV420P: case QVideoSurfaceFormat::Format_YUV422P: - case QVideoSurfaceFormat::Format_YV12: { - static constexpr float pw[] = { 1, 1, 1 }; - planeWidth = pw; - break; - } + case QVideoSurfaceFormat::Format_YV12: case QVideoSurfaceFormat::Format_UYVY: - case QVideoSurfaceFormat::Format_YUYV: { - static constexpr float pw[] = { 1, 1, 0 }; - planeWidth = pw; - break; - } + case QVideoSurfaceFormat::Format_YUYV: case QVideoSurfaceFormat::Format_NV12: case QVideoSurfaceFormat::Format_NV21: case QVideoSurfaceFormat::Format_P010: - case QVideoSurfaceFormat::Format_P016: { - static constexpr float pw[] = { 1, 1, 0 }; - planeWidth = pw; + case QVideoSurfaceFormat::Format_P016: break; } - } // { matrix4x4, colorMatrix, opacity, planeWidth[3] } - QByteArray buf(64*2 + 4 + 3*4, Qt::Uninitialized); + QByteArray buf(64*2 + 4, Qt::Uninitialized); char *data = buf.data(); memcpy(data, transform.constData(), 64); memcpy(data + 64, colorMatrix(format.yCbCrColorSpace()).constData(), 64); memcpy(data + 64 + 64, &opacity, 4); - memcpy(data + 64 + 64 + 4, planeWidth, 3*4); return buf; } |