libcamera2: Enable video stabilization
authorAlex Ray <aray@google.com>
Fri, 21 Sep 2012 08:52:40 +0000 (01:52 -0700)
committerThe Android Automerger <android-build@android.com>
Fri, 21 Sep 2012 22:43:46 +0000 (15:43 -0700)
Bug: 7208193
Change-Id: Ib1cf6a716413e15a7c6576d5b844fe37e496aefe

libcamera2/ExynosCamera2.cpp
libcamera2/ExynosCamera2.h
libcamera2/ExynosCameraHWInterface2.cpp
libcamera2/ExynosCameraHWInterface2.h

index c6b61403784300f7697fbd91926ebdf910d2b67a..629280ea40dec0749f48aae8d7d43370a2604749 100644 (file)
@@ -555,10 +555,8 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info,
             availableAfModes, sizeof(availableAfModes));
 
     static const uint8_t availableVstabModes[] = {
-            ANDROID_CONTROL_VIDEO_STABILIZATION_OFF
-#ifdef VDIS_ENABLE
-            ,ANDROID_CONTROL_VIDEO_STABILIZATION_ON
-#endif
+            ANDROID_CONTROL_VIDEO_STABILIZATION_OFF,
+            ANDROID_CONTROL_VIDEO_STABILIZATION_ON
     };
     ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
             availableVstabModes, sizeof(availableVstabModes));
@@ -735,9 +733,6 @@ status_t ExynosCamera2::constructDefaultRequest(
     ADD_OR_SIZE(ANDROID_COLOR_MODE, &colorMode, 1);
     ADD_OR_SIZE(ANDROID_TONEMAP_MODE, &tonemapMode, 1);
     ADD_OR_SIZE(ANDROID_EDGE_MODE, &edgeMode, 1);
-#ifndef VDIS_ENABLE
-    vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF;
-#endif
     ADD_OR_SIZE(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, &vstabMode, 1);
 
     /** android.noise */
index 2f62d2ee966c3deaa99bd21512a4825db55f11b2..5d98a7520f580f82f47df12c37259a1781d8bb7d 100644 (file)
@@ -34,8 +34,6 @@
 #include "exynos_format.h"
 #include "fimc-is-metadata.h"
 
-//#define VDIS_ENABLE
-
 namespace android {
 
 struct ExynosCamera2Info
index 4eb809e06bb4dd665388ff23c286d2d2bba4b183..b458d298ebca3f514dfbdaa811fb661c68cc9610 100644 (file)
@@ -282,9 +282,7 @@ RequestManager::RequestManager(SignalDrivenThread* main_thread):
     m_lastAeMode(0),
     m_lastAaMode(0),
     m_lastAwbMode(0),
-#ifdef VDIS_ENABLE
     m_vdisBubbleEn(false),
-#endif
     m_lastAeComp(0),
     m_frameIndex(-1)
 {
@@ -702,7 +700,6 @@ void    RequestManager::UpdateIspParameters(struct camera2_shot_ext *shot_ext, i
         m_lastAeComp = (int)(shot_ext->shot.ctl.aa.aeExpCompensation);
     }
 
-#ifdef VDIS_ENABLE
     if (request_shot->shot.ctl.aa.videoStabilizationMode) {
         m_vdisBubbleEn = true;
         shot_ext->dis_bypass = 0;
@@ -710,7 +707,6 @@ void    RequestManager::UpdateIspParameters(struct camera2_shot_ext *shot_ext, i
         m_vdisBubbleEn = false;
         shot_ext->dis_bypass = 1;
     }
-#endif
 
     shot_ext->shot.ctl.aa.afTrigger = 0;
 
@@ -736,12 +732,10 @@ void    RequestManager::UpdateIspParameters(struct camera2_shot_ext *shot_ext, i
     (int)(shot_ext->shot.ctl.aa.afMode));
 }
 
-#ifdef VDIS_ENABLE
 bool    RequestManager::IsVdisEnable(void)
 {
         return m_vdisBubbleEn;
 }
-#endif
 
 int     RequestManager::FindEntryIndexByFrameCnt(int frameCnt)
 {
@@ -905,10 +899,8 @@ ExynosCameraHWInterface2::ExynosCameraHWInterface2(int cameraId, camera2_device_
             m_afState(HAL_AFSTATE_INACTIVE),
             m_afMode(NO_CHANGE),
             m_afMode2(NO_CHANGE),
-#ifdef VDIS_ENABLE
             m_vdisBubbleCnt(0),
             m_vdisDupFrame(0),
-#endif
             m_IsAfModeUpdateRequired(false),
             m_IsAfTriggerRequired(false),
             m_IsAfLockRequired(false),
@@ -2576,10 +2568,8 @@ void ExynosCameraHWInterface2::m_mainThreadFunc(SignalDrivenThread * self)
             if (NULL == currentRequest) {
                 ALOGE("DEBUG(%s)(0x%x): dequeue_request returned NULL ", __FUNCTION__, currentSignal);
                 m_isRequestQueueNull = true;
-#ifdef VDIS_ENABLE
                 if (m_requestManager->IsVdisEnable())
                     m_vdisBubbleCnt = 1;
-#endif
             }
             else {
                 m_requestManager->RegisterRequest(currentRequest);
@@ -2950,24 +2940,16 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self)
             matchedFrameCnt = m_requestManager->FindFrameCnt(shot_ext);
         }
 
-#ifdef VDIS_ENABLE
         if (matchedFrameCnt == -1 && m_vdisBubbleCnt > 0) {
             matchedFrameCnt = m_vdisDupFrame;
         }
-#endif
 
         if (matchedFrameCnt != -1) {
-#ifdef VDIS_ENABLE
             if (m_vdisBubbleCnt == 0) {
                 frameTime = systemTime();
                 m_requestManager->RegisterTimestamp(matchedFrameCnt, &frameTime);
                 m_requestManager->UpdateIspParameters(shot_ext, matchedFrameCnt, &m_ctlInfo);
             }
-#else
-            frameTime = systemTime();
-            m_requestManager->RegisterTimestamp(matchedFrameCnt, &frameTime);
-            m_requestManager->UpdateIspParameters(shot_ext, matchedFrameCnt, &m_ctlInfo);
-#endif
 
             if (m_afModeWaitingCnt != 0) {
                 ALOGV("### Af Trigger pulled, waiting for mode change cnt(%d) ", m_afModeWaitingCnt);
@@ -3188,7 +3170,6 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self)
             (int)(shot_ext->shot.ctl.aa.awbMode), (int)(shot_ext->shot.ctl.aa.afMode),
             (int)(shot_ext->shot.ctl.aa.afTrigger));
 
-#ifdef VDIS_ENABLE
             if (m_vdisBubbleCnt > 0 && m_vdisDupFrame == matchedFrameCnt) {
                 shot_ext->dis_bypass = 1;
                 shot_ext->request_scp = 0;
@@ -3198,7 +3179,6 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self)
             } else {
                 m_vdisDupFrame = matchedFrameCnt;
             }
-#endif
 
             uint32_t current_scp = shot_ext->request_scp;
 
index ef39b1d794f2f93ec79879c25f5774b5caf34a7b..9b3e0260112bb7ea3ed05e95577222492b9a50a2 100644 (file)
@@ -294,9 +294,7 @@ public:
     uint8_t  GetOutputStreamByFrameCnt(int frameCnt);
     uint8_t  GetOutputStream(int index);
     int     FindFrameCnt(struct camera2_shot_ext * shot_ext);
-#ifdef VDIS_ENABLE
     bool    IsVdisEnable(void);
-#endif
     int     FindEntryIndexByFrameCnt(int frameCnt);
     void    Dump(void);
     int     GetNextIndex(int index);
@@ -332,9 +330,7 @@ private:
     int                             m_lastAaMode;
     int                             m_lastAwbMode;
     int                             m_lastAeComp;
-#ifdef VDIS_ENABLE
     bool                            m_vdisBubbleEn;
-#endif
     nsecs_t                         m_lastTimeStamp;
     List<int>                   m_sensorQ;
 };
@@ -652,10 +648,8 @@ class MainThread : public SignalDrivenThread {
     uint32_t                            lastAfRegion[4];
     float                               m_zoomRatio;
 
-#ifdef VDIS_ENABLE
     int                                 m_vdisBubbleCnt;
     int                                 m_vdisDupFrame;
-#endif
 
     mutable Mutex                       m_qbufLock;