summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2018-11-13 11:07:10 +0800
committerxianming wang <mingwax@codeaurora.org>2018-11-14 16:41:52 +0800
commit117bf7ee2877a491e11241ea8c9129f8b53f9da3 (patch)
treef8d22377cf551cef2c940d08db27d67956a0342d /src
parent78b730055695188e43819ddf108b63021c9d7d7c (diff)
downloadandroid_packages_apps_Snap-117bf7ee2877a491e11241ea8c9129f8b53f9da3.tar.gz
android_packages_apps_Snap-117bf7ee2877a491e11241ea8c9129f8b53f9da3.tar.bz2
android_packages_apps_Snap-117bf7ee2877a491e11241ea8c9129f8b53f9da3.zip
SnapdragonCamera: Add vendorTag noiseReduction for HDR
Add vendorTag custom_noise_reduction for HDR Scene. Disable ZSL when enable HDR, capture button should enable until image received. CRs-Fixed: 2348911 Change-Id: I88c21c682d04636e903b07804634add60a3ba1f6
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 5ec6f5be9..08b533e04 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -2639,10 +2639,11 @@ public class CaptureModule implements CameraModule, PhotoController,
ImageAvailableListener listener = new ImageAvailableListener(i) {
@Override
public void onImageAvailable(ImageReader reader) {
- if (mIsSupportedQcfa || isMFNREnabled()) {
+ if (captureWaitImageReceive()) {
mHandler.post(new Runnable() {
@Override
public void run() {
+ Log.d(TAG, "image available for cam enable shutter button " );
mUI.enableShutter(true);
}
});
@@ -2826,7 +2827,7 @@ public class CaptureModule implements CameraModule, PhotoController,
@Override
public void run() {
mUI.stopSelfieFlash();
- if (!(mIsSupportedQcfa || isMFNREnabled())) {
+ if (!captureWaitImageReceive()) {
mUI.enableShutter(true);
}
if (mDeepPortraitMode) {
@@ -2850,6 +2851,22 @@ public class CaptureModule implements CameraModule, PhotoController,
return mfnrEnable;
}
+ private boolean isHDREnable() {
+ boolean hdrEnable = false;
+ if (mSettingsManager != null) {
+ String value = mSettingsManager.getValue(SettingsManager.KEY_SCENE_MODE);
+ if (value != null) {
+ int mode = Integer.parseInt(value);
+ hdrEnable = (mode == CaptureRequest.CONTROL_SCENE_MODE_HDR);
+ }
+ }
+ return hdrEnable;
+ }
+
+ private boolean captureWaitImageReceive() {
+ return mIsSupportedQcfa || isMFNREnabled() || isHDREnable();
+ }
+
private Size parsePictureSize(String value) {
int indexX = value.indexOf('x');
int width = Integer.parseInt(value.substring(0, indexX));
@@ -4761,7 +4778,7 @@ public class CaptureModule implements CameraModule, PhotoController,
try {
builder.set(custom_noise_reduction, (byte)0x01);
} catch (IllegalArgumentException e) {
- Log.w(TAG, "cannot find vendor tag: " + custom_noise_reduction.toString());
+ Log.w(TAG, "capture can`t find vendor tag: " + custom_noise_reduction.toString());
}
}
}
@@ -5983,6 +6000,13 @@ public class CaptureModule implements CameraModule, PhotoController,
&& mode != SettingsManager.SCENE_MODE_PROMODE_INT) {
request.set(CaptureRequest.CONTROL_SCENE_MODE, mode);
request.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_USE_SCENE_MODE);
+ if (mode == CaptureRequest.CONTROL_SCENE_MODE_HDR) {
+ try {
+ request.set(custom_noise_reduction, (byte)0x01);
+ } catch (IllegalArgumentException e) {
+ Log.w(TAG, " HDR can`t find vendor tag: " + custom_noise_reduction.toString());
+ }
+ }
} else {
request.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_AUTO);
}