diff options
author | Samuel Mira <samuel.mira@qt.io> | 2022-03-22 17:17:22 +0200 |
---|---|---|
committer | Samuel Mira <samuel.mira@qt.io> | 2022-03-28 12:03:57 +0200 |
commit | 78891c03ec3675373ef6b54559d244cda32a9402 (patch) | |
tree | 879d5f8354465451a88523415b0e6f4a3ebb5980 /tests | |
parent | a355a746aec41fd5c3e2536c2d9d6cd25e1f029e (diff) |
Fix Multimedia auto test videoDimension on Android
Added a seekTo in the android mediaPlayer setPosition to update position
and a function on videooutput to render one single frame.
Both changes were added for consistency between different platforms.
Fixes: QTBUG-99361
Pick-to: 6.2 6.3
Change-Id: I2ad0d1bb71ddd7cbc31a97587506050b9969fdd0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/integration/qmediaplayerbackend/testdata/BigBuckBunny.mp4 | bin | 45969 -> 36724 bytes | |||
-rw-r--r-- | tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 13 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/testdata/BigBuckBunny.mp4 b/tests/auto/integration/qmediaplayerbackend/testdata/BigBuckBunny.mp4 Binary files differindex 8aa192503..6cf08011c 100644 --- a/tests/auto/integration/qmediaplayerbackend/testdata/BigBuckBunny.mp4 +++ b/tests/auto/integration/qmediaplayerbackend/testdata/BigBuckBunny.mp4 diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 0cbee4ba8..afce5052f 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -93,6 +93,7 @@ private: QUrl localWavFile2; QUrl localVideoFile; QUrl localVideoFile2; + QUrl videoDimensionTestFile; QUrl localCompressedSoundFile; QUrl localFileWithMetadata; @@ -187,6 +188,10 @@ void tst_QMediaPlayerBackend::initTestCase() localVideoFile2 = MediaFileSelector::selectMediaFile(mediaCandidates); mediaCandidates.clear(); + mediaCandidates << "qrc:/testdata/BigBuckBunny.mp4"; + videoDimensionTestFile = MediaFileSelector::selectMediaFile(mediaCandidates); + + mediaCandidates.clear(); mediaCandidates << "qrc:/testdata/nokia-tune.mp3"; mediaCandidates << "qrc:/testdata/nokia-tune.mkv"; localCompressedSoundFile = MediaFileSelector::selectMediaFile(mediaCandidates); @@ -1224,12 +1229,14 @@ void tst_QMediaPlayerBackend::videoDimensions() QEXPECT_FAIL("", "On Android isSeekable() is always set to true due to QTBUG-96952", Continue); #endif QVERIFY(!player.isSeekable()); - player.setSource(localVideoFile); + player.setSource(videoDimensionTestFile); QTRY_COMPARE(player.mediaStatus(), QMediaPlayer::LoadedMedia); player.pause(); QTRY_COMPARE(surface.m_totalFrames, 1); - QCOMPARE(surface.m_frameList.last().height(), 120); - QCOMPARE(surface.videoSize().height(), 120); + QCOMPARE(surface.m_frameList.last().width(), 540); + QCOMPARE(surface.videoSize().width(), 540); + QCOMPARE(surface.m_frameList.last().height(), 320); + QCOMPARE(surface.videoSize().height(), 320); } void tst_QMediaPlayerBackend::position() |