summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* GStreamer: Video overlay - trivial cleanups6.6Tim Blechmann2024-04-041-16/+16
| | | | | | | | | | | | | | * use unicode strings to avoid unnecessary ascii/unicode conversions * move semantics * capture by const ref in range-based for Pick-to: 6.5 Change-Id: Ia32713731a315b1887c322261bff33dd1bf4001a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit cce20d24bd00f3f6c486d0a3291596fe52426af4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ae4f1169a01871545900218fe0ad585759bbe81c)
* Tighten ownership of video buffers in QVideoFrameJøger Hansegård2024-04-042-6/+4
| | | | | | | | | | | | | Switch to std::unique_ptr to prevent future lifetime management bugs Task-number: QTBUG-122099 Pick-to: 6.5 Change-Id: I453915a135e07dd175bf3632724a3d7d8200b47d Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 40410efc3df4d5ab8b47c8121313a74231dd7061) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c2ba4e6cc2437bcd92ec6cc40b427d3db8ab43e1)
* GStreamer: fix nativeSize handlingTim Blechmann2024-04-043-3/+16
| | | | | | | | | | | | | | In `parseStreamsAndMetadata` we may not have a `QVideoSink` set, but still use a fake video sink. So we should not propagate the native size hint directly, but apply it to the `QGstreamerVideoOutput`. Pick-to: 6.5 Change-Id: I9a3667185f0bf7c3a7547235f1fa61469feb1548 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 8de19600c9ddc9dd2a44a2031885323399b185a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b2f80e7a87078ed96b344def185ed29812e4c815)
* GStreamer: fix playbin to pipeline castTim Blechmann2024-04-043-3/+8
| | | | | | | | | | | | we need to install the `pipeline-private` handler if we want to install message filters Pick-to: 6.5 Change-Id: Ie423abc43fb835273877866e2916f0d8f99f0c2e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 72b13de749fb94520fb211b81c3d70a27d99cca0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 9a203acf0de715056392f4d21c6988f5775d4751)
* GStreamer: fix assertion failure in QGstreamerMediaCaptureTim Blechmann2024-04-032-2/+1
| | | | | | | | | | | | | we don't need to sync the state with the parent element, considering that we're running inside a `modifyPipelineWhileNotRunning` context. Pick-to: 6.5 Change-Id: I9e57f621c70da80ed5b4e91143183c91fe081493 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit ccf3c2296c24b82960c9f036c83885964c560638) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit dba66bea72f133760f85283d90497ce5a153ef71)
* unit tests: silence unused variable warningTim Blechmann2024-04-031-1/+1
| | | | | | | | | | Pick-to: 6.5 Change-Id: I39ec9f460983cdf4a546a51611e40515b435e29d Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit b441cd25a3f3b5ce4b81db41dedcb100e089f993) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c0eb9a309d4e015c484345c779e35b9f29d3c320)
* GStreamer: process messages immediatelyTim Blechmann2024-04-031-14/+3
| | | | | | | | | | | | | | GStreamer delivers messages on the application thread, dispatching events over a queue will could cause application logic to be reordered, causing unit test failures Task-number: QTBUG-123905 Pick-to: 6.5 Change-Id: I2da313cde5a814d93337d532f8beb679a66c4fb1 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit a4a4221d4b71cd8b97066be27b9c6596c3ce77e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 137e2188b0702fa1b9259c0eec1302a4d4fa5543)
* GStreamer: improve pipeline modification codeTim Blechmann2024-04-039-60/+40
| | | | | | | | | | | | | | | | | * avoid setPipeline in `QGstreamerCamera` and `QGstreamerAudioOutput`, since we now can obtain the pipeline from the output/camera elements * introduce static `modifyPipelineWhileNotRunning` helper to `QGstPipeline` * Ensure that `setAudioDevice` only modifies the pipeline while the pipeline is not running Task-number: QTBUG-119535 Pick-to: 6.5 Change-Id: Iad4cc887d8d2acddea4cf0c515545588558b652f Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit e0ff2ec5c8f8517f5cb55f3c2596abe262350ffc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5b3803a70eed01d059a0a161da9925684983c4b2)
* Move FFmpeg VideoEncoder to its own filesJøger Hansegård2024-04-025-122/+162
| | | | | | | | | | | | | This helps readability because qffmpegvideoencoder_p.h file is quite big and contains multiple classes. Task-number: QTBUG-121792 Pick-to: 6.5 Change-Id: Ia7295daa879375547e0b4db37c270f9aad768fc3 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit ba1da65044863c79a23bb21ea0126de572d917cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0e9a4bc4c83f4c4d1597dbd65e2a54d52a432edc)
* Move FFmpeg AudioEncoder class to its own filesJøger Hansegård2024-04-025-236/+280
| | | | | | | | | | | | | This helps readability because the qffmpegrecordingengine_p.h file is quite big. Task-number: QTBUG-121792 Pick-to: 6.5 Change-Id: Icc693073e16239076a250cb1ad0de21562c59375 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit f232089960ce56d1abe1524e0d63f175c78a71e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 1bda134e6a0409dcd2e4952eac5f3a41d99cc706)
* Move FFmpeg::Muxer into its own fileJøger Hansegård2024-04-025-86/+119
| | | | | | | | | | | | | This helps readability because the qffmpegrecordingengine_p.h file is quite big. Task-number: QTBUG-121792 Pick-to: 6.5 Change-Id: Ibb8a51937622f44820e7f0b46b32f20f47225216 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 1e69b9774b65d43ca8c6197f8c5031c5955fdcc7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a149227f76911e6953636ec07a59525acb34cfb6)
* Rename FFmpeg Encoder class to RecordingEngineJøger Hansegård2024-04-025-42/+42
| | | | | | | | | | | | This better describes what the class is. Task-number: QTBUG-121792 Pick-to: 6.5 Change-Id: I98469296f9724ac50e9b19ec804d690ffde68816 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit b8feb024a270e70d7193380a330c074209ac0f0d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fce1e3905fa31360584134b3e1ba28289a892ccf)
* Move files FFmpeg media recording files to recordingengine folderJøger Hansegård2024-04-0212-6/+13
| | | | | | | | | | | | | | Group files related to FFmpeg media recording into a separate directory to make it easier to understand the structure of the FFmpeg media backend. Task-number: QTBUG-121792 Pick-to: 6.5 Change-Id: I2fd08e5a62e799171c263df5ee3546e05be1f71d Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 262153cb3f2de501d7362adec4c019bfd7490ee5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5d20620c213976c7c57ca0a2ead60ffef2bb93b4)
* Document deployment of dynamically linked FFmpeg on WindowsJøger Hansegård2024-04-011-0/+13
| | | | | | | | | | | | | With latest versions of Qt, FFmpeg is dynamically linked into the FFmpeg multimedia backend. This patch documents how this change impacts deployment of Qt applications that uses this backend. Pick-to: 6.5 Change-Id: I3d374bebc1ee069ce6f170e669a230fc1dfaf391 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit e99bc63f3035440750c59038850de11061900df9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e47eca514d26cbca8af78ae8204a5ca02f4709ae)
* GStreamer - log gstreamer versionTim Blechmann2024-04-011-0/+5
| | | | | | | | | | | small quality of life improvement Pick-to: 6.5 Change-Id: Idabcfbe2f760d532adaff708c7b04eccb1129bbf Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 85622ccaa1c0c2345a439118c18faf5e3a707686) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2f6bcfd7fa5a7d7f2d84735a353fe60ee4378cbd)
* GStreamer: Adapters - use qGstXXXCastTim Blechmann2024-03-302-11/+47
| | | | | | | | | | | | | | Our cast methods are a bit more typesafe than what gstreamer has to offer. Pick-to: 6.5 Change-Id: I70eb6cc1f94246783ee80a13f3622ab5cc56e432 Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 2e767cabc1fb0c597cd154078f6ae2aa054fa32e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d7bde2df6ec4a45a0ca8e3d1ecd2dfa42789b5a5)
* Correctly initialize QAbstractVideoBuffer::m_rhiVolker Krause2024-03-301-4/+5
| | | | | | | | | | | | This fixes a regression introduced in a443ea329f681ee which broke mapping and reading video frame content. Pick-to: 6.5 Change-Id: I45f862a25494d3161fc118ce593ab3e0a04b2955 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit e1b4840eb488165dcd3b1770aa7a64e0077e1907) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fb3739afd20e8d60891425e4457939f88cacd2f1)
* CMake: separate GStreamer plugin into unit-testable Core libraryTim Blechmann2024-03-301-9/+20
| | | | | | | | | | | | | | | We cannot unit-test plugin code, so we separate the plugin entry point and and implementation into two separate targets. This allows us to link the static library into unit tests. Pick-to: 6.5 Change-Id: I4d579caf90a3912258c7979e8ee4771bc68329a9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6351b52b24ec5c8fa37abb4d394a4ca40d6fcf51) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3667072b27fd9bc2a2c165b89af0a7e314da1c8a) Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* MFVideoRendererControl: fix AutoMoc warningVladimir Belyavsky2024-03-291-2/+0
| | | | | | | | | | | | | Just remove redundant inclusion of "mfvideorenderercontrol.moc" file that was forgotten in 5941227b5e135d9cc4f1f9228f4d7649824bf382 change. Pick-to: 6.5 Change-Id: I697d9db66b3553b5d66c9ca1523984150db97fdb Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit d15a5cb65254e800aefb87ff86fd19f0f99d83ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 83083dccc7b177faffd3a775670c8cd4a8ce9b6b)
* GStreamer: remove unused function declarationTim Blechmann2024-03-291-1/+0
| | | | | | | | | Pick-to: 6.5 Change-Id: I00023271d1675182f8ffd5f9f61ca51ee39f5e55 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit c1f53a3c8e225101c2636655af3fe0c8c0420f8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit cfe4882a82b287d6d9f5445171490b099c689818)
* GStreamer: clang-tidy cleanup - default initialize membersTim Blechmann2024-03-294-5/+5
| | | | | | | | | | | applying cppcoreguidelines-pro-type-member-init Pick-to: 6.5 Change-Id: I4cc0ed021869b663643343bf1db7d9bd7d42f427 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit ee578a5f9b2fa9b437021d07daa68cd4ca34b3fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2e1413e51d24feedb53d914abf833efffba8f30b)
* GStreamer: remove relic of restarting playback after new source is setTim Blechmann2024-03-292-11/+4
| | | | | | | | | | | | | | | | `QGstreamerMediaPlayer::setMedia` tried to restart the playback state if the playback was running before setting them media. However `QMediaPlayer::setSource` explicitly stops the playback. Removing the code and documenting the setSource behavior in the public documentation Pick-to: 6.5 Change-Id: I03722afc2bb6f87f79c005a3b64ca7e036ac27f2 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit b915eb159537bfa85bbeb760b032772cbddf1f59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fe857a9f27a4eb3b99ad3a70ba00abd04d3fb252)
* GStreamer: improve naming consistency for environment variablesTim Blechmann2024-03-291-3/+3
| | | | | | | | | | | Pick-to: 6.5 Change-Id: Ieb9ce619a7c5eb8c370e3188f8fe69db308d736b Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit 6def89408267aa46ec5e0c311f4c5da958aee18b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 15ec1c592e63aa0cf177b48190ec16a6c78c334f)
* GStreamer: make all reference counting explicitTim Blechmann2024-03-298-15/+22
| | | | | | | | | | | | When constructing a wrapper object from a gstreamer pointer, we should always use the explicit reference counting argument. Pick-to: 6.5 Change-Id: I1a5d589ea48e242b4350ef237312b9e85828c870 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 157185521ddf4d1ebeefcdd3ebc82319dd88f786) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ee4776f5c3ea153ec2ca489b2a45032ea5083896)
* GStreamer: use glib to resolve/reference `QGstPipelinePrivate`Tim Blechmann2024-03-295-48/+98
| | | | | | | | | | | | | | We attach `QGstPipelinePrivate` to the the `QGstPipeline`, which means that we cannot cast from base classes to the pipeline. So we rework this code a bit to use glib's `g_object_set_data` to attach the private data to pipelines constructed by us. Pick-to: 6.5 Change-Id: I09e60af4ef566d87483f318ac6b9b573325ed155 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 63d629446ecd2a2c8e0ee86c4c363455d454f6f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 147c77a3c01514e96305c076db8068da927895ae)
* Tie Qt Multimedia backend lifetime to Qt Application lifetimeJøger Hansegård2024-03-286-11/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses a specialized application static variable to tie backend lifetime to the Qt application lifetime if an application is present. This ensures that system resources are released before static destruction, and prevents abrupt termination on Windows during static destruction. This is according to Windows Media Foundation's documentation that states that WMF classes shall not be released during static destruction. If Qt Multimedia features are used without a Qt Application object, the lifetime of the multimedia backend remains as before, and destruction takes place as part of static destruction. As a side effect, this change fixes a crash if Qt Multimedia features are used after recreating the Qt Application. Fixes: QTBUG-120198 Pick-to: 6.5 Change-Id: I570743d6462e27630d8f29dc60cfa414c8cbc17d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 7efc9f9b6d058b6e7e6c768b94abf602719b31b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f187f750734497f27d934b54293d3f513d0dfbca)
* GStreamer: separate plugin entry point into separate sourceTim Blechmann2024-03-283-16/+29
| | | | | | | | | Pick-to: 6.5 Change-Id: I3e8ddc3ab806df593fe1163ca46c8b9b68fb7d9e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 8cff735306de8bd9b159744d88c4ae6593d9f28d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5a46233bf410b6cbb4c1500fed37315c310f4240)
* GStreamer: fix deprecation warningsTim Blechmann2024-03-282-2/+3
| | | | | | | | | | | Implicit conversion from `const char*` seems to be deprecated. Pick-to: 6.5 Change-Id: I00ae957d22f7d50696a0b10ccfd5746eddcc67ae Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 1e7de0a8ffed840b8a6d7749fd92e4372cc18bf8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit faacd06b61dadb82369eded51344b664892f88f4)
* GStreamer: include cleanupTim Blechmann2024-03-2846-183/+179
| | | | | | | | | | | | Pull gstreamer plugin headers in via full path. Also clean up some include paths and remove unnecessary ones. Pick-to: 6.5 Change-Id: I24f8795c66c8a750ddb2e6a3ec046672f70090d0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 8775acf7ecdc795517c29b939a3f32a38609073a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit dfbbd20114352fd4bbd54dbbe4e64e39e1c2a35b)
* Document that FFmpeg 6.1.1 is used by the FFmpeg multimedia backendJøger Hansegård2024-03-271-1/+1
| | | | | | | | | Pick-to: 6.5 Change-Id: I93a6a4f24fa5901babb8075aaffb640a66f245aa Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit c47cd30cbafcf9fcceeacedea97345a1868c0e3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 1c2ec787d6ff191debdefa1b55029087b5e7b7c0)
* Plugins - don't export internal classesTim Blechmann2024-03-2714-26/+23
| | | | | | | | | | | | | | | Plugins are MODULEs not SHARED libraries in cmake terminology and thus cannot be linked, but instead their intention is to be just loaded dynamically. Therefore we remove all `Q_MULTIMEDIA_EXPORT` statements on function definitions which are not the plugin entry points. Pick-to: 6.5 Change-Id: Ibc246b51a8183d42444cd956254e4452a014046f Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit c016e3e8b3364d0f7d152efbe55fc8e66717a156) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 07a2cbf0172bac068ec64d2bbf7a46e6209c5406)
* GStreamer: introduce `createFromDevice`Tim Blechmann2024-03-267-17/+24
| | | | | | | | | | | | | | | `createFromDevice` internally takes care of the glib reference count. This should fix a reference count error in the non-pulseaudio configuration. Pick-to: 6.5 Change-Id: I28871677c331fb6a40052694de441e61dc3e16a1 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit 07788a4e3d1fe842506cbced237d280cfd4e2386) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c660888d487fd6a0f33bda858a48b964cc03d764)
* FFMPEG: fix name clashed in unity buildsTim Blechmann2024-03-261-0/+4
| | | | | | | | | | | | | | libavformat and AVFoundation clash Pick-to: 6.5 Change-Id: Ifca94efd75210f05c8910c545c53acea1af25e26 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit bc35ebb78d96d0e144162922ec310060750ef3b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 1c0d0ea72f13a38b174a8ed9eacd06a8e7fd2ea1)
* Test that QAudioDecoder emits error when source has no audio trackJøger Hansegård2024-03-262-4/+19
| | | | | | | | | | | | | This patch adds a test that verifies that QAudioDecoder is well behaved when no audio track is present in the input media file. Task-number: QTBUG-123597 Pick-to: 6.5 Change-Id: Iecf745cab3b0cd70506399c06d9a7fdd15d29e8a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit cd8330b98314faf1bbdd069e5c74e0e97765260b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 301900232721c035f3caad2d5146f940abf0fe15)
* CMake: use gstreamer "feature" only when egl/gstreamer_gl are availableTim Blechmann2024-03-252-7/+8
| | | | | | | | | | | | | | | The GStreamer plugin requires gstreamer_gl/egl for video output. Tying the CMake feature to both gstreamer and gstreamer_gl would allow devs to compile the gstreamer plugin on all platforms where the implementation is reasonably feature-complete. Pick-to: 6.5 Change-Id: I51162ade8e167dfc6ea4e2117609d9ef39b8de4d Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit cccaeb77fcfe927d1db9a283288d8862ac625ddc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d63bc4cf1fe98c2e2ef944dcf3e70c34608fe201)
* Add some auto tests for QMaybeJøger Hansegård2024-03-253-0/+134
| | | | | | | | | | | | Having tests helps keeping QMaybe maintainable and with documented requirements. Pick-to: 6.5 Change-Id: If5bcd320d811e7698f66523a7180a95b94759e02 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 6af4c86b2004cf539d8344b09d38abf515e964e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit eb7e0047ecaff3ff2a8c329a442f3f5670663025)
* GStreamer: cast - fix nullptr supportTim Blechmann2024-03-251-2/+3
| | | | | | | | | | | | | Don't preform runtime type check on nullptr. Pick-to: 6.5 Change-Id: I2359b2c77bc534dcacf3119785146f215bc8ec3d Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 483e128a0ef661f97dcfa5797b36c3aea8d2cd01) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b9a03fd0b4da51ac9e4310c452c1cb7658359d55)
* Check audio streams in QAudioDecoder upon startArtem Dyomin2024-03-251-3/+8
| | | | | | | | | | Fixes: QTBUG-123597 Pick-to: 6.5 Change-Id: Ic4dbed477beaa46b280a5d7ff1dc8f9ecd39b576 Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 5d2bdf00927771b74c407f7ffa958eb37b1f5e89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fbcbdf3e3b78ec98ca933549596fdef636be3da4)
* Video - rename ALIGN to QT_MEDIA_ALIGNTim Blechmann2024-03-254-6/+6
| | | | | | | | | | | | | ALIGN clashes with the macos macro of the same name as defined in `usr/include/i386/param.h` Pick-to: 6.5 Change-Id: I58ca673f38c75f1976d96dbb72bb494ae7e8036e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit 540c6fab72b6c56fafa5b4263bc6e913580c99cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6ed0e5452beebeb1606a56259c15d08ab63051ad)
* GStreamer - Set Buffering Property in uridecodebinJithin Nair2024-03-251-0/+2
| | | | | | | | | | | | | | | | | Buffering messages was not updated since elements was not posting them on the bus. Forced the uridecodebin & decodebin to post buffering messages by setting use-buffering property in both bins. Task-number: QTBUG-123459 Pick-to: 6.5 Change-Id: I9c4ab6fb2f64bd3652a8bf5f6c80239feab44f5d Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org> (cherry picked from commit 45366033234880be0925c5c1e657c873b3fc09bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 55cc5c503b62ac846f0effd79086e70b5b58ecc3)
* Examples: fix warning on changing device in AudioSource exampleVladimir Belyavsky2024-03-221-1/+1
| | | | | | | | | | | | | | | | There was a warning "QIODevice::write (AudioInfo): device not open" that appeared every time on changing the audio input device. To fix this, we just need to stop the audio source (m_audioInput) before closing the I/O device (m_audioInfo). Fixes: QTBUG-123045 Pick-to: 6.5 Change-Id: I499d4e5d96e4076ab3c71444a27153b9d7642b02 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 2b14f2e4a96ce7cadb4d7a768172cdec09be9d6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit def8747372d137baccdf5569fb17e93f32cf5d18)
* FFmpegVideoEncoder: Process frames also in pause stateBartlomiej Moskal2024-03-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | Remove the pause flag check from processOne() method in QVideoEncoder. When pause flag is set, no more frames will be added to the queue in addFrame method anyway. That is why additional check in processOne method is not needed and we can allow to handle already delivered frames. This removal fixes a possible infinity loop that occurs when recording is stopped in the pause state. This will happen when m_videoFrameQueue is not empty. In the cleanup method we will try to process all frames, but we will not process frames due to the pause state. Pick-to: 6.5 Fixes: QTBUG-122184 Change-Id: I1cc307bb140b934d130bae08a59fd61f08111b84 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 653d196a1c77aba2f80566c114f4646af676f69e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f56950898be94445859c16c92374c8ebc3d2dcdb)
* Use std::addressof to get the address of QMaybe wrapped typeJøger Hansegård2024-03-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Using QMaybe with types that overloads operator& can have unintended effects because QMaybe::operator-> would call the overload. This could cause problems with types such as WRL::ComPtr which resets its pointer when taking its address. To ensure that we get the address of the instance, we should use std::addressof instead of calling operator& to get the wrapped object's address. This fixes an issue where QMaybe<ComPtr> resets the COM pointer and returns nullptr when attempting to extract the raw interface pointer like this: QMaybe<ComPtr<Interface>, HRESULT> instance = foo(); Interface *rawIf = instance->Get(); // Reset instance and return 0 Pick-to: 6.5 Change-Id: I544dec6dc0cf59c2b3a46fe6d9ebbf08aac80737 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 3367b137e3aeec76b7edb7d14bde1a6cec7a64f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 08b52a310244d299dddf01128493bdadc32325cf)
* Reset error when calling QPulseAudioSource::reset()Mikko Hallamaa2024-03-211-1/+2
| | | | | | | | | | | | | | | | QPulseAudioSource::reset() called stop() which changes the state to Stopped without resetting any possible error and then calls close(). This patch changes reset() to reset the error to NoError, and then calls close(). This behavior is the same as in QPulseAudioSink::reset(). Pick-to: 6.5 Change-Id: If5e1a189812fbbfbd39e43948bb5b07955997224 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit a39d9c31245cc42f25da0886c7d28d4f763707bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d452a99af057bf354a48e7ba1ddecbeb704cf5ec)
* PulseAudio: Clean up readable byte amount logicMikko Hallamaa2024-03-212-30/+16
| | | | | | | | | | | | | | This patch cleans up the logic in QPulseAudioSource by calling pa_stream_readable_size() directly in bytesReady() instead of keeping around a member variable that needs to be kept updated. Pick-to: 6.5 Change-Id: Ia8de889ff0805f43b302745cf3b5f1c98b68b71f Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 33f03b352ea5cf0a533dcc131080dbf71bd6fbef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b56ca7e1b8c2f877d187d8d6a207fe2e0ec2ba56)
* Use QAudioStateMachine for state handling in PulseAudio sourceMikko Hallamaa2024-03-212-80/+34
| | | | | | | | | | | | | | | | | The PulseAudio source used internal variables for state and error updates, which are liable to data races if accessed from different threads without protection. This patch updates this to use QAudioStateMachine that enables atomic state transitions to prevent possible data races. Pick-to: 6.5 Change-Id: Ia24399184765a9852e665224ee9678c99f1c92e0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit c56b9ab3e08f72fb2ac9db0d5342d3df44198143) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c5182bbe46a479795e818ebb940c116f7224031d)
* GStreamer: fill context infoTim Blechmann2024-03-211-0/+8
| | | | | | | | | | | | | | | | GStreamer warns that: The application may be missing a call to gst_gl_context_fill_info() So we do what gstreamer asks from us. Pick-to: 6.5 Change-Id: Ic90d4d2c9f2c2b4b698aa2da0f5ab10de1525add Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> (cherry picked from commit 49c066e39afb69e9042af4df1cc865aad47e6a20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 04efb04465aad960c7816499c1ca1ce3e72c3a3f)
* Fix mapping of QVideoFrame in write modeArtem Dyomin2024-03-214-7/+102
| | | | | | | | | | | | | | | | | | | After mapping of QVideoFrame with a write mode, we get this: - the hw frame in QFFmpegVideoBuffer is not valid anymore - the cached QImage is not valid anymore The implemented approach might be revisited if we decide to implement copy-on-modify idiom for QVideoFrame instead of buffer sharing. Fixes: QTBUG-123131 Pick-to: 6.5 Change-Id: I1c1662c5a4ac6f5bffa2cea8e36c4fbf60c20f64 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 537fae96a9fabec2203460e786ff62075cf43bb8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fab367331f0f781be8ab0af62dfd8226013e5a3a)
* Use QBasicTimer in QPulseAudioSourceMikko Hallamaa2024-03-202-8/+16
| | | | | | | | | | | | | Replace QTimer with the more light-weight QBasicTimer in QPulseAudioSource. Pick-to: 6.5 Change-Id: I47a10c5cbed1a5fcd8c771b190faf3112ca0ad93 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit f1720f9bc4b30416eda384b88adfa304ef2ae180) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3ae4d0b080693626efec68197ac7ff1f8a081e99)
* Name IO device writing lambda in MediaCaptureSessionMikko Hallamaa2024-03-201-18/+16
| | | | | | | | | | | | | The lambda used to push data to the audio sink in MediaCaptureSession was unnamed. This patch gives it a descriptive name. Pick-to: 6.5 Change-Id: I86bd85836cb65503d25b849522526637e09f0c6a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit 6289bb03401224f3139d43add0cda166ba23e3eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a7baacccae71c7175825d2cc01d7c64f93972f57)