summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Reduce startup time on Windows with FFmpeg 7.0HEADdevJøger Hansegård26 hours2-0/+10
| | | | | | | | | | | | | | FFmpeg 7.0 introduces a new AV_HWDEVICE_TYPE_D3D12VA device type. Since Direct3D 12 exists on all Windows versions supported by Qt, we can skip checking if the D3D12VA HW context can be created, and instead rely on a precheck that verifies presence of d3d12.dll. This saves time during startup on all Windows versions. Task-number: QTBUG-124482 Pick-to: 6.7 6.5 Change-Id: I9aff8640c28fab3a710d5f939b37301cc873f416 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org>
* Fix handling of the leftover packets in muxer upon cleanupArtem Dyomin28 hours1-1/+5
| | | | | | | | | | | We handle the leftover frames in audio and video encoders, and we have to do the same for muxer to avoid missing written packets at the end. Pick-to: 6.7 6.5 Change-Id: Ib92f768abd5331f4abe33eb562bf6454039783ed Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Rename QPlatformMediaRecorder::error(code, desc) => updateErrorArtem Dyomin28 hours11-50/+50
| | | | | | | | | The name 'updateError' works better as QPlatformMediaRecorder::error() is also a getter returning the current error code. Pick-to: 6.7 6.5 Change-Id: I9c6cdf4caa997a9465fc8fa89e50548432aee01c Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Update dependencies on 'dev' in qt/qtmultimediaQt Submodule Update Bot28 hours1-4/+4
| | | | | Change-Id: I15e69177e3ec17c89189acc87a45846aa472df75 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Use loop data mutex in muxerArtem Dyomin30 hours2-4/+2
| | | | | | | | | | | The CR fixes consistency of usage conditional variable with mutex. The CR amends de8e329db579930b0f5c275a28399f5c5acb09e4 Pick-to: 6.7 6.5 Change-Id: Ifba6c909939f00c54c264c0f422472b8cf282d24 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Apply clazy's old-style-connectTim Blechmann34 hours7-27/+25
| | | | | | | | | Pointer-to-member syntax is faster, has improved type safety and is more tooling friendly. Pick-to: 6.5 6.7 Change-Id: If629ba3fe29bfa88014ee07d9641b77e030e7de8 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Fix little/big endian mixup for source audio in ALSA sourceMikko Hallamaa34 hours1-6/+6
| | | | | | | | | | | Big/little endian PCM formats were flipped when setting format in ALSA audio source. Fixes: QTBUG-124431 Pick-to: 6.7 6.5 Change-Id: I6aee262856bd9a3243d930778fcaa8fb7295d964 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: Media player - finish state change before shutdownTim Blechmann35 hours1-0/+1
| | | | | | | | | | | | There are cases when the `typefind` worker thread is starting the playback while the player pipeline is shutting down. This causes a "critical" gstreamer error message in the unit tests. To prevent this, we wait for the current gstreamer pipeline state change to finish. Pick-to: 6.5 6.7 Change-Id: I177e29fe2b246a4a1169e0095a25d4e2af0828c7 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: QGstreamerCamera - fix crash when unplugging cameraTim Blechmann38 hours1-1/+11
| | | | | | | | | | | | When unplugging a camera we can get into a situation where there is no `GstDevice` for the camera we want to open. Adding a nullptr check and emitting an error when running into this situation. Pick-to: 6.5 6.7 Change-Id: Ib38c1ef4642541456ce3d395559a3e5e2ddda24f Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Tests: camera backend - test image metadataTim Blechmann41 hours1-0/+23
| | | | | | | | Validate metadata emitted by `QImageCapture` Pick-to: 6.5 6.7 Change-Id: Ibd9a517b37f57a1c637dafac26779a52a74e6343 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Update dependencies on 'dev' in qt/qtmultimediaQt Submodule Update Bot2 days1-4/+4
| | | | | Change-Id: Iccb4deeea4481f80883c8b703d125d649ca9d0a5 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* FFmpeg/VAAPI: Enable finding libva shared libraries from cacheLars Sutterud2 days1-3/+4
| | | | | | | | | | | | | | | | | | This change prevents an issue where Qt fails to load the VA-API shared library libva, even though FFmpeg manages to find it. By adding the version number of the latest libva.so file as an argument to the overloaded function QLibrary::resolve, we make it possible for Qt to find libva in the cache if FFmpeg has already loaded it. Libva so files are numbered with VA-API version + 1, according to the source files: https://github.com/intel/libva/blob/master/configure.ac#L64 E.g. VA-API version 1.14 generates the filename libva.so.2 Pick-to: 6.7 6.5 Task-number: QTBUG-124586 Change-Id: I76c5a13d5f421272cff0ccfc613ec7cf0b148b06 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Extend tests to cover YUYV and UYVY pixel formatsJøger Hansegård2 days18-13/+75
| | | | | | | | Task-number: QTBUG-124537 Task-number: QTBUG-124647 Pick-to: 6.7 6.5 Change-Id: Ia80df913cea9abdf976cbdfa1c3508df948bf7db Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: increase input buffer sizeTim Blechmann2 days1-1/+4
| | | | | | | | | | | The input buffer size of 128bytes (not kb(!)) could lead to demux failures in the qtdemux element. increasing the maximum buffer size to 2mb seems to improve the behavior drastically. Fixes: QTBUG-124776 Pick-to: 6.5 6.7 Change-Id: I14e3d8b12c9963def5a4a77f2bf1a404e2d0f122 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: fix QGstreamerMediaPlayer - fix metadata testTim Blechmann2 days2-6/+8
| | | | | | | | | | | | | | | QGstreamerMediaPlayer did not emit metaDataChanged after parsing GST_MESSAGE_TAG. This caused metadata to be changed without notifying the application. In the unit test we need to wait for `metaDataChanged` at least twice, since it is called from both the GST_MESSAGE_TAG handler and from parseStreamsAndMetadata. Fixes: QTBUG-124182 Pick-to: 6.5 6.7 Change-Id: I68f81d5bcb1a2c809f3641ec11356f5b9a8cb601 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: metadata - separate out type GValue parsersTim Blechmann2 days1-82/+119
| | | | | | | | | `addTagToMetaData` became too big. Moving out the type converters to helper functions. Pick-to: 6.5 6.7 Change-Id: I154ad8b7e18b05b1b8acbcb36e2a3f82a1b5170c Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Tests: apply clazy's old-style-connectTim Blechmann4 days18-244/+260
| | | | | | | | | | Automated refactoring done via clazy. PMF syntax is faster and more tooling-friendly. Pick-to: 6.5 6.7 Change-Id: Iaa31b2ab00ca032cf4f02d7565b910a0b3d22e5e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: AudioDecoder - fix race conditionTim Blechmann4 days3-65/+50
| | | | | | | | | | | | | | The app sources lives on a gstreamer thread. `bufferAvailableChanged` was called from both application thread and gstreamer thread, which is not thread safe. We simplify the application logic by deferring all mutation of the `QGstreamerAudioDecoder` state to the application thread. This seems to fix a spurious failure in tst_QAudioDecoderBackend::fileTest Pick-to: 6.5 6.7 Change-Id: I992c39b071ebd48d5fc5ca28fae499c855b93304 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: clean up metadata APIsTim Blechmann4 days9-116/+144
| | | | | | | | | Most notably getting rid of `QGstreamerMetaData`. Most notably downcasting from QMediaMetaData is undefined behavior. Pick-to: 6.5 6.7 Change-Id: I370598e0083b2121361e27e9c65ae87f5771d4b8 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* FFmpeg VAAPI: Fix not closing fd's when returning from getTextures()Lars Sutterud4 days1-4/+8
| | | | | | | | | | | | Added a QScopeGuard to make sure we close all file descriptors in the VADRMPRIMESurfaceDescriptor struct after calling vaExportSurfaceHandle() There are multiple return points in VAAPITextureConverter::getTextures() and the QScopeGuard will iterate through the struct and close all fd's upon destruction. Change-Id: I34037d5ca30bdeb27ec73beaabd559595a509910 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: apply clazy's old-style-connectTim Blechmann4 days2-2/+3
| | | | | | | | Pointer-to-member syntax is faster and more tooling friendly. Pick-to: 6.5 6.7 Change-Id: Ie3c2bb791d62aa4ff20c2ac946f659cc9c6bfa70 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Fix mutex usage in encoders of the FFmpeg recorderArtem Dyomin4 days6-13/+21
| | | | | | | | | | | | | | It was a mess of using data locking / conv var notifications. The mutex in the ConsumerThread is supposed to protect threading data (frames queue) and the exit flag. The confitional variable must be invoked after releasing of this mutex, but not after releasing a separate m_queueMutex that was used before. Pick-to: 6.7 6.5 Change-Id: I9010f4e9656b6298793b400211ccc82e12401e36 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: add reproduce for duration metadataTim Blechmann5 days2-7/+30
| | | | | | | Task-number: QTBUG-124544 Pick-to: 6.5 6.7 Change-Id: I256de9abf38324f7504ed36a24e3ea6ba24bb9ae Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Update dependencies on 'dev' in qt/qtmultimediaQt Submodule Update Bot5 days1-4/+4
| | | | | Change-Id: I74e9fcd98b6645f7b8cdf5b6a35166c75c14f4d2 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Cleanup in the RecordingEngineArtem Dyomin5 days10-135/+141
| | | | | | | | | | The patch amends renamings Encoder to RecordingEngine. No functional changes. Pick-to: 6.7 6.5 Change-Id: I27b929d7b0ea3c0dde825cccad5878c991afe130 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: QGstreamerMediaPlayer - apply rotation to nativeSizeTim Blechmann5 days3-2/+23
| | | | | | | | | Fix play_playsRotatedVideoOutput_whenVideoFileHasOrientationMetadata unit test. Pick-to: 6.5 6.7 Change-Id: I5826d39329a1b137090a38e10a30e2487bec968b Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* FFmpeg-Android: Set the configured FPS on CameraBartlomiej Moskal6 days2-14/+30
| | | | | | | | | | | | | | | | | | Add implementation for setting up FPS on Android Camera. [0]QCameraFormat (beyond the pixel format and resolution) contains also max/min frame rate. Those parameters were not passed and set on Android Camera. After this commit, the whole configuration kept in QCameraFormat is set on device during camera activation. [0]https://doc.qt.io/qt-6/qcameraformat.html Task-number: QTBUG-113399 Pick-to: 6.7 6.5 Change-Id: Iba4f4c0c8ac4bbdaf3488a0a9005bff42390c428 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Android-FFmpeg: Don't use higher resolution than 4k for video recordingBartlomiej Moskal6 days1-3/+5
| | | | | | | | | | | | | | Camera preview crashes when trying to use higher resolution than 4K (like 4096x3072, 4096x2304 or 3072x3072). Crash comes from rendering in OpenGL call (glTexSubImage2D(...)) - take a look on comments in QTBUG-122140. That it why video recording for higher than 4K resolution is turned off. Fixes: QTBUG-122140 Pick-to: 6.7 6.5 Change-Id: I0122bf0cc20af1ade76154e851b3768ef2421c5a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Android: Increase maximum number of images that can be acquiredBartlomiej Moskal6 days1-1/+1
| | | | | | | | | | | | | | | Increase maximum number of images that can be acquired from 10 to 12 for Android Camera. The reason for this is the m_maxQueueSize value in VideoEncoder in the ffmpeg-backend implementation. m_maxQueueSize limitation is 10 and at the same time one additional frame can be processed. In such case we still want to be able to get one more frame, that is why the MaxNumberFrames is changed to 12 Task-number: QTBUG-122140 Pick-to: 6.7 6.5 Change-Id: I2b884d5dc7101f7bcc8794646e363a4410865819 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Remove deprecated avcodec_closePavel Dubsky7 days3-9/+4
| | | | | | | | | | | Since FFmpeg n7.0 avcodec_close is marked as deprecated. According to the documentation avcodec_free_context should be used which is already true therefore the removal shouldn't cause any problems. Task-number: QTBUG-124482 Pick-to: 6.7.1 6.7 6.5 Change-Id: Ia2bdec8e9560441f99cc159b341ef60c1a39e88f Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Tests: QScreenCapture - relax backend testsTim Blechmann8 days1-6/+8
| | | | | | | | | | | With larger waiting times and a smaller expected frame count, the tests reliably pass on my workstation. Pick-to: 6.5 6.7 Task-number: QTBUG-122577 Change-Id: Id26f04e8d97748cecc38b345bd4ed472833ee282 Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: add private API to access pipeline for capture sessionTim Blechmann8 days11-37/+178
| | | | | | | | | | | | | Allows users to mess with the underlying gstreamer pipeline of the `QMediaCaptureSession` like they can with the `QMediaPlayer` [ChangeLog] QMediaCaptureSession: GStreamer - private interface to access underlying GstPipeline of QMediaCaptureSession Pick-to: 6.5 6.6 6.7 Task-number: QTBUG-123830 Change-Id: I5b17240c9951ee8e05dd6cb4a78b203a56794922 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: unit test native pipeline accessTim Blechmann8 days6-8/+110
| | | | | | | | | | | | Add initial test for the accessing the GStreamer pipeline via a platform-specific interface. Some fixes to the GStreamer plugin were necessary in order to include the headers from the `QGstreamerMediaPluginPrivate` target Pick-to: 6.5 6.6 6.7 Change-Id: Ia60e31426395f5a89b3b76d4d12aedd95f12731c Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Update pffft version to the latest version from upstreamMikko Hallamaa8 days2-29/+21
| | | | | | | | | | | Update pffft from SHA 7641e679 to fbc40586. [ChangeLog][Third-Party Code] Updated pffft to fbc4058. Fixes: QTBUG-124759 Pick-to: 6.7.1 6.7 6.5 6.2 5.15 Change-Id: Id48bd07f396650fcef61a5688f4cc3a32ce1a360 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Manage media backend lifetime using Q_APPLICATION_STATICJøger Hansegård8 days2-61/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks lifetime management of the Qt media backend to use a plain Q_APPLICATION_STATIC instead of a hybrid between a Q_APPLICATION_STATIC and a Q_GLOBAL_STATIC. This hybrid mechanism tolerated creating the Qt media backend before a QApplication was instantiated. This was considered necessary because Qt example code for enumerating media devices previously demonstrated this without a QApplication. Unfortunately, the hybrid mechanism prevented maintenance of the Q_APPLICATION_STATIC implementation, and was on its own complex to understand and maintain. By switching to lifetime management using Q_APPLICATION_STATIC, we may break debug builds of legacy applications that enumerate media devices without having a QApplication, but we consider this an unlikely scenario. We have updated Qt documentation to state that a Qt application object is required to access any Qt Multimedia APIs (9cf4494d49170eafb9c179d5304c0a70eaf25b96), and error logging is improved to make developers aware of this requirement (c2b1fb925798f5a87b21891dcf18cd967436de3e). We are now making this requirement harder by asserting in debug. With this change, legacy applications that use Qt Multimedia APIs without having a Qt application object will assert in debug builds. Release builds will for now continue to work as before, but with extra error logging. [ChangeLog][Changed lifetime management of the Qt Media backend. The Qt media backend lifetime is now always bound to a Qt application object, and Qt Multimedia APIs require that a Qt application object exists before use. Using Qt multimedia APIs without a Qt application object will assert in debug builds and result in undefined behavior in release builds.] Fixes: QTBUG-124577 Task-number: QTBUG-120198 Task-number: QTBUG-124578 Change-Id: I2b9864d8ee3dc937a80796891ff13854ce8968ee Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Add since 6.8 to a new QVideoFrame constructor documentationArtem Dyomin8 days1-0/+1
| | | | | | Change-Id: I4f2fd9194a718f061d9c1a43cc69c73c4d5f1805 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: QGstreamerAudioDecoder - simplify message handlerTim Blechmann8 days2-90/+99
| | | | | | | | Splitting up the processBusMessage, as it wat quite long. Pick-to: 6.5 6.7 Change-Id: I2aefc4e73400e6f588cd38e838fabb5b0668c371 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: improve tracing of GstMessagesTim Blechmann8 days7-59/+147
| | | | | | | | | | | | | warning/info/state_changed are often useful to see parsed properly. * print them in a parsed manner on the QDebug output * introduce a QCompactGstMessageAdaptor adaptor that can be used to parse these messages in a consistent manner in message handlers. this can be used to remove boilerplate code. Pick-to: 6.5 6.7 Change-Id: I0ca76bcfc69628b747fd5e095cc1c783287acb3c Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: simplify GstMessage processingTim Blechmann8 days4-34/+19
| | | | | | | | | | * reduce boilerplate code * reduce unnecessary null checks * avoid moc Pick-to: 6.5 6.7 Change-Id: Ic57db040a3acf55f9abd1eeac4e53991650bfa97 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Android: Restart camera after QCameraFormat changesBartlomiej Moskal8 days1-2/+10
| | | | | | | | | | | | | Before this change, QCameraFormat was not immediately updated. It was remembered and updated only after restarting the camera. Because of this, the camera continued to generate frames with the old resolution. When recording the video, each frame had to be scaled to obtain the desired resolution. Task-number: QTBUG-122140 Pick-to: 6.7 6.5 Change-Id: If30ef071f0140bfde4e08afe43bbb9e392dc6e82 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: metadata - fix extraction of rotation metadataTim Blechmann9 days3-5/+58
| | | | | | | Pick-to: 6.5 6.7 Change-Id: Ic5d27ff7c763e5dd05af2f7205028985d97ae650 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: QGstreamerMediaEncoder - fix duration updatesTim Blechmann9 days1-0/+2
| | | | | | | | | | | | `QGstreamerMediaEncoder` has a timer to update the duration. This timer is stopped when `pause` or `stop`. We should update the duration in this case to cope with the duration that may have expired since the last update. Task-number: QTBUG-124183 Pick-to: 6.5 6.7 Change-Id: Ia8b0df7a1e19917b137260069eba1c053188c2b0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Tests: minimal player - add test to switch output widget dynamicallyTim Blechmann9 days1-15/+69
| | | | | | Pick-to: 6.5 6.7 Change-Id: If948d85b0845247d40dcff1fac0bcaa635d09cd5 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: prevent dangling references on glib callbacksTim Blechmann9 days4-3/+8
| | | | | | | | | by using `QGObjectHandlerScopedConnection` where possible. Pick-to: 6.5 6.7 Change-Id: I60b7c68700fea80cb05f37757d27ba095f840441 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: reference counting cleanupsTim Blechmann9 days12-60/+83
| | | | | | | | Simplify reference counting by using handle types Pick-to: 6.5 6.7 Change-Id: I78788cb73e9597dc9fcd37d86d4ae179dea7bdbf Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* CMake: fix styleTim Blechmann9 days10-27/+27
| | | | | | | | | by removing the space after `if` `endif` Pick-to: 6.5 6.7 Change-Id: I5fdec78af7e92d4f5a88ad79feca222cfeb5b7d1 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* GStreamer: metadata - reduce complexity for metadata lookupTim Blechmann9 days6-53/+185
| | | | | | | | | | Instead of doing a linear search, we can do a binary search in a constexpr array. Reducing O(N) to O(log(N)). Pick-to: 6.5 6.7 Change-Id: I5bdc42bfc73dc9993e80c7352d64e54bbffe9a28 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Update dependencies on 'dev' in qt/qtmultimediaQt Submodule Update Bot9 days1-4/+4
| | | | | Change-Id: I15442dd988e69a92869871d2153e0e8f32a9379e Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Ensure that EGL::EGL is promoted to global for the standalone QtMultimedia ↵Alexey Edelev9 days1-1/+5
| | | | | | | | | builds Pick-to: 6.5 6.6 6.7 Change-Id: If3914fcfc52033bc377d47153bdd1a7f4ac1b401 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org>
* GStreamer: QGstreamerImageCapture - modernisationTim Blechmann9 days2-38/+39
| | | | | | | | | | * use lambdas for asynchronous invocations * simplify control flow Pick-to: 6.5 6.7 Change-Id: I99695977d177978f1f108949d80fa750c0d72e73 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>