summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Doc: fix return type of Camera::cameraFormatTasuku Suzuki2023-01-191-1/+1
| | | | | | | Change-Id: Ib02b6d0bd4562e574462f5e63e1e91d6c34c94a1 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 6a58cdd1249e34f4d35f68f17a001e083a2487f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add internal ability to adjust RTSP latencyJames DeLisle2023-01-182-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the gstreamer backend, the RTSP latency is set to 2000ms by default. This latency creates issues for cases where near realtime camera feedback is critical for directing the user. This change adds the ability to turn 3 knobs in the RTSP jitter buffer pipeline using the following environment variables: 1. QT_MEDIA_RTSP_LATENCY An unsigned integer value expressed in ms. This dictates the high water mark of the latency buffer. Default: 2000 ms 2. QT_MEDIA_RTSP_DROP_ON_LATENCY May be set to 1 for on or 0 for off When turned on, the jitter buffer will drop packets that arrive after the high water mark of the buffer has been filled. No new packets will be accepted until the high water mark recedes sufficiently to allow new packets to be stored in the buffer. Default: off 3. QT_MEDIA_RTSP_DO_RETRANSMISSION May be set to 1 for on or 0 for off When set to true, the jitter buffer will request a re-send of dropped packets. Default: off This change is strictly for a customer project, but may be helpful in understanding what additions to the public API would be helpful in the future. Change-Id: Icede93161d72936970f4835c6443e369789b4c38 Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 2fcf1212ff78f02e7c7d408c2719a0369eab5bad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix camera crash on macOSArtem Dyomin2023-01-181-10/+11
| | | | | | | | | | The crash was reproduced with OBS virtual camera which doesn't provide kCVImageBufferYCbCrMatrixKey Change-Id: I9c13de41e7d892b4d58aa151f914b450dd28716e Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit a5127186701df965dd94f712c64981eacd022b0a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Set default size to the Video QML elementTasuku Suzuki2023-01-141-0/+2
| | | | | | | | | | Video element is not visible unless width and height are set explicitly. Change-Id: I4ad2e1c815139869ca771c48acef0d8198c3b0f2 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 8d98e2553e65dfa2a102a210c4237615239e007f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix for randomly not working cameraBartlomiej Moskal2023-01-121-1/+3
| | | | | | | | | | | | | | | | | | After commit: 2abfa1e5cd3cbb148305dc0fe85671488a542397, there was a thread race in QAndroidCameraSession. Calling setVideoSize put setFrameSize method to queue (which resets a viewport). It happened from time to time that source texture coordinates was calculated with not ready viewport. To avoid this situation setFrameSize will be queued as BlockingQueuedConnection. Fixes: QTBUG-109561 Fixes: QTBUG-109391 Change-Id: Ie6a7bbd332fb42f1aba4fea53449ecac082aaf89 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit e08d5348459fa9fbb67404ffd0c3c6ba818ebe75) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't define same logging category in both pluginsSamuli Piippo2023-01-123-21/+21
| | | | | | | | | | | | | | | Both ffmpeg and gstreamer plugins define the same logging category, which breaks application linking when using static linking: error: /usr/lib/plugins/multimedia/libgstreamermediaplugin.a(qgstreamerimagecapture.cpp.o): multiple definition of 'qLcImageCapture()' /usr/lib/plugins/multimedia/libffmpegmediaplugin.a(qffmpegimagecapture.cpp.o): previous definition here Fixes: QTBUG-109613 Change-Id: I9dd573fe8412ec0ea9144ec4a56f5680060cec16 Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 24eb3e2a8859eeff73c4954ff2a3d366a7ab0511) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Provide default implementation for QPlatformMediaDevicesPiotr Srebrny2023-01-128-26/+23
| | | | | | | | | | | | | | In case no audio backend is available we should provide some default implementation for QPlatformDevices otherwise the code crashes on an attempt list audio devices. As a bonus clean some leftovers of video devices interface. Fixes: QTBUG-108221 Change-Id: I8d7e5ebe2ec98ba9381fae429f359b8ffaea3bb6 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit ab49644bea444d105e6fa6ca246f21eccd7a67e0)
* Fix crash with ffmpeg on specific video filesArtem Dyomin2023-01-121-3/+12
| | | | | | | | | | | | | | | | | FFmpeg doc says that the following case is possible: AVFrame.linesize[i] < 0 and AVFrame.data[i] points to the end of data, it's a weird case of flipped pixels direction, only one video with such an encoding has been found for now. Function sws_scale solves the problem so we should call it in the cases of flipped videos. I'm going to add a test after finding a way of getting such files. Task-number: QTBUG-108403 Change-Id: I72f45781e2c3983d6a1991db2b833b78184b90dd Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 1e8653062d6d23e4dc026661c485e74750c9d4c2)
* Android: Prevent Camera set automatically activeSamuel Mira2023-01-113-4/+11
| | | | | | | | | | | | The Android backend was different from the rest of the backends and it automatically started the camera when it was attached to media capture session. This patch changes to set it as the rest of the backends. Fixes: QTBUG-109415 Change-Id: I88342e9db068bec05404f5bfd91f73ea5015bb96 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit f18be9c59cb38fb3cc5046932c5587997af35cf5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Drop the dirty flag once a video texture is created for a frameTasuku Suzuki2023-01-101-0/+1
| | | | | | | Change-Id: I2ea4f8c21838abf8fcb727d95b9c8c24b0ac6d05 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 15c88c4b6ef08e0112b12b5883e481a2372329c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use correct prop and enum const in code snippetAndreas Eliasson2023-01-091-2/+2
| | | | | | | | | | | | * There is no MediaRecorder.RecordingStatus constant, so change to MediaRecorder.RecordingState. * There's no status prop, so change this to recorderState. Fixes: QTBUG-97265 Change-Id: Iad40b161f86a0c386f745ce7d293a81718f90c6f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 108cda751aab4a753c1bfac73d2941f02abdfa49) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Fix for subtitle language metadata detectionBartlomiej Moskal2023-01-091-9/+1
| | | | | | | | | | | The QLocale supports ISO639-2 language tags. That is why we should start to use QLocale::codeToLanguage in our implementation. Task-number: QTBUG-97166 Change-Id: I8f62d6b3d7c8be555249792bfe0c6d6f82af217b Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 4b976b27e1a879fd89d786ff0776a275eb5e1938) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correctly finish, clear and delete AndroidTextureThreadLauri Laanmets2023-01-061-10/+15
| | | | | | | | | | | | | | | | | 'QAndroidTextureVideoOutput' destructor waited for 'm_surfaceThread' to be finished but seems that this thread was nowhere requested to finish. In addition, 'AndroidTextureThread' created 'std::unique_ptr<QRhi> m_rhi;' in it's own thread but didn't reset it. Thus, deleting the whole 'AndroidTextureThread' from another thread, started deleting it and failed. Task-number: QTBUG-109168 Change-Id: I9e12228c579457710c4fe5d8185bffabf9f3755a Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit d4e02d9efd6e8e41aa1a83c0f3d6534d138e7ae3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix memleak in QGstCapsPiotr Srebrny2023-01-0416-135/+116
| | | | | | | | | | | | | | gst_device_get_caps and gst_pad_query_caps require decreasing of reference count when caps are not longer needed. This was not done with QGstCaps. This patch adds reference counting on QGstCaps and remove QGstCapsMutable as it was based on a missconception. GstCaps can be mutated only when refernce count is 1. This was not ensured with QGstCapsMutable. Change-Id: Id058a0a916b5f76eef758a099791bec7cc917af9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit f0ae787ec3d087a8afac45b1473a22c535a44dc3)
* ffmpeg: avoid infinite loop with non-discreate framesizesSamuli Piippo2023-01-041-2/+2
| | | | | | | | | | | | The v4l2 camera checkup can properly handly only discrete types. In case ioctl reports anything else, make sure we increase the index to avoid getting stuck on infinite loop. Fixes: QTBUG-109535 Change-Id: I7e669b8167361875b75d4eece5c0c9a92a76c331 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 8897d36de57db3ce9d75fbd87bcec96bbbd4d69f)
* Improve macos audio data warningsArtem Dyomin2023-01-024-118/+174
| | | | | | | | | | | | | Functions AudioObjectGetPropertyDataSize and AudioObjectGetPropertyData have been wrapped into util functions that can print warnings with info that might help us. Task-number: QTBUG-108176 Change-Id: I787d5a93ad395d2156df6b542c290949c61daaa3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 23e4f614b3ab22300b2ce58c50b1e9a6d4ab5011) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QAudioDevice docs to reflect Qt 6 APIPaul Olav Tvete2022-12-301-1/+1
| | | | | | | | | | | QAudioDevice::defaultOutputDevice() no longer exists in Qt 6. The new method is QMediaDevices::defaultAudioOutput(). Fixes: QTBUG-109583 Change-Id: I108baf830fb751bee0ecf85554242285f06cc1db Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 6fe75cbd3f96203dd35d13cdbe72cd66bebc15d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not assert in Android VideoOutput in debug buildsLaszlo Agocs2022-12-161-1/+1
| | | | | | | | | | | | The pattern of passing the same resource update batch to both beginPass() and endPass() will cause a failing assert in endPass(). Change-Id: I3787722d426dabaf3ccee79cf1dcd701c224700c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> (cherry picked from commit 88d2477f9cdf302d2f27b3d0929c1990778be75d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix access to multi front/back cameras on Android devicesAndrey Yaromenok2022-12-161-0/+6
| | | | | | | | | | | | | | Allow to access second (and more) front or back cameras on Android devices by adding a counter number at the end of additional camera name and description (don't need to brake current code compatibility or confuse majority of the users with only one front/back cameras on their devices) Fixes: QTBUG-59726 Change-Id: Icecb3af7521d4bbd3fbb0b953895c045cfdbf60a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 633597b00423adf8359763bc14d185e3ca91efbe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a divide-by-zero exception for ffmpegInho Lee2022-12-161-2/+3
| | | | | | | | | | When calculating duration, there is a possible divide-by-zero error. Task-number: QTBUG-108412 Change-Id: I2399027a39f32125b2336e1ad9aee1c0ff04341f Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit d8e22e3fa321560bed48089a5445edba9cfc535c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix thread hang on tst_qvideowidgetSamuel Mira2022-12-161-1/+8
| | | | | | | | | | | | | | | | QVideoWidget gets blocked because of a hanging thread on QAndroidTextureVideoOutput. This thread waits on the destructor forever. This only happened when the provided sink had no RHI. QAndroidTextureVideoOutput depends on OpenGL so it does not work without an RHI. Therefore a check was added on the constructor to prevent the thread to start in this case. Fixes: QTBUG-109443 Change-Id: I158ff95967116697018e7d6f34c29c5e999182be Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit f6b0e3a33add68972e3ba556dddb1f745224ce01) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Change log for RTSP failureBartlomiej Moskal2022-12-151-1/+3
| | | | | | | | | | | | | | MediaPlayer does not play rtsp media properly on some devices. The problem seems to be orthogonal on Android. Same problem can be noticed on pure Android applications. This commit contains improved logging for mentioned case. Fixes: QTBUG-103567 Change-Id: I8f52dcc8e38f6af063a54c779348ccff4043cabb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6838d738409418185fba3804c8ad14e0e3dbb005) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include moc_*.cpp files in QtMM qnx pluginArtem Dyomin2022-12-159-0/+22
| | | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: I72526688b6ce66cbf5e010632340f5e31b0194eb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 17a98404f2b19a04e5aad742b944be123750d3c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include moc_*.cpp files in QtMM android pluginArtem Dyomin2022-12-1515-0/+28
| | | | | | | | | | | | | | | | The reason for the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: Ic564cb560271b75c8ffe871244e4c3a5a3a5ef93 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit f77f5a2b8ec84d68ba0e793dba36476462bc460b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include moc_*.cpp files in QtMM ffmpeg pluginArtem Dyomin2022-12-159-0/+22
| | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: Idab09ddd6bda4f74fb395e1b0876c88f0910c710 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit a3c36e681d6036f053fed01526ed5db4ba6d713a) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Include moc_*.cpp files in main QtMM codeArtem Dyomin2022-12-1519-38/+134
| | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - some headers have been decoupled into header and cpp - the same refactorings of examples, tests, plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: I6716cef5116769230c36e8d584d9ba6ec40aabb2 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 49e1615c98816d8e19fd364a493478d1d6e42eb1)
* Include moc_*.cpp files in QtMM gstreamer pluginArtem Dyomin2022-12-1515-3/+38
| | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: I6859614f1c68b278f95acd79b5e98fbb6585ad0b Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit adcc3e43231fd75cdacfbc534912162cd16b8d78) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Enter IdleState when resuming audio sink in push modePiotr Srebrny2022-12-141-1/+4
| | | | | | | | | | | QAudioSink must enter IdleState when resuming in push mode and it should generate UnderrunError error if no data is provided. This patch fixes the tst_qaudiosink tests. Change-Id: I3051d8fe62c60a3c4fd9955f0df6c35ae6e40800 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit edaf2a2ef06c80f37f24483fbdcaf0b4d124c0d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disconnect all signals from QVideoSink before unregistering sourcesPiotr Srebrny2022-12-141-0/+1
| | | | | | | | | | | | | gstreamer implementation of QPlatformVideoSink emits signals to QVideoSink on the call to unregisterSource(). This causes ASSERT failure as QVideoSink is being destroyed at that time. Disconnecting all signals from QVideSink before calling unregisterSource() prevents this. Change-Id: I137bef89ec84e166b9d2c176680d4cde1abbdea2 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit b34c8fb3e637a02ef9c49f3c6b7f58254d2d6136) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Windows: Fix position reported by QMediaPlayer after seek"David Schulz2022-12-142-21/+1
| | | | | | | | | | | | | This reverts commit 633cf2057f4f10f0e02dbc851827856c8ed93499, which introduced issues when seeking a paused wma file. Additionally the previous issue that seeking flac files reports a wrong position doesn't seem to reoccur. Fixes: QTBUG-108995 Change-Id: Ib54770771ae1b28c448893441d2d23c507f86951 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 1b25008c5d54063d50aba7e8eaa4ac5883bcd352) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include moc_*.cpp files in QtMM windows pluginArtem Dyomin2022-12-1314-2/+48
| | | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: I2f9e07cd30d09778bc48b2df7202ef8c06ad398e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 3d3ece9f5fc3e89becaf56eff7faf97cffb1a03d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include moc_*.cpp files in QtMM AVF pluginArtem Dyomin2022-12-134-14/+18
| | | | | | | | | | | | | | | The reason of the refactoring is following the common approach that leads to reducing compilation time and binary size. - logic hasn't been touched - the same refactorings of main QtMM code, tests, examples, other plugins are coming in the next commits Task-number: QTBUG-103290 Change-Id: I09a8ee9344ba3f3db6c04c5f22a2faf46580a09a Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 4d17ecbcd4f278159c643f14a7cceaca1d53a6e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Refactor and fix AVFAudioDecoderArtem Dyomin2022-12-092-194/+248
| | | | | | | | | | | | | | | | | What's done: - Fix threading issues. - Fix sending signals after decoder.stop. It simplifies usage and makes the decoder better for unit tests. - Fix queue size limitation - Code clean up - Little fixes in tests in order to fix some flakyness (race conditions) - Additional debug logs with logging category. As a result, tst_qaudiodecoderbackend works fine with avf Change-Id: If712dfe0c0c11390aa5245afd62ecabf16601431 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 4c7f2d3291a842c33b0ba48f968d0dcc1df277b5)
* Remove .dll extension as QSystemLibrary unconditionally adds itPiotr Srebrny2022-12-071-1/+1
| | | | | | Fixes: QTBUG-108383 Change-Id: Ie3128ed4ff6bd2326dd95b00c59e75052296a70d Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Docs: fix links on multimediaoverview.htmlNicholas Bennett2022-12-051-2/+2
| | | | | | | | | | The reference documentation links were missing the \l command, this has been added. Change-Id: I7b340bc87302bd0179c6d9d79a15d09f3edcf708 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 28faab38a2acf323d6803ea2c0aed3d73cffb6b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reset playbin state after decoding has finishedPiotr Srebrny2022-12-051-0/+1
| | | | | | | | | | playbin is left in the PLAYING state after receiving EOS. Thus, we must reset its state to NULL to be able to decode again. Change-Id: Ie158fad713b0e6ee313b6f2e3756cfdb99476a5d Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 3aff10d9b51ebbffcffca2110b2c399a61b8df63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix QMediaDevices code example to reflect Qt 6Andreas Eliasson2022-12-051-3/+3
| | | | | | | | | | | availableDevices() does no longer exist in Qt 6. The correct method should be audioOutputs(). Fixes: QTBUG-108668 Change-Id: Id909fa97adcadd266c4a75be70c0007f86e8dc78 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 70ce4a4d477781ef238883431f18ca4ed81decce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Map 0 channels to ChannelConfigUnknownPiotr Srebrny2022-12-021-0/+3
| | | | | | | | | | | We must set default channel config with channel count 0 explicitly to ChannelConfigUnknown as the defualt algorithm will map it to UnknownPosition resulting in channel count 1. Change-Id: I88c289b3edb1d3f8ac5a971f02c8b542373041c8 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit cc2ac2a76a2d9e867e26e2f4162d4da1d976533c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unncessary checks as playbin is never nullPiotr Srebrny2022-12-021-18/+1
| | | | | | | | | | QGstreamerAudioDecoder constructor receives not null playbin, thus it will never be null. Change-Id: Idd1e8f0840cdc7736b3724f1706c76663ffa46c0 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit fe1ede7ce059c91404e348ee2cbbf70dc6f3afd2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove reference to missing cameraDevice.orientation()Andreas Eliasson2022-12-022-4/+1
| | | | | | | | | | | It seems as if this method is not a member of the QCameraDevice class. Fixes: QTBUG-109070 Change-Id: I1628708c1aabdca238da191d5836d86b4c2072bf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit e92af1c77bce45f27e54d4b6a3c4db8510659e15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix ffmpeg camera crash when videotoolbox doesn't support formatArtem Dyomin2022-12-013-14/+30
| | | | | | | | | | | | | | | | The change just fixes the crash: hw accel is not valid if videotoolbox doesn't support core format (e.g. 'yuvs', 'yuvf'). Ffmpeg camera still doesn't work with these core formats, it's to be fixed under the bug QTBUG-109009 (most likely, on ffmpeg library side). The issue is reproduced with pretty old cameras, e.g. on macbook pro 2015 year. Fixes: QTBUG-109009 Change-Id: Ib36a7e6b3b8c71fa1a3a2717c3509ca30d3b5caa Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 1fc49f0c2ff603c39ba9d1dd90f0e621a0fde488)
* Fix see-also syntax, silence qdoc warningVolker Hilsheimer2022-11-301-1/+1
| | | | | | | | | | | | | | qdoc informed us that it can't link to space-less 'QAudioSink,QAudioSource,QAudioFormat' because there is no such thing. Insert space after comma to fix the links and silence qdoc. Change-Id: I192a73753e2885ffc7e05a94b6fc0a9ac91f13b8 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> (cherry picked from commit e9dc2e079a5fdde2af37896d6cf7f35ab6bc89d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix ffmpeg camera crash on macOS (double releasing of an object)Artem Dyomin2022-11-302-2/+4
| | | | | | | | | | | | | | | The reason for the crash is 'autorelease' and 'release' in the destructor. In applications, QMacAutoReleasePool releases it 2nd time. The application crashed after a few camera changes. So we should use only one approach. The suggestion is to manage the object manually for both backends in order to make the behavior more predictable. The added test checks the case. Change-Id: I80a644acd94ae469a16fd95ba971441c78e7a700 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit d73cc0bce893b81de3f84c570110c8969b9ee468) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo: to setup -> to set upPiotr Srebrny2022-11-288-10/+10
| | | | | | Change-Id: Ia9c8964ce8671fcf384c5590b4fcb804a3e42915 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 5a0b6bee16c9b71589209e6aa18a77c987d27800)
* QWindowsMediaDevices: Fix potential null-pointer-accessVladimir Belyavsky2022-11-271-4/+5
| | | | | | | | | | It seems sometimes IMMDeviceEnumerator::GetDefaultAudioEndpoint() may return null device even when succeeded. It's probably a bug in MS Core Audio. So we'll check this explicitly to prevent null-pointer-access. Fixes: QTBUG-108898 Change-Id: Iba1e6673f12a3dafd80f3de11e40babeb1e21e35 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 9f7eb2bacee57bf95f975f97d72e98d9ca19714e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some memory leaks and crashes in corner cases with ffmpeg encoderArtem Dyomin2022-11-239-103/+105
| | | | | | | | | | | | | Refactoring: use unique_ptr for managing avframes. Memory leaks occurred because of inaccurate avframe memory management Crashes occurred on linux with some virtual cameras because of null pix_fmts and null codecContext. Change-Id: I8ad0b922e89cf01bc79eba6cbbfeb9d6172b9d56 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 9242a5262a32d793deb5c4d745546fab8dd8d165) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Android: Fix for QAndroidMediaPlayer isSeekable methodBartlomiej Moskal2022-11-232-7/+2
| | | | | | | | | | | | | | | | | isSeekable() method should return correct value. It seem that m_seekable is corretly set in Base class. That is why we shouldn't override isSeekable method in our implementation. Additionally, after commit 0de7ff081f6d75122d2186d399a6f06cd865978e, default m_seekable value was changed to false which is not the correct approach on Android. Value need to be set to true in QAndroidMediaPlayer constructor. It changes if MEDIA_INFO_NOT_SEEKABLE is received. Task-number: QTBUG-103567 Change-Id: I662e12610ea76472bfde408ba8a1dac602b63788 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit d986272abe0e78aa4fecd2c385f880fd28ec336b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-11-1811-30/+30
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-182-8/+8
| | | | | | | | | | This is a the same semantic patch (qt-port-to-std-compatible-api V5 with config Scope: 'Container') as in dev. I've re-ran it in 6.4 to avoid cherry-pick conflicts. Change-Id: I9621dee5ed328b47e78919a34c307105e4311903 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix camera ffmpeg crashArtem Dyomin2022-11-161-1/+7
| | | | | | | | | | The commit just fixes typo made in one of recent commits. Tests on local PC get passed after the fix. Change-Id: I4e4adf5f0f039867f0ecad5130e072169ab91eac Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit be49af3b0f062fceef31711c67450ffbf595a808) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>