summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-21 18:20:06 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commitc0a0f6e79d08b0eb53e14b6eb0f5c2781bb9e67c (patch)
tree00ef7b94630d92cb946d6fbb192f3ff2a14e2bce
parent68991103750ceba818c6c55d2e015697c9a406c7 (diff)
downloadandroid_packages_apps_Snap-c0a0f6e79d08b0eb53e14b6eb0f5c2781bb9e67c.zip
android_packages_apps_Snap-c0a0f6e79d08b0eb53e14b6eb0f5c2781bb9e67c.tar.gz
android_packages_apps_Snap-c0a0f6e79d08b0eb53e14b6eb0f5c2781bb9e67c.tar.bz2
SnapdragonCamera: Synchronize af & ae states before capturing
When in dual camera mode, synchronize AF and AE states between the two cameras before issuing capture requests. This allows capture requests to be issued simultaneously and achieves better temporal matching. CRs-Fixed: 993611 Change-Id: I097eae6b95153eefebeed3b22e02d4f4e56d565e
-rw-r--r--src/com/android/camera/CaptureModule.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 80e9d55..73d157f 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -143,6 +143,10 @@ public class CaptureModule implements CameraModule, PhotoController,
* Camera state: Waiting for the touch-to-focus to converge.
*/
private static final int STATE_WAITING_TOUCH_FOCUS = 5;
+ /**
+ * Camera state: Focus and exposure has been locked and converged.
+ */
+ private static final int STATE_AF_AE_LOCKED = 6;
private static final String TAG = "SnapCam_CaptureModule";
// Used for check memory status for longshot mode
@@ -515,8 +519,7 @@ public class CaptureModule implements CameraModule, PhotoController,
// CONTROL_AE_STATE can be null on some devices
if (aeState == null || (aeState == CaptureResult
.CONTROL_AE_STATE_CONVERGED) && isFlashOff(id)) {
- mState[id] = STATE_PICTURE_TAKEN;
- captureStillPicture(id);
+ checkAfAeStatesAndCapture(id);
} else {
runPrecaptureSequence(id);
}
@@ -541,8 +544,7 @@ public class CaptureModule implements CameraModule, PhotoController,
Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
Log.d(TAG, "STATE_WAITING_NON_PRECAPTURE id: " + id + " aeState:" + aeState);
if (aeState == null || aeState != CaptureResult.CONTROL_AE_STATE_PRECAPTURE) {
- mState[id] = STATE_PICTURE_TAKEN;
- captureStillPicture(id);
+ checkAfAeStatesAndCapture(id);
}
break;
}
@@ -551,6 +553,22 @@ public class CaptureModule implements CameraModule, PhotoController,
}
}
+ private void checkAfAeStatesAndCapture(int id) {
+ if(isBackCamera() && getCameraMode() == DUAL_MODE) {
+ mState[id] = STATE_AF_AE_LOCKED;
+ if(mState[BAYER_ID] == STATE_AF_AE_LOCKED &&
+ mState[MONO_ID] == STATE_AF_AE_LOCKED) {
+ mState[BAYER_ID] = STATE_PICTURE_TAKEN;
+ mState[MONO_ID] = STATE_PICTURE_TAKEN;
+ captureStillPicture(BAYER_ID);
+ captureStillPicture(MONO_ID);
+ }
+ } else {
+ mState[id] = STATE_PICTURE_TAKEN;
+ captureStillPicture(id);
+ }
+ }
+
public void startFaceDetection() {
mUI.onStartFaceDetection(mDisplayOrientation,
mSettingsManager.isFacingFront(getMainCameraId()),