summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSultanxda <sultanxda@gmail.com>2015-10-04 01:16:49 -0700
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-07 15:04:47 -0800
commit1e235c50d445df2dd34f5093a0506c266a93d5ea (patch)
tree04d2090bfed9f8815765ed8c1d8526d4db58b9e1
parentc03569f4b62647b9327b5a81e17805f0644fb1f8 (diff)
downloadandroid_packages_apps_Snap-1e235c50d445df2dd34f5093a0506c266a93d5ea.zip
android_packages_apps_Snap-1e235c50d445df2dd34f5093a0506c266a93d5ea.tar.gz
android_packages_apps_Snap-1e235c50d445df2dd34f5093a0506c266a93d5ea.tar.bz2
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 <sultanxda@gmail.com>
-rw-r--r--src/com/android/camera/VideoModule.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index cecaf14..e617ab2 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -118,6 +118,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;
@@ -502,6 +504,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 autoFocus() {
Log.e(TAG, "start autoFocus.");
@@ -534,6 +550,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);
@@ -2745,6 +2763,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