summaryrefslogtreecommitdiffstats
path: root/src/plugins/android/src/common
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-255-104/+104
| | | | | | | | | | | 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-275-104/+104
| | | | | | | | | | | | | | | | 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>
* Android: Remove usage of qt_androidRequestPermissionVal Doroshchuk2019-11-152-3/+8
| | | | | | | Use specific function instead, e.g. qt_androidRequestCameraPermission. Change-Id: I925e4d8ac4f1993c073930a79453894dd516d769 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Don't close camera when recording permission is askedVal Doroshchuk2019-11-152-0/+6
| | | | | | | | | | | | | | | | If camera permission is granted and recording is requested it also requires recording audio permission. If it was not granted before the popup will be shown to ask the user to grant the permission and the app goes to inactive state, which destroys the camera handlers. When the camera is loaded but the app requires additional permissions, it should not destroy the camera. Change-Id: Iee3662a7ac3381b0eb29190779b0116f9f64304f Fixes: QTBUG-79909 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-142-0/+38
|\ | | | | | | Change-Id: Ie351f3c36eecf9e83a5b6a55ec0aac27387b5656
| * Android: Fix fetching video frame data from the GUI thread5.13Val Doroshchuk2019-11-122-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QAbstractVideoSurface is not used on rendering thread added a way to pass shared opengl context via GLContext surface property. Camera and media players that are created in Qt Quick will usually have their rendering done on the render thread, but the callback for custom video surface(s) (or probes) will usually be handle on the GUI thread, so to make it convenient to for the user to access the frame data, which is rendered on request, we now set-up context sharing and render to a fbo on the calling thread, if needed. Task-number: QTBUG-69333 Change-Id: I4cc5c1f741c82376f1402a047b946b59281c9a4c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Remove usages of deprecated APIsSona Kurazyan2019-08-081-1/+1
|/ | | | | | | | | | | | | | - Replace the usages of deprecated APIs by corresponding alternatives. - Made the tests for deprecated APIs to compile conditionally, based on the deprecation version. Task-number: QTBUG-76491 Task-number: QTBUG-76540 Task-number: QTBUG-76541 Change-Id: Ifd397dae9b3ebc2ba2504db7baa2d8ff21bfb3a7 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-022-8/+17
|\ | | | | | | Change-Id: Ia13d887c3e3bf00b6ded5d052384fc5689b816fe
| * Android: Fix memory leak of GL resourcesVal Doroshchuk2019-01-312-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DeferredDelete events have implicitly higher priority, which makes this event to be handled before MetaCall events. See QSGSoftwareRenderThread::sync(): ... QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); Where it processes deferred deletes and no meta calls will be delivered even if they were requested before the deferred delete. Task-number: QTBUG-67280 Change-Id: Iba23550d2cffb1cea1b4c2fe4c903078d9f2f046 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Android: Change video frame format from BGR32 to ABGR32Val Doroshchuk2018-10-031-1/+1
|/ | | | | | | | | | | | When mapping video frame, data will be downloaded to QImage from frame buffer with QImage::Format_RGBX8888 which is XBGR32 in Little Endian. Thus added new pixel format QVideoFrame::Format_ABGR32. Changed QVideoFrame::Format_BGR32 to QVideoFrame::Format_ABGR32. Task-number: QTBUG-69968 Change-Id: I0f58d1a5b5cbdb5ab48ee5ad4d75f9b62f516333 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-061-1/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5acdc7e0bd3729b80522dfff0f388cf2507fb111
| * Revert "Android: Set the correct scan line for the video surface format"v5.10.0-rc3v5.10.0-rc2v5.10.0Christian Stromme2017-11-281-1/+0
| | | | | | | | | | | | | | | | | | | | The change causes the video output to be shown upside down. This reverts commit 2ec485482d185f92e4de33f634bc3ef9dd6c9188. Task-number: QTBUG-64764 Change-Id: I9d3e63d2c0cce17d945b62ffead38ab5f58ace7f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-271-0/+1
|\| | | | | | | Change-Id: Ib509a8c90dd6c7229510a400612cc27a4957d015
| * Android: Set the correct scan line for the video surface formatChristian Strømme2017-10-231-0/+1
| | | | | | | | | | | | | | | | | | The default value for QVideoSurfaceFormat is TopToBottom, so we need to change it. Task-number: QTBUG-51213 Change-Id: I47826a60fbae57f3d30d358a9ab8f05b784aeebd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-221-7/+7
|/ | | | | Change-Id: I17b3650a3df5688274151c1f2c4629e4a5062028 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: Fix crash caused by stale video-frame objectsChristian Strømme2017-04-272-18/+36
| | | | | | | | | | Make sure that the frame being processed is still valid, that is, the size is valid and correct, and that the frame buffer is accessible. Task-number: QTBUG-60115 Change-Id: Ic64b6f7d45d92b7923d97d6ecdc630da31abee17 Reviewed-by: Michael Dippold <mike@dippold.com> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Android: Add convenience method for checking and requesting permissionsChristian Strømme2017-03-222-0/+31
| | | | | | | | This will be used to check and request permissions at run-time. Task-number: QTBUG-55992 Change-Id: I344859aeb05fecf09ac46064e9452787d615a8a1 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Android: Add logging categoryChristian Strømme2017-03-222-0/+53
| | | | | | | Adds logging category for the android plugin. Change-Id: I0b0868fa7da4ce5426b3682ab40c4317afb79cd0 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-132-51/+47
|\ | | | | | | Change-Id: I3204cdf695f4b47730a88a7c41fc7a6de967b161
| * Android: Fix texture leak in QAndroidTextureVideoOutputChristian Strømme2016-08-122-51/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Yoann Lopes2016-08-011-1/+7
|\| | | | | | | Change-Id: Ic29cb09048003f18ff86d4546cd547be715eaec8
| * 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>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-301-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklisted a few functions in tst_QAudioInput. Conflicts: .qmake.conf src/plugins/avfoundation/camera/avfcameracontrol.mm src/plugins/avfoundation/camera/avfcameraservice.h src/plugins/avfoundation/camera/avfcameraservice.mm src/plugins/avfoundation/camera/avfcamerasession.h src/plugins/avfoundation/camera/avfcamerasession.mm src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.h src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm src/plugins/avfoundation/camera/avfimagecapturecontrol.mm src/plugins/avfoundation/camera/avfimageencodercontrol.mm src/plugins/avfoundation/camera/avfmediarecordercontrol.h src/plugins/avfoundation/camera/avfmediarecordercontrol.mm tests/auto/integration/qaudioinput/BLACKLIST Task-number: QTBUG-54459 Task-number: QTBUG-49736 Change-Id: I3a1fe8cef50b44d5c2785aaf4cf69fe3f16728e6
| * Android: flush the current video frame when the video output is reset.Yoann Lopes2016-06-031-0/+4
| | | | | | | | | | | | | | | | The texture renderer could end up in a situation where a frame could be scheduled to be rendered after the renderer was reset. Change-Id: Ie6b6c9d0b5f5851f14aa6eb5f8421196aff8c691 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-102-13/+44
|\| | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * Android: improve texture rendering on API level >= 16.Yoann Lopes2016-05-102-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Android API level 16 added SurfaceTexture::attachToGLContext(). This allows to create the OpenGL texture when the first video frame is available, rather than at initialization. This means we can do without the ugly hack that makes the render thread call us back through some custom property. Additionally, it allows to recreate a new OpenGL texture every time the SurfaceTexture is reset. Task-number: QTBUG-51911 Change-Id: I17b04524d426c42ef8aa0288b0731597bc9eba62 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| * Android: detect more error cases when rendering frames to textures.Yoann Lopes2016-05-091-0/+3
| | | | | | | | | | | | | | | | Don't render the frame if the SurfaceTexture has been released or if the render size is invalid. Change-Id: I6b8bf14e023ff54a560b0a9e6027ef9d7d06ab6a Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| * Android: correctly use mutex for texture rendering.Yoann Lopes2016-05-091-0/+3
| | | | | | | | | | | | | | | | | | | | Some sections were not protected by the mutex, even though they should have been. An example of problem that could happen because of this was if the SurfaceTexture was reset while the render thread was rendering that texture. Change-Id: Ie95860fd4eb722bbac04cccc430cc1a8abf1df4d Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-194-56/+80
|/ | | | | | | | | | | 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: support non OpenGL video surfaces for the camera.Yoann Lopes2015-12-046-156/+150
| | | | | | | | | | | | | | | 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>
* Add private API for conversion from QVideoFrame to QImage.Yoann Lopes2015-10-202-560/+0
| | | | | | | | | | The Android plugin had a function to convert from NV21 to RGB32. It's now moved to the Qt Multimedia library and it supports additional source formats. It could be further improved with more SIMD code, it could then become a public API. Change-Id: Ibee349027048a263a1a7ea74dc51237f7747912c Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Android: allow to map video buffers.Yoann Lopes2015-09-081-8/+39
| | | | | | | | | Since we internally use a fbo, use QOpenGLFramebufferObject::toImage() to grab the pixel data and enable the use of map() on frames retrieved using QAbstractVideoFilter. Change-Id: If96e992e12e26091524913bb24926fa21d9d58cc Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Update copyright headersAntti Kokko2015-02-125-35/+35
| | | | | | | | | 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-245-95/+55
| | | | | | | | | - 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: Don't expose java calls in the control classes.Christian Strømme2014-06-043-40/+7
| | | | | | | Makes the abstraction more clear. Change-Id: Ia9a7b0b157e1182158cd26b62775d13f6c5e1727 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Rename the wrapper classesChristian Strømme2014-06-042-5/+4
| | | | | Change-Id: I2ce15c8475da3186f128ba59b7c58f9b5b0a67e1 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: fix calling start() and stop() on the video surface.Yoann Lopes2014-05-301-1/+1
| | | | | | | | | We restart the surface when the frame size changes, though we were not using the correct function to get the surface's current frame size. This was causing start() and stop() to be called for every frame. Change-Id: I8ff4b4852cb7fcc92ac3b1b3ad7bf991d7bddc6b Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: Fix QtSurfaceTextureChristian Strømme2014-03-272-9/+10
| | | | | | | | | | | | Don't extend SurfaceTexture as this causes ART to fail when it doesn't find the postEventFromNative() function. The postEventFromNative() function was implemented sometime after API 11, so to avoid this situation we can use composition instead. Task-number: QTBUG-37605 Change-Id: Ie1013d218291ba0035f1bb18a0c0655fd2170bfd Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: Make the Mediaplayer more robustChristian Strømme2014-03-213-14/+28
| | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-01-222-28/+175
|\ | | | | | | Change-Id: Ifcb0e0bac29c11980ea2a9d67b12e1b79c4bd9f6
| * Android: fixed video rendering with multiple media players.Yoann Lopes2014-01-202-28/+175
| | | | | | | | | | | | | | | | | | | | | | It seems all Android media players share the same video buffers, which results in textures containing frames for the wrong media player. When getting a new frame, we now copy it into a FBO in order to avoid that another media player overwrites the frame being shown on screen. Task-number: QTBUG-35868 Change-Id: I6701cf7368a3ef9e73d649c3ece1f206cafd5bb3 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* | Android: optimized NV21 top ARGB32 conversion.Yoann Lopes2014-01-171-15/+550
|/ | | | | | | | | | | Now based on fixed-point arithmetic and uses pre-generated lookup tables for YUV coefficients and RGB clamping. The new implementation is on average 2x-3x faster than the previous one (tested on the Samsung Galaxy S4). Change-Id: I1daf12f7f9b2f2334e90e0ede79e6d83800f1db6 Reviewed-by: Denis Kormalev <dkormalev@ics.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: fixed image capture preview.Yoann Lopes2013-10-015-10/+27
| | | | | | | | | | We used to generate the capture preview from the video output, grabbing the pixels of the last frame (in a FBO). This is not possible anymore, we instead query the camera for a preview frame, which is in the NV21 format and needs to be converted to RGB. Change-Id: I1c728b3a708a6f052a83aebf9f15f511eab7a02f Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Android: refactor video renderer.Yoann Lopes2013-10-013-259/+93
| | | | | | | | | | | | | 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: Adapt the multimedia plugin to new QJNI APIChristian Strømme2013-09-202-3/+3
| | | | | Change-Id: Id87f5518724eed6c9de6d5d3b8141860bd511643 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Android: added camera support.Yoann Lopes2013-09-126-0/+762
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>