diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-09-22 12:37:16 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-09-22 15:41:52 +0800 |
commit | d5b2118fc4aa377a3c4f5e4052745f14ec78b2c4 (patch) | |
tree | b7adfb5d559453748a43ecb444ac0f2c8eed9a6e /src/com | |
parent | 82d8d49ab1d0d303fc2e1c81e89389a81404895f (diff) | |
download | LegacyCamera-d5b2118fc4aa377a3c4f5e4052745f14ec78b2c4.zip LegacyCamera-d5b2118fc4aa377a3c4f5e4052745f14ec78b2c4.tar.gz LegacyCamera-d5b2118fc4aa377a3c4f5e4052745f14ec78b2c4.tar.bz2 |
Lock AE and AWB before autofocus starts.
Now camera API specifies autofocus does not lock AE and AWB.
So the application locks AE/AWB when focus starts.
AE/AWB are unlocked when focus finishes or preview starts.
bug:5356404
Change-Id: I9d735404babd5bc84bef5253768221fd7509afca
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/Camera.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 26d4497..970d98e 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -120,6 +120,9 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private Parameters mInitialParams; private boolean mFocusAreaSupported; private boolean mMeteringAreaSupported; + private boolean mAwbLockSupported; + private boolean mAeLockSupported; + private boolean mAeAwbLock; private MyOrientationEventListener mOrientationListener; // The degrees of the device rotated clockwise from its natural orientation. @@ -1417,6 +1420,9 @@ public class Camera extends ActivityBase implements FocusManager.Listener, // Do not do focus if there is not enough storage. if (pressed && !canTakePicture()) return; + // Lock AE and AWB so users can half-press shutter and recompose. + mAeAwbLock = pressed; + setCameraParameters(UPDATE_PARAM_PREFERENCE); mFocusManager.doFocus(pressed); } @@ -1519,6 +1525,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, if (mFaceView != null) { mFaceView.setDisplayOrientation(mDisplayOrientation); } + mAeAwbLock = false; // Always unlock AE and AWB before start. setCameraParameters(UPDATE_PARAM_ALL); try { @@ -1568,6 +1575,14 @@ public class Camera extends ActivityBase implements FocusManager.Listener, } private void updateCameraParametersPreference() { + if (mAwbLockSupported) { + mParameters.setAutoWhiteBalanceLock(mAeAwbLock); + } + + if (mAeLockSupported) { + mParameters.setAutoExposureLock(mAeAwbLock); + } + if (mFocusAreaSupported) { mParameters.setFocusAreas(mFocusManager.getTapArea()); } @@ -1972,5 +1987,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, && isSupported(Parameters.FOCUS_MODE_AUTO, mInitialParams.getSupportedFocusModes())); mMeteringAreaSupported = (mInitialParams.getMaxNumMeteringAreas() > 0); + mAwbLockSupported = mInitialParams.isAutoWhiteBalanceLockSupported(); + mAeLockSupported = mInitialParams.isAutoExposureLockSupported(); } } |