summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* New API for handling media formats and codecsLars Knoll2021-02-091-0/+16
| | | | | | | | | | | | | | | | Implement a new API for handling media formats and codecs. The API gives better control to discover supported file formats and codecs for encoding and decoding. QMediaRecorder will be moved over to use the new API in a subsequent commit. Android only has stubs implemented currently, as I can't test anything beyond simple compilation. Change-Id: Iff5f044f87c97f83d9151b10d7a78709822e077a Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanup QAudioFormat and friendsLars Knoll2021-02-0917-688/+259
| | | | | | | | | | | | Reduce the amount of available formats, and always use host endianness. Return both sample rate and channel count as a range, not a list of values. Change-Id: I88389b49ace077764fb647f50834236448e55c0e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove codec property from QAudioFormat and relatedLars Knoll2021-01-2912-238/+148
| | | | | | | | | | We only ever supported audio/x-raw (ie. unencoded PCM). Remove the codec properties from QAudioBuffer and QAudioDeviceInfo. Those deal with raw unencoded data and nothing else. Change-Id: I772d1bf624c8515b1d2f696da3f8e5bd5f0cc2f1 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanup resolution and frameRate handlingLars Knoll2021-01-291-1/+2
| | | | | | | | | | | The Camera determines the available resolutions and framerates. There's no point routing requests around that through the backend again, if we can get it from QCameraInfo in the first place. Change-Id: Ie00285811202bf93799155736de149c37561fd31 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QAudioProbe and QVideoProbeLars Knoll2021-01-294-19/+13
| | | | | | | | | | | | | | They worked very inconsistently between platforms (or not at all) and made the implementation quite a bit more complex. Longer term they will get replaced by adding the possibility to have multiple audio/video outputs and implementing monitoring output classes that can deliver QAudioBuffers and QVideoFrames to the app. Change-Id: Ic5b4506e7392d352d33b51f01ff0d5169d7b5129 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for notification when audio devices change on macOSLars Knoll2021-01-292-6/+13
| | | | | | | | | This required some deep digging, as apparently the AVAudioSession doesn't exist on macOS. Change-Id: Ic47c6bacbfc1b0eb1f9f451fc63f7e910ac2953d Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement notifications when the available cameras change for macOSLars Knoll2021-01-292-11/+23
| | | | | | | | | Listen to AVCaptureDeviceWas(Dis)ConnectedNotification notifications and refresh our video device list if we get one of them. Change-Id: Idf79e88e06422d74ab61cb82676c4b82fd1fb387 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make camera switching in the camera example workLars Knoll2021-01-292-7/+7
| | | | | | | | | Tested on macOS: If you have more than one camera installed, you can now switch between them in the example. Change-Id: I6d24c91e1e6c4d51eccc468ec9d5aefa46d9a99c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Provide an Info.plist file for the camera example on macOSLars Knoll2021-01-292-0/+50
| | | | | | | | This required, so that the app can actually run. Change-Id: I967a0b5c23464cfa258f920f83d3a6775e106212 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some compiler warningsLars Knoll2021-01-292-21/+14
| | | | | | Change-Id: Ia25756c626ac2734e33b7a4d537925d302ac2cc3 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid configuration errors when building examplesLars Knoll2021-01-292-3/+0
| | | | | | | | The XML module is not required for the player in any case. Change-Id: Id6572f87403d837f87395496030dea5d5a591dd5 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the supportedMimeTypes() API in QMediaPlayerLars Knoll2021-01-293-11/+0
| | | | | | | | | | | We might want to re-add a "supportedContainerFormats()" method later on, but then implement something that actually works. For now it's probably better if the method is simply gone (it was only working on AVFoundation anyway). Change-Id: I3a19529b35c9d7916df7385b406fcccf19d7f484 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add find modules for 3rd party libraries and fix CMake filesDoris Verria2021-01-282-3/+3
| | | | | | | | | Detect gstreamer, avfoundation, pulseaudio, alsa, mmrenderer and wmf with cmake. Regenerate and adjust configure.cmake and CMakeLists.txt files accordingly. Change-Id: I550136909498d3870e0babd6294652774a718f64 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for selecting the audio output in QMediaPlayerLars Knoll2021-01-222-0/+19
| | | | | | | | | | | | | | | | Add API to select the audio output devive in QMediaPlayer. Implement it where possible. The gstreamer implementation still has issues, on rare occasions, the video stops playing when changing the audio output. There seems to be a race condition somewhere. Windows partially works, but the output device will not get updated after playback started. Change-Id: Ic6e99f7d2e3452915a9870dce45e2e01b079d3c2 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the static methods from QCameraInfoLars Knoll2021-01-221-3/+4
| | | | | | | | Those do now live in QMediaDeviceManager. Change-Id: If7ee7358b290ab783e9c07ede30ad3839328e954 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the static methods from QAudioDeviceInfoLars Knoll2021-01-227-14/+23
| | | | | | | | QMediaDeviceManager now has the information. Change-Id: Iadba41d14c2a8d02d3e8eb3024e30a525ea0e14c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QAudioInputSelectorControlLars Knoll2021-01-221-4/+8
| | | | | | | | | Use the new QMediaDeviceManager to get the list of available audio inputs instead. Simplify the API in QMediaRecorder. Change-Id: I0faf89a083b6778d0e172851fc8fb3f0d7569f54 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-224-5/+7
| | | | | | | | | | | | | | | | | 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>
* Get rid of plugins for MM backendsLars Knoll2021-01-221-35/+37
| | | | | | | | | | There's no need for having those in plugins and we can further remove abstractions and simplify our code if the code is directly compiled into Qt Multimedia. Change-Id: I5267a6a776375d99be8f0de4207f0288d963e620 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QAudioRecorder and the audiocapture pluginLars Knoll2021-01-222-8/+8
| | | | | | | | QMediaRecorder will need to get an audio-only mode instead. Change-Id: I7c4ee72e96de16cc1536f46a59ad18509607fa22 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Provide a proper descriptive name for audio devicesLars Knoll2021-01-223-5/+5
| | | | | | | | deviceName() should probably go and be renamed to id(). Change-Id: I9e04f9194d21036adf21108e3206e77d608cc991 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of the QMediaServiceFeaturesInterfaceLars Knoll2021-01-224-4/+4
| | | | | | | | Replace it by one virtual method in the media player control. Change-Id: I18778d2f56b9af8a16418c30c75c973e54b6add8 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QMediaContentLars Knoll2021-01-224-1/+4
| | | | | | | | | There's no need for it without playlist support in QMediaPlayer. Simply replace it with a QUrl. Change-Id: I28421772b106dad67d321f2c7053558ebfe2a592 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove playlist support from QMediaPlayerLars Knoll2021-01-223-38/+21
| | | | | | | | | | Playlists can be trivially supported on top of QMediaPlayer, as the modified player example shows. There's no need to have all this complexity in QMediaPlayer itself. Change-Id: Iacdd58f7736809606669d150b1ba6046813b2207 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Smaller fixes to the audiooutput exampleLars Knoll2021-01-222-15/+9
| | | | | | Change-Id: I13b55a16c131d7f18728212f4024a81c733b09b4 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* audio/pcm is not a valid mimetypeLars Knoll2021-01-229-12/+12
| | | | | | | | Use audio/x-raw instead, in line with gstreamer. Change-Id: Ib6c27fec7e227d1086750b24f91b4b69ecc870a9 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the gsttools into Qt MultimediaLars Knoll2021-01-222-3/+2
| | | | | | | | | Let's not have a separate helper lib for those. The longer term goal is to get rid of platform specific plugins anyway. Change-Id: I24c9e984c696a4ecfc4693413ad51264f6926afe Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Show the proper device description in the UI, not the IDLars Knoll2021-01-221-1/+2
| | | | | | Change-Id: I2dc44ef333e15e58ee65e1511493527148f24012 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Kill QCameraViewFinderLars Knoll2021-01-222-4/+4
| | | | | | | | | The class didn't do anything beyond what QVideoWidget does, so simply replace it's usage by QVideoWidget. Change-Id: Ieb2931ea2e98f0f289d9d8ee45745ca9e55226fd Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge QAbstractPlanarVideoOutput into QAbstractVideoOutputLars Knoll2021-01-221-1/+1
| | | | | | | | | And while we're at it, sanitize the signature of the virtual map() method. Change-Id: I8feb09e1dd6abdd9f480e202568ff84e6c3c08a9 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Coding style cleanupsLars Knoll2021-01-216-49/+46
| | | | | | | | Do some coding style fixes proposed by clang-tidy. Change-Id: I62584767fd7af2f98ac02653c1105d64188f5554 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Modernize code baseLars Knoll2021-01-218-26/+25
| | | | | | | | | Run clang-tidy over the code base with some code modernization options. Change-Id: I9e74d1225bce333e74224e3b92c02c7e9884d8f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Initial Cmake port for qtmultimediaDoris Verria2021-01-2025-0/+1362
| | | | | | Fixes: QTBUG-89540 Change-Id: I2cf8d0edae2769a53cadd667ab5ac4f9cb754a50 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Be (somewhat more) consistent about the value of piEdward Welbourne2020-09-083-3/+3
| | | | | | | | | Use qmath.h's value for M_PI in shaders (where we can't use M_PI itself), instead of a different hand-rolled value in each. Task-number: QTBUG-58083 Change-Id: I8d3acf0e6f46e2a8cae78c83c122e2b90db31f7c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove AudioEngineVaL Doroshchuk2020-08-039-393/+0
| | | | | | | Task-number: QTBUG-74423 Fixes: QTBUG-84596 Change-Id: I21184ee24cbcbd5091e3466b132301e80bfad7d8 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Update dependencies on 'dev' in qt/qtmultimediaVaL Doroshchuk2020-06-301-1/+0
| | | | | Change-Id: I463d3a1541cee1fcf4a6b6d1e2e1eac85fbfc682 Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-288-14/+14
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I5466906d759a7cc046d77a21e2c647a4b938d070 Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-2511-40/+39
| | | | | | Task-number: QTBUG-84469 Change-Id: Id8d07836a66e4d9223341483bfe0ed251ba2806c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Doc: minor fixes re the camera documentationAndy Shaw2020-06-152-0/+2
| | | | | | Pick-to: 5.15 Change-Id: I8fbff45f5ebae681ab37cfd0ab0acb79eec88864 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Remove Radio supportVaL Doroshchuk2020-06-1012-691/+0
| | | | | | Fixes: QTBUG-84592 Change-Id: I3b9e51689fd542c35cb57cf6c51a141aec3034df Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove QT_DEPRECATED APIVaL Doroshchuk2020-06-041-1/+1
| | | | | | Change-Id: I2aa2334f7408164bf288d82b28e4e6aff9a2503b Fixes: QTBUG-84593 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-05-292-17/+17
|\
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-292-17/+17
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/multimedia/audiodecoder/audiodecoder.cpp examples/multimedia/audiodecoder/main.cpp src/multimedia/playback/qmediaplayer.cpp Change-Id: I8cf1293023c09069745aa3aa6df49b1e0a8a1c22
| | * Remove deprecated QTextStream operators from examplesTopi Reinio2020-04-032-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | Use '\n' instead. Task-number: QTBUG-82532 Change-Id: I01bf8cc3254469514cb0f56f3055b944bac578a2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Examples: Don't use QApplication::desktop()VaL Doroshchuk2020-05-292-2/+3
|/ / | | | | | | | | | | | | Since all API has been removed. Change-Id: I73d00ef273ed3cea2d6aaec0c3e60b78527b1961 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-185-2/+52
|\| | | | | | | Change-Id: I21c230900111b4881b40c451bffc3d5c2101111b
| * Examples: request Android storage permissions when using QStandardPathsAssam Boudjelthia2020-02-274-0/+50
| | | | | | | | | | | | | | | | | | | | Some examples uses QStandardPaths, on Android permissions might need to be explicitly requested to read/write to those paths. Task-number: QTBUG-80717 Change-Id: Ifb52e1c13ed99dcc82fb79a305b64e538596db7c Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Remove usage of QGL* APIsVaL Doroshchuk2020-02-181-2/+2
| | | | | | | | | | | | | | | | | | QOpenGL API should be used instead. Task-number: QTBUG-74409 Fixes: QTBUG-81902 Change-Id: I80d09cba79248451cf211eabd87651301ae18b63 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2019-11-301-2/+4
|\| | | | | | | Change-Id: I840b63f6d6fc8ff974d256e26732bf54937256cc
| * spectrum example: Fix warnings about deprecated QList<T>::toSet()Friedemann Kleint2019-11-251-2/+4
| | | | | | | | | | | | | | | | | | Use std::unique() to obtain a sorted, unique list, fixing: engine.cpp:572:49: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] engine.cpp:579:43: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] Change-Id: I7bc1b5ed4f3bf56897cc1e187833c11cb8560500 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>