summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-26 03:02:10 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-26 03:02:11 +0200
commit71e2096c2b704420cbb0ee836c16565b658b3d0f (patch)
tree95f94c252437cdf3fb6788a449ed9e0a24ad9b98
parent65488e1d950f8af5662aff931b68f46774ef7801 (diff)
parent4b99c0e0474da438e8b3e978dc84c2fb9880f6ce (diff)
downloadqtmultimedia-71e2096c2b704420cbb0ee836c16565b658b3d0f.tar.gz
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I742809ff57da23390b36c60d508b213910dad15c
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index ccd68aeec..894486230 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -49,6 +49,7 @@
#include <qcameraimagecapture.h>
#include <qvideorenderercontrol.h>
#include <private/qmediaserviceprovider_p.h>
+#include <private/qvideoframe_p.h>
QT_USE_NAMESPACE
@@ -414,8 +415,6 @@ void tst_QCameraBackend::testCaptureToBuffer()
QTRY_COMPARE(camera.status(), QCamera::LoadedStatus);
- QCOMPARE(imageCapture.bufferFormat(), QVideoFrame::Format_Jpeg);
-
QVERIFY(imageCapture.isCaptureDestinationSupported(QCameraImageCapture::CaptureToFile));
QVERIFY(imageCapture.isCaptureDestinationSupported(QCameraImageCapture::CaptureToBuffer));
QVERIFY(imageCapture.isCaptureDestinationSupported(
@@ -452,23 +451,9 @@ void tst_QCameraBackend::testCaptureToBuffer()
QCOMPARE(imageAvailableSignal.first().first().toInt(), id);
QVideoFrame frame = imageAvailableSignal.first().last().value<QVideoFrame>();
- QVERIFY(frame.isValid());
- QCOMPARE(frame.pixelFormat(), QVideoFrame::Format_Jpeg);
- QVERIFY(!frame.size().isEmpty());
- QVERIFY(frame.map(QAbstractVideoBuffer::ReadOnly));
- QByteArray data((const char *)frame.bits(), frame.mappedBytes());
- frame.unmap();
- frame = QVideoFrame();
-
- QVERIFY(!data.isEmpty());
- QBuffer buffer;
- buffer.setData(data);
- buffer.open(QIODevice::ReadOnly);
- QImageReader reader(&buffer, "JPG");
- reader.setScaledSize(QSize(640,480));
- QImage img(reader.read());
- QVERIFY(!img.isNull());
+ QVERIFY(!qt_imageFromVideoFrame(frame).isNull());
+ frame = QVideoFrame();
capturedSignal.clear();
imageAvailableSignal.clear();
savedSignal.clear();
@@ -524,9 +509,7 @@ void tst_QCameraBackend::testCaptureToBuffer()
QCOMPARE(imageAvailableSignal.first().first().toInt(), id);
frame = imageAvailableSignal.first().last().value<QVideoFrame>();
- QVERIFY(frame.isValid());
- QCOMPARE(frame.pixelFormat(), QVideoFrame::Format_Jpeg);
- QVERIFY(!frame.size().isEmpty());
+ QVERIFY(!qt_imageFromVideoFrame(frame).isNull());
QString fileName = savedSignal.first().last().toString();
QVERIFY(QFileInfo(fileName).exists());