summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java27
-rwxr-xr-xsrc/com/android/camera/ui/ProMode.java22
2 files changed, 33 insertions, 16 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index cf5ebdb..3a69a03 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -4024,7 +4024,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
};
- private void configureCameraSessionWithParameters(CameraDevice camera,
+ private void configureCameraSessionWithParameters(int cameraId,
List<Surface> outputSurfaces, CameraCaptureSession.StateCallback listener,
Handler handler, CaptureRequest initialRequest) throws CameraAccessException {
List<OutputConfiguration> outConfigurations = new ArrayList<>(outputSurfaces.size());
@@ -4033,13 +4033,32 @@ public class CaptureModule implements CameraModule, PhotoController,
outConfigurations.add(new OutputConfiguration(surface));
}
+ String zzHDR = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_HDR_VALUE);
+ boolean zzHdrStatue = zzHDR.equals("1");
+ // if enable ZZHDR mode, don`t call the setOpModeForVideoStream method.
+ /* if (!zzHdrStatue) {
+ setOpModeForVideoStream(cameraId);
+ }*/
+ String value = mSettingsManager.getValue(SettingsManager.KEY_FOVC_VALUE);
+ if (value != null && Boolean.parseBoolean(value)) {
+ mStreamConfigOptMode = mStreamConfigOptMode | STREAM_CONFIG_MODE_FOVC;
+ }
+ if (zzHdrStatue) {
+ mStreamConfigOptMode = STREAM_CONFIG_MODE_ZZHDR;
+ }
+ if (DEBUG) {
+ Log.v(TAG, "configureCameraSessionWithParameters mStreamConfigOptMode :"
+ + mStreamConfigOptMode);
+ }
+
Method method_setSessionParameters = null;
Method method_createCaptureSession = null;
Object sessionConfig = null;
try {
Class clazz = Class.forName("android.hardware.camera2.params.SessionConfiguration");
sessionConfig = clazz.getConstructors()[0].newInstance(
- SESSION_REGULAR, outConfigurations, new HandlerExecutor(handler), listener);
+ SESSION_REGULAR | mStreamConfigOptMode, outConfigurations,
+ new HandlerExecutor(handler), listener);
if (method_setSessionParameters == null) {
method_setSessionParameters = clazz.getDeclaredMethod(
"setSessionParameters", CaptureRequest.class);
@@ -4047,7 +4066,7 @@ public class CaptureModule implements CameraModule, PhotoController,
method_setSessionParameters.invoke(sessionConfig, initialRequest);
method_createCaptureSession = CameraDevice.class.getDeclaredMethod(
"createCaptureSession", clazz);
- method_createCaptureSession.invoke(camera, sessionConfig);
+ method_createCaptureSession.invoke(mCameraDevice[cameraId], sessionConfig);
} catch (Exception exception) {
Log.w(TAG, "configureCameraSessionWithParameters method is not exist");
exception.printStackTrace();
@@ -4173,7 +4192,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mSessionListener, mCameraHandler, initialRequest);
} else {
- configureCameraSessionWithParameters(mCameraDevice[cameraId], surfaces,
+ configureCameraSessionWithParameters(cameraId, surfaces,
mSessionListener, mCameraHandler, mVideoRequestBuilder.build());
}
} else {
diff --git a/src/com/android/camera/ui/ProMode.java b/src/com/android/camera/ui/ProMode.java
index c5193bd..7a0dede 100755
--- a/src/com/android/camera/ui/ProMode.java
+++ b/src/com/android/camera/ui/ProMode.java
@@ -325,20 +325,18 @@ public class ProMode extends View {
mIndex = index;
String key = currentKey();
- if (mIndex > 0) {
- View v = mAddedViews.get(mIndex);
- if (v instanceof TextView) {
- ((TextView) v).setTextColor(BLUE);
- } else if (v instanceof ImageView) {
- if (mMode == WHITE_BALANCE_MODE) {
- ((ImageView) v).setImageResource(wbIconsBlue[mIndex]);
- }
+ View v = mAddedViews.get(mIndex);
+ if (v instanceof TextView) {
+ ((TextView) v).setTextColor(BLUE);
+ } else if (v instanceof ImageView) {
+ if (mMode == WHITE_BALANCE_MODE) {
+ ((ImageView) v).setImageResource(wbIconsBlue[mIndex]);
}
- if (key != null) mSettingsManager.setValueIndex(key, mIndex);
- CharSequence[] cc = mSettingsManager.getEntries(key);
- mUI.updateProModeText(mMode, cc[mIndex].toString());
- invalidate();
}
+ if (key != null) mSettingsManager.setValueIndex(key, mIndex);
+ CharSequence[] cc = mSettingsManager.getEntries(key);
+ mUI.updateProModeText(mMode, cc[mIndex].toString());
+ invalidate();
}
private void removeViews() {