Android: fix crash in QAndroidCaptureSession.

Don't try to apply video recording settings until a camera is actually
started.

Change-Id: I5348b91669835b9d776f56a3f49e3f8a11533d15
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2014-01-21 16:23:41 +01:00
committed by The Qt Project
parent deaeb676eb
commit b690a4d902

View File

@@ -389,7 +389,7 @@ void QAndroidCaptureSession::applySettings()
} }
// video settings // video settings
if (m_cameraSession && m_videoSettingsDirty) { if (m_cameraSession && m_cameraSession->camera() && m_videoSettingsDirty) {
if (m_videoSettings.resolution().isEmpty()) { if (m_videoSettings.resolution().isEmpty()) {
m_videoSettings.setResolution(m_defaultSettings.videoResolution); m_videoSettings.setResolution(m_defaultSettings.videoResolution);
m_resolutionDirty = true; m_resolutionDirty = true;
@@ -466,6 +466,8 @@ void QAndroidCaptureSession::onCameraOpened()
qSort(m_supportedResolutions.begin(), m_supportedResolutions.end(), qt_sizeLessThan); qSort(m_supportedResolutions.begin(), m_supportedResolutions.end(), qt_sizeLessThan);
qSort(m_supportedFramerates.begin(), m_supportedFramerates.end()); qSort(m_supportedFramerates.begin(), m_supportedFramerates.end());
applySettings();
} }
QAndroidCaptureSession::CaptureProfile QAndroidCaptureSession::getProfile(int id) QAndroidCaptureSession::CaptureProfile QAndroidCaptureSession::getProfile(int id)