diff options
Diffstat (limited to 'tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp')
-rw-r--r-- | tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp b/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp index e15ffa248..e83bdbf7c 100644 --- a/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp +++ b/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp @@ -31,6 +31,7 @@ #include <QtTest/QtTest> #include <qvideoframe.h> +#include <qvideosurfaceformat.h> #include "private/qmemoryvideobuffer_p.h" #include <QtGui/QImage> #include <QtCore/QPointer> @@ -190,7 +191,7 @@ void tst_QVideoFrame::create() QFETCH(int, bytes); QFETCH(int, bytesPerLine); - QVideoFrame frame(bytes, size, bytesPerLine, pixelFormat); + QVideoFrame frame(bytes, bytesPerLine, QVideoSurfaceFormat(size, pixelFormat)); QVERIFY(frame.isValid()); QCOMPARE(frame.handleType(), QVideoFrame::NoHandle); @@ -229,7 +230,7 @@ void tst_QVideoFrame::createInvalid() QFETCH(int, bytes); QFETCH(int, bytesPerLine); - QVideoFrame frame(bytes, size, bytesPerLine, pixelFormat); + QVideoFrame frame(bytes, bytesPerLine, QVideoSurfaceFormat(size, pixelFormat)); QVERIFY(!frame.isValid()); QCOMPARE(frame.handleType(), QVideoFrame::NoHandle); @@ -264,7 +265,7 @@ void tst_QVideoFrame::createFromBuffer() QFETCH(QSize, size); QFETCH(QVideoFrame::PixelFormat, pixelFormat); - QVideoFrame frame(new QtTestDummyVideoBuffer(handleType), size, pixelFormat); + QVideoFrame frame(new QtTestDummyVideoBuffer(handleType), QVideoSurfaceFormat(size, pixelFormat)); QVERIFY(frame.isValid()); QCOMPARE(frame.handleType(), handleType); @@ -358,7 +359,7 @@ void tst_QVideoFrame::createNull() // Null buffer (shouldn't crash) { - QVideoFrame frame(nullptr, QSize(1024,768), QVideoFrame::Format_ARGB32); + QVideoFrame frame(nullptr, QVideoSurfaceFormat(QSize(1024,768), QVideoFrame::Format_ARGB32)); QVERIFY(!frame.isValid()); QCOMPARE(frame.handleType(), QVideoFrame::NoHandle); QCOMPARE(frame.pixelFormat(), QVideoFrame::Format_ARGB32); @@ -383,7 +384,7 @@ void tst_QVideoFrame::destructor() QPointer<QtTestDummyVideoBuffer> buffer = new QtTestDummyVideoBuffer; { - QVideoFrame frame(buffer, QSize(4, 1), QVideoFrame::Format_ARGB32); + QVideoFrame frame(buffer, QVideoSurfaceFormat(QSize(4, 1), QVideoFrame::Format_ARGB32)); } QVERIFY(buffer.isNull()); @@ -440,7 +441,7 @@ void tst_QVideoFrame::copy() QPointer<QtTestDummyVideoBuffer> buffer = new QtTestDummyVideoBuffer(handleType); { - QVideoFrame frame(buffer, size, pixelFormat); + QVideoFrame frame(buffer, QVideoSurfaceFormat(size, pixelFormat)); frame.setStartTime(startTime); frame.setEndTime(endTime); @@ -530,7 +531,7 @@ void tst_QVideoFrame::assign() QVideoFrame frame; { - QVideoFrame otherFrame(buffer, size, pixelFormat); + QVideoFrame otherFrame(buffer, QVideoSurfaceFormat(size, pixelFormat)); otherFrame.setStartTime(startTime); otherFrame.setEndTime(endTime); @@ -624,7 +625,7 @@ void tst_QVideoFrame::map() QFETCH(QVideoFrame::PixelFormat, pixelFormat); QFETCH(QVideoFrame::MapMode, mode); - QVideoFrame frame(mappedBytes, size, bytesPerLine, pixelFormat); + QVideoFrame frame(mappedBytes, bytesPerLine, QVideoSurfaceFormat(size, pixelFormat)); QVERIFY(!frame.bits()); QCOMPARE(frame.mappedBytes(), 0); @@ -739,45 +740,45 @@ void tst_QVideoFrame::mapPlanes_data() planarBuffer->m_numBytes = sizeof(bufferData); QTest::newRow("Planar") - << QVideoFrame(planarBuffer, QSize(64, 64), QVideoFrame::Format_YUV420P) - << (QList<int>() << 64 << 36 << 36) - << (QList<int>() << 512 << 765); + << QVideoFrame(planarBuffer, QVideoSurfaceFormat(QSize(64, 64), QVideoFrame::Format_YUV420P)) + << (QList<int>() << 64 << 36 << 36) + << (QList<int>() << 512 << 765); QTest::newRow("Format_YUV420P") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_YUV420P) - << (QList<int>() << 64 << 62 << 62) - << (QList<int>() << 4096 << 6080); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_YUV420P)) + << (QList<int>() << 64 << 62 << 62) + << (QList<int>() << 4096 << 6080); QTest::newRow("Format_YV12") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_YV12) - << (QList<int>() << 64 << 62 << 62) - << (QList<int>() << 4096 << 6080); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_YV12)) + << (QList<int>() << 64 << 62 << 62) + << (QList<int>() << 4096 << 6080); QTest::newRow("Format_NV12") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_NV12) - << (QList<int>() << 64 << 64) - << (QList<int>() << 4096); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_NV12)) + << (QList<int>() << 64 << 64) + << (QList<int>() << 4096); QTest::newRow("Format_NV21") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_NV21) - << (QList<int>() << 64 << 64) - << (QList<int>() << 4096); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_NV21)) + << (QList<int>() << 64 << 64) + << (QList<int>() << 4096); QTest::newRow("Format_IMC2") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_IMC2) - << (QList<int>() << 64 << 64) - << (QList<int>() << 4096); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_IMC2)) + << (QList<int>() << 64 << 64) + << (QList<int>() << 4096); QTest::newRow("Format_IMC4") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_IMC4) - << (QList<int>() << 64 << 64) - << (QList<int>() << 4096); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_IMC4)) + << (QList<int>() << 64 << 64) + << (QList<int>() << 4096); QTest::newRow("Format_IMC1") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_IMC1) - << (QList<int>() << 64 << 64 << 64) - << (QList<int>() << 4096 << 6144); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_IMC1)) + << (QList<int>() << 64 << 64 << 64) + << (QList<int>() << 4096 << 6144); QTest::newRow("Format_IMC3") - << QVideoFrame(8096, QSize(60, 64), 64, QVideoFrame::Format_IMC3) - << (QList<int>() << 64 << 64 << 64) - << (QList<int>() << 4096 << 6144); + << QVideoFrame(8096, 64, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_IMC3)) + << (QList<int>() << 64 << 64 << 64) + << (QList<int>() << 4096 << 6144); QTest::newRow("Format_ARGB32") - << QVideoFrame(8096, QSize(60, 64), 256, QVideoFrame::Format_ARGB32) - << (QList<int>() << 256) - << (QList<int>()); + << QVideoFrame(8096, 256, QVideoSurfaceFormat(QSize(60, 64), QVideoFrame::Format_ARGB32)) + << (QList<int>() << 256) + << (QList<int>()); } void tst_QVideoFrame::mapPlanes() @@ -988,7 +989,7 @@ do { \ void tst_QVideoFrame::isMapped() { - QVideoFrame frame(16384, QSize(64, 64), 256, QVideoFrame::Format_ARGB32); + QVideoFrame frame(16384, 256, QVideoSurfaceFormat(QSize(64, 64), QVideoFrame::Format_ARGB32)); const QVideoFrame& constFrame(frame); TEST_UNMAPPED(frame); @@ -1018,7 +1019,7 @@ void tst_QVideoFrame::isMapped() void tst_QVideoFrame::isReadable() { - QVideoFrame frame(16384, QSize(64, 64), 256, QVideoFrame::Format_ARGB32); + QVideoFrame frame(16384, 256, QVideoSurfaceFormat(QSize(64, 64), QVideoFrame::Format_ARGB32)); QVERIFY(!frame.isMapped()); QVERIFY(!frame.isReadable()); @@ -1041,7 +1042,7 @@ void tst_QVideoFrame::isReadable() void tst_QVideoFrame::isWritable() { - QVideoFrame frame(16384, QSize(64, 64), 256, QVideoFrame::Format_ARGB32); + QVideoFrame frame(16384, 256, QVideoSurfaceFormat(QSize(64, 64), QVideoFrame::Format_ARGB32)); QVERIFY(!frame.isMapped()); QVERIFY(!frame.isWritable()); @@ -1218,7 +1219,7 @@ void tst_QVideoFrame::image() QFETCH(int, bytesPerLine); QFETCH(QImage::Format, imageFormat); - QVideoFrame frame(bytes, size, bytesPerLine, pixelFormat); + QVideoFrame frame(bytes, bytesPerLine, QVideoSurfaceFormat(size, pixelFormat)); QImage img = frame.image(); QVERIFY(!img.isNull()); @@ -1231,8 +1232,7 @@ void tst_QVideoFrame::emptyData() { QByteArray data(nullptr, 0); QVideoFrame f(new QMemoryVideoBuffer(data, 600), - QSize(800, 600), - QVideoFrame::Format_ARGB32); + QVideoSurfaceFormat(QSize(800, 600), QVideoFrame::Format_ARGB32)); QVERIFY(!f.map(QVideoFrame::ReadOnly)); } |