summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* WMF: make it possible to build only the audio decode serviceYoann Lopes2016-11-0213-14/+26
| | | | | | | | | | | | The WMF plugin can now be built without the media player service. That enables the audio decode service even when DirectShow is used as media player backend. The default configuration on Windows is now: Camera, MediaPlayer -> DirectShow AudioDecode -> WMF Change-Id: Ic6f3c85ed849e0c603719cfb03794e6abd2d52fa Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* WindowsAudio: fix volume when using multiple QAudioOutputsYoann Lopes2016-11-021-13/+10
| | | | | | | | | | | | | | | We were using Windows' waveOutSetVolume() function to set the volume on an audio stream. That function applies the volume on the sound device and not on a particular stream, meaning all QAudioOutputs and QSoundEffects were sharing the same volume. All Qt audio streams are supposed to have their volume controllable separately; in order to respect that, we now apply the volume ourselves on the data before writing it to the device. Task-number: QTBUG-43765 Task-number: QTBUG-48049 Change-Id: I407588ca40cf4216454431fe3e6ce4d8740f391d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add missing Q_DECL_CONSTEXPRChristian Strømme2016-11-011-6/+4
| | | | | | | | The functions were missing the constexpr specifier, and since the code was touched, the equality check was also updated to use qFuzzyCompare. Change-Id: Ib06c5e7927bef0ebe513a411e2bb79b433e3ccd7 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Mark AndroidCameraInfo as movableChristian Strømme2016-11-011-0/+1
| | | | | Change-Id: I00b8444e00cbf3dc0d4a7c2ff8b83e217a8966f5 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Change PLUGIN_DISABLE_MMAP to PLUGIN_MMAPJames McDonnell2016-10-312-2/+2
| | | | | | | | | | | PLUGIN_DISABLE_MMAP has been deprecated since 6.6.0 and it was recently removed from 7.0.0. PLUGIN_MMAP is favored as of 6.6.0. The DISABLE in the value name is unnecessary because the value is only used to call a function whose name already indicates that's how it'll be used. Change-Id: Ie714f0fe8e874bbd1c7d8ee998f5a65f38f24fd2 Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Android: emit mediaStatus changes before state changesYoann Lopes2016-10-281-3/+3
| | | | | | | | | This makes sure all mediaStatus changes are emitted, even when some action is done on the media player as a result of a state change. Task-number: QTBUG-49578 Change-Id: I89594da2c2efc71103a7aa64f598eea4097425f6 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* WMF: fix incorrect pointer dereferenceYoann Lopes2016-10-211-1/+1
| | | | | | Task-number: QTBUG-56134 Change-Id: I9c8799a96ff08f2657e4879dfbe14de3bfe3d25f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Reduce size of QMediaPlayerPrivateChristian Stromme2016-10-191-10/+10
| | | | | | | | Rearranged the data members to reduce the object size (-16 bytes on 64 bit systems). Change-Id: I0f285fafc42633fff42eba1ddc68c6f9bee2cec8 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Doc: Add a \brief for the QMediaMetaData namespaceLeena Miettinen2016-10-071-1/+1
| | | | | | | ...to display the docs for it properly in tables. Change-Id: Ib719d2ef7278f44a25f9101e1629e558901bba5d Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* GStreamer: emit mediaStatus changes before state changesYoann Lopes2016-10-061-6/+6
| | | | | | | | | This makes sure all mediaStatus changes are emitted, even when some action is done on the media player as a result of a state change. Task-number: QTBUG-49578 Change-Id: I60153cd8e1d665797a25549ab81afcfb553ce2cc Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Doc: Add comment about stream requirementsChristian Strømme2016-09-281-2/+2
| | | | | Change-Id: I92e16722dc5cc8df23cf4ed0d048a0d2a23956eb Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Remove useless castChristian Strømme2016-09-281-1/+1
| | | | | | | Casting to same type. Change-Id: I93935b75edac56c958d0669eff216b9dcf16a153 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Clamp out-of-range volume values in QAudioInput and QAudioOutputYoann Lopes2016-09-282-2/+4
| | | | | Change-Id: I6da76524533e16f6987fad6029b1f42960972383 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Clamp volume in QMediaRecorder and QSoundEffectYoann Lopes2016-09-272-6/+4
| | | | | Change-Id: Ie61c33592873b7e5a2ed1b8ccf3386b20edb2cef Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* AVFoundation: fix metadata controlYoann Lopes2016-09-272-53/+59
| | | | | | | | Correctly emit metaDataAvailableChanged and metaDataChanged signals. Task-number: QTBUG-46368 Change-Id: Ic79acd519b47f4d864fa335c8f75758fe9185c39 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* GStreamer: print a warning when the camerabin plugin is missingYoann Lopes2016-09-211-1/+12
| | | | | | | | | Don't create the camera service when the camerabin plugin is not available on the system and print a warning. Task-number: QTBUG-50775 Change-Id: I56c7e6297bebe4b90596cb3c0323f1d38231bceb Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* PulseAudio: make code more robustYoann Lopes2016-09-212-31/+95
| | | | | | | | | | Some asynchronous operations return a pa_operation pointer, which can be null if the operation fails. In some cases we were not checking that the returned object was non null, leading to some asserts being raised in pa_operation_unref. Change-Id: Iff1cc67b7f79b758fa81d79e658debb1d737b29f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Remove unnecessary import statement in QML snippetYoann Lopes2016-09-201-3/+0
| | | | | Change-Id: I1f34e52c4a8f72a91b1c673fe7e152335d8a0ade Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* DirectShow: support MJPEG camerasYoann Lopes2016-09-161-0/+2
| | | | | | | | | Map MEDIASUBTYPE_MJPG to QVideoFrame::Format_Jpeg, which makes sure that cameras that only support MJPEG are configured properly. Task-number: QTBUG-55359 Change-Id: I732c56afc51109aba0231c8537f795e8d276c194 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* fix documentation for QML PlaylistJochen Seemann2016-09-021-7/+7
| | | | | | | | | Some signals for QDeclarativePlaylist were wrongly tagged to QDeclarativeAudio. Task-number: QTBUG-55007 Change-Id: I16185f74768b45115f19c049ec1261d1d3dadf5c Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Optimize QMediaPlaylistPrivate::readItems()Yoann Lopes2016-08-311-2/+4
| | | | | | | | | | When reading playlist items from a file, pass them to the playlist backend all at once rather than one by one. This might be faster depending on the implementation. Task-number: QTBUG-54849 Change-Id: I57acdc68604ee56fe5d7615ba0a72655e668443f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* OpenSL ES: Fix EOS handlingChristian Strømme2016-08-251-2/+11
| | | | | | | This fixes the remaining auto tests that were failing. Change-Id: I3b31263e7912422407cb98b4bf2db7080bcfc1a8 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* OpenSL ES: Release audio device source in push modeChristian Strømme2016-08-251-0/+6
| | | | | | | | | The IO device was leaking in push mode, as a new one was created each time start was called. Change-Id: I78bb45e9e4e801772e88104b11d7baedc9e91ba8 Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* OpenSL ES: Stop the device if it's not stopped alreadyChristian Strømme2016-08-241-0/+7
| | | | | | Change-Id: I4a9906d2d5aa1eaf8e67773f79ca217150a53ce5 Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* OpenSL ES: Reset states before startingChristian Strømme2016-08-241-0/+4
| | | | | | | | Some of the state variables were not reset correctly. Change-Id: I22113072320dd1812529c598cda1a5f6cc8c780b Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* DirectShow: Restore negotiation of sample type in the io filterChristian Stromme2016-08-233-11/+77
| | | | | | | | | | | This functionality was removed in d44a327da4a956f62cc0d51, but is still needed, as we need to negotiate the media type with the input pin; even if we limit the scope to streaming types. Task-number: QTBUG-55264 Change-Id: I7cc02c5ea17cca9912c29c40813314b04b91bd18 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* OpenSL ES: Fix buffer corruptionMichael Dippold2016-08-221-0/+1
| | | | | | | | | | | When start is called, the buffer is always filled starting from index 0 without regard to m_nexBuffer. m_nextBuffer could be set to 1 from the previous playback which causes the second buffer to be filled first, which is now the currently playing buffer. This is causing an audible hiccup right after starting in cases where m_nextBuffer starts at 1. Change-Id: Ia0d73638350d5258a51943d7a1c7cd6f22d068ee Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* AVFoundation: fix memory leakYoann Lopes2016-08-221-3/+13
| | | | | | | | | | | | | Using 'self' in a block maintains a strong reference to it, the previous code would never release that reference and therefore leak the AVFMediaPlayerSessionObserver object when the session was deleted. Captured variables used in the relevant block are now marked with '__block' to make sure no strong references are maintained. We now also make sure the session still exist when that callback block is called. Change-Id: I847b524d8692559fe5884517abb5b9cc7696b4fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Fix instance method not found warningJake Petroules2016-08-171-0/+6
| | | | | | | | NSView/UIView were only forward declared here which led to warnings when calling methods on instances of them. Change-Id: Ic2b391bb0ed8d45306dc16e2a807ce7fcae5015e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* PulseAudio (QSoundEffect): don't write data to an unready streamYoann Lopes2016-08-151-0/+4
| | | | | | | | The PulseAudio stream must be ready to write data to it, otherwise an assert is raised. Change-Id: Iaa108124a135b018aa84845a37665895a005f380 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* PulseAudio: flush stream before loading a new source in a sound effectYoann Lopes2016-08-152-10/+45
| | | | | | | | | When loading a new QSoundEffect source, the data in the stream must be flushed to avoid that the old source plays right before the new one. Task-number: QTBUG-48982 Change-Id: Iff14884edb2fb4851f93e67ff8191b77ebb16359 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Doc: Change instances of 'OS X' to 'macOS'Topi Reinio2016-08-153-3/+3
| | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase). Change-Id: I1ba3b1e3c11870523516d3a13790d40dd0803aad Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* WinRT: emit mediaStatus changes before state changesYoann Lopes2016-08-121-13/+19
| | | | | | | | | | | | | | | This makes sure all mediaStatus changes are emitted, even when some action is done on the media player as a result of a state change. Also, when both mediaStatus and state are changed at the same time, make sure both variables are updated before sending the corresponding signals. Task-number: QTBUG-49578 Change-Id: I8eed6692503bba1540070f6435b7ea1f5e25c023 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* AVFoundation: fix mediaStatus and state changesYoann Lopes2016-08-121-6/+15
| | | | | | | | | | | | When both state and mediaStatus are updated at the same time, make sure both variables are updated before emitting the corresponding signals. Also, always emit mediaStatusChanged() signals before stateChanged() to make sure mediaStatus changes are not cancelled by some action resulting from a state change. Task-number: QTBUG-49578 Change-Id: I0caea8261120595227834dbac7fed286d125bcab Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Fix playing a playlist containing an invalid media as first itemYoann Lopes2016-08-121-7/+9
| | | | | | | | | | | | | When a playlist contains an invalid media, QMediaPlayer normally continues to the next media. If an invalid media was first in the list, the backend would never go into PlayingState, which would then cause the media player to never start the next item in the list (thinking it's stopped). We now always transition to PlayingState when starting playback of a playlist, regardless of the backend going into that state or not. Change-Id: I4227f937e7a619afbd8adbe2fccedfa5d43ad89a Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Android: Fix texture leak in QAndroidTextureVideoOutputChristian Strømme2016-08-124-55/+51
| | | | | | | | | | | | | Simplify the ownership of the OpenGL resources and make it simpler to release individual resources as needed. Previously we would reset the texture handle without releasing it back to the system, making us leak texture each time the video output was reset. Also, be consistent with the type used for the texture handle. Task-number: QTBUG-54340 Change-Id: Ic3b3c7322677a909e51aa5983fa99ccf8b290302 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Android: fix freeze when taking pictures on some devicesYoann Lopes2016-08-122-1/+11
| | | | | | | | | On some devices and on the emulator, the preview callback must be cleared before taking a picture to avoid a camera server freeze. Task-number: QTBUG-54709 Change-Id: I9e4ad417fa08cddea7edfd232f5b5df40ada59ee Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Android: restart preview when image capture failsYoann Lopes2016-08-121-0/+3
| | | | | | | | The preview must be restarted after taking a picture but were doing that only when the capture succeeded. We now also do it when it fails. Change-Id: I8bfff06a811d9333220050e5e81561438f5a3786 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Android: don't process capture previews when capture is canceledYoann Lopes2016-08-121-0/+3
| | | | | Change-Id: Ia068b0fcc30412755639412ec03e49c740b66bed Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* AudioCapture: fix data chunk size in WAV headerYoann Lopes2016-08-121-3/+4
| | | | | | | | The size in the data chunk was missing 8 bytes. Task-number: QTBUG-54710 Change-Id: I0530ea9d2420dd90d196993e1678003697c0ebaa Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Android: fix imageCaptured() signalYoann Lopes2016-08-122-7/+37
| | | | | | | | | | | | | | When capturing two pictures in a row, the second capture would not trigger the imageCaptured() signal. The reason is that capturing a picture restarts the preview when done, which in turns clears the cached last preview frame. The second fetchLastPreviewFrame() would therefore not do anything. In this situation, we now retry fetching the frame as soon as a new one arrives (rather than bailing out). Task-number: QTBUG-48975 Change-Id: Id5476f37641c04b0edd92bddd40711d5125887f0 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* DirectShow: fix possible deadlock when capturing camera imageYoann Lopes2016-08-121-8/+15
| | | | | | | | | Don't emit signals while mutexes are locked. Task-number: QTBUG-41573 Change-Id: I287b031a579cbec1cd178501df4426ceff9e9142 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Ruslan Vorobei <zvorobei@gmail.com>
* QPlaylistFileParser: fix QUrl::resolved+QUrl::fromLocalFile misuseDavid Faure2016-08-041-1/+1
| | | | | | | | | | QUrl::resolved can be used to resolve relative paths, but not by passing them via QUrl::fromLocalFile (8a33077 in qtbase made QUrl more strict). To resolve both relative and absolute local paths against a local directory, QUrl::fromUserInput(3 args) does the job. Change-Id: Ifc01bbd590978f939f9538e70d12f2f3704d7b5d Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Android camera: use closest viewfinder resolutionAnatoly Stolbov2016-07-271-2/+13
| | | | | | | | | | For some cameras difference between preview aspect rate and capture aspect rate is more than 0.01. Therefore it is better to use preview size with closest aspect rate. Task-number: QTBUG-50813 Change-Id: I1284c8ec2be1aa160a656e396a52960fa06aaa56 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* AVFMediaAssetWriter - fix race conditionsTimur Pocheptsov2016-07-264-65/+67
| | | | | | | | | | | | | | | | | | | | | | | | Apple recommends starting/setting up a session (AVCaptureSession) on a special queue and in the past we did this on the writer's queue. Unfortunately, we also can access the same session from a different thread and this results in race conditions and different weird crashes, for example, we're calling start/stopRunning from the writer's queue, while the session is being configured (in between beginConfiguration/commitConfiguration on the recorder control's thread). So we have to limit access to the session by the control's thread. Apple docs say we have to ensure all appendSampleBuffer calls done _before_ finishWriting. We ensure this by dispatching_sync an empty block on the writer's queue after store-release of m_state. We also do the same with video queue to ensure it does not try to access viewfinder's data after stop/abort executed. All these changes also make lock/mutex unneeded. Task-number: QTBUG-54890 Change-Id: I38e86c879b6b62306bdfbeade65405d6ac3be9f3 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Resource leak fixedJesus Fernandez2016-07-251-1/+4
| | | | | | | | CameraBinV4LImageProcessing::setParameter was leaking the resource fd in some cases in the switch using return instead of break. Change-Id: Ie56eaf4cf1d1b7531094c321f49a818632985628 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Make sure JNI_OnLoad is not called more than onceBogDan Vatra2016-07-201-0/+5
| | | | | | | | | | | | | Since Android 5.0 Google introduce a nasty bug[1] which calls JNI_OnLoad more than once. Basically every time when a library is loaded JNI_OnLoad is called if found, but it calls *again* JNI_OnLoad of its .so dependencies! [1] Workaround https://code.google.com/p/android/issues/detail?id=215069 Change-Id: I81b4a94beedaad299267ac6deab2f9c3a1693a62 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* AVFMediaAssetWriter - fix atomics useTimur Pocheptsov2016-07-192-27/+32
| | | | | | | | | | | 1. No need in two different atomics (m_stopped/m_aborted) - the single one 'm_state' with states (Idle/Active/Aborted) should be enough. 2. QAtomicInt::load/store actually have relaxed memory ordering semantics, (not like std::atomic with sequential ordering as the default one) which is not always appropriate - replace with loadAquire/storeRelease instead. Change-Id: I4ce8c9ca7556de3d2c7e369b8a05276b2870460c Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Android: Fix OpenGL texture name leakPavel Golikov2016-07-061-1/+7
| | | | | | | | | | | | | This fixes texture name leak when changing media player's source. Texture name shold be deleted by OpenGLResourcesDeleter class, but when player's source is changed OpenGLResourcesDeleter's texture name is reassigned with new one without old name deletion. This change deletes OpenGLResourcesDeleter's current texture name when new name is assigned. Task-number: QTBUG-54340 Change-Id: I22bbd60b4462b0034fd115f0582ea43b9bcaee4b Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* DirectShow: correctly clear surface in EVR presenterYoann Lopes2016-07-062-3/+27
| | | | | | | | The surface was never cleared in the EVR presenter. It could lead to situations where the presenter would use a destroyed surface. Change-Id: If2223f09f6f8c20c06345bed40803da10dcf4ae3 Reviewed-by: Christian Stromme <christian.stromme@qt.io>