diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-03-09 16:26:33 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-06-14 09:55:13 +0000 |
commit | 32b8310e34890b83929f8b143dc9947f370994e3 (patch) | |
tree | 3188d31a1f1ade02c4c6e272e73c891749df6814 /src/plugins/avfoundation/camera/avfimageencodercontrol.mm | |
parent | af5e0d04852e5efc1ebd9d099f3906bc66a62338 (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/avfimageencodercontrol.mm')
-rw-r--r-- | src/plugins/avfoundation/camera/avfimageencodercontrol.mm | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/plugins/avfoundation/camera/avfimageencodercontrol.mm b/src/plugins/avfoundation/camera/avfimageencodercontrol.mm index b35008030..20de4b5e8 100644 --- a/src/plugins/avfoundation/camera/avfimageencodercontrol.mm +++ b/src/plugins/avfoundation/camera/avfimageencodercontrol.mm @@ -227,15 +227,7 @@ bool AVFImageEncoderControl::applySettings() return false; } - if (match != captureDevice.activeFormat) { - const AVFConfigurationLock lock(captureDevice); - if (!lock) { - qDebugCamera() << Q_FUNC_INFO << "failed to lock for configuration"; - return false; - } - captureDevice.activeFormat = match; - activeFormatChanged = true; - } + activeFormatChanged = qt_set_active_format(captureDevice, match, true); #if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_8_0) { |