hardware: samsung_slsi: libcamera2: Fix black frame after night shot
authorSungjoong Kang <sj3.kang@samsung.com>
Thu, 4 Oct 2012 02:30:25 +0000 (19:30 -0700)
committerRebecca Schultz Zavin <rebecca@android.com>
Thu, 4 Oct 2012 05:05:11 +0000 (22:05 -0700)
By maintaining proper scene mode during shot-to-shot period,
removed black frames after taking a night shot.

Bug: 7283906
Change-Id: I4778f71c8ed5e73a62a12fc78c15348de27315a1
Signed-off-by: Sungjoong Kang <sj3.kang@samsung.com>
libcamera2/ExynosCameraHWInterface2.cpp
libcamera2/ExynosCameraHWInterface2.h

index 758748ed543e54c5ada45bfe76c7116fdb3eb600..22fb7b4161acf025bfebcf0a23a861ff291b60eb 100644 (file)
@@ -933,6 +933,7 @@ ExynosCameraHWInterface2::ExynosCameraHWInterface2(int cameraId, camera2_device_
             m_halDevice(dev),
             m_nightCaptureCnt(0),
             m_nightCaptureFrameCnt(0),
+            m_lastSceneMode(0),
             m_cameraId(cameraId),
             m_thumbNailW(160),
             m_thumbNailH(120)
@@ -1451,7 +1452,7 @@ int ExynosCameraHWInterface2::notifyRequestQueueNotEmpty()
     }
     m_isRequestQueueNull = false;
     if (m_requestManager->GetNumEntries() == 0)
-        m_requestManager->SetInitialSkip(5);
+        m_requestManager->SetInitialSkip(0);
 
     if (m_isIspStarted == false) {
         /* isp */
@@ -1558,7 +1559,7 @@ int ExynosCameraHWInterface2::notifyRequestQueueNotEmpty()
     if (m_isIspStarted == false) {
         StartISP();
         ALOGV("DEBUG(%s):starting sensor thread", __FUNCTION__);
-        m_requestManager->SetInitialSkip(5);
+        m_requestManager->SetInitialSkip(0);
         m_sensorThread->Start("SensorThread", PRIORITY_DEFAULT, 0);
         m_isIspStarted = true;
     }
@@ -3198,6 +3199,7 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self)
             // update AF region
             m_updateAfRegion(shot_ext);
 
+            m_lastSceneMode = shot_ext->shot.ctl.aa.sceneMode;
             if (shot_ext->shot.ctl.aa.sceneMode == AA_SCENE_MODE_NIGHT
                     && shot_ext->shot.ctl.aa.aeMode == AA_AEMODE_LOCKED)
                 shot_ext->shot.ctl.aa.aeMode = AA_AEMODE_ON;
@@ -3434,6 +3436,11 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self)
             } else {
                 shot_ext->setfile = ISS_SUB_SCENARIO_STILL;
             }
+            shot_ext->shot.ctl.aa.sceneMode = (enum aa_scene_mode)m_lastSceneMode;
+            if (shot_ext->shot.ctl.aa.sceneMode == AA_SCENE_MODE_NIGHT_CAPTURE || shot_ext->shot.ctl.aa.sceneMode == AA_SCENE_MODE_NIGHT) {
+                shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 8;
+                shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;
+            }
             shot_ext->shot.ctl.aa.aeflashMode = AA_FLASHMODE_OFF;
             ALOGV("### isp QBUF start (bubble)");
             ALOGV("bubble: queued  aa(%d) aemode(%d) awb(%d) afmode(%d) trigger(%d)",
index 30ef0af3ec8c58deea7673e7a5838976c1957990..e10905eb2dd4249a26fa2db5288fabb07f48567e 100644 (file)
@@ -675,6 +675,7 @@ class MainThread : public SignalDrivenThread {
     int                                 m_scpOutputImageCnt;
     int                                 m_nightCaptureCnt;
     int                                 m_nightCaptureFrameCnt;
+    int                                 m_lastSceneMode;
     int                                 m_thumbNailW;
     int                                 m_thumbNailH;
     int                                 m_reprocessStreamId;