summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2016-03-09 16:26:33 +0100
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-06-14 09:55:13 +0000
commit32b8310e34890b83929f8b143dc9947f370994e3 (patch)
tree3188d31a1f1ade02c4c6e272e73c891749df6814 /src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
parentaf5e0d04852e5efc1ebd9d099f3906bc66a62338 (diff)
AVFoundation: improve changing the capture device format.
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>
Diffstat (limited to 'src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm')
-rw-r--r--src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
index 1d2539893..14f146d25 100644
--- a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
@@ -382,15 +382,7 @@ bool AVFCameraViewfinderSettingsControl2::applySettings(const QCameraViewfinderS
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_7, __IPHONE_7_0)
AVCaptureDeviceFormat *match = findBestFormatMatch(settings);
if (match) {
- if (match != captureDevice.activeFormat) {
- const AVFConfigurationLock lock(captureDevice);
- if (lock) {
- captureDevice.activeFormat = match;
- activeFormatChanged = true;
- } else {
- qDebugCamera() << Q_FUNC_INFO << "failed to lock for configuration";
- }
- }
+ activeFormatChanged = qt_set_active_format(captureDevice, match, false);
} else {
qDebugCamera() << Q_FUNC_INFO << "matching device format not found";
// We still can update the pixel format at least.