Log final camera params

This commit is contained in:
Sean Owen 2014-07-27 15:18:50 +01:00
parent 8e86c7b7dc
commit 70b02ea882
2 changed files with 26 additions and 24 deletions

View file

@ -61,11 +61,11 @@ public final class CameraConfigurationUtils {
String focusMode = null;
if (autoFocus) {
if (safeMode || disableContinuous) {
focusMode = CameraConfigurationUtils.findSettableValue("focus mode",
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_AUTO);
} else {
focusMode = CameraConfigurationUtils.findSettableValue("focus mode",
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,
Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO,
@ -74,7 +74,7 @@ public final class CameraConfigurationUtils {
}
// Maybe selected auto-focus but not available, so fall through here:
if (!safeMode && focusMode == null) {
focusMode = CameraConfigurationUtils.findSettableValue("focus mode",
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_MACRO,
Camera.Parameters.FOCUS_MODE_EDOF);
@ -92,12 +92,12 @@ public final class CameraConfigurationUtils {
List<String> supportedFlashModes = parameters.getSupportedFlashModes();
String flashMode;
if (on) {
flashMode = CameraConfigurationUtils.findSettableValue("flash mode",
flashMode = findSettableValue("flash mode",
supportedFlashModes,
Camera.Parameters.FLASH_MODE_TORCH,
Camera.Parameters.FLASH_MODE_ON);
} else {
flashMode = CameraConfigurationUtils.findSettableValue("flash mode",
flashMode = findSettableValue("flash mode",
supportedFlashModes,
Camera.Parameters.FLASH_MODE_OFF);
}
@ -263,8 +263,7 @@ public final class CameraConfigurationUtils {
Log.i(TAG, "Negative effect already set");
return;
}
String colorMode =
CameraConfigurationUtils.findSettableValue("color effect",
String colorMode = findSettableValue("color effect",
parameters.getSupportedColorEffects(),
Camera.Parameters.EFFECT_NEGATIVE);
if (colorMode != null) {

View file

@ -100,6 +100,9 @@ final class CameraConfigurationManager {
}
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
Log.i(TAG, "Final camera parameters: " + parameters.flatten());
camera.setParameters(parameters);
Camera.Parameters afterParameters = camera.getParameters();
@ -124,7 +127,7 @@ final class CameraConfigurationManager {
if (camera != null) {
Camera.Parameters parameters = camera.getParameters();
if (parameters != null) {
String flashMode = camera.getParameters().getFlashMode();
String flashMode = parameters.getFlashMode();
return flashMode != null &&
(Camera.Parameters.FLASH_MODE_ON.equals(flashMode) ||
Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode));