summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Don't fail tests when recording does not start due to format errorPiotr Srebrny2022-10-191-3/+7
| | | | | | | | | | Recorders don't handle all camera formats and we should not fail test in such case. Specifically Windows encoders do not handle Y8 format that is produced by IR cameras. Change-Id: I964d7edc0cef294ceb92932b901af8f3c174fe11 Reviewed-by: André de la Rocha <andre.rocha@qt.io> (cherry picked from commit 9aa6f08a92ecfefdbfd120940ee954eaa57080a4)
* Enable error reporting when failed to initialize backend elementPiotr Srebrny2022-10-062-17/+17
| | | | | | | | | | | | | | | This patch adds an option to report error message when a backend component cannot be instantiated. This error message is then displayed in the console with qWarning and in some cases reported to the app user with error signals. We need further improvements on the error reporting side. Additionally, this patch cleans up the code in the .cpp API classes. Change-Id: Id39865cc8f1e9b52804bf5b9d9b15e738508f860 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit f1aa625049a08519d52ba87958e25cb80e47fd1e)
* Fix qmediaplayerbackend testsAndré de la Rocha2022-09-141-5/+6
| | | | | | | | | | Some tests were failing on Windows due to timing issues that were not being considered by the tests themselves. Change-Id: I89dfbbe901a043f7e4ed543a754e8ccd9f6e4b86 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 83c25233565418ab3cb30036d18499a66b2d61f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Fix for QImage format issue in the qImageFromVideoFrame function"André de la Rocha2022-08-241-29/+13
| | | | | | | | | | | | | | | | The patch was incorrect, as the shader-based conversion always generates RGBA images, while the CPU-based conversion can generate other formats. It caused, for instance, images to be captured from the camera with the wrong colors. Also adjusting tst_QVideoFrame::image() accordingly. This reverts commit 80871c952a009be6b35a912d946d63b78d5d06b4. Change-Id: Iadfb9a391bb7a3290e604a8ac13803cb4f0d2e87 Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit c173807a7da112451cf459c70e6aac1686ee09f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Validate array length before accessing elements to avoid ASSERTsPiotr Srebrny2022-08-221-0/+7
| | | | | | | | | | | Always validate the array length before accessing the elements. Otherwise, we get ASSERT from the QList that exit() the tests without indicating the failure point (which occurred to me). Change-Id: I66a79b8b90261836cec1dfc18bd0719008cefb9c Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit e613d48299508189bdb2dd5e4f51ed13b866cc5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Provide mock cameras from QMockIntegrationPiotr Srebrny2022-08-163-42/+53
| | | | | | | | | | | During refactoring of QPlatformMediaDevices, the list of system cameras has been moved to QPlatformIntegration. However, this has not been done for the mock, which this patch completes. Change-Id: Ibe51a2c4bbb2ef3d31f10f9eff231238acb8bdad Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 6e238e9130f7f3665aab459c194994d1f20513d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove access to texture handles from public QVideoFrame APIPiotr Srebrny2022-08-091-2/+3
| | | | | | | | textureHandle and rhiTexture should only be use internally and we can get access to those from QAbstractVideoBuffer Change-Id: Ifad8a3c533b3d76a6b97fde5b2e52986bffd1bb8 Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Use SPDX license identifiersLucie Gérard2022-06-2856-1579/+113
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Ida08dfe6c84778656e942178c3d39042c9ef1ed2 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit e9abd242abfbc368478f7be3e2923e7b100a9386) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Android: fix for tst_qaudiodecoderbackend testPekka Gehör2022-05-311-8/+32
| | | | | | | | | | QRC files taken to use for Android. Added a few conditions for Android due to Android limitations. Fixes: QTBUG-99094 Pick-to: 6.2 6.3 Change-Id: I13afc038ab7f2ea725c2aa1180800fe1d33f53f4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Extend fraction computation algorithm to numbers above 1 and below 0Piotr Srebrny2022-05-243-0/+107
| | | | | | | | | | This patch extends the algorithm for finding a real number numerator and denominator to numbers below 0 and above 1. It also improves interface by returning a pair of number. Additionally, it adds some basic test cases. Change-Id: I70f23a06a1cd2451242a53ec7c5e2fb90b9586bb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_qmediaplayerbackend: don't check signal countRafael Roquetto2022-05-061-2/+0
| | | | | | | | | | | | | | | | Do not set the signal count on the signal spies for the position and state fields. When the media is done playing before the spies are cleared, it is reasonable that the backends could be already on the stopped state and on a fixed position (e.g. 0). Resetting the media source shouldn't necessarily trigger a state change for these fields - it in fact makes sense that the state remains untouched (e.g. 'Stopped', or position == '0'). Checking the final state only (which already happens)is a better check than relying on signal spy counts for this reason. Change-Id: I49f720e640fa3733154e6ad19272f049b99994a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_qmediaplayerbackend: fix duration test on QNXRafael Roquetto2022-05-061-0/+5
| | | | | | | | | There's no way to query the duration before the playback starts. The mm-renderer API reports the duration via an event that is triggered when mmr_play() is called only. Change-Id: I42445fe7b0a6a56c9f2ad2fee581126393243467 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the low level audio integration back into Qt MultimediaLars Knoll2022-04-294-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Those integrations are selected at compile time and not dependent on native vs ffmpeg backend. Because of that we can move them back into Qt Multimedia directly. This will simplify and improve a couple of things: * We don't need to build the audio code twice (once per plugins) * Low level audio is always available even if you choose not to ship a large backend for audio/video decoding and recording * We can use Qt Multimedia as a backend for other modules requiring audio only without bloating things there (e.g. for Qt Speech) * We can directly integrate support for 3D audio and headphone spatialization into Qt Multimedia without requiring an additional module for that. To do so, we need to remove the camera handling from QPlatformMediaDevices. This is only partially done in this commit (by adding a QPlatformVideoDevices class), and will be further cleaned up in followup commits. Change-Id: Ib4a33d7255faaf26dd825527786eae10ed283490 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Restart pulling data if QIODevice signals readyReadPiotr Srebrny2022-04-261-1/+65
| | | | | | | | | | | | This patch improves handling of the QIODevice protocol by QAudioSink in the pull mode. QAudioSink will restart pulling data when it receives the readyRead signal. If the QIODevice source is atEnd(), QAudioSink will no longer emit UnderrunError, but will switch to IdleState without error. It will first check if the device is open and ask for bytesAvailable before performing read. Change-Id: Idd1d18419f7b77d2df2d76e7b1892194d652d63a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tst_QAudioSouce::pushSuspendOrResumeRafael Roquetto2022-04-141-2/+2
| | | | | | | | | Be consistent with the comment stating that IdleState _is_ an acceptable state to transition to from resume() Change-Id: Ia64c77f2a643624531358fe35f75023db22177e1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
* Rename QVideoFrameFormat::YCbCrColorSpace to ColorSpaceLars Knoll2022-04-091-24/+23
| | | | | | | | | This is much more in line with common naming in other places and also a lot simpler. In addition, color spaces do define how RGB pixel values are supposed to be interpreted as well. Change-Id: Ia5e21a541deb17c8373c72293eca2f6b3c0299d4 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Expose the color range being used in the video dataLars Knoll2022-04-081-1/+1
| | | | | | | | | | | | Add QVideoFrameFormat::colorRange, and expose the color range being used in the video data. Deprecate the full range color space enum values. This is much better exposed through a separate property. As a drive by fix and clarify the naming of the JPEG color space by renaming it to AdobeRgb. Change-Id: Ifcdadcca41fdeade7d5ff2b80f59c135518d5d39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix autotest if no cameras are availableLars Knoll2022-04-041-0/+2
| | | | | Change-Id: Ib82bb3c4ef26fafa8673f8484f8ec3ea3c8b5aa2 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* pulse audio sink: Do timing calculation manuallyLars Knoll2022-04-041-14/+5
| | | | | | | | | | | | | | | | | | | | | | It turns out that pulse audio doesn't give us good enough timing data to estimate the current position in the audio stream (processedUSecs()). So change the code to do the calculation manually, using the data from the lower level pa_timing_info structure. That structure gets updated on a regular basis. To keep our data a bit more stable, we average over the last 10 latencies we get from the struct. Timing is then the amount of bytes read by the server converted to time minus latency plus time passed since the last update of the pa_timing_info struct. Add some checks to not overrun and ensure numbers increase monotonically. Fixes the qaudiosink autotest on pulseaudio. Change-Id: I9084b71f85fc92568d67dce8708ec8158685e682 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Fix qaudiosource auto test when using pulseaudioLars Knoll2022-04-041-2/+2
| | | | | Change-Id: I538ab32837061157a9e259674d97fa6ddca4d4c6 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Fix qcamerabackend testLars Knoll2022-04-041-3/+5
| | | | | | | | Don't expect the stateChanged() signal to come asynchronously when calling stop(). Change-Id: I213e84c20f4e8cf7a7c5563d2a336cb867851c76 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Fix issues with detecting the end of playbackLars Knoll2022-04-041-1/+6
| | | | | | | | | | | | Store the duration in usecs, and tell the media player we're done once we're within 10ms of the end of the stream. The 10ms jitter is there to help with rounding errors when resampling the audio stream. In addition some cleanups removing things we don't use anymore. Change-Id: Ib22e216c90766f411daa7df7c5148ddfc87c445b Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* FFmpeg: allow using a QIODevice as the source for playbackLars Knoll2022-04-041-0/+1
| | | | | | | | Implement the required support in the decoder, so that both QAudioDecoder and QMediaPlayer can handle an input device. Change-Id: I96e33a4cddd60b7ddd91022638efd040ea54ee96 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Fix half the test failures in the tst_qmediaplayerbackendLars Knoll2022-04-021-1/+0
| | | | | Change-Id: I688b203353fd4d12f2f16cd1a13bcbcd43d2a511 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Remove the blacklist on macOSLars Knoll2022-04-011-3/+0
| | | | | | | This test is actually passing on macOS. Change-Id: Ifeafe79fdf158f67390a0693443f77436d58227e Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Add QAudioFormat::defaultChannelConfigForChannelCount()Lars Knoll2022-04-011-1/+1
| | | | | | | | | | | This method returns a default channel configuration if we only have the number of audio channels. Use the method in the ffmpeg decoder to correctly initialize the audio converter in all cases. Change-Id: I1582ef2aea0c57e142e117beccbe390a5a55ca94 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* FFmpeg: Various fixes to the ffmpeg audio decoderLars Knoll2022-04-011-2/+3
| | | | | | | | | * Pass more of the audio decoder auto tests. * Correctly handle requesting a specific audio format. * Fixes to error handling Change-Id: I9ef1afe5038951dc6c666cb007d941758ced5056 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
* Fix Multimedia auto test videoDimension on AndroidSamuel Mira2022-03-282-3/+10
| | | | | | | | | | | 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>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-222-33/+0
| | | | | | Pick-to: 6.3 Change-Id: Ibf08af40c82d60ca06996644eb8390909a180178 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Move the list of QMediaDevices to QPlatformMediaIntegrationLars Knoll2022-01-183-4/+4
| | | | | | | | | | This makes it possible to split up the backend interfaces for audio and camera devices handling and simplifies combining ffmpeg with a platform specific backend for audio. Pick-to: 6.2 Change-Id: I01992bfbeac79ba2d413a4b918f9f304cf33f35b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-184-23/+0
| | | | | | | Task-number: QTBUG-94446 Change-Id: Ic1e20efef59a95355a58a9374c80b6127ad8423d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix Android sending a single video frameSamuel Mira2022-01-121-6/+0
| | | | | | | | | | | Android was not sending video frames automatically, and it had to readback frame for the next frame to be available. This patch forces the emit of the frameAvailable. Fixes: QTBUG-99650 Pick-to: 6.2 6.3 Change-Id: I7559c65b734724d4e21bbb9b2e7f3a3ae8de97d2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix SurfaceText test in AndroidSamuel Mira2022-01-071-0/+6
| | | | | | | | | | | | Looking at logcat, it was possible to understand that the frames were parsed, but they were not updated. Looks like that in android it is necessary to call the frame map for the AndroidTextureVideoBuffer to updateReadbackFrame. Updated the example to force that. Fixes: QTBUG-99358 Pick-to: 6.2 6.3 Change-Id: Id8a0e622158f836813b7ed266ad3580aff68171f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QEXPECT_FAIL to android tests regarding isSeekableSamuel Mira2021-12-131-0/+9
| | | | | | | | | | isSeekable in Android always returns true. This behavior may change in QTBUG-96952, but from now on expect failure in these tests. Fixes: QTBUG-99129 Pick-to: 6.2 6.3 Change-Id: I422298e57c7942bfcccb91c5e9998446c89a12e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tst_qmediarecorder autotestSamuel Mira2021-12-102-0/+14
| | | | | | | | | | The auto test depended on a member variable that was changed but not reset before the test. Added a reset function and a call to reset. Fixes: QTBUG-99092 Pick-to: 6.2 Change-Id: I7d1505654474c392d84f7189da8ec2da2b88682a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Enable QAudioDecoder backend tests for WindowsPiotr Srebrny2021-11-022-9/+6
| | | | | | | | | | | | | | | The patch enables the QAudioDecoder backend tests for Windows with minor adjustments. The expected duration time of the resampled file has been reduced as the Windows resampler produces slightly shorter audio after resampling. Additionally, the expected error code when reading invalid file is changed to ResourceError, which is better suited for this case than AccessDeniedError that relates to lack of permission. Pick-to: 6.2 Change-Id: Iaf905a66c6e03d6ba6d5c9afd4fc8e88b9cb7840 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Add test for multiple sourceSamuel Mira2021-11-016-14/+104
| | | | | | | | | | | | | Two tests added to verify for QTBUG-96456 issue. One on unit and other on integration (tests against emu). Also fixed tst_QMediaPlayerBackend to work on android. Before it did not worked, because the test files were not copied to apk file. Pick-to: 6.2 Change-Id: Ie6c3c1ca16092ab377ca96e122a24131dfdc2335 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add autotest for recording with mute audioSamuel Mira2021-10-211-1/+75
| | | | | | | | | Added a new test for testing if a audioInput mutes while it is recording Tested by checking signals and confirming that a file is created. Pick-to: 6.2 Change-Id: I4f73ee72bfc541e10b2198118eceea1dad8a2404 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Windows: fix and enable media player backend auto-testsAndré de la Rocha2021-10-155-50/+33
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-96677 Change-Id: Ib9063eba2541f719d8b66cac5ead56624d620b06 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add test for change application state while recordingSamuel Mira2021-10-131-0/+31
| | | | | | | | | | | This test tests if the a media recording can finish successfully when the application state changes to a inative state while recording. This can happen in mobile devices when you are recording and user changes the app or if the user gets a popup from the OS like a permission popup. Pick-to: 6.2 Change-Id: I4a4dbca3e47b4aa345be4ea3fa257eac523bb8a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QCameraBackend::testNativeMetadata() on gstreamerLars Knoll2021-10-121-2/+5
| | | | | | | | | | | Let it record a bit, otherwise we don't get anything. Don't check QMediaMetaData::Date, as some encoders set that on their own. Instead use Language and fix issues in correctly writing the language. Pick-to: 6.2 Change-Id: Ib5e2bacc053814afc2fafdae65330950e591d6fc Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix qcamerabackend autotest for gstreamerLars Knoll2021-10-111-4/+7
| | | | | | | | | | | Mainly fixes in the auto test to ensure it works correctly. Add one log message to the image capture backend in case we fail to save to a file. Pick-to: 6.2 Change-Id: Ie631ebfdd45d16a16a5b7e22d8bbe00db78afd6f Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QCameraBackend::testCtorWithCameraDevice() testLars Knoll2021-10-061-8/+24
| | | | | | | | | The default constructor of QCamera should pick the default camera. Pick-to: 6.2 Change-Id: I847a2cc65470bf337da6f070d9abbaa3c478f055 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix tst_qmediacapturesession on macOSLars Knoll2021-10-061-9/+41
| | | | | | | | | | | | | Fix the remaining test failures on macOS: Increase timeouts in tests, as those often caused failures. Fix a couple of behaviors in the platform specific code, to ensure we handle errors correctly. Pick-to: 6.2 Change-Id: Ib1a0949f5e65a0fb3d0b89a5508631d1faa7cf1e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* GStreamer: remove an element from a pipeline before setState(NULL)Piotr Srebrny2021-10-012-0/+29
| | | | | | | | | | | | If an element is a part of a pipeline bin, the bin tries to synchronize its state with its own. Thus, after setting the element state to NULL, the state can be set back to READY, PAUSE, or PLAYING before it is removed from the pipeline. This patch first removes an element from the pipeline and then sets its state to NULL to avoid this race. Pick-to: 6.2 Change-Id: Ied9cd037fabab19682a53c5ab3d0c7335c58d9c9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: mark test case for isSeekable() as QEXPECT_FAILAssam Boudjelthia2021-09-301-0/+3
| | | | | | | | | | Note a bug ticket for the fail and continue. Task-number: QTBUG-96952 Pick-to: 6.2 Change-Id: Id5951deb8e9360b53619813e15b0edf9ab8fe1b7 Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix exposureCompensationChanged signal signature in tst_QCameraAssam Boudjelthia2021-09-301-1/+1
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-95883 Change-Id: Id471f485bf9a0ba2ce6ae41b5a034df72ed92900 Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* GStreamer: emit not ready for capture when no session or cameraPiotr Srebrny2021-09-291-4/+7
| | | | | | | | | | | | We should emit signal when disconnecting session from the image capture, or when disconnecting camera from the session. GStreamer implementation send capture not available when taking a picture. This patch makes test more permissible to account for that. Pick-to: 6.2 Change-Id: If4fa780710811491678ad50fa11f3a9ee52ae530 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Support handover of QCamera and QImageCapture between sessionPiotr Srebrny2021-09-291-0/+69
| | | | | | | | | | | Additionally, the patch fixes the can_add_and_remove_different_Cameras and can_record_Camera_with_null_CameraDevice tests that did not have activated QCamera. Pick-to: 6.2 Change-Id: I3c5702e09face5d3ba4f7acd0e208e2c7d65c15f Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Handover recorder between sessionPiotr Srebrny2021-09-291-0/+33
| | | | | | | | | | | This patch enable a proper handover of QMediaRecorder between session. When the recorder is set to one session it will automatically disconnect from the owning session. Pick-to: 6.2 Change-Id: I7bc210134dee98126fea9da8d68c55cfa72a57f8 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>