diff options
author | Bartlomiej Moskal <bartlomiej.moskal@qt.io> | 2023-03-24 08:41:20 +0100 |
---|---|---|
committer | Bartlomiej Moskal <bartlomiej.moskal@qt.io> | 2023-04-14 08:39:03 +0100 |
commit | 01caaf362a17d167cd9c0fb4501f35d0b15abb1e (patch) | |
tree | 737f174c88dda787436febaf7ce1f6622ae1ee30 /tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp | |
parent | 519dbbc4cfa8edbfc9817fd53de649b7280d62ee (diff) |
Tests: fix failing tst_QCameraBackend on Android part 3/3
YUV420P and NV12 are similar formats. They contain the same data, just
slightly differently arranged in memory.
On Android we cannot be sure which format we will receive. It dependes
on vendors' implementaion. Therefore, it is not a failure when we asked
for YUV420P but got NV12.
This commit contains fix in comparation format types for Android.
Formta_YUV420P and Fromat_NV12 are treated as the same formats.
Task-number: QTBUG-112175
Change-Id: Ie166226f43a42b55cfe18864594ff1111cbf79ef
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp')
-rw-r--r-- | tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp index bc6ce5e0b..91f397528 100644 --- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp @@ -98,6 +98,14 @@ public Q_SLOTS: if (surfaceFormat.pixelFormat() == cameraFormat.pixelFormat() && surfaceFormat.frameSize() == cameraFormat.resolution()) { formatMismatch = 0; +#ifdef Q_OS_ANDROID + } else if ((surfaceFormat.pixelFormat() == QVideoFrameFormat::Format_YUV420P + || surfaceFormat.pixelFormat() == QVideoFrameFormat::Format_NV12) + && (cameraFormat.pixelFormat() == QVideoFrameFormat::Format_YUV420P + || cameraFormat.pixelFormat() == QVideoFrameFormat::Format_NV12) + && surfaceFormat.frameSize() == cameraFormat.resolution()) { + formatMismatch = 0; +#endif } else { formatMismatch = 1; } |