summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QAVFCamera: pass the correct resolution6.5Timur Pocheptsov2023-10-182-1/+21
| | | | | | | | | | | | | | Which can be affected by the connection.videoOrientation (the sizes of sample buffers can become 'transposed' - width and height swapped). So when updating camera format (and there we create HWAccel) - check if the orientation is 'portrait' but the dimensions are landscape - transpose such QSize. Change-Id: Ibd2dac5c532abcc60238bb0e9101195fae79bb1d Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit a669d3e0dca82dde7356385054634c9b4fc453bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 61a7eb181bab7f84e43dc1d05bd74ad08acae08f)
* Ensure that FFmpeg media data holder is completely recreatedJøger Hansegård2023-10-173-12/+19
| | | | | | | | | | | | | The FFmpeg media data holder was reset using a member function that was recreating its state. Although this works, it is better to use a factory function for this, to get a design guarantee that the media data holder is fully recreated also after future refactoring. Change-Id: If9fc75ef20788f433f9e3bd8c4ba5c3a8081e28b Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 33f58f6a93d1d782fde973c57437d6a0b4a09327) (cherry picked from commit c6f882f58d7676f538ba5d5ffb4996a53c9d5c36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cleanup and harden mediaplayer testsJøger Hansegård2023-10-135-571/+782
| | | | | | | | | | | | | The tests should be a specification for the media player. This change hardens the media player tests, removes dead code, and improves the media player specification. Change-Id: I2fcad8e06650ca982e03e2129fd60e7396769fa5 Reviewed-by: Lars Sutterud <lars.sutterud@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 740b9eef8f87b4081786eae13f3285ee696ecf1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7057a57ba9d731bee16b6a7ebe860162246aac5e)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-131-4/+4
| | | | | Change-Id: I770e691a94f7d312d74f4c651ae130a21cfb00ee Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Use xioctl function wrapper for v4l2 cameraArtem Dyomin2023-10-121-27/+38
| | | | | | | | | | | | | | | | | | | | ioctl documentation says: "On error, -1 is returned, and errno is set to indicate the error." So we have an undefined state when result is -1 but errno is not set. xioctl tries ioctl again in the undefined state, and it is used in v4l2 camera example, see https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/capture.c.html This suspects that ioctl commands, that have been sent to v4l2, may occasionally return this state and should be retried again. Change-Id: I738990855886d5628834f0e5934a13359650261b Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 2011f29aabe75c2e79029b85acdcaeba3a0284c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5d75ca43131d1e8fbe508fa71124208dee5d4e58)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-121-4/+4
| | | | | Change-Id: I2d2a063963c28e933daea4453e3243d446101027 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Replace camera-example picture with Windows 11 lookJøger Hansegård2023-10-111-0/+0
| | | | | | | | | | | | | | The Camera Example image displayed as the first Multimedia example in Qt Creator was rendered using an old Windows style and appeared old. Re- creating the screen shot on Windows 11 makes the example look more modern. Change-Id: Iedebc7f7fd21b4dda7f8c64e326af5d23069bcf7 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit d04da8a3dfb2716db578e30e1d852a26084cb644) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 873367a6ea095b3e7a70f1d95496b1cc3422ae80)
* QWindowsFormatInfo: avoid implicit detach in getImageFormatList()Vladimir Belyavsky2023-10-111-1/+1
| | | | | | | | | | | by making a variable const Change-Id: I54bd46e1dfe2ffd1d17ae80d258b78981dcedf36 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 6cfcbfbdf698dd843d764cf0387dcd2dc744b1b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit eb4e3b087aceb615c199ef9e7bf05a29f4345037)
* Use aggregation instead of inheritance with FFmpeg MediaDataHolderJøger Hansegård2023-10-113-16/+49
| | | | | | | | | | | | | | Playback engine was inheriting MediaDataHolder in a 'uses' relationship, not in an 'is a' relationship. In this case, aggregation is preferable to adhere to the single responsibility principle and to make dependencies more explicit in the code. Change-Id: I4342aa6e0c2c47e074eb88d20c73d630315f573c Reviewed-by: Lars Sutterud <lars.sutterud@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 7a30b8651537b21bd5eadda7509b8e8029928a28) (cherry picked from commit 563eab133079f5f73f0d2072cc748496c7593442) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Minor cleanup in v4l2 cameraArtem Dyomin2023-10-112-5/+4
| | | | | | | | | | | Let's use unique_ptr instead of raw ptr. Change-Id: Ia34654d13eaa6f0c5c977f95febdf40f410b196e Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit d928a3762781e23d76aeac788fe64a9529738318) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fbf0c890ed51cded8bd5f9673f1b011ba760e918)
* Remove unused files qffmpegclock_p.h and qffmpegclock.cppJøger Hansegård2023-10-113-307/+0
| | | | | | | | | | These files were compiled in but never included anywhere. Change-Id: I4f4dd2369c2fb923f680a1b79bc012e8af87cace Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 5ca1665ec6854533d033224fbcbb9a67a6e3a681) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0d6b66a2cc131370a9205f77823a640b226bc93b)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-101-4/+4
| | | | | Change-Id: I18323637e6739bc15e72fcb0e0f77e9ad44a395e Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Remove static keyword for functions inside anonymous namespaceJøger Hansegård2023-10-101-5/+4
| | | | | | | | | | | Functions inside anonymous namespaces are static by definition. There is no need to repeat this. Change-Id: I49b44dc287c4ec0dc705c6b5ff2cf880c2fdaaf3 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit a2a3b93424c49cf68007c03c6d7949ebccfbdfb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 36ea0cc8716a144963c974eef060080dad445b9d)
* Make FFmpeg::Thread easier to readJøger Hansegård2023-10-104-76/+88
| | | | | | | | | | | | | | | | | * Remove unused code related to timeout handling and simplify sleep/ notify mechanism. * Rename to ConsumerThread because it is not a general purpose thread, but a thread that is waken to consume available incoming data. * Rename functions and variables to better match intent. * Reduce scope of mutex that appears to only protect a single stop flag. We previously held a mutex while calling functions on derived classes, which could increase risk of deadlocks. Change-Id: I9e4835a4084ca717ff67e35a0b93454bd1f1ada6 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 66fbfc5ca448d8668c43932aacf57d6ec4b96880) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 77414af998aceeb602a5579489828eca428969a2)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-091-4/+4
| | | | | Change-Id: Ie81ca0318a4235686977128f1ef836b12a0ddc05 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Doc: Remove left-over in documentation of Camera exampleKai Köhne2023-10-061-1/+0
| | | | | | | | | | Fixes a left-over introduced in commit e03727e047 Change-Id: If159f6c63e60060ae9e48bc533a3027f45984213 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit b4a23b1e73a371bf8f992ea9a0708c1f98eefed3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 935a6b04aa538c3b369a7460d0de8fb0b5363b5f)
* Encapsulate FFmpeg MediaDataHolder data membersJøger Hansegård2023-10-063-8/+22
| | | | | | | | | | | | Protected data members makes code harder to reason about, and violates encapsulation. Change-Id: I00b9a66a46f49af6cd099e999d30a1bd75bc13d8 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Sutterud <lars.sutterud@qt.io> (cherry picked from commit e515d2b6c770f11a90fb5df3a9815c08b82ea1fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d04035ddd4adf3b99da4805025c76af5e4d3f658)
* Android: Support more audio channelsBartlomiej Moskal2023-10-051-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The audio player configuraion (using OpenSL ES), expects channel mask to be correctly set according the number of audio channels. Before this change, channel mask was set to SL_SPEAKER_FRONT_CENTER (for one channel) and to SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT for more than one. That didn't work if there were more than two channels. Configuration finishes with errors (for 6 channels): E libOpenSLES: pAudioSrc: requested 6 channels but mask (0x3) has 2 channel bits set W libOpenSLES: Leaving Engine::CreateAudioPlayer (SL_RESULT_PARAMETER_INVALID) W libapplearnplayer_armeabi-v7a.so: Unable to create AudioPlayer We should handle more than 2 audio channels. To do that, channel mask need to be correctly set. Fixes: QTBUG-115444 Change-Id: I145a0068f7815edf67afcdf484cc41a046c71a0a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 10864c9b1f230c36d9ba6c497b2e8a38a279ceb4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit db1b01ef68a398b76d2f0c208705a20bcd703be9)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-051-4/+4
| | | | | Change-Id: I52f5f90af3511d4d0c920b1adc748a59308c75e0 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Add audio warm-up opt out optionPavel Dubsky2023-10-051-0/+12
| | | | | | | | | | | | | | | | | | Current workaround to fix audio cutting out in the beginning of the audio on Windows introduced some weird side effects which are hard to reproduce, such as: blocking sleep mode, stucking CPU core at the minimum frequency. So far, there's no any other solution to the cutting sound issue, so an environment variable that provides the ability to opt out is introduced. Task-number: QTBUG-117528 Task-number: QTBUG-117612 Change-Id: I8b6ecab5cb3ae9136fd29adf5186d15c9128707f Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 194b1b22dcd49df3949a6c8ed5d54585970798cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ac55a1c164de20c11143aae6feb49a78cb1d3d15)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-10-041-4/+4
| | | | | Change-Id: Id73230e717d5cce14f8324233bb0f36d0bdd4948 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Expose QScreen to QMLUlf Hermann2023-09-291-0/+7
| | | | | | | | | | | | | | | | | Since QQuickScreenCapture is constructed with inheritance, the original "screen" property is still visible in the qmltypes. It should have been constructed with composition instead. Now, since tooling needs to see all types for all properties, we need to expose QScreen here. Fixes: QTBUG-115568 Change-Id: I40f115756e5e81d0dd9a49dfd994d74a247b8279 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 9004cbdc2c4be6b693cddd1f536fa04e064729dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5009a11245b56760865c7f05cae70c0d4f2f89b0)
* Fix getting an initial position of media streamsArtem Dyomin2023-09-277-1/+48
| | | | | | | | | | | | | The patch detects an initial position be the first packet for not seekable streams and streams/files with undefined duration. Task-number: QTBUG-116782 Change-Id: I7de1df964ba3343dce9d58b3e77b63e3c61ca452 Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 2ec4170ac9feccb48ab2267911887ea1e2897a3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e2910eac27eb8cec21aae0db6e4ccf44b361d947)
* Fix demuxer seek errors reportingArtem Dyomin2023-09-271-7/+14
| | | | | | | | | | | | | | | | | * skip seeking for unseekable streams * drop 0 position seeking error for streams with undefined duration. Ffmpeg may report failure on seeking rtsp streams even though the stream is seekable. Let's drop the error of initial seeking. This might need improvements. * Remove currently useless 'return' on seeking error. This might need improvements as well in the future. Change-Id: I859a9a27c9f7a057d0ec7e0b4c2e244159d9b7f9 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 7b78abff4f617238f49f517881ec9683c30c8a0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 877d7574c9a59cbdacd382fccf53e4f781062f0a)
* Android: Turn on dynamic openSSL symbol resolvingBartlomiej Moskal2023-09-271-1/+3
| | | | | | | | | | | | | | | Set ENABLE_DYNAMIC_RESOLVE_OPENSSL_SYMBOLS variable to True also for Android OS. That will allow to try to turn on DYNAMIC_RESOLVE_OPENSSL_SYMBOLS (for ssl or crypto libs). Task-number: QTBUG-110805 Task-number: QTBUG-114954 Task-number: QTBUG-113980 Change-Id: Ic916b1419cf85425c2c11d24e9f65e70c46e7cd3 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 882624324204cde47115042c4cb8ab38521bf91e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0dfab726bad8e697d631f148b57ff9b94cc847bc)
* Introduce integration tests for rtsp streams playbackArtem Dyomin2023-09-271-20/+184
| | | | | | | | | | | | | | | For now the tests are manual since they need vlc for creating test rtsp streams. VLC media player is a convenient tool for running rtsp streams (server and streamer together) on different platforms. It might be replaced with other tools if we encounter issues on integration it on CI. Change-Id: Ie204dc5a53d8788a95289a263585006363b2bffa Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 9c4e9e75ed80ba669b84fd12f8a7e5de4c5e9be7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7b9e29421d0875da84dfe93dd61717941c263248)
* Fix getting mediaplayer position in streams with undefined durationArtem Dyomin2023-09-272-5/+10
| | | | | | | | | | | | | rtsp streams don't have exact duration, but users should know current position of the playback for this streams and other streams/files with undefined duration. Change-Id: I5585d807e96304647165ecb88d386ed2ae836be8 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 49165a8d075284fcf3fc10e0955a2b4f577ae5ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2fe0180cdc32e5492cd89f46f65ecfcaaf4ddb41)
* Android: fix compilation for FFmpeg with openSSLBartlomiej Moskal2023-09-271-1/+1
| | | | | | | | | | | | QByteArray type has no assignment operator for QString. Just use qEnvironmentVariable instead. Fixes: QTBUG-117599 Change-Id: I0f779c4bf90f0276179e84bb2ff6b742906b8641 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 03e6411af18767e195396a5043de444ec170d3b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e992fb7aeecb9e38b7ae3e73a00cf9efd884492f)
* Minor cleanup in ffmpeg demuxerArtem Dyomin2023-09-271-9/+11
| | | | | | | | | | | Just use local reference avPacket instead of taking the pointer from packet. Change-Id: If173a49224cc53ae2f7269a203bdcb85ddfc259e Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 153b3f345a3c804b3ff0b7a74a1130ed4fa7f562) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8ecb599ab1ffd820d0714165e8a1e71fe549809a)
* Bump version to 6.5.4Jani Heikkinen2023-09-271-1/+1
| | | | | Change-Id: I5ef000df0e9d4802ad7287c03f49188a6f4f6a2e Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-09-271-4/+4
| | | | | Change-Id: Ia08f3b2ac2e7853bf3a359195c12d7e085918ba4 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Fix bug in QML video example causing camera to not get displayedJakub Wincenciak2023-09-271-1/+2
| | | | | | | | | | | | | The bug was due to undefined property (item.centerIn instead of item.anchors.centerIn). Also added ignoreUnknownSignals property to one of Connections because target property was set to dynamically created object. Task-number: QTBUG-110012 Change-Id: Ic31218a778a3c13efc227b3db6b72ffd6f1abae4 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit c62180636cb5636915f06806d6f6f65bad3b582c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4e05a5100feb7a38cf77f5409f439c97daf8ddec)
* Always provide ALSA default deviceAndreas Cord-Landwehr2023-09-251-1/+10
| | | | | | | | | | | | | In several ALSA setups, specifically on embedded devices, there is no "default" device when iterating over devices via snd_device_name_hint. For such situation, bring back the Qt5 ALSA logic to always generate a "default" interface and provide as first device. Change-Id: I32ee48b436544991a6790775024655b2ec736b53 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 4fafcd6d2c164472ce63d5f09614b7e073c74bea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a0de4480a7584ece9b6867e3b25a7b770dcb3447)
* Fix little/big endian mixup for audio formatAndreas Cord-Landwehr2023-09-251-6/+6
| | | | | | | | Change-Id: I49ea140f4923c220caa600ed61e11ea529d72e14 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 256fffdc04dc0a4ae2f7bbde80e9e256f20bfa07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f7647f5e2648725494a6d9ebd8010a7e86457a1b)
* MediaRecorder: Fix crash if output path contains whitespaceLars Sutterud2023-09-223-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a URL containing whitespace characters was specified as outputLocation in MediaRecorder, the application crashed when recording was started. This is because we converted the path using QUrl::toEncoded(), which converts whitespaces to %20, which in turn leads to a segmentation fault in the ffmpeg backend. The soulution is to use QUrl::toString(QUrl::PreferLocalFile) instead, which returns a QString formatted as a local file path, preserving whitespaces. To make things more readable, the resolving of outputLocation to a valid file path is also moved out of Encoder::Encoder. This constructor now receives QString &filePath instead of a QUrl. Resolving the outputLocation to a valid file path and converting it to QString is now done inside QFFmpegMediaRecorder::record, with help from QMediaStorageLocation::generateFileName. Some other small simplifications and name tweaks was also made. Fixes: QTBUG-116801 Change-Id: Ia4b3befa99c639185bec29382cb18c0cd7e3c23e Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit b3a1c56ab98c6eedd68288e043fb55e8bfd9fe6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 587a90b7ac0e0824a0be64eb68b6ef64d403cbb5)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-09-221-4/+4
| | | | | Change-Id: If30e23466c5b5cfd6a436e8c70d4de2ebca339fc Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-09-211-4/+4
| | | | | Change-Id: Id525b0ac6088171805d342765b9aa105e292d1c0 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* EVR: add possibility for an user to opt-out HW video renderingVladimir Belyavsky2023-09-201-12/+29
| | | | | | | | | | | | | | | | | | | In 'ffmpeg' backend we already have an option to disable HW-texture conversion, introduced in 24cfd4a28a06eb00804265ec87f54e6f5d099fd0 by reading special env. variable QT_DISABLE_HW_TEXTURES_CONVERSION. So we can use the same variable in 'windows' backend as well, to provide a way for users to disable HW texture rendering (aka "zero-copy optimization"), in case of any troubles with it. Task-number: QTBUG-110498 Task-number: QTBUG-117099 Change-Id: Ice2d1f0eddbe98539873fdc147d9e4460f1678a9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit e0197adf8ebc5721efe2bce783eb6245d4dad8fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2276c14ace06a290f070a4afd6269fb7d1c6f1a2)
* Mute warning that always appear on first call to QVideoFrame::toImageJøger Hansegård2023-09-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When calling the QVideoFrame::toImage using the FFmpeg backend, the following warning was always logged: QVideoFrame::toImage: failed to get textures for frame; format: 172 textureConverter null This happens because the textureConverter is null (as evident from the log message). By code inspection, whe see that when called through the QVideoFrame::toImage/qImageFromVideoFrame functions, the textureConverter will always be null. It is only when called through a QVideoWindow that direct HW transfer is enabled. Therefore it makes sense to mute the warning if we don't have a textureConverter. Fixes: QTBUG-116688 Change-Id: I5e2a1c80f24c04b42ccd5f44b7fdeca3c6ada9e4 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit fd9faa342a0c8656741c4197f8d9b62cc0989858) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 51da96e94590ea4aee3f6a5c32311879fb305b31)
* Fix formats conversion in ffmpeg video framesArtem Dyomin2023-09-191-7/+8
| | | | | | | | | | | | | | | | | | | | | We convert frames if ffmpeg avPixelFormat is not directly mapped to qt pixel format. E.g. av pixel format is AV_PIX_FMT_RGBA64, we map it qt format RGBA8888, this means that we should convert AV_PIX_FMT_RGBA64 => AV_PIX_FMT_RGBA to ensure proper data, this mechanism was broken, we got broken rendering outputs for such formats. The patch fixes the conversion. Task-number: QTBUG-107563 Task-number: QTBUG-108403 Change-Id: I952677bf161195267662c3b170271618ce301edf Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit f0c75fafaa6eeed720a287f081ed5c340fbf64cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ab46759ee7b7efd6232c8e74da584542a7bc8835)
* Example: Fix wrong positions of PopupsBartlomiej Moskal2023-09-192-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Declarative-camera example handles Portrait and Landscape states. These states affect popup anchors: - when moving to "MobileLandscape" state, anchors.right was set to parent.left; - when moving to "MobilePortrait" state, anchors.right/anchors.left were not updated; Because of that, popups were moved out of the screen after changing states: Portrait->Landscape->Portrait. This commit sets correct horizontal anchor for Popup (for MobilePortrait state). Pick-to: 6.2 Fixes: QTBUG-114083 Change-Id: I1470c0ead3dbb5248bb77650519b5eef6f8eb6ff Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit d438df6cd24f2a299ce5b8aff91ec82334596bd1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 40719a19171e0cd349903bea148f29aa89d795ee)
* Fix MediaPlayer qml properties position and durationArtem Dyomin2023-09-192-1/+49
| | | | | | | | | | | | | | | | We document MediaPlayer.position and MediaPlayer.duraton as int, but declare the properties as qint64, which is not supported by qml. With the patch we init the correct properties in QQuickMediaPlayer, where required casts are implemented. Task-number: QTBUG-116978 Change-Id: Id9d4d8710986dfa98a014c80b105df96e083e25a Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 2c278d0067f0399defff94c563329cd64e5bff5c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d318d3ca25df6f0f1f49f2a46d902d83a53effeb)
* Update dependencies on '6.5' in qt/qtmultimediaQt Submodule Update Bot2023-09-191-4/+4
| | | | | Change-Id: I0f386383f302067abf66e57363efc99493e759c6 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Minor cleanup of MediaPlayer.source qml implementationArtem Dyomin2023-09-192-3/+3
| | | | | | | | | | | | | | * the property "source" is extra in QMediaPlayer since it's overridden in the qml implementation (QuickMediaPlayer) * make the internal naming consistent with the following change. Change-Id: I2039d86980c6e05fe9c26ac18f6763a5f30a682e Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ef47fb3603f4031ee9cfbc1481724c688cfba033) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8e685754651b73595c2efc78fcee230b76684a4a)
* ffmpeg: add include for timevalSamuli Piippo2023-09-191-0/+2
| | | | | | | | | | | | | | Fix build issue with missing include: src/plugins/multimedia/ffmpeg/qv4l2camera_p.h:149:5: error: 'timeval' does not name a type | 149 | timeval firstFrameTime = {-1, -1}; | | ^~~~~~~ Change-Id: Iaca7514633cdaf439f5f7960cc5191f106c3f15a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 79533b4b45308ca0a345b8ee3e5b1628bb52a6bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 551ad43653ee9ab207be888242900bcfd935ce64)
* Fix memory corruption in audiosink testsArtem Dyomin2023-09-191-1/+1
| | | | | | | | | | | | | IODevice must be removed after audiosink stopped. Fixes: QTBUG-117056 Change-Id: I8e8f705a519750ce6399d0b97a9000f04ac9c6f1 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 57d59a4e2f5c599445dfa3558fcd3247cb69b4d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3a5250038b334778783abf84eea4a91f195f8206)
* Improve and prettify logic and usage of QAudioStateMachineArtem Dyomin2023-09-187-317/+277
| | | | | | | | | | | | | | | | | * both audio state + error now are handled atomically together. * internal synchronization is not need for current purposes; it has been addressed. * use acq/rel and relaxed memory order depending on the situation instead of the default non-optimal sequential order. * add new unit tests and remove some of old ones that are not relevant o the refactoring. Change-Id: I644d8e67c933c0d98556a00d4a614fce879e37c2 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 834e008f4772462c536726b80cb3e4e19b851b53) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7de81980a6f26605a5afc0688072f1243ca36a50)
* Test QVideoFrameFormat::planeCount() functionJøger Hansegård2023-09-181-0/+55
| | | | | | | | | | | | | This test verifies that the planeCount function returns the number of color planes as specified in the Qt documentation for all supported pixel formats. This can help preventing regressions. Task-number: QTBUG-116991 Change-Id: Ic090c9b810d192946b147da39e211a1cc6df6909 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 80b4e25ac8631557bad4645d8faa47bfeac554ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8b432542d8c1a5f82d6fce6db536c4a6d2ee63e5)
* QFFmpegMediaCaptureSession: fix compilation with C++20Marc Mutz2023-09-181-1/+1
| | | | | | | | | | | | | | C++20 deprecated the implicit capture of 'this' in [=]. There's nothing captured except 'this', so just use [this]. Amends 98347e9fd38fada7c681671d629d912de53b7c6d. Pick-to: 6.5.3 Change-Id: I22847c620b8791e1fa41ea5d23998da1e9840471 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 64bc6d242c0ac66f5cc6e66ebf63be9521a8c49e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7ff59937c8545a62752757120015d40504f95ceb)
* Test QVideoFrame::map also with the YUV422P formatJøger Hansegård2023-09-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QVideoFrame::map function was not tested with the YUV422P format. This reveals incorrect calculation of color plane strides and offsets. The YUV422P format is a planar format, where the Y, U, and V components are in separate color planes. The U and V planes are sub-sampled horizontally to half the width of the Y plane, but have the same height as the Y plane. +----------- Y_stride ------------+ | | | Y (8 bit) | height | | U_offset --> +--- U_stride ---+----------------+ | | | U (8 bit) | height | | V_offset --> +--- V_stride ---+ | | | V (8 bit) | height | | +----------------+ Here, we calculate the U and V stride incorrectly as U_stride = Y_stride / 4 (Wrong) It should have been U_stride = Y_stride / 2 (Correct) Also, the V offset is incorrectly calculated as if the U plane was sub- sampled both in width in height: V_offset = Y_stride * height + Y_stride / 2 * height / 2 (Wrong) It shouldhave been V_offset = Y_stride * height + Y_stride / 2 * height (Correct) Task-number: QTBUG-116991 Change-Id: I97e36bf1b7148aa4aed69060d0d0146713edd370 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit c16ef0d7e40a19906a1ac98447da387750350f96) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f41c57bb8c3b1428d7478c01b5d79449d9b57db0)