summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-251-20/+20
| | | | | | | | | | | 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-271-20/+20
| | | | | | | | | | | | | | | | 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>
* AVF: Use supported pixel formats from video surface in CameraVal Doroshchuk2020-03-031-20/+23
| | | | | | | | | | | | | QAbstractVideoSurface is waiting for the video frames in supported pixel formats. See QAbstractVideoSurface::supportedPixelFormats(). If the surface does not support device's pixel format, don't show the camera's viewfinder and don't return video frames in unsupported formats. Task-number: QTBUG-82264 Change-Id: I084674f4b093a751bc4f4941047b979766880963 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* AVF: Fix applying viewfinder settings for iOSVal Doroshchuk2020-02-181-1/+10
| | | | | | | | | | | | | | | | | | | | | 1. If a resolution of the viewfinder is requested to be changed, it is not needed to check available formats for highResolutionStillImageDimensions (since it is viewfinder resolution and not still images). format.highResolutionStillImageDimensions returns the highest resolution still image that can be produced by the format. Using this format will cause wrong resolution in the viewfinder. 2. Seems iOS requires to call beginConfiguration/commitConfiguration to apply any changes. commitConfiguration is currently called when the camera gets active. In case if settings are changed after starting the camera, they will not be applied. To fix that, added beginConfiguration/commitConfiguration. Fixes: QTBUG-79935 Change-Id: I60b6e08887a82e4337a2a302b8e5513c65b26e61 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* AVF: Always lock the capture device when start the cameraVal Doroshchuk2020-01-241-0/+1
| | | | | | | | | | | If the viewfinder settings are valid, need to lock the capture device to avoid reseting settings to default values. See also a8123e737140719549252806e0e6a1c121359f79 Fixes: QTBUG-81048 Change-Id: I834815ef6c5ef28d8017d04bdb9d5256c02d1de7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* AVF: Don't apply settings if the camera is not active yetVal Doroshchuk2020-01-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | In macOS, a capture session can still automatically configure the capture format after you make changes. If frame rates are applied to the capture device and the camera is still not active, these rates will be overridden by old values when the capture session will be started. For this purpose lockForConfiguration is currently used within startRunning method of capture session. But in case if the settings are already applied to the capture device, we don't call lockForConfiguration within starting of the capture session (since it is needed to be called only when the settings have been changed). Suggesting to postpone setting of the format (to the capture device) until the camera is started. This will lead to apply settings before startRunning method with proper configuration lock. Fixes: QTBUG-81048 Change-Id: I04664e7b63474ce28571e888e524170b995a38d6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* avfoundation: modernize by using nullptr and overrideJochen Seemann2019-01-041-4/+4
| | | | | Change-Id: Ifd483f925ed69f0ba35c46facfdb571dea87c1ac Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Remove deprecated QSysInfo APIs and dead code from macOS/iOS backendJake Petroules2016-09-231-97/+64
| | | | | | | Deployment targets are currently macOS 10.9 and iOS 7.0. Change-Id: I500a95c00eb3be6e693e38f0f2205941f7bc9601 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-211-204/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-204/+9
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * AVFoundation: improve changing the capture device format.Yoann Lopes2016-06-141-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the device format is always set in the same way. We don't actually set the format anymore when it's the same as the current one. We also make sure the frame rate is preserved. Change-Id: I1c68239bc99d9c3cef920effcf47fc253220c26f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * AVFoundation: implement QVideoEncoderSettingsControl.Yoann Lopes2016-06-031-196/+9
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-40338 Change-Id: Ic23dabaad94d7b293019460710ae1a097002e227 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-1/+6
|\| | | | | | | | | | | Change-Id: I773db005bbdc511169917ee35eb5b517e898926b
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-101-1/+6
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| | * AVFoundation: return correct viewfinder settings.Yoann Lopes2016-04-131-1/+6
| | | | | | | | | | | | | | | | | | | | | When the camera is unloaded, return the requested settings. Change-Id: If39e158cd8d0fd8d4bbd7cf6cd48226cdefc1272 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | | Add YUV 4:2:2 8Bit to supported formats of OS X camera plugin.Samuel Gaist2016-04-291-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | Now that QtQuick handles YUV 4:2:2 8Bit video formats, let the input use them. [ChangeLog][OS X][Input format] Added YUV 4:2:2 8 bit to supported camera video formats. Change-Id: Ib9b927a530232111a1d1139689b4cd2adf34da3f Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* / Updated license headersAntti Kokko2016-01-191-14/+20
|/ | | | | | | | | | | 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>
* AVFoundation: correctly set the activeFormat on the AVCaptureDevice.Yoann Lopes2015-12-101-17/+13
| | | | | | | | | | | | | | According to the AVCaptureDevice documentation, the device must be locked before starting the capture session to prevent the activeFormat from being overridden. We now do that, but only if we explicitly set an activeFormat. Otherwise the device is not locked, which allows the session to find an appropriate format for the capture device. The device is also locked when enabling video capture, as doing so might also reset the activeFormat. Task-number: QTBUG-49170 Change-Id: I75478fd4bbfec96cd2abd2c3ae2951088b38978e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* AVFoundation: improve viewfinder settings.Yoann Lopes2015-11-201-104/+100
| | | | | | | | | | | | Retrieving the supported viewfinder settings don't actually require a video surface, we just need a capture device. The supported settings can now be retrieved without calling QCamera::setSurface(). More generally, all viewfinder settings that don't require a video surface can now be gotten/set before calling setSurface(). Task-number: QTBUG-49170 Change-Id: I39b14eeb40517a9ba399748b5778be8bbc8cfcda Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Add qt_real_to_fraction() helper function.Yoann Lopes2015-11-191-2/+4
| | | | | | | | | | Private API meant to be used by plugins whose backends expect frame rate values represented by a ratio. The function implementation was moved from the AVFoundation plugin to the QtMultimedia library. Change-Id: I555b9d5da5ca3bae88992ed03501869fb731e45f Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* AVFoundation: render camera frames using OpenGL textures on iOS.Yoann Lopes2015-09-171-12/+19
| | | | | | | | | | | | | | | OpenGL textures can easily be created from a CVImageBuffer using Apple APIs. It avoids having to map the buffer to main memory and therefore greatly improves rendering performances. We could do the same on OSX, but there, the textures are always of the GL_TEXTURE_RECTANGLE target type and changes need to be done to the QVideoFrame API and to the video node implementations to support that. Change-Id: I6dde7e8d7a27460e41523cd474c3c741affc1480 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* AVFoundation: fix default camera viewfinder pixel format.Yoann Lopes2015-05-291-20/+25
| | | | | | | | | | | | It was hardcoded to ARGB32, which is not a good idea, at least on iOS where the necessary conversion is slow. We now pick the QAbstractVideoSurface's preferred format, or if no surface is set, we pick the default from AVFoundation. As a result, the QML VideoOutput will now always use the NV12 format. Change-Id: I65205c706455502883b8098f0b5c0577b4106e01 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* AVFoundation: additional build fixes for OSX < 10.9.Yoann Lopes2015-05-271-9/+26
| | | | | | | | 0df8d839 didn't fix all of the problems. Task-number: QTBUG-46159 Change-Id: I4f2a390da1cca13775302aeef60c522e0da55a1a Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* AVFoundation: fix compilation on OSX < 10.9.Yoann Lopes2015-05-191-16/+25
| | | | | | | | AVCaptureConnection.videoMaxFrameDuration is supported only since 10.9. Task-number: QTBUG-46159 Change-Id: I8ea57b69e97ea3802b5c444c57ab090c4edf31e2 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* AVFCameraViewfinderSettings - add NV12 formatTimur Pocheptsov2015-03-201-26/+51
| | | | | | | | | Add QVideoFrame::Format_NV12 (AVFoundation has kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange). Report it (set it) only if it's supported by renderer's surface. Add bi-planar format support into CVPixelBufferVideoBuffer. Change-Id: Ibc1c2be056bddf5cf3b595570fc40c626ee3ccf5 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* AVCaptureDeviceFormat - avoid duplicates (OS X/iOS)Timur Pocheptsov2015-03-101-5/+10
| | | | | | | | | | | Excluding video range (iOS) is not the right way to avoid "duplicates" - with other devices there can be also duplicates (formats with the same resolutions), but completely different pixel formats. Since we do not know what they will be in advance, we take the media subtype from the initial preset for a capture device and use it as a filter. Update viewfinder and image encoder settings controls. Change-Id: If20aea24b19b43574d5c3e9bf2ba85f50fc08916 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Viewfinder settings control (1) for OS X/iOSTimur Pocheptsov2015-03-021-0/+153
| | | | | | | | | QCameraViewfinderSettingsControl - version for AVFoundation plugin ('obsolete' viewfinder settings control interface, camera session uses v2 instead). v1 is implemented using v2 (the v2 object from camera service). Change-Id: I81207b52b0ba5a67e64465f0e5e0c80d7267df3e Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Viewfinder settings control (2) - version for iOS/OS XTimur Pocheptsov2015-03-021-0/+579
QCameraViewfinderSettingsControl2 - version for AV foundation plugin (the new settings control interface implemented). Change-Id: I3fbfb87925e57c914d43eb711fa5422e26981207 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>