summaryrefslogtreecommitdiff
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-10-13 10:35:35 -0700
committerJay Wang <jaywang@codeaurora.org>2016-10-14 11:04:58 -0700
commitc250484c375484e70a1c8e64eb8bd956b3f1c15d (patch)
tree8b2e9bd5967ced66491bf877e1ff094e1dfb8625 /src/com/android/camera/CaptureModule.java
parent83d4e541a63de5026dca6c00d869a469e3a1d9ab (diff)
SnapdragonCamera: Use flash torch mode during continuous shot
When flash is turned on during continuous shot, flash is configured to torch mode. Change-Id: I8993bcfd974a34319193c5cf35e94c5f0d04346f CRs-Fixed: 1077543
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index ddee816a5..c800c6e4e 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1192,14 +1192,15 @@ public class CaptureModule implements CameraModule, PhotoController,
captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, mControlAFMode);
captureBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CaptureRequest.CONTROL_AF_TRIGGER_IDLE);
captureBuilder.set(CdsModeKey, 2); // CDS 0-OFF, 1-ON, 2-AUTO
- applySettingsForLockExposure(captureBuilder, id);
applySettingsForCapture(captureBuilder, id);
if(csEnabled) {
+ applySettingsForLockExposure(captureBuilder, id);
checkAndPlayShutterSound(id);
ClearSightImageProcessor.getInstance().capture(
id==BAYER_ID, mCaptureSession[id], captureBuilder, mCaptureCallbackHandler);
} else if(id == getMainCameraId() && mPostProcessor.isFilterOn()) { // Case of post filtering
+ applySettingsForLockExposure(captureBuilder, id);
checkAndPlayShutterSound(id);
mCaptureSession[id].stopRepeating();
captureBuilder.addTarget(mImageReader[id].getSurface());
@@ -1640,7 +1641,6 @@ public class CaptureModule implements CameraModule, PhotoController,
applyAFRegions(builder, id);
applyAERegions(builder, id);
applyCommonSettings(builder, id);
- applyFlash(builder, id);
}
private void applySettingsForCapture(CaptureRequest.Builder builder, int id) {
@@ -1654,7 +1654,10 @@ public class CaptureModule implements CameraModule, PhotoController,
builder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER,
CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_START);
applyCommonSettings(builder, id);
- applyFlash(builder, id);
+
+ // For long shot, torch mode is used
+ if (!mLongshotActive)
+ applyFlash(builder, id);
}
private void applySettingsForLockExposure(CaptureRequest.Builder builder, int id) {
@@ -3196,19 +3199,29 @@ public class CaptureModule implements CameraModule, PhotoController,
private void applyFlash(CaptureRequest.Builder request, String value) {
String redeye = mSettingsManager.getValue(SettingsManager.KEY_REDEYE_REDUCTION);
-
- if (redeye != null && redeye.equals("on")) {
+ if (redeye != null && redeye.equals("on") && !mLongshotActive) {
request.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE);
} else {
switch (value) {
case "on":
- request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
- request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
+ if (mLongshotActive) {
+ request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
+ request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_TORCH);
+ } else {
+ request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
+ request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
+ }
break;
case "auto":
- request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
- request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
+ if (mLongshotActive) {
+ // When long shot is active, turn off the flash in auto mode
+ request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
+ request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF);
+ } else {
+ request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
+ request.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
+ }
break;
case "off":
request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);