summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/gstreamer/audio/qgstreameraudiosink.cpp
Commit message (Collapse)AuthorAgeFilesLines
* GStreamer: remove unused codeTim Blechmann2024-05-231-376/+0
| | | | | | | | | | `QGStreamerAudioSink` / `QGStreamerAudioSource` are apparently unused, since `QPlatformAudioSink` / `QPlatformAudioSource` are provided by pulseaudio/alsa. Pick-to: 6.5 6.7 Change-Id: I6a65d8459ffbfc1de1de2bf1c830bea52c3cc37c Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: improve tracing of GstMessagesTim Blechmann2024-04-261-6/+1
| | | | | | | | | | | | | 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: rename `QGstAppSrc` to `QGstAppSource`Tim Blechmann2024-04-101-5/+5
| | | | | | | | | | | | | | `QGstXXX` elements tend to be wrappers around `GstXXX` elements. `QGstAppSource` is a bit of a different beast, though, as it's a QObject that manages the underlying element. Renaming it to `QGstAppSource` will free up the name of `QGstAppSrc` for a proper wrapper object. Pick-to: 6.5 6.6 6.7 Change-Id: I73571d623ee7e2388e1f07a5957469329c7b2af0 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: audio - remove installed message filter in dtorTim Blechmann2024-04-051-0/+2
| | | | | | | | | When installing message filters in ctors, we should remove them in dtors, as can potentially lead to use-after-free bugs. Pick-to: 6.5 6.6 6.7 Change-Id: Ie50fdbdbef9a603e66d84211caed1b758d16bebf Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: include cleanupTim Blechmann2024-03-281-8/+8
| | | | | | | | | Pull gstreamer plugin headers in via full path. Also clean up some include paths and remove unnecessary ones. Pick-to: 6.5 6.6 6.7 Change-Id: I24f8795c66c8a750ddb2e6a3ec046672f70090d0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: introduce `createFromDevice`Tim Blechmann2024-03-261-1/+1
| | | | | | | | | | | | `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 6.6 6.7 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>
* GStreamer: use more expressive queue namesTim Blechmann2024-03-071-1/+1
| | | | | | | | This helps debugging, as queue names are setting the thread names. Pick-to: 6.5 6.6 6.7 Change-Id: Id61f3a7f34ac0c7b18a5d4d250b568a620e5b201 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: use more expressive pipeline namesTim Blechmann2024-02-281-1/+1
| | | | | | | | | | Don't overuse the term `pipeline`. Pipeline names are cosmetic, but using the same name makes pipeline debugging more obscure Pick-to: 6.5 6.6 6.7 Change-Id: Idb520b0587ef4f1cbf28ed6a8d0feab2a3d90bbf Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: api cleanups - rework add/link/remove APIsTim Blechmann2024-02-281-1/+1
| | | | | | | | | | * Variadic templates allow us to remove some code duplication * `link`/`unlink` are semantically better as free functions Pick-to: 6.5 6.6 6.7 Change-Id: I8f6aa978e3925f7ccf530474b93b2442040bee1e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io>
* GStreamer: replace gst allocating ctors with factory functionsTim Blechmann2024-02-261-5/+6
| | | | | | | | | | Factory functions are a bit more expressive, tooling-friendly, and make it easier to reason about the code. Pick-to: 6.5 6.6 6.7 Change-Id: I3f42f9b24216c28ff8430a8f7d4fbbc459839fb5 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* gstreamer: separate out handle typesTim Blechmann2024-02-211-13/+9
| | | | | | | | | | We have a few (unique) handles based on QUniqueHandle. Separating them out into a new header and consolidating their use to make the codebase easier to reason about. Pick-to: 6.5 6.6 6.7 Change-Id: Id89150e8178723ff68eb3921eb05a3dd83fe7694 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* gstreamer: gst adaptors - make ctors explicitTim Blechmann2024-02-141-1/+1
| | | | | | | | | | Using explicit constructors to improve code readability and implicit conversion surprise Pick-to: 6.5 6.6 6.7 Change-Id: I188b7c8c2a78556dadb887688580d58deacad7ad Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* gstreamer: adaptors - consistent access to wrapped objectTim Blechmann2024-02-131-1/+1
| | | | | | | | | | | | | * Hiding QGstObjectWrapper::m_object behind a getter function * Prevent mutable access to m_object pointer from derived classes * Improve naming consistency when accessing wrapped gst objects * replace QGstreamerMessage(const QGstStructure &) with QGstStructure::getMessage Pick-to: 6.5 6.6 6.7 Change-Id: I8c028598737c85937675ae370f39fbe51aeb57a2 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Fix behavior of QAudioSink::resume in push modeVolker Hilsheimer2023-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now, a QAudioSink in push mode (ie. started without a QIODevice, but returning a QIODevice buffer that the client has to push data into) transitioned to IdleState when resuming after a suspend, even if there was still data in the buffer or device to play. This resulted in the sink playing audio even though it was in IdleState, and the client not getting notified when the audio data was actually drained (as the stateChanged signal did not get emitted again). Fix this by storing the state in which the sink gets suspended, and restore to that state when resuming. If the sink then runs into an underrun because not enough data is available in the push-buffer, then it will transition to IdleState with UnderrunError later. Implement this consistently in all platform implementations, adjust the test, which previously verified that a push-sink transitions to IdleState when resuming, and change the documentation accordingly. [ChangeLog][QtMutimedia][QAudioSink] Calling QAudioSink::resume() now returns the sink to the state it had when QAudioSink::suspend() was called, no matter whether the sink operates in pull or push mode. Pick-to: 6.5 Change-Id: If0c7fe8629627de814276d629d825e469c998d2d Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Add parent-child relationship on audio sources and sinksPiotr Srebrny2022-11-101-4/+5
| | | | | | | | | | | | | | QAudioSink and QAudioSource must propagate their parents to the platform specific implementation to enable correct operation of the moveToThread function. Furthermore, all QObject elements that are owned by audio sink/source must also establish the parent-child relationship. This mainly affects QTimer's used by the audio sink/sources. Pick-to: 6.4 Fixes: QTBUG-108187 Change-Id: I476a97300a6fb1e0022b2a5570a3803be8fd0a88 Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Validate that gstreamer elements necessary for operation are availablePiotr Srebrny2022-10-101-8/+27
| | | | | | | | | | | | | | | | This patch validates that all elements that are necessary to run the requested functionality are available. Instead of running constructors directly, the patch uses a static create() function for each class. This function first tries to instantiate all necessary GStreamer plugins and then pass them to the class constructor. If some element is missing the function returns an error message describing the element. Pick-to: 6.4 Fixes: QTBUG-106257 Change-Id: I2b9db3f509e9ad5b760fcc251e634a01c687b790 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Use SPDX license identifiersLucie Gérard2022-06-241-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ida08dfe6c84778656e942178c3d39042c9ef1ed2 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix state transition in QGStreamerAudioSink::resume()Axel Spoerl2022-05-241-1/+1
| | | | | | | | | | | Calling resume() resulted in a state transition depending on the audio sink's mode: Transition to ActiveState in pull mode and to IdleState in push mode - even when there was audio playback remaining. This patch always transitions the state to ActiveState. State transitions to IdleState anyway, when the playback has finished. Change-Id: I34146eeab81f5d6629ac90c5153abc3e4e6e77c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Restart pulling data if QIODevice signals readyReadPiotr Srebrny2022-04-261-1/+3
| | | | | | | | | | | | This patch improves handling of the QIODevice protocol by QAudioSink in the pull mode. QAudioSink will restart pulling data when it receives the readyRead signal. If the QIODevice source is atEnd(), QAudioSink will no longer emit UnderrunError, but will switch to IdleState without error. It will first check if the device is open and ask for bytesAvailable before performing read. Change-Id: Idd1d18419f7b77d2df2d76e7b1892194d652d63a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Turn the gstreamer backend into a pluginLars Knoll2022-01-111-0/+395
Change-Id: Iff27c996f2f9432a97a492aee9bdf2e60b131e4e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io>