summaryrefslogtreecommitdiffstats
path: root/src/plugins/android/src/mediacapture
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.13' into ↵v5.15.13-lts-lgpl5.15Tarja Sundqvist2024-01-042-4/+40
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I3b153fa928169f990cd278566dda2f7c7706a015
| * Android: Handle Pause() by QAudioRecorderBartlomiej Moskal2023-01-052-4/+40
| | | | | | | | | | | | | | | | | | | | Add implementation for pause() method for the QAudioRecorder on the Android side. Fixes: QTBUG-106897 Fixes: QTBUG-105505 Change-Id: Ie98b35c2c5dcb09c141c0216ba01c732e85e75a4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into ↵v5.15.11-lts-lgplTarja Sundqvist2023-06-091-2/+13
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I3279e8339e4fadcc6d5aaafa01e4b15a92168a6c
| * Android: Align emit sequenceSamuel Mira2022-06-221-2/+13
| | | | | | | | | | | | | | | | | | Change the emit sequence according to match docs and other platforms. Fixes: QTBUG-104041 Change-Id: Ic7a3b25d0b0538414b5b467b57a61790238692ed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-2548-1003/+1003
|/ | | | | | | | | | | 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-2748-1003/+1003
| | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-203-4/+17
|\ | | | | | | Change-Id: Ib250ceecd02291f752b7775f329f0f494c4aed38
| * Android: Remove usage of qt_androidRequestPermissionVal Doroshchuk2019-11-151-1/+1
| | | | | | | | | | | | | | 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-153-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Introduce QVideoFrame::image()VaL Doroshchuk2019-10-311-2/+1
|/ | | | | | | | | | | | | Since QVideoFrame::pixelFormat's do not 100% match QImage::Format's, introducing converstion function. Returns an image based on current frame. Converts data if needed to supported QImage format. Change-Id: I3331578c01cf9c999a380efc4a83bf9eddb07901 (cherry picked from commit 93f966335e1ed8ed47b7e8b32452d43c2f8a7bb1) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Allow starting camera without viewfinder availableVal Doroshchuk2019-05-131-11/+32
| | | | | | | | | | | | | | Currently it is not able to start camera without viewfinder. For this purpose there is QAndroidCameraDataVideoOutput with SurfaceView in order to be able to start the camera preview. Implemented dummy QAbstractVideoSurface to render to it when no video output is provided before starting the preview. Task-number: QTBUG-73582 Fixes: QTBUG-73237 Change-Id: Ic76d247b5d5352e8539ba61271484e56d3a40fbd Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Android: Don't postpone setting of camera's stateVal Doroshchuk2019-05-032-19/+23
| | | | | | | | | | | | | | | | | | | | | Currently if the application is inactive, the state is postponed to be set and processed when the app becomes active. This also postpones stateChanged() signal and saving the state value, while it should be set (but not processed) immediately as done in another backends. Added a fix to store the state and emit stateChanged regardless of activity of the application. When the application becames available, the state will be processed. In case of an error while opening the camera: - UnloadedState is emitted - CameraError - UnloadedStatus Change-Id: Ie376d29366168a6b15eccea884f385070f94fe35 Task-number: QTBUG-73582 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: Fix status of QMediaRecorder after start/stopVal Doroshchuk2019-04-032-45/+35
| | | | | | | | | | | | | | | | | | If the camera is ready for capture -> QMediaRecorder::LoadedStatus. If CaptureVideo is changed to CaptureStillImage -> StoppedState and UnloadedStatus. If camera's status is StoppingStatus -> StoppedState and UnloadedStatus. If camera's status is LoadingStatus -> LoadingStatus. If recording is requested -> RecordingState and RecordingStatus. If recording is audio-only -> immediately LoadedStatus, before start and after stop. Fixes tst_QCameraBackend::testVideoRecording Task-number: QTBUG-73582 Change-Id: I976c4e3afab529e0949571c4002e9ceba74cac97 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Android: Use CaptureStillImage as default capture modeVal Doroshchuk2019-03-281-1/+1
| | | | | | | | Fixes tst_QCameraBackend::testCaptureMode. Change-Id: I2f6486102ebcbf7e1ab0feea8c13658772d5b90f Fixes: QTBUG-73582 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace deprecated qSort() by std::sort()Friedemann Kleint2018-02-281-2/+4
| | | | | Change-Id: I74ffd5bafaef9ebbe7f12600ad831c8deb58ae64 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-3/+7
|\ | | | | | | Change-Id: Icaf645e271b21320c4cb6269178d9e722092a263
| * 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>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-2/+2
| | | | | | | | | | Change-Id: I3b7601b4a97f8a2b1d2da6ef134f1577846ba713 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-2217-85/+85
|/ | | | | Change-Id: I17b3650a3df5688274151c1f2c4629e4a5062028 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: Run-time permission checks for cameraChristian Strømme2017-04-231-1/+1
| | | | | | | | | | | | | | | 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-201-0/+6
| | | | | | | | | | | | 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-301-0/+9
| | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-0/+6
|\ | | | | | | Change-Id: I3204cdf695f4b47730a88a7c41fc7a6de967b161
| * 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>
* | 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.6' into 5.7Yoann Lopes2016-08-011-2/+13
|\| | | | | | | 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>
* | Implement QCameraViewfinderSettingsControl2 interface for AndroidRuslan Baratov2016-06-028-45/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Updated license headersAntti Kokko2016-01-1946-646/+922
| | | | | | | | | | | | | | | | | | | | | | 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-158-101/+483
|\| | | | | | | | | | | | | | | 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
| | * Android: Don't call restartViewfinder() for audio only recordings.Christian Strømme2016-01-111-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling restartViewfinder() would try to access m_cameraSession without checking if it was valid. This change adds guards around the calls to restartViewfinder(), and one in the function itself. Task-number: QTBUG-50282 Change-Id: I1f2b4d2b2342bf2dc2b7f28a7bcd00e08a0edb44 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-072-0/+31
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/android/src/wrappers/jni/androidcamera.cpp Change-Id: Ibb34f710b1dfb9a23b378462f31432581c6c26f4
| | * Android: check for exceptions in some camera operations.Yoann Lopes2015-12-032-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all camera operations are documented to raise exceptions, but they actually might do so depending on the hardware/drivers. Check for exceptions in all functions that could porentially fail and react appropriately. Task-number: QTBUG-49134 Change-Id: I633ca7f2e3aeb6532e1c445735e62135f52cf25f Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| * | Android: fix QMediaRecorder crashing the camera server on some devices.Yoann Lopes2015-12-042-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices require MediaRecorder.setPreviewDisplay() to always be called, even though the Android doc says otherwise. Task-number: QTBUG-37837 Change-Id: I1e9b56f06e7c41bdf684f93b5ec7635f8ae9f379 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| * | Android: support non OpenGL video surfaces for the camera.Yoann Lopes2015-12-047-98/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Replace foreach with range-based forAnton Kudryavtsev2016-01-151-1/+1
|/ / | | | | | | | | | | | | ... in Android, AudioCapture and m3u plugins. Change-Id: If06a97e49cfa4d32a41da2f043710cfdbd8a7b20 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* / Add private API for conversion from QVideoFrame to QImage.Yoann Lopes2015-10-201-5/+6
|/ | | | | | | | | | 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: minor refactor of the camera frame callback.Yoann Lopes2015-08-202-44/+45
| | | | | Change-Id: I6b281c9b2d02cf223e66e04e31fdd0268aa277fc Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Android: fix video probes when recording the camera.Yoann Lopes2015-08-201-1/+6
| | | | | | | | | The preview frame callback is cleared by the Android Camera whenever a MediaRecorder is set up. We need to reset the callback after starting the media recorder. Change-Id: I604320b11eb3a7f6f8d7d3167d5aae371999be14 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Android: fix setting the camera preview resolution.Yoann Lopes2015-05-273-27/+18
| | | | | | | | | | | | | - When the video capture resolution or the image capture resolution changes, we now always set the viewfinder resolution to the highest available one with the same aspect ratio as the capture resolution. We were previously not doing anything if the new capture resolution had the same aspect ratio as the current viewfinder resolution. - Some devices don't support using a viewfinder resolution different from the video capture resolution. Make sure we handle this case. Change-Id: I8d3ab7b01c56ed78d1ca838a522ba459692fc332 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Yoann Lopes2015-05-052-17/+13
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/avfoundation/camera/avfcamerasession.h src/plugins/avfoundation/camera/avfcamerasession.mm Change-Id: Ib2e25d907a7069591920d2f69e007f314cc0fd85
| * Android: Don't delete the media recorder object twice.Christian Strømme2015-04-302-17/+13
| | | | | | | | | | | | | | | | | | | | In QAndroidCaptureSession::stop() we call restartViewFinder() which eventually calls QAndroidCaptureSession::stop() again, but this time the media recorder object is already released. Task-number: QTBUG-45637 Change-Id: I943c423398a99d98ccda1063fc16e47cba470deb Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-131-9/+14
|\| | | | | | | Change-Id: I5575a4ba13212c9bfe73a3de3ef17c6528beafc3
| * Android: fix adjusting camera viewfinder resolution.Yoann Lopes2015-02-111-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | The viewfinder resolution must be in the same aspect ratio as the image capture resolution. When adjusting the viewfinder resolution to comply with that restriction, we assumed that the ratios had to be exactly equal. Though, in practice, there can be a small difference. For example for resolutions 2592x1952 (ratio=1.3278) and resolution 640x480 (ratio=1.3333). Task-number: QTBUG-37525 Change-Id: Ia5a6dd3a4a6d901b24bf74f8aa4e34bffe61f89b Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Update copyright headersAntti Kokko2015-02-1244-308/+308
| | | | | | | | | | | | | | | | | | 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>
* | Add additional exposure modes to QCameraExposure.Andrew den Exter2014-11-281-0/+50
|/ | | | | | | | | [ChangeLog][GStreamer][Android] Camera exposure mode extended to support Action, Landscape, NightPortrait, Theatre, Sunset, SteadyPhoto, Fireworks, Party, Candlelight, and Barcode modes. Change-Id: I13d4bb042d27c0bd2ffcd369882b56bbabc84335 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Update license headers and add new license filesAntti Kokko2014-08-2444-830/+478
| | | | | | | | | - 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: Make sure we check and clear exceptions from the camera.Christian Strømme2014-07-141-3/+4
| | | | | | | | | | In several places we where ignoring the fact that we might get an exception from the camera code on Android. Failing to clear them will cause the application to to terminate. Task-number: QTBUG-39425 Change-Id: Idfe40e1749f54d551d37dae25912d9ddbc3da01e Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>