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:
committed by
The Qt Project
parent
deaeb676eb
commit
b690a4d902
@@ -389,7 +389,7 @@ void QAndroidCaptureSession::applySettings()
|
||||
}
|
||||
|
||||
// video settings
|
||||
if (m_cameraSession && m_videoSettingsDirty) {
|
||||
if (m_cameraSession && m_cameraSession->camera() && m_videoSettingsDirty) {
|
||||
if (m_videoSettings.resolution().isEmpty()) {
|
||||
m_videoSettings.setResolution(m_defaultSettings.videoResolution);
|
||||
m_resolutionDirty = true;
|
||||
@@ -466,6 +466,8 @@ void QAndroidCaptureSession::onCameraOpened()
|
||||
|
||||
qSort(m_supportedResolutions.begin(), m_supportedResolutions.end(), qt_sizeLessThan);
|
||||
qSort(m_supportedFramerates.begin(), m_supportedFramerates.end());
|
||||
|
||||
applySettings();
|
||||
}
|
||||
|
||||
QAndroidCaptureSession::CaptureProfile QAndroidCaptureSession::getProfile(int id)
|
||||
|
||||
Reference in New Issue
Block a user