From: Younghwan Joo Date: Fri, 21 Sep 2012 07:42:08 +0000 (-0700) Subject: hardware: samsung_slsi: libcamera2: modify CAF sequence for flash X-Git-Tag: cm-10.1-M1~111 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7f8d32121e67c60900dbe5239b5b4ce937d4692;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git 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 --- 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;