summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2016-05-24 16:53:56 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:45:51 -0700
commit58af4e7bb6f048fea48d3c4656548188eca5f1de (patch)
tree62f5e30b0b8a5f8bd890d0167dbaaf72c481f657 /src/com
parent50dca41acfe880bf5d96cfd8cd21475a86d5dd5a (diff)
downloadandroid_packages_apps_Snap-58af4e7bb6f048fea48d3c4656548188eca5f1de.zip
android_packages_apps_Snap-58af4e7bb6f048fea48d3c4656548188eca5f1de.tar.gz
android_packages_apps_Snap-58af4e7bb6f048fea48d3c4656548188eca5f1de.tar.bz2
SnapdragonCamera: Add redeye reduction
Add redeye reduction to Camera2 Change-Id: Iae4beb9287a0a927330ba987238fac6a2dae058e CRs-Fixed: 1018118
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/CaptureModule.java2
-rw-r--r--src/com/android/camera/CaptureUI.java1
-rw-r--r--src/com/android/camera/SettingsManager.java20
3 files changed, 22 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 2b28f99..feef31f 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -2038,7 +2038,7 @@ public class CaptureModule implements CameraModule, PhotoController,
.FLASH_MODE_OFF);
break;
case CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH:
- if (redeye.equals("disable")) {
+ if (redeye != null && redeye.equals("disable")) {
request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest
.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE);
}
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 5b8ecad..3d766fa 100644
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -96,6 +96,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
SettingsManager.KEY_MAKEUP
};
String[] mDeveloperKeys = new String[]{
+ SettingsManager.KEY_REDEYE_REDUCTION,
SettingsManager.KEY_MONO_ONLY,
SettingsManager.KEY_CLEARSIGHT,
SettingsManager.KEY_MONO_PREVIEW
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index f3a2285..3a5f6f7 100644
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -36,6 +36,7 @@ import android.graphics.Rect;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
+import android.hardware.camera2.CameraMetadata;
import android.hardware.camera2.params.StreamConfigurationMap;
import android.util.Log;
import android.util.Range;
@@ -491,6 +492,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
ListPreference clearsight = mPreferenceGroup.findPreference(KEY_CLEARSIGHT);
ListPreference monoPreview = mPreferenceGroup.findPreference(KEY_MONO_PREVIEW);
ListPreference monoOnly = mPreferenceGroup.findPreference(KEY_MONO_ONLY);
+ ListPreference redeyeReduction = mPreferenceGroup.findPreference(KEY_REDEYE_REDUCTION);
if (whiteBalance != null) {
CameraSettings.filterUnsupportedOptions(mPreferenceGroup,
@@ -529,7 +531,11 @@ public class SettingsManager implements ListMenu.SettingsListener {
if (clearsight != null) removePreference(mPreferenceGroup, KEY_CLEARSIGHT);
if (monoPreview != null) removePreference(mPreferenceGroup, KEY_MONO_PREVIEW);
if (monoOnly != null) removePreference(mPreferenceGroup, KEY_MONO_ONLY);
+ }
+ if (redeyeReduction != null) {
+ CameraSettings.filterUnsupportedOptions(mPreferenceGroup,
+ redeyeReduction, getSupportedRedeyeReduction(cameraId));
}
}
@@ -682,6 +688,20 @@ public class SettingsManager implements ListMenu.SettingsListener {
return res;
}
+ private List<String> getSupportedRedeyeReduction(int cameraId) {
+ int[] flashModes = mCharacteristics.get(cameraId).get(CameraCharacteristics
+ .CONTROL_AE_AVAILABLE_MODES);
+ List<String> modes = new ArrayList<>();
+ for (int i = 0; i < flashModes.length; i++) {
+ if (flashModes[i] == CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE) {
+ modes.add("disable");
+ modes.add("enable");
+ break;
+ }
+ }
+ return modes;
+ }
+
private List<String> getSupportedWhiteBalanceModes(int cameraId) {
int[] whiteBalanceModes = mCharacteristics.get(cameraId).get(CameraCharacteristics
.CONTROL_AWB_AVAILABLE_MODES);