AVFoundation: fix default camera viewfinder pixel format.
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>
This commit is contained in:
@@ -283,12 +283,12 @@ void AVFCameraSession::setState(QCamera::State newState)
|
||||
|
||||
if (m_state == QCamera::ActiveState) {
|
||||
Q_EMIT readyToConfigureConnections();
|
||||
[m_captureSession commitConfiguration];
|
||||
[m_captureSession startRunning];
|
||||
m_defaultCodec = 0;
|
||||
defaultCodec();
|
||||
applyImageEncoderSettings();
|
||||
applyViewfinderSettings();
|
||||
[m_captureSession commitConfiguration];
|
||||
[m_captureSession startRunning];
|
||||
}
|
||||
|
||||
if (oldState == QCamera::ActiveState) {
|
||||
@@ -374,8 +374,7 @@ void AVFCameraSession::applyViewfinderSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if (!vfSettings.isNull())
|
||||
vfControl->applySettings();
|
||||
vfControl->applySettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user