summaryrefslogtreecommitdiffstats
path: root/src/plugins/android
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Android: Set the correct scan line for the video surface format"Christian Stromme2017-12-011-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> (cherry picked from commit 3598915a360c596da48c9e7b00ba8469cba5249a)
* Fix crash when an app is sent to background while capturing an imageVal Doroshchuk2017-11-101-3/+7
| | | | | | | | | | | Since the native notify* methods for QtCameraListener.java are executed on different thread, there is a potential for a race condition when the applicationStateChanged is received before the notify* signals, which leads to the camera being release before the slots are executed. Task-number: QTBUG-52366 Change-Id: Ifc82f3a75a7e88e4e76fac3edbf16bb9f138fde7 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* 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>
* 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: Run-time permission checks for cameraChristian Strømme2017-04-233-1/+16
| | | | | | | | | | | | | | | The camera should ask for permission before being used. Normally this should be handle by the user, which can provide proper reasons for why the camera is used. To verify that we are allowed to open the camera, and as a good default, we'll check the permission and request access if needed. [ChangeLog][Android] Added run-time permission checks for accessing the camera. Task-number: QTBUG-55992 Change-Id: Ifb4e176728aab3076fdba292e17e17d33b1260a2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: Fix camera preview orientationChristian Strømme2017-04-203-0/+19
| | | | | | | | | | | | Before API level 24 the display orientation (the preview) was always set to 0. On newer versions of Android the clockwise rotation is set to be either 0 or 180, depending on the hardware. Since we don't want Android to apply transformation on our surface, we'll just enforce that the display orientation is always set to 0. Task-number: QTBUG-56536 Change-Id: Ie1aacda97540d5c97e6cbd8edb2afc53e7041e1e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: Add run-time permission check for recordingChristian Strømme2017-03-303-0/+16
| | | | | | | | | | | Check and request permission to record audio if needed. [ChangeLog][Android] Added run-time permission checks for media-recording. Task-number: QTBUG-55992 Change-Id: I781e5a5447f1ad03c069b2171637525ae9108d78 Reviewed-by: Yoann Lopes <yoann.lopes@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-223-2/+57
| | | | | | | Adds logging category for the android plugin. Change-Id: I0b0868fa7da4ce5426b3682ab40c4317afb79cd0 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-262-8/+8
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/qnx/qnx.pro sync.profile Change-Id: I353a44578276264a9ffb80820d8c5a0babfa1638
| * Merge remote-tracking branch 'origin/5.7.1' into 5.7Liang Qi2016-11-242-8/+8
| |\ | | | | | | | | | Change-Id: I6690c4161c57734ad03ee3e03311a3e62f181e89
| | * Pass the context to QtAndroidMediaPlayerBogDan Vatra2016-09-282-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | This way it can be used in a service Task-number: QTBUG-54506 Change-Id: I2d75b69dfbf7b345322f7625baf544af2af200c5 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-112-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qtmultimedia.pro src/multimedia/playback/qmediaplayer.cpp src/plugins/directshow/directshow.pro tests/auto/integration/qmediaplayerbackend/BLACKLIST Change-Id: I6dacdcbb223c1d12dd72eb308a67170983c709b3
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-042-3/+4
| |\ \ | | |/ | |/| | | | Change-Id: Ib038c5e3ebb48c0e46569a35d530fa5ceaf06a32
| | * Mark AndroidCameraInfo as movableChristian Strømme2016-11-011-0/+1
| | | | | | | | | | | | | | | Change-Id: I00b8444e00cbf3dc0d4a7c2ff8b83e217a8966f5 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>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-179-89/+143
|\| | | | | | | | | | | Change-Id: Ib8d05d6e21c7beb19f618cd1edc52d248b1e43b8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-137-63/+105
| |\| | | | | | | | | | Change-Id: I3204cdf695f4b47730a88a7c41fc7a6de967b161
| | * 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>
| | * 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>
| * | Replaced old license headers with new and correct onesJani Heikkinen2016-08-122-26/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced - header.LGPL3 with header.LGPL - header.LGPL21 with header.LGPL Change-Id: If11396da6ff12e9122281c17fc4354b05a554ee5 Reviewed-by: Ruslan Baratov <ruslan_baratov@yahoo.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-027-28/+67
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/integration/qsoundeffect/BLACKLIST Change-Id: Icd2edd4410a4ee914d489634d26b262c0c146bf4
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Yoann Lopes2016-08-016-22/+62
| |\| | | | | | | | | | Change-Id: Ic29cb09048003f18ff86d4546cd547be715eaec8
| | * 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>
| | * 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>
| | * 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>
| | * Android: Fix attach- and detachFromGLContext()Christian Strømme2016-07-053-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression caused by ba8127639857232d8a. The change assumed that the AndroidSurfaceTexture class could cope with changing textures, but since the callback from the SurfaceTextureListener was tied to the initial, invalid, texture handle, it would only work as long as there were only one texture; all textures would register the callback to the same invalid handle. This change maps the callback directly to the android texture object, instead of the texture handle. Task-number: QTBUG-54340 Change-Id: I39568d0f97fa6b9cb1182efaca568b16a26f0d09 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| * | This module doesn't need an Activity to work, a Context object is enoughBogDan Vatra2016-07-261-6/+5
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-54506 Change-Id: I81ad9b90fdc55aaaa828ef8256edb7bccca45e64 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-212-1/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowiosource.cpp One side disintermediated filling a vector; the other reduced it to one entry. src/plugins/directshow/player/directshowiosource.h One side renamed a member, the other added another adjacent to it. src/plugins/pulseaudio/qpulseaudioengine.h One side added a header, the other replaced the next with a different header. Change-Id: I3a031975f5af43ca39cca571f215c612f640b7d6
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-302-1/+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: Fix crash in AndroidCamere::open()Christian Strømme2016-06-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would attempt to delete the AndroidCameraPrivate object twice if the native call to open failed. On recent version of Android (~6.0), this problem is harder to reproduce, as the camera is properly released when the application goes into the background. Task-number: QTBUG-53536 Change-Id: I064d276f9025924dfdb071aa52311d2b553c6953 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| | * 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.7' into devLiang Qi2016-06-1110-45/+519
|\| | | | | | | | | | | Change-Id: Iffd8d86489161c49a647cae77a31f5451b06cf4b
| * | Implement QCameraViewfinderSettingsControl2 interface for AndroidRuslan Baratov2016-06-0210-45/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add class QAndroidViewfinderSettingsControl2 which implements QCameraViewfinderSettingsControl2 interface. This make next QCamera methods working on Android: * QCamera::setViewfinderSettings * QCamera::supportedViewfinderFrameRateRanges * QCamera::supportedViewfinderPixelFormats * QCamera::supportedViewfinderResolutions * QCamera::supportedViewfinderSettings * QCamera::viewfinderSettings Originally from: * https://github.com/headupinclouds/gatherer/issues/109 Change-Id: Ic43e434289a626691f01ed9832654fa9b0105c7d Reviewed-by: Ruslan Baratov <ruslan_baratov@yahoo.com> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Android: fix media player volume.Yoann Lopes2016-06-091-12/+1
|/ / | | | | | | | | | | | | | | Qt expects a linear volume, so does Android. We don't need to do any conversion. Change-Id: I35acf0040aff0c6c0d812b4d11fe42a7a6a97ed0 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-104-13/+63
|\| | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * Android: improve texture rendering on API level >= 16.Yoann Lopes2016-05-104-13/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove the traces of the discontinued android-no-sdk platformv5.7.0-beta1Eirik Aavitsland2016-04-122-3/+1
| | | | | | | | | | Change-Id: Ib9ba913543270e25e9c8deff492b98b0525c9219 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Android: Use the new QtAndroidPrivate::runOnAndroidThreadSyncBogDan Vatra2016-04-062-47/+27
| | | | | | | | | | Change-Id: I47cb99d84ad87f3b0f6578d3fbdc22d788b31c57 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Android: Use default API version (16)BogDan Vatra2016-03-171-1/+0
| | | | | | | | | | Change-Id: I379a4708b2d79824ee6266471e7aec983b87cd68 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-072-9/+11
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/avfoundation/mediaplayer/mediaplayer.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro Change-Id: I5742596230dc510ba2a09eba624429bb67179194
| * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-02-252-9/+11
| | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: I8e1554b648327ea2fb342b882ce8e439bd6f271d Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-1985-1192/+1702
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.6' into devChristian Strømme2016-01-1538-402/+1544
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/android/src/mediacapture/qandroidcamerasession.cpp src/plugins/wmf/mftvideo.cpp Change-Id: I78868b416ea4baec89ca3e2dc9eb4712db16d5fc
| * Merge remote-tracking branch 'origin/5.5' into 5.6Christian Strømme2016-01-121-2/+7
| |\ | | | | | | | | | Change-Id: Ia563cf734178b821c2aadda8b79b1f09b17de7cd