Camera2: fix ZSL snapshot
- don't stop zsl channel after snapshot is taken
- statemachine needs to change to preview_pic_taking state while taking
zsl snapshot
- default fps range should set to the last one which is highest fps
Change-Id: I23fb0f3a2b4876be11edd148eb9aa336c0369089
diff --git a/QCamera2/HAL/QCameraStateMachine.cpp b/QCamera2/HAL/QCameraStateMachine.cpp
index 2993d97..5c9eee4 100644
--- a/QCamera2/HAL/QCameraStateMachine.cpp
+++ b/QCamera2/HAL/QCameraStateMachine.cpp
@@ -606,8 +606,21 @@
bool needRestart = false;
rc = m_parent->updateParameters((char*)payload, needRestart);
if (rc == NO_ERROR) {
- rc = m_parent->commitParameterChanges();
+ if (needRestart) {
+ // need restart preview for parameters to take effect
+ m_parent->unpreparePreview();
+ // commit parameter changes to server
+ m_parent->commitParameterChanges();
+ // prepare preview again
+ rc = m_parent->preparePreview();
+ if (rc != NO_ERROR) {
+ m_state = QCAMERA_SM_STATE_PREVIEW_STOPPED;
+ }
+ } else {
+ rc = m_parent->commitParameterChanges();
+ }
}
+
result.status = rc;
result.request_api = evt;
result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
@@ -975,7 +988,11 @@
rc = m_parent->takePicture();
if (rc == NO_ERROR) {
// move state to picture taking state
- m_state = QCAMERA_SM_STATE_PIC_TAKING;
+ if (m_parent->isZSLMode()) {
+ m_state = QCAMERA_SM_STATE_PREVIEW_PIC_TAKING;
+ } else {
+ m_state = QCAMERA_SM_STATE_PIC_TAKING;
+ }
} else {
// move state to preview stopped state
m_state = QCAMERA_SM_STATE_PREVIEW_STOPPED;