summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camera/exynos_camera.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index 9657eea..6b6bce3 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -653,7 +653,7 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
int fimc_is_mode = 0;
char *focus_mode_string;
- int focus_mode = 0;
+ int focus_mode = FOCUS_MODE_DEFAULT;
char *focus_areas_string;
int focus_left, focus_top, focus_right, focus_bottom, focus_weight;
int focus_x;
@@ -923,6 +923,9 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
ALOGE("%s: Unable to set object y position", __func__);
}
}
+
+ focus_mode = FOCUS_MODE_TOUCH;
+
}
// Zoom
@@ -1009,7 +1012,7 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
ALOGE("%s: Unable to set scene mode", __func__);
}
- if (scene_mode != SCENE_MODE_NONE && !flash_mode && !focus_mode) {
+ if (scene_mode != SCENE_MODE_NONE && !flash_mode && focus_mode == FOCUS_MODE_DEFAULT) {
flash_mode = FLASH_MODE_OFF;
focus_mode = FOCUS_MODE_AUTO;
}
@@ -1057,24 +1060,26 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
focus_mode_string = exynos_param_string_get(exynos_camera, "focus-mode");
if (focus_mode_string != NULL) {
- if (strcmp(focus_mode_string, "auto") == 0)
- focus_mode = FOCUS_MODE_AUTO;
- else if (strcmp(focus_mode_string, "infinity") == 0)
- focus_mode = FOCUS_MODE_INFINITY;
- else if (strcmp(focus_mode_string, "macro") == 0)
- focus_mode = FOCUS_MODE_MACRO;
- else if (strcmp(focus_mode_string, "fixed") == 0)
- focus_mode = FOCUS_MODE_FIXED;
- else if (strcmp(focus_mode_string, "facedetect") == 0)
- focus_mode = FOCUS_MODE_FACEDETECT;
- else if (strcmp(focus_mode_string, "continuous-video") == 0)
- focus_mode = FOCUS_MODE_CONTINOUS_VIDEO;
- else if (strcmp(focus_mode_string, "continuous-picture") == 0)
- focus_mode = FOCUS_MODE_CONTINOUS_PICTURE;
- else {
- exynos_param_string_set(exynos_camera, "focus-mode",
- exynos_camera->raw_focus_mode);
- return -EINVAL;
+ if (focus_mode == FOCUS_MODE_DEFAULT) {
+ if (strcmp(focus_mode_string, "auto") == 0)
+ focus_mode = FOCUS_MODE_AUTO;
+ else if (strcmp(focus_mode_string, "infinity") == 0)
+ focus_mode = FOCUS_MODE_INFINITY;
+ else if (strcmp(focus_mode_string, "macro") == 0)
+ focus_mode = FOCUS_MODE_MACRO;
+ else if (strcmp(focus_mode_string, "fixed") == 0)
+ focus_mode = FOCUS_MODE_FIXED;
+ else if (strcmp(focus_mode_string, "facedetect") == 0)
+ focus_mode = FOCUS_MODE_FACEDETECT;
+ else if (strcmp(focus_mode_string, "continuous-video") == 0)
+ focus_mode = FOCUS_MODE_CONTINOUS_VIDEO;
+ else if (strcmp(focus_mode_string, "continuous-picture") == 0)
+ focus_mode = FOCUS_MODE_CONTINOUS_PICTURE;
+ else {
+ exynos_param_string_set(exynos_camera, "focus-mode",
+ exynos_camera->raw_focus_mode);
+ return -EINVAL;
+ }
}
rc = exynos_v4l2_s_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_FOCUS_MODE, focus_mode);