summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qaudiosystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor DarwinAudioSink and PulseAudioSink and run CI testArtem Dyomin2023-07-141-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the main change: implemented QAudioStateMachine allowing atomic state changing. The main reasons for creating the state machine: * get rid of state changing race conditions without mutex lockings and contentions. * it's good to have a common approach for audio states changings and notifications. The implementation of the state machine supports synchronization of actions after states toggling (turned off for pulse slink sinse it has own synchronization approach). Other audio sinks and sources might be refactored in the future. - remove a hack in PulseAudioSink with a callback based on QObject::destroyed connection, the hack appeared to cause a memory leak time-to-time. - the main business logic is not changed Testing: - tested manually on linux and macOS - auto tests * Linux QAudioSink tests became working locally and on CI. * macOS tests work locally, on CI only one test is blacklisted due to the issue not related to race conditions. Task-number: QTBUG-113194 Pick-to: 6.5 6.6 Change-Id: I68002c243dea874c4309b14b1fbd7b618392ab1f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Add audio engine warm-up on WindowsPavel Dubsky2023-05-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Current implementation has the following audio problem on Windows: if any of the classes that support audio playback are used (QMediaPlayer or QSoundEffect) sound is cutting off (part of the sound is missing usually beginning). If there're some other applications playing sounds in the system while we try to play our sound then everyting works fine. Apparently this happens due to warm up delays for system audio engine and if there're other applications available they're simply keeping it alive and it's already fully initialized and ready to be used by us when we need it. As a workaround to this problem an unused audio device is created that is fully initialized and set to play (nothing) but is actually present for any subsequently created audio devices that are ready from the start without any delays. Pick-to: 6.5 Task-number: QTBUG-112512 Change-Id: I660a48e8ac1a1ebd1cfb6a9ff76605c3b4742e17 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Include moc_*.cpp files in main QtMM codeArtem Dyomin2022-12-131-0/+19
| | | | | | | | | | | | | | | 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 Pick-to: 6.5 6.4 Change-Id: I6716cef5116769230c36e8d584d9ba6ec40aabb2 Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Remove docs for internal APIsLars Knoll2022-06-161-255/+0
| | | | | | | | | | Those are left-overs from Qt5, mess with qdoc and are simply mirroring the public API. In that sense they don't provide any additional value, so let's get rid of them. Pick-to: 6.4 Change-Id: Ia5092ce31cfb2f7dc2fcecda4eacb1a9b410667f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Doc: Part 1 Fix Qt Multimedia documentation issuesTopi Reinio2021-07-091-30/+30
| | | | | | | | | | | | | TODO: * src/multimedia/audio/qaudiobuffer.cpp:333: (qdoc) warning: Cannot find 'QAudioBuffer::StereoFrame' * multimediaquick/camerafocus.qdoc content refers to now-removed classes * multimediawidgets module doc needs CMake build instructions/snippet * Lots of undocumented parameters, enum values, other minor things Pick-to: 6.2 Change-Id: I4861aa0edf2904e5e43783f5167c5d2ba575b91b Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QAudio::RoleLars Knoll2021-06-161-5/+0
| | | | | | | | | This was only ever implemented to some extent for Android. Remove for now, as it's not really an important feature and can't be implemented properly on many of our platforms. Change-Id: Idc4d21c857380088ca6d10d59a0e05d192899534 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove some outdated internal documentationLars Knoll2021-06-041-64/+0
| | | | | | Change-Id: I95a27d372aae809b1201dbaa0dcd55e9262f1a12 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QAudioOutput to QAudioSinkLars Knoll2021-06-041-27/+27
| | | | | Change-Id: If852737b85d3ca95d55a852a3c50f80a5a09c61e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QAudioInput to QAudioSourceLars Knoll2021-06-041-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | The renaming is a part of some changes coming from an API review that tries to solve the problem of not having API symmetry between QCameraInfo/QCamera and QAudioDeviceInfo where QAudioDevice is missing (so you can't select a nullptr as the input/output device to disable it). One issue is that QAudioInput/QAudioOutput are there for reading and writing low level PCM data from an audio device. They as such are not quite suitable as classes to use together with QMediaPlayer or QMediaCaptureSession, as they allow direct writing of data bypassing the player or capture pipeline. To solve this, we renamve those classes to QAudioSource/Sink (making it a bit more symmetric with QVideoSink). That opens up our API space for a QAudioDevice class avoiding names that feel like they are doing the same thing. The patch also renames things on the backend side to keep API and implementation consistent. Change-Id: I9f6b4892d3eee4e252cb3782e681b0c3824f27e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QAudioInput/Output::periodSize()Lars Knoll2021-05-141-22/+0
| | | | | | | | The periodSize() is badly defined and one does not really need it in the public API. Get rid of it. Change-Id: If95f040d386ac91620c8de4f907cd206b7dad16a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace category in QAudioOutput with an audio roleLars Knoll2021-05-071-0/+5
| | | | | | | | | This makes the API consistent with QMediaPlayer and removes a place where we accepted random strings without knowing what the backend might do with them. Change-Id: Icdd699bc547eacb9250f4e860e23e5f645dc45d8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QAudioInput:: Rename bytesReady to bytesAvailableVolker Hilsheimer2021-05-071-6/+6
| | | | | | | | | And use qsizetype, also for bytesFree and the buffer size APIs. Adjust platform implementations, leave the internal name unchanged for now. Change-Id: I2471090fc5826e992580d557d0d5b545e2be1a0a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move handling of QAudioInput/Output::processedUSecs() to the frontendLars Knoll2021-04-301-10/+0
| | | | | | | | | There's no need to handle this in platform specific code, when we might as well handle it in platform independent code. Change-Id: Ie0cdd49d41f0ecb5b784fc1564af71a106e41ad0 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix part of the tst_qaudioinput failuresLars Knoll2021-04-301-0/+12
| | | | | | Change-Id: I1ba863ef17648e0ce36dfaee4d06b358f2c57705 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the notifyInterval() functionalityLars Knoll2021-04-081-37/+0
| | | | | | | | | This was nothing else than a timer, something you can just as well implement on top of Qt Multimedia if required. Change-Id: I1ef362f1f4ad5a5f85e92bfbb1d73b7710271e5c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a QMediaDeviceInfo class to enumerate input/output devicesLars Knoll2021-01-221-106/+0
| | | | | | | | | | | | | | | | | Use this as the starting point for a new QPA like backend infrastructure. Refactor places that use the device information to use the new infrastructure. Cleanup the audio subsystem part and port it over to the new infrastructure. Android and QNX are not ported yet. Change-Id: I99c459c998f1f05e1c40ad30c700011e41cef533 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use gstreamer for audioLars Knoll2021-01-221-2/+6
| | | | | | | | | | | | | | This is a basic implementation of the audio classes using gstreamer. The code still has bugs and needs further work, but this is good enough for now. With this change, we can remove the alsa/pulseaudio code paths and start getting rid of the plugin architecture as a whole. Change-Id: I5469d13991071ef28d35f63aa3c15539334db15e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the qnx audio plugin into QtMultimediaLars Knoll2021-01-201-0/+4
| | | | | | Change-Id: I09825e7d6f1ed724e7238bd167537fcd72b0aeba Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the android audio code into QtMultimediaLars Knoll2021-01-201-0/+4
| | | | | | Change-Id: I879641ae2dfc8d171afb3cc6db8bad27120dcf7c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move Windows audio code over into Qt MultimediaLars Knoll2021-01-201-0/+4
| | | | | | Change-Id: Ib4f652b49a2d0805a5a44e9f2114b24ab366cdb5 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move coreaudio code into Qt MultimediaLars Knoll2021-01-201-1/+5
| | | | | | Change-Id: I8662d63fb9e17ae2c50ca3095f1baba4d626f293 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Shuffle some code aroundLars Knoll2021-01-201-2/+88
| | | | | | | | | Move the QAudioSystemInterface class into the qaudiosystem.h header file and make that one private. Change-Id: Ib83dceaafcdf418f27264bfa6dbec8a1dafef13b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QAudioSystemPlugin doc visible.Yoann Lopes2017-01-271-3/+0
| | | | | Change-Id: I0384fd6069349f321e60ffedd03834f1c46f634b Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Updated license headersAntti Kokko2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I324f65c61171f36641472964d095d72e452afb3a Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersAntti Kokko2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Update license headers and add new license filesAntti Kokko2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Ied06887225df341064c12bcc14c259ae74116f2e Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: Ia8c1c38aba1544603fada8c414cc856f365fd15b Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Id77334cfb15de096941c88e32d04ca07b4eb4709 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I20e5215108c6ebd5f8474fed5c3665118e4791e6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Ie8cd560b6d9a2c6e552b6be1ad8bc96c80a6535c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix up a few doc issuesMichael Goddard2012-01-171-0/+1
| | | | | | | | | | | | | * lingering references to Mobility * missing group tags on some classes meant they went missing * put classes into functional groups as well (e.g. audio, camera) * added some of the qdoc files to OTHER_FILES so they show up in Creator There are still a lot of warnings since it seems like qdoc is not processing the controls directory. Change-Id: I036f8826ae63f8273b3e649cb32c091d964ce830 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
* Remove antiquated \since lines in docs.Michael Goddard2012-01-161-56/+0
| | | | | | | They aren't useful in the case of QtMultimedia{Kit} Change-Id: If1b0b6625763c85907fb05beb9c440046472ddef Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
* Update year in Nokia copyright headers.Jason McDonald2012-01-121-1/+1
| | | | | | | Update headers from before 2011 that were missed in the previous commit. Change-Id: Ib0fd91a39ffc57117fe01280e34519c3f914fac0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rename QtMultimediaKit to QtMultimedia.Michael Goddard2011-10-071-0/+436
There are a few legacy bits left in place so it passes CI, and then qt5.git etc can be updated. Change-Id: I6b082e50e6958c72fdabc2974992e16d90dafa3a Reviewed-on: http://codereview.qt-project.org/5368 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>