diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-29 09:09:18 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-30 09:13:02 +0100 |
commit | b06d378501d0221d6c2d74220010d779760e23c2 (patch) | |
tree | 27cff7199f808ecb65adea5a92a6f97f4ba90234 /tests | |
parent | b537049f40e46a7892214f4593ca70c80d609071 (diff) | |
parent | 71e2096c2b704420cbb0ee836c16565b658b3d0f (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I08764f113c0c37ff7355007c32f93ff47a48e7f1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp | 24 | ||||
-rw-r--r-- | tests/auto/unit/qvideoframe/tst_qvideoframe.cpp | 6 |
2 files changed, 7 insertions, 23 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp index ccd68aeec..27fc014aa 100644 --- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp @@ -414,8 +414,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 +450,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(!frame.image().isNull()); + frame = QVideoFrame(); capturedSignal.clear(); imageAvailableSignal.clear(); savedSignal.clear(); @@ -524,9 +508,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(!frame.image().isNull()); QString fileName = savedSignal.first().last().toString(); QVERIFY(QFileInfo(fileName).exists()); diff --git a/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp b/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp index bcf40a995..943051435 100644 --- a/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp +++ b/tests/auto/unit/qvideoframe/tst_qvideoframe.cpp @@ -33,6 +33,7 @@ #include <qvideoframe.h> #include <QtGui/QImage> #include <QtCore/QPointer> +#include <QtMultimedia/private/qtmultimedia-config_p.h> // Adds an enum, and the stringized version #define ADD_ENUM_TEST(x) \ @@ -1222,7 +1223,7 @@ void tst_QVideoFrame::image_data() << 16384 << 256 << QImage::Format_ARGB32; - +#if !QT_CONFIG(directshow) QTest::newRow("64x64 AYUV444") << QSize(64, 64) << QVideoFrame::Format_AYUV444 @@ -1258,7 +1259,7 @@ void tst_QVideoFrame::image_data() << 256 << QImage::Format_ARGB32; - QTest::newRow("32x256 YUYV") + QTest::newRow("64x64 YUYV") << QSize(64, 64) << QVideoFrame::Format_YUYV << 16384 @@ -1278,6 +1279,7 @@ void tst_QVideoFrame::image_data() << 16384 << 256 << QImage::Format_ARGB32; +#endif } void tst_QVideoFrame::image() |