QCamera2: Override recording hint if there is no active recording.

When recording hint is set and application calls take picture
without even starting recording session, override recording hint
internally and fallback to non-zsl capture. This can happen during
CTS which expect preview behaviour in this case similar to non-zsl
capture, that is preview should be stopped after snapshot.

Change-Id: I42c197980a5f7804dba740e4ecb26adc618661cf
cm-14.0
Sai Kumar Sanagavarapu 12 years ago committed by Ricardo Cerqueira
parent 97fcf9a494
commit 595442a41e

@ -1142,38 +1142,38 @@ int32_t QCameraStateMachine::procEvtPreviewingState(qcamera_sm_evt_enum_t evt,
break;
case QCAMERA_SM_EVT_TAKE_PICTURE:
{
if ( m_parent->mParameters.getRecordingHintValue() == false) {
if (m_parent->isZSLMode() || m_parent->isLongshotEnabled()) {
m_state = QCAMERA_SM_STATE_PREVIEW_PIC_TAKING;
rc = m_parent->takePicture();
if (rc != NO_ERROR) {
// move state to previewing state
m_state = QCAMERA_SM_STATE_PREVIEWING;
}
} else {
m_state = QCAMERA_SM_STATE_PIC_TAKING;
rc = m_parent->takePicture();
if (rc != NO_ERROR) {
// move state to preview stopped state
m_state = QCAMERA_SM_STATE_PREVIEW_STOPPED;
}
}
result.status = rc;
result.request_api = evt;
result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
m_parent->signalAPIResult(&result);
} else {
if ( m_parent->mParameters.getRecordingHintValue() == true) {
m_parent->stopPreview();
m_parent->mParameters.updateRecordingHintValue(FALSE);
// start preview again
rc = m_parent->preparePreview();
if (rc == NO_ERROR) {
rc = m_parent->startPreview();
if (rc != NO_ERROR) {
m_parent->unpreparePreview();
}
}
}
if (m_parent->isZSLMode() || m_parent->isLongshotEnabled()) {
m_state = QCAMERA_SM_STATE_PREVIEW_PIC_TAKING;
rc = m_parent->takeLiveSnapshot();
if (rc != NO_ERROR ) {
rc = m_parent->takePicture();
if (rc != NO_ERROR) {
// move state to previewing state
m_state = QCAMERA_SM_STATE_PREVIEWING;
}
result.status = rc;
result.request_api = evt;
result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
m_parent->signalAPIResult(&result);
} else {
m_state = QCAMERA_SM_STATE_PIC_TAKING;
rc = m_parent->takePicture();
if (rc != NO_ERROR) {
// move state to preview stopped state
m_state = QCAMERA_SM_STATE_PREVIEW_STOPPED;
}
}
result.status = rc;
result.request_api = evt;
result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
m_parent->signalAPIResult(&result);
}
break;
case QCAMERA_SM_EVT_SEND_COMMAND:

Loading…
Cancel
Save