AVFoundation: correctly set the activeFormat on the AVCaptureDevice.

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>
This commit is contained in:
Yoann Lopes
2015-11-19 15:41:01 +01:00
committed by Timur Pocheptsov
parent 8b00d8e542
commit 604a5753fa
7 changed files with 62 additions and 38 deletions

View File

@@ -68,7 +68,7 @@ private:
AVFCameraService *m_service;
QImageEncoderSettings m_settings;
void applySettings();
bool applySettings();
bool videoCaptureDeviceIsValid() const;
};