summaryrefslogtreecommitdiff
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorzhuw <zhuw@codeaurora.org>2017-11-20 17:21:38 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-19 02:17:16 -0800
commitf5fb8e08e74bc802b946f4c1783d15dec218410d (patch)
treed507b60353bd1a7085e4ddb54635eb6f7077f4b6 /src/com/android/camera/CaptureModule.java
parent5c7d3d53d845fedccf4eb930da539db5c495d686 (diff)
SnapdragonCamera: add EIS in dev option
1. add filter for dev mode 2. add EIS in dev mode Change-Id: Ie9ccef765160b96260e7ba80f66206854d262676 CRs-Fixed: 2161096
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index bd3e4bec5..4f294a2e9 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -265,6 +265,8 @@ public class CaptureModule implements CameraModule, PhotoController,
"org.codeaurora.qcamera3.sharpness.strength", Integer.class);
public static final CaptureRequest.Key<Integer> exposure_metering = new CaptureRequest.Key<>(
"org.codeaurora.qcamera3.exposure_metering.exposure_metering_mode", Integer.class);
+ public static final CaptureRequest.Key<Byte> eis_mode =
+ new CaptureRequest.Key<>("org.quic.camera.eis3enable.EISV3Enable", byte.class);
private boolean[] mTakingPicture = new boolean[MAX_NUM_CAM];
private int mControlAFMode = CameraMetadata.CONTROL_AF_MODE_CONTINUOUS_PICTURE;
@@ -398,6 +400,7 @@ public class CaptureModule implements CameraModule, PhotoController,
private boolean mHighSpeedCapture = false;
private boolean mHighSpeedRecordingMode = false; //HFR
private int mHighSpeedCaptureRate;
+ private boolean mEisEnabled = false;
private CaptureRequest.Builder mVideoRequestBuilder;
private static final int STATS_DATA = 768;
@@ -3434,6 +3437,7 @@ public class CaptureModule implements CameraModule, PhotoController,
applyFaceDetection(builder);
applyZoom(builder, cameraId);
applyVideoEncoderProfile(builder);
+ applyEIS(builder);
}
private void updateVideoFlash() {
@@ -3559,6 +3563,15 @@ public class CaptureModule implements CameraModule, PhotoController,
mMediaRecorderPausing = true;
mRecordingTotalTime += SystemClock.uptimeMillis() - mRecordingStartTime;
mMediaRecorder.pause();
+ if (mEisEnabled) {
+ try {
+ if (mCurrentSession != null) {
+ mCurrentSession.abortCaptures();
+ }
+ } catch (CameraAccessException e) {
+ Log.w(TAG, "pauseVideoRecording " + " Camera access failed");
+ }
+ }
}
private void resumeVideoRecording() {
@@ -3593,6 +3606,13 @@ public class CaptureModule implements CameraModule, PhotoController,
boolean shouldAddToMediaStoreNow = false;
// Stop recording
checkAndPlayRecordSound(cameraId, false);
+ if (mEisEnabled) {
+ try {
+ mCaptureSession[cameraId].abortCaptures();
+ } catch (CameraAccessException e) {
+ Log.w(TAG, "stopRecordingVideo " + cameraId + " Camera access failed");
+ }
+ }
mFrameProcessor.setVideoOutputSurface(null);
mFrameProcessor.onClose();
closePreviewSession();
@@ -4145,7 +4165,11 @@ public class CaptureModule implements CameraModule, PhotoController,
String value = mSettingsManager.getValue(SettingsManager.KEY_SHARPNESS_CONTROL_MODE);
if (value != null) {
int intValue = Integer.parseInt(value);
- request.set(CaptureModule.sharpness_control, intValue);
+ try {
+ request.set(CaptureModule.sharpness_control, intValue);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
}
}
@@ -4161,6 +4185,22 @@ public class CaptureModule implements CameraModule, PhotoController,
}
}
+ private void applyEIS(CaptureRequest.Builder request) {
+ if (!mSettingsManager.isDeveloperEnabled()) {
+ return;//don't apply if not in dev mode
+ }
+ String value = mSettingsManager.getValue(SettingsManager.KEY_EIS_VALUE);
+ if (value != null) {
+ mEisEnabled = Boolean.parseBoolean(value);
+ byte byteValue = (byte) (mEisEnabled ? 0x01 : 0x00);
+ try {
+ request.set(CaptureModule.eis_mode, byteValue);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
private void applyExposureMeteringModes(CaptureRequest.Builder request) {
String value = mSettingsManager.getValue(SettingsManager.KEY_EXPOSURE_METERING_MODE);
if (value != null) {