AVFoundation: fix switching to still image capture mode.
It would reset the active format on the capture device. The patch prevents that. Change-Id: I97c192c064bf3c6ed4ba1f8d78768196927819a7 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "avfcameradebug.h"
|
#include "avfcameradebug.h"
|
||||||
#include "avfimagecapturecontrol.h"
|
#include "avfimagecapturecontrol.h"
|
||||||
#include "avfcameraservice.h"
|
#include "avfcameraservice.h"
|
||||||
|
#include "avfcamerautility.h"
|
||||||
#include "avfcameracontrol.h"
|
#include "avfcameracontrol.h"
|
||||||
|
|
||||||
#include <QtCore/qurl.h>
|
#include <QtCore/qurl.h>
|
||||||
@@ -208,6 +209,8 @@ void AVFImageCaptureControl::updateCaptureConnection()
|
|||||||
|
|
||||||
if (![captureSession.outputs containsObject:m_stillImageOutput]) {
|
if (![captureSession.outputs containsObject:m_stillImageOutput]) {
|
||||||
if ([captureSession canAddOutput:m_stillImageOutput]) {
|
if ([captureSession canAddOutput:m_stillImageOutput]) {
|
||||||
|
// Lock the video capture device to make sure the active format is not reset
|
||||||
|
const AVFConfigurationLock lock(m_session->videoCaptureDevice());
|
||||||
[captureSession addOutput:m_stillImageOutput];
|
[captureSession addOutput:m_stillImageOutput];
|
||||||
m_videoConnection = [m_stillImageOutput connectionWithMediaType:AVMediaTypeVideo];
|
m_videoConnection = [m_stillImageOutput connectionWithMediaType:AVMediaTypeVideo];
|
||||||
updateReadyStatus();
|
updateReadyStatus();
|
||||||
|
|||||||
Reference in New Issue
Block a user