From d2f05a901f2c1e82ad2c1904b6dfc55574318668 Mon Sep 17 00:00:00 2001 From: Sultanxda Date: Sun, 4 Oct 2015 01:16:49 -0700 Subject: SnapdragonCamera: Lock AE and AWB for tap-to-focus in camcorder Lock the auto exposure (AE) and auto white balance (AWB) when tap-to-focus is used in the camcorder. Change-Id: Ieb24e04b74a06b2390eb9302e74b4f69b1486951 Signed-off-by: Sultanxda --- src/com/android/camera/VideoModule.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/com/android/camera/VideoModule.java') diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 5aefbd6db..1754b48ec 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -129,6 +129,8 @@ public class VideoModule implements CameraModule, private Parameters mParameters; private boolean mFocusAreaSupported; private boolean mMeteringAreaSupported; + private boolean mAeLockSupported; + private boolean mAwbLockSupported; private boolean mIsInReviewMode; private boolean mSnapshotInProgress = false; @@ -574,6 +576,20 @@ public class VideoModule implements CameraModule, mPendingSwitchCameraId = -1; } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + private void setAutoExposureLockIfSupported() { + if (mAeLockSupported) { + mParameters.setAutoExposureLock(mFocusManager.getAeAwbLock()); + } + } + + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + private void setAutoWhiteBalanceLockIfSupported() { + if (mAwbLockSupported) { + mParameters.setAutoWhiteBalanceLock(mFocusManager.getAeAwbLock()); + } + } + @Override public void waitingLocationPermissionResult(boolean result) { mLocationManager.waitingLocationPermissionResult(result); @@ -615,6 +631,8 @@ public class VideoModule implements CameraModule, mParameters.setFocusAreas(mFocusManager.getFocusAreas()); if (mMeteringAreaSupported) mParameters.setMeteringAreas(mFocusManager.getMeteringAreas()); + setAutoExposureLockIfSupported(); + setAutoWhiteBalanceLockIfSupported(); if (mFocusAreaSupported || mMeteringAreaSupported) { mParameters.setFocusMode(mFocusManager.getFocusMode(true)); mCameraDevice.setParameters(mParameters); @@ -3121,6 +3139,8 @@ public class VideoModule implements CameraModule, private void initializeCapabilities() { mFocusAreaSupported = CameraUtil.isFocusAreaSupported(mParameters); mMeteringAreaSupported = CameraUtil.isMeteringAreaSupported(mParameters); + mAeLockSupported = CameraUtil.isAutoExposureLockSupported(mParameters); + mAwbLockSupported = CameraUtil.isAutoWhiteBalanceLockSupported(mParameters); } // Preview texture has been copied. Now camera can be released and the -- cgit v1.2.3