hardware: samsung_slsi: libcamera2: Add AF state reset on mode change
authorSungjoong Kang <sj3.kang@samsung.com>
Wed, 24 Oct 2012 06:50:12 +0000 (23:50 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Thu, 25 Oct 2012 01:35:15 +0000 (18:35 -0700)
Resets AF state on AF mode change.
AF cancellation works properly in manual(infinite) mode.
Removed some compile warnings.

BUG : 6970465
Signed-off-by: Sungjoong Kang <sj3.kang@samsung.com>
Change-Id: I9d577c5f57a0cebd31fb50954fee555722bae6a7

libcamera2/ExynosCameraHWInterface2.cpp

index 324d02aa3cd72fbf9cbfb94f9fb0846471ec3fb0..2cdb41ecc28b428d9b796f2030a9f27a6bc63d41 100644 (file)
@@ -2177,7 +2177,7 @@ int ExynosCameraHWInterface2::releaseStream(uint32_t stream_id)
                     ion_unmap(targetStream->m_parameters.svcBuffers[i].virt.extP[j],
                                     targetStream->m_parameters.svcBuffers[i].size.extS[j]);
                     ALOGV("(%s) ummap stream buffer[%d], plane(%d), fd %d vaddr %x", __FUNCTION__, i, j,
-                                  targetStream->m_parameters.svcBuffers[i].fd.extFd[j], targetStream->m_parameters.svcBuffers[i].virt.extP[j]);
+                                  targetStream->m_parameters.svcBuffers[i].fd.extFd[j], (unsigned int)(targetStream->m_parameters.svcBuffers[i].virt.extP[j]));
                 }
             }
         }
@@ -2249,7 +2249,7 @@ int ExynosCameraHWInterface2::releaseStream(uint32_t stream_id)
                     ion_unmap(targetStream->m_parameters.svcBuffers[i].virt.extP[j],
                                     targetStream->m_parameters.svcBuffers[i].size.extS[j]);
                     ALOGV("(%s) ummap stream buffer[%d], plane(%d), fd %d vaddr %x", __FUNCTION__, i, j,
-                                  targetStream->m_parameters.svcBuffers[i].fd.extFd[j], targetStream->m_parameters.svcBuffers[i].virt.extP[j]);
+                                  targetStream->m_parameters.svcBuffers[i].fd.extFd[j], (unsigned int)(targetStream->m_parameters.svcBuffers[i].virt.extP[j]));
                 }
             }
         }
@@ -3891,7 +3891,7 @@ void ExynosCameraHWInterface2::m_streamFunc_direct(SignalDrivenThread *self)
                             &(selfStreamParms->svcBufHandle[selfStreamParms->bufIndex]));
                 }
                 else if ((currentOutputStreams & STREAM_MASK_ZSL) && selfThread->m_index == 1) {
-                    ALOGV("** SCC output (frameCnt:%d), last(%d)", frame->rcount);
+                    ALOGV("** SCC output (frameCnt:%d)", frame->rcount);
                     res = selfStreamParms->streamOps->enqueue_buffer(selfStreamParms->streamOps,
                                 frameTimeStamp,
                                 &(selfStreamParms->svcBufHandle[selfStreamParms->bufIndex]));
@@ -5521,6 +5521,7 @@ void ExynosCameraHWInterface2::OnAfCancel(int id)
     case AA_AFMODE_AUTO:
     case AA_AFMODE_MACRO:
     case AA_AFMODE_OFF:
+    case AA_AFMODE_MANUAL:
         OnAfCancelAutoMacro(id);
         break;
     case AA_AFMODE_CONTINUOUS_VIDEO:
@@ -5642,6 +5643,8 @@ void ExynosCameraHWInterface2::SetAfMode(enum aa_afmode afMode)
             ALOGV("(%s): current(%d) new(%d)", __FUNCTION__, m_afMode, afMode);
             m_IsAfModeUpdateRequired = true;
             m_afMode = afMode;
+            SetAfStateForService(ANDROID_CONTROL_AF_STATE_INACTIVE);
+            m_afState = HAL_AFSTATE_INACTIVE;
         }
     }
 }