From f7f8d32121e67c60900dbe5239b5b4ce937d4692 Mon Sep 17 00:00:00 2001 From: Younghwan Joo Date: Fri, 21 Sep 2012 00:42:08 -0700 Subject: [PATCH] hardware: samsung_slsi: libcamera2: modify CAF sequence for flash This patch is to modify CAF sequence for proper operation with flash Change-Id: I59fb549d8eec763ca74d7fa2ba3be747946ef995 Signed-off-by: Younghwan Joo --- libcamera2/ExynosCameraHWInterface2.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index b458d29..18afdf7 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -4917,6 +4917,11 @@ void ExynosCameraHWInterface2::OnAfNotificationCAFPicture(enum aa_afstate noti) } } else if (m_afState == HAL_AFSTATE_NEEDS_DETERMINATION) { + //Skip notification in case of flash, wait the end of flash on + if (m_ctlInfo.flash.m_flashEnableFlg && m_ctlInfo.flash.m_afFlashDoneFlg) { + if (m_ctlInfo.flash.m_flashCnt < IS_FLASH_STATE_ON_DONE) + return; + } switch (noti) { case AA_AFSTATE_INACTIVE: nextState = NO_TRANSITION; @@ -4927,13 +4932,14 @@ void ExynosCameraHWInterface2::OnAfNotificationCAFPicture(enum aa_afstate noti) case AA_AFSTATE_AF_ACQUIRED_FOCUS: // If Flash mode is enable, after AF execute pre-capture metering if (m_ctlInfo.flash.m_flashEnableFlg && m_ctlInfo.flash.m_afFlashDoneFlg) { - ALOGV("[AF Flash] AUTO start with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); switch (m_ctlInfo.flash.m_flashCnt) { case IS_FLASH_STATE_ON_DONE: + ALOGV("[AF Flash] AUTO start with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); m_ctlInfo.flash.m_flashCnt = IS_FLASH_STATE_AUTO_AE_AWB_LOCK; nextState = NO_TRANSITION; break; case IS_FLASH_STATE_AUTO_DONE: + ALOGV("[AF Flash] AUTO end with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); m_ctlInfo.flash.m_flashCnt = IS_FLASH_STATE_AUTO_OFF; m_IsAfLockRequired = true; nextState = HAL_AFSTATE_LOCKED; @@ -4951,13 +4957,14 @@ void ExynosCameraHWInterface2::OnAfNotificationCAFPicture(enum aa_afstate noti) case AA_AFSTATE_AF_FAILED_FOCUS: // If Flash mode is enable, after AF execute pre-capture metering if (m_ctlInfo.flash.m_flashEnableFlg && m_ctlInfo.flash.m_afFlashDoneFlg) { - ALOGV("[AF Flash] AUTO start with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); switch (m_ctlInfo.flash.m_flashCnt) { case IS_FLASH_STATE_ON_DONE: + ALOGV("[AF Flash] AUTO start with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); m_ctlInfo.flash.m_flashCnt = IS_FLASH_STATE_AUTO_AE_AWB_LOCK; nextState = NO_TRANSITION; break; case IS_FLASH_STATE_AUTO_DONE: + ALOGV("[AF Flash] AUTO end with Mode (%d) state (%d) noti (%d)", m_afMode, m_afState, (int)noti); m_ctlInfo.flash.m_flashCnt = IS_FLASH_STATE_AUTO_OFF; m_IsAfLockRequired = true; nextState = HAL_AFSTATE_FAILED; -- 2.20.1