summaryrefslogtreecommitdiff
path: root/src/plugins/winrt/qwinrtcameracontrol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* winrt: Obtain new camera sample format and size on camera changeOliver Wolff2018-06-221-0/+2
| | | | | | | | | | | | By Resetting d->cameraSampleformat to Format_User when the selected video device is changed we make QWinRTCameraVideoRendererControl reobtain the camera sample format and size during the next call of queueBuffer. This is needed as the new camera might have other values for these, which might result in a white screen after a camera change. Task-number: QTBUG-67417 Change-Id: I29e28ddf4fc278aff00ad824bda61aedad91471d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* WinRT: Add ref to prevent seg faultVal Doroshchuk2018-05-041-0/+1
| | | | | | | | | | If IMFMediaSink is returned from IMFStreamSink needs to add ref because caller will release it. Task-number: QTBUG-68054 Change-Id: I6d1732f7873e09f742c072380673a08ad86fe73a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* WinRT: Keep camera as uninitialized when errorVal Doroshchuk2018-05-031-1/+1
| | | | | | | | | | | If initialization of camera finished with an error no need to report that camera is initialized successfully. Using camera in this case might lead to some segfaults and other errors. Task-number: QTBUG-68054 Change-Id: I6a197989c2b44454a8594ff19b8c03fb08f57c7e Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* winrt: Fix rotation of camera imageOliver Wolff2018-04-251-2/+1
| | | | | | | Task-number: QTBUG-63014 Change-Id: I6afacdb31f13a9e95784afaab90029a77f9fabfc Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Replace deprecated qSort() by std::sort()Friedemann Kleint2018-02-281-3/+4
| | | | | Change-Id: I74ffd5bafaef9ebbe7f12600ad831c8deb58ae64 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-191-129/+169
|\ | | | | | | | | | | | | Conflicts: src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.h Change-Id: Ic6e27742ef6d1af0532ad05902a1431ebd5f449d
| * Ask for camera permissionsOliver Wolff2017-09-261-119/+161
| | | | | | | | | | | | Task-number: QTBUG-63308 Change-Id: Ic66d5d50b026350cf03afc19c58fc7c93029a69a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * winrt: Use QMutex instead of criticalSectionsOliver Wolff2017-09-251-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | critical sections are really unpredictable when it comes to order of activation. It was possible that the loop in QWinRTAbstractVideoRendererControl's syncAndRender blocked its setBlitMode for up to 30 seconds on application start. During this time the camera screen just stayed black. The whole approach seems to work a lot better when QMutexes are used. Task-number: QTBUG-63015 Change-Id: Ib1b0fa1da35fe299896068146254e4cf1d9616fb Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-5/+5
| | | | | | | | | | Change-Id: I3b7601b4a97f8a2b1d2da6ef134f1577846ba713 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-221-31/+31
|/ | | | | Change-Id: I17b3650a3df5688274151c1f2c4629e4a5062028 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* winrt: Fix crash when locking/unlocking focusMaurice Kalinowski2016-10-111-39/+59
| | | | | | | | The lock/unlock operation has to be created in the Xaml thread. Task-number: QTBUG-56034 Change-Id: I450ad0ba4a8f1275f878917bcd16c31fbf87e164 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* winrt: Add QCameraFlashControlMaurice Kalinowski2016-09-191-0/+11
| | | | | | | | | | | This is without video modes so far, simply because video itself is not supported yet. Also included a cleanup for string conversions. Task-number: QTBUG-48541 Change-Id: Ib090f61861596e095d597cf7e5e74f7040fbc58f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replaced old license headers with new and correct onesJani Heikkinen2016-08-121-12/+15
| | | | | | | | | | 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-1/+2
|\ | | | | | | Change-Id: Ic29cb09048003f18ff86d4546cd547be715eaec8
| * winrt: Do not assert when missing region of interestMaurice Kalinowski2016-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Asserting is too heavy and can cause false positive on devices like the Lumia 535, where focus is supported, but not setting a focus point. Later on we check for existence of the control during the initialization, so it is safe to continue here. Task-number: QTBUG-54278 Change-Id: Ie68ff754d742888bdd6f4047e07d207707c90c91 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-301-39/+51
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/5.6.1' into 5.6Liang Qi2016-06-091-6/+9
| |\ | | | | | | | | | Change-Id: I0b4fde2a47b428fd04012a8dbec16fd14797b8dd
| * | winrt: focus action has to happen in the xaml threadMaurice Kalinowski2016-05-311-39/+51
| | | | | | | | | | | | | | | | | | | | | Otherwise it will cause asserts and/or crashes. Change-Id: If8af4202395ae573b280744343dd853346a8c160 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Merge remote-tracking branch 'origin/5.6.1' into 5.7.0Liang Qi2016-06-011-6/+9
|\ \ \ | | |/ | |/| | | | Change-Id: If59885e0d0780390705c69fa7520c6ccc179ef45
| * | winrt: Fix potential crash when querying for resolutionsv5.6.1-1v5.6.15.6.1Maurice Kalinowski2016-05-311-6/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c84bdf63e4de16586eda3c45d5c3c3b2dc4fe089 introduced a potential crash on Windows Phone as querying for photo resolutions still might return video properties. As a result, querying for ImageEncodingProperties will fail and the function returns no resolution at all causing an assert later on. Instead of checking for the stream type passed to getMediaStreamResolutions we have to check for the property type of the list itself. Task-number: QTBUG-53714 Change-Id: I7bfc48ebf1fef4f9165135af604ce6c91a418438 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-10/+25
|\ \ | |/ | | | | Change-Id: Ib95ddbbc6e2b69663597cae045ec81eda6d12d58
| * Merge 5.6 into 5.6.1Oswald Buddenhagen2016-05-121-1/+1
| |\ | | | | | | | | | Change-Id: Ib4a7640e12319d78ea5ae8f58d79c9fab8d0ea60
| | * winrt: Only set focus if supportedMaurice Kalinowski2016-05-101-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ic6dc2eb6acbd0f5167aa4bad9af08ce8aa5a456b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | winrt: Fix crash when initializing certain camerasMaurice Kalinowski2016-05-111-9/+24
| |/ | | | | | | | | | | | | | | | | | | | | Some cameras return video properties when querying for MediaStreamType_Photo, ie. Surface Book. This caused an assert. Instead when asking for photo resolutions, only query the available image resolutions and skip results not of type image. Change-Id: Ia1886a11f47676d6713eec86f3a80c664871a968 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-101-166/+210
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * winrt: Disable camera deactivation automation in debug modeMaurice Kalinowski2016-04-221-0/+4
| | | | | | | | | | | | | | | | | | | | Camera control reacts to an application becoming inactive and turns off the camera. However, when debugging or watching internals inside an IDE this feature breaks the state of the application as the IDE gets focus and hence camera is turned off. Change-Id: I6f80476592c0faa32e9da11401f699c6211d226a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * winrt: fix camera control after move to xaml threadMaurice Kalinowski2016-04-221-164/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Camera control management has to happen inside the xaml thread, otherwise the behavior is undefined. This results in ie. the first capture not working due to synchronization issues. When (de-)activating the videoRenderer we have to switch to the UI thread first. In addition add focus for Windows 10 (Mobile), previously it was compiled for Windows Phone 8.1 only. On desktop this might return no focus mode to be supported, but API-wise this is available. Task-number: QTBUG-47803 Change-Id: I9b345ebc82502fc6e00aede43b9096893cd0ad53 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * winrt: Add categorized logging to camera controlMaurice Kalinowski2016-04-221-0/+10
| | | | | | | | | | | | Change-Id: I6d823ac07950212d766905c9409469f2b1b84954 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| * winrt: Use ComPtr for better ref count trackingMaurice Kalinowski2016-04-221-2/+2
| | | | | | | | | | | | | | Just forwarding the content of a ComPtr is potentially dangerous. Change-Id: I4f3dfa04a5844d299a5653e31a4a0d1e1b86f9b5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | WinRT, WindowsAudio plugins: replace foreach with range-based forAnton Kudryavtsev2016-01-151-1/+1
|/ | | | | Change-Id: I37ab3239aeaa01ecd033bfe7d9c8885511844d4d Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* winrt: Wait for focus to finish when camera stoppedSamuel Nevala2015-11-201-4/+19
| | | | | | | | | Change-Id: I53918a8f7c5f50331593ad09233cd737e040e650 Task-Id: QTBUG-49527 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Matti Malinen <matti.malinen@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: Fix toggling camera position.Samuel Nevala2015-11-171-3/+3
| | | | | | | | | | Change scanline direction every time camera position changes. Change-Id: I8673eabe361c951f97f4422a682d11e862f8b27a Task-Id: QTBUG-47809 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: Fix crash when camera unloaded while searching focus.Samuel Nevala2015-11-111-2/+9
| | | | | | | | | | Return early from focus related methods when async operation reports that it is write protected. Change-Id: I41bf9121e7ae431e5158b5e4c43cde582c30dfd7 Task-Id: QTBUG-49347 Reviewed-by: Peng Wu <peng.wu@intopalo.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Fix crash when focus operation in progress.Samuel Nevala2015-10-221-0/+2
| | | | | | | | | If focus is locked repeatedly and fast on Lumia 920 FocusAsync returns null IAsyncAction and ::await crash on null pointer. Fix crash by returning early from method when operation in progress. Change-Id: Ie268fd2276d3e9090a47bf362cd58743bb83284a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Unload camera when application is suspended.Samuel Nevala2015-10-151-1/+25
| | | | | | | | | Camera needs to be unloaded when going to suspend. Otherwise resume from suspend will hang and application will be terminated. Change-Id: Idc8bd47e56c99ebd53a1a4632338cf977317a495 Task-Id: QTBUG-48569 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Prevent camera device from being suspended.Samuel Nevala2015-10-151-0/+26
| | | | | | | | | | | | On certain Lumia devices video buffer gets page locked when camera is stopped. Subsequent call to video frame map/unmap leads to camera device suspension. As a fix delay camera unload until all mapped video frames are unmapped and return early from video frame map when camera is not active. Task-Id: QTBUG-48672 Change-Id: If547b9d430727bbe0e12cd8c07a30aeff81d13e3 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Fix two possible null pointer exceptionsSamuel Nevala2015-10-141-3/+5
| | | | | | | | If camera state is changed rapidly these can occur. Change-Id: Ia9ccf9e03162350cd411ff9fc059c14f47b9a42e Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Fix frozen UI caused by camera search and lock focus.Samuel Nevala2015-10-011-1/+1
| | | | | | | | | Instead of yielding thread process events while waiting for focus to complete. Change-Id: I6b5f08bc175af37430c851f151fce5c3bfe238ad Task-Id: QTBUG-48534 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* Revert: "winrt: fix camera preview on Lumia 630"Samuel Nevala2015-09-301-42/+1
| | | | | | | | | This reverts commit be0a231be4ed28474271fb29f44e1eb3270f35b7. Moving blitting away from the camera device removed the need to lock buffer. Change-Id: I3a0e983d9ff2135e32e3e352c443ca653c1dd017 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Introduce DirectX pipeline bypass.Samuel Nevala2015-09-291-16/+0
| | | | | | | | | | | | Qt Windows Runtime camera uses DirectVideo to convert NV12 format texture to BGRA format texture. As the EGL Node can draw using NV12 already, allow video render control to choose which path to take. By default use DirectVideo. Bypass can be used as fallback when DirectVideo cannot be used or is not working. Task-Id: QTBUG-48331 Change-Id: I0cb87a7c4523bfb60610e6b41ab3fb05aff092a1 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Fix aspect ratio deviation between preview and encoding streamsSamuel Nevala2015-08-181-60/+85
| | | | | | | | | | | | | | | | The source texture size from camera was wrong due to a missing IMediaDeviceController::SetMediaStreamPropertiesAsync call for the preview media type. Therefore Viewfinder and StillImage capture modes behave tha same from QCamera point of view. By default, the camera takes the lowest capture resolution and the lowest preview resolution with a matching aspect ratio. If the capture resolution is set, the preview resolution is set to the lowest possible resolution with a matching aspect ratio. Until viewfinder settings are implemented for WinRT, there is no way for user to change the viewfinder resolution. Change-Id: I4b76ceb46bd4c366561f5206d913b97c0d0df211 Task-Id: QTBUG-47465 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* winrt: Add camera video probe controlsPeng Wu2015-08-101-0/+1
| | | | | | | | | [ChangLog][multimedia][winrt] The WinRT backend now supports QVideoProbes on camera objects. Task-number: QTBUG-46228 Change-Id: I7850c5ec6f61e5824064d4be8afc8a0b55d05806 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Add camera focus and focus lock controlsPeng Wu2015-08-101-0/+411
| | | | | | | | | [ChangLog][multimedia][winrt] The winrt backend now supports camera focus and focus lock for Windows Phone. Task-Id: QTBUG-46120 Change-Id: Idb222798284d887a6e90a4986c69274e0ef765f5 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-261-1/+4
|\ | | | | | | Change-Id: I5a5b387b93a4b9dbaa9710e78fd7bf1ca09aa3b3
| * WinRT: fix namespaced buildJoerg Bornemann2015-06-041-1/+3
| | | | | | | | | | | | Change-Id: I06b18e2a1318bda826befde52ee1fd874e25dd47 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * winrt: fix camera preview on Lumia 530Peng Wu2015-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | Lumia 530 has the same QTBUG-44838 device bug that gives black frames when blitting to the target texture for image preview. Add it to workaround blacklist. Task-number: QTBUG-45920 Change-Id: Ia411793b90e487fa57b943ed7f01e370bfb84a1f Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | winrt: Implement QImageEncoderControl for cameraPeng Wu2015-06-231-10/+30
|/ | | | | | | | | | Implement QImageEncoderControl for camera still image capture. It provides the functions to set camera capture resolution and get supported resolutions list. Task-number: QTBUG-46456 Change-Id: Ideb1aa02d420be3a30d588bebf31714fa4fa6415 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Updated WinRT license headers to use LGPLv3 instead of LGPLv21Jani Heikkinen2015-05-211-10/+13
| | | | | | | | From 5.5.0 -> WinRT port is licensed with LGPLv3, see http://blog.qt.io/blog/2015/04/29/windows-10-support-in-qt/ Change-Id: I86e43ba051e3bc1dfb3eb9e1d442a9a12e9efdb7 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: fix camera preview on Lumia 630Peng Wu2015-04-161-1/+41
| | | | | | | | | | | | Certain devices give black frames when blitting to the target texture for image preview. However, a workaround has been found that simply mapping the buffer forces the frames to be rendered properly. As this degrades performance on devices with hardware buffers, a blacklist is introduced to specify which devices require this workaround. Task-number: QTBUG-44838 Change-Id: I137a1dc4e5126e7cf9ee00cb2d7e7722bf917efa Reviewed-by: Andrew Knight <qt@panimo.net>
* Update copyright headersAntti Kokko2015-02-121-22/+14
| | | | | | | | | 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>