summaryrefslogtreecommitdiffstats
path: root/src/plugins/android/src/mediaplayer
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-2512-251/+251
| | | | | | | | | | | This reverts commit 80d46e3a5f64ff2456c40bdba63b6d5c69a32cdd. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I5c64ffa120f916711e5cf01c828774f8456dec06 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-2712-251/+251
| | | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtmultimedia. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reaso for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4171 Change-Id: I86ebf7c3653b55983cefff246c0cb019cbcda8c4 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-021-4/+4
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I72aa0ccae06030043ba40f0f908826e5ca4a31ab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Deprecate canonicalUrl and canonicalRequest in QMediaContentVaL Doroshchuk2019-05-132-3/+3
| | | | | | | | | | | Since QMediaContent can contain only one content and media resources are already deprecated, canonicalUrl and canonicalRequest are a bit confusing and outdated. Deprecated and replaced by QMediaContent::request() which already contains the url. Change-Id: I418006e112f49466b0129bf1e6e1ae629c714538 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Android: Introduce HTTP headers to MediaPlayerVal Doroshchuk2019-03-251-1/+1
| | | | | | | | | | | | | | Added using the headers from QNetworkRequest to be sent together with the request for the data in MediaPlayer::setDataSource. The MediaPlayer requires also a Context object, together with headers, to resolve the Uri. It will try to find a content provider. Since no content providers are implemented, this produces a warning: "MediaPlayer: Couldn't open file on client side; trying server side: java.io.FileNotFoundException: No content provider" Task-number: QTBUG-74073 Change-Id: I1566953b523e84400882ba9d3a968cec6b4a61cf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: Implement audio rolesVal Doroshchuk2019-02-089-0/+328
| | | | | | | | | | | | | | | Introduced custom and standard audio role controls using MediaPlayer.setAudioAttributes(AudioAttributes) which added in API level 21. Custom audio roles might contain a list of roles separated by comma. E.g "CONTENT_TYPE_MOVIE,USAGE_ALARM", which means content type is movie and usage is alarm. [ChangeLog][Platform Specific Changes][Android] Implemented audio roles. Task-number: QTBUG-73119 Change-Id: I281d1ce899d29f54d271516a1fca5f11c897fc90 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Android: implement QMediaPlayer::setPlaybackRate()Yoann Lopes2018-09-262-3/+42
| | | | | | | | Only possible on Android API level 23 or higher. Task-number: QTBUG-61115 Change-Id: I147575ed0a48f84d4208978a67e0856918e65b3d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: Fix crash when play() is called but state is not setVal Doroshchuk2018-09-241-1/+3
| | | | | | | | | Change state to PlayingState only when media content has been provided. Task-number: QTBUG-70653 Task-number: QTBUG-68998 Change-Id: Iad8fc2c964ff22e90de6eb9b84c82a0950d0b1ac Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Android: Fix the player state when play() is called with no mediaVal Doroshchuk2018-08-161-2/+1
| | | | | | | | | | | | If play() is called before any media is set, don't change the current state to PlayingState. This was inconsistent with the other backends, and required an unneeded call to stop() when a media later got set. Task-number: QTBUG-68998 Change-Id: I8281c7bf83e36e9a80f2136ca9fc2430c55e8bd6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-224-33/+33
| | | | | Change-Id: I17b3650a3df5688274151c1f2c4629e4a5062028 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-041-3/+3
|\ | | | | | | Change-Id: Ib038c5e3ebb48c0e46569a35d530fa5ceaf06a32
| * 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>
* | Updated license headersAntti Kokko2016-01-198-112/+160
|/ | | | | | | | | | | 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>
* Android: Call release() in AndroidMediaMetadataRetriever's destructor.Christian Strømme2016-01-071-2/+0
| | | | | | | | | | This should be the default when the wrapper is destroyed. Note: It's not possible to re-use the instance after release() is called. Change-Id: I761cac05ed2c2cda49573c69c6803b136892c528 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Android: Make the meta-data reader asyncChristian Strømme2016-01-073-91/+128
| | | | | | | | | | | | | Reading the meta-data can be slow and cause the UI to become unresponsive. This is especially noticeable when the media source is loaded from a remote location, or over a slow network. To improve this situation the media-reader is moved off the main thread and we wait until the media is loaded before starting the meta-data extraction. Task-number: QTBUG-46491 Change-Id: I0b9cf2ae6b8e08596a2f0b8fa0042d74604c46f9 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Android: support non OpenGL video surfaces for the camera.Yoann Lopes2015-12-047-12/+145
| | | | | | | | | | | | | | | QCamera can now pass raw frame data to its QAbstractVideoSurface. The now deprecated Android camera API we're using doesn't allow to get frame data without also displaying the frames in a SurfaceView or a SurfaceTexture. To work around that, an invisible dummy SurfaceView is used. This allows to retrieve frames in the NV21, YV12, YUY2 or RGB565 formats, depending on the Android version and on the device. Task-number: QTBUG-35416 Change-Id: I77b4f50505c3b91efb4b2288a57f50398922c0db Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* QMediaPlayer: handle resource files in a cross-platform way.Yoann Lopes2015-04-075-28/+11
| | | | | | | | | | | | | | | | | | | | It was the backend's responsibility to handle resource files in an appropriate way. In practice, it was either not handled at all, or implemented in an almost identical manner in every backend that does handle it. This is now dealt with in QMediaPlayer, always passing to the backend something it will be able to play. If the backend has the StreamPlayback capability, we pass a QFile from which it streams the data. If it doesn't, we copy the resource to a temporary file and pass its path to the backend. Task-number: QTBUG-36175 Task-number: QTBUG-42263 Task-number: QTBUG-43839 Change-Id: I57b355c72692d02661baeaf74e66581ca0a0bd1d Reviewed-by: Andrew Knight <qt@panimo.net> Reviewed-by: Peng Wu <peng.wu@intopalo.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-171-2/+2
|\ | | | | | | Change-Id: Id24f14bef17b86e7027e055473f0357854780979
| * Android: fix some MediaPlayer signals not being emitted on first load.Yoann Lopes2015-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | When loading the first media while the video output was not yet ready, mediaChanged() and mediaStatusChanged() signals were not emitted. That's because in that particular situation, the backend believed the delayed loading was a reload of the same media. Change-Id: If5dfbf383ea2dac065fc26b70640ebfb2c52862d Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-131-1/+1
|\| | | | | | | Change-Id: I5575a4ba13212c9bfe73a3de3ef17c6528beafc3
| * Encode urls passed to media player properlyJoni Poikelin2015-02-101-1/+1
| | | | | | | | | | | | Task-number: QTBUG-44383 Change-Id: I2c63d5530ad76474ccad8ad69493419dd46032fa Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Update copyright headersAntti Kokko2015-02-126-42/+42
|/ | | | | | | | | 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>
* Android: fix some problems with the media player.Yoann Lopes2014-09-262-62/+69
| | | | | | | | | | | | | - Correctly emit positionChanged signal. One of the problems with this was that QMediaPlayer automatically sends periodic position updates while playing a media. There's no need to have the same logic in the backend. - Seeking after reaching the end of the media now correctly works Auto tests included. Change-Id: I6d5ecbae6e05f94a8aac1a0834cf57427adf219b Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: fix QMediaPlayer's state and mediaStatus signals.Yoann Lopes2014-09-242-3/+53
| | | | | | | | | Emit signals only after both properties are written to avoid having incoherent values in signal handlers. Task-number: QTBUG-40314 Change-Id: I6c8445e61cccf1a9803647329c4fa1f0e452f56d Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-015-10/+13
|\ | | | | | | | | | | | | | | | | Conflicts: src/gsttools/qgstreamervideoinputdevicecontrol.cpp src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp Change-Id: Ic854589562d2deeaa0ebf75840cb8a2ee32e99de
| * Android: fix retrieving metadata from assets, qrc and remote files.Yoann Lopes2014-08-255-10/+13
| | | | | | | | | | | | | | | | | | | | | | We need the same logic as for the media player: local files and assets must be loaded with a FileDescriptor. Because of a bug in Android API level >= 14, remote files have to be loaded in different ways depending on the version. Task-number: QTBUG-40274 Change-Id: I6411b959064d22219cf981a4dc8f4f26cf16f65f Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* | Update license headers and add new license filesAntti Kokko2014-08-246-114/+66
|/ | | | | | | | | - 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>
* Android: Use a file descriptor for all local media files.Christian Strømme2014-06-051-1/+1
| | | | | | | | | Using a fd is more consistent across different Android versions and also works with files that are in the applications private storage. Task-number: QTBUG-39346 Change-Id: I462822459d12d7842d15f1cb7caafc75c18fe32c Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Don't expose java calls in the control classes.Christian Strømme2014-06-041-5/+5
| | | | | | | Makes the abstraction more clear. Change-Id: Ia9a7b0b157e1182158cd26b62775d13f6c5e1727 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Rename the wrapper classesChristian Strømme2014-06-044-101/+101
| | | | | Change-Id: I2ce15c8475da3186f128ba59b7c58f9b5b0a67e1 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Fix loading from qrcChristian Strømme2014-05-211-1/+1
| | | | | | | | | On Android < 4.1 our temporary file is discarded without checking the content. With this change we just open the file and pass the fd to the mediaplayer instead. Change-Id: I9233822725d8987c572b2d0b598721cee886de80 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: fix QMediaPlayer::bufferStatus value.Yoann Lopes2014-05-152-3/+17
| | | | | | | | | | | It was returning the buffering progress for the whole media, which is not what is expected according to the documentation. It should return instead how much the playback buffer is filled. This information is not available on Android so we simply return 100% when the status is BufferedMedia or BufferingMedia, 0% otherwise. Change-Id: I9fb55a9317948ba9375291a57bbf100f186382a2 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: Fix MetadataRetriver wrapperChristian Strømme2014-03-271-6/+1
| | | | | | | The QJNIObject was never intended to be used as a base class. Change-Id: Ic4effd5e1c89a08515c756bd5092fb1e1eead688 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Don't call release() unless it's necessary.Christian Strømme2014-03-271-1/+3
| | | | | | | | If the mediaplayer is in either Idle or Uninitialized state, then there is no need to call release again. Change-Id: Idb6f2d9ea7aad7a9036e7e9a534c3bd296324068 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Fix reload check in onStateChanged().Christian Strømme2014-03-271-1/+3
| | | | | | | The condition was missing the Uninitialized flag. Change-Id: I555f4eae6cc33bee0a4925e626dd56041e4b0471 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Make the Mediaplayer more robustChristian Strømme2014-03-212-126/+282
| | | | | | | | | | | | In some cases the the Android media player would get into a unexpected state and we where then not able to recover. With this patch we monitor the state changes more closely and recover when possible. Task-number: QTBUG-35651 Change-Id: I142c63fbbf716d3f94ebdcf016a7cadad7b13207 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Normalize signal & slot signatures in connectionThiago Macieira2014-02-031-6/+6
| | | | | | | Profiling shows Qt Creator spends 2% of its load time normalizing Change-Id: I1a4bef16be79ced35c47da865153ebe1bee22f9c Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Use QStringRef instead of QString whenever possible.Jędrzej Nowacki2014-01-151-1/+1
| | | | | | | That way we reduce count of temporary QString instances. Change-Id: Id806c68ea616828c2355c07b8576616fa6a8da17 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android add support for qrc in mediaplayer.Christian Strømme2013-12-092-3/+14
| | | | | | | | | | [ChangeLog][QtMultimedia][Android] Enable mediaplayer to read files from the Qt Resource system. Task-number: QTBUG-31422 Change-Id: Iaaefb35566b623b78b9f8aa22daf6ac92fb35e67 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: fix two race conditions in the media player.Yoann Lopes2013-11-061-1/+1
| | | | | | | | | | start() could be called before the media player was marked as prepared. When changing media, setMediaPath() could be called before the media player was reset. Task-number: QTBUG-34558 Change-Id: I886fd5f5008f76dcbc88c57d7b16a439b394d4a7 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: refactor video renderer.Yoann Lopes2013-10-013-16/+9
| | | | | | | | | | | | | Removed the overhead of having to create a shared OpenGL context in the GUI thread and pre-render the frame into a FBO. We now directly render the GL_TEXTURE_EXTERNAL_OES in the QtQuick render thread, using an Android-specific QSGVideoNode. We also use a callback from the render thread to create the texture from there and not have to create a separate shared OpenGL context. Change-Id: I6c8eb94b47d0a03329c912701b8af3fb5ebd1876 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: added camera support.Yoann Lopes2013-09-127-0/+1147
This patch includes all camera features: viewport, settings, image capture, and video recording. It also adds support for QAudioRecorder. Change-Id: Ib962177cc8de4bac03f42a2bc0f534e03464bbfc Reviewed-by: Christian Stromme <christian.stromme@digia.com>