summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-02-03 17:21:57 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-02-03 17:21:57 +0000
commitc2bbe95d98f2eaf8d4bec28c1423ca53675c70f6 (patch)
tree4974f0308c035e1ea10eb3d598e12253c87f3edf
parent853971825628c510d2c7acadf0a94ebbcf3c4da8 (diff)
parent58f00475ce3549e300e7c14e9453f68076925d7e (diff)
downloaddevice_samsung_smdk4412-common-c2bbe95d98f2eaf8d4bec28c1423ca53675c70f6.zip
device_samsung_smdk4412-common-c2bbe95d98f2eaf8d4bec28c1423ca53675c70f6.tar.gz
device_samsung_smdk4412-common-c2bbe95d98f2eaf8d4bec28c1423ca53675c70f6.tar.bz2
Merge "smdk4412-common: camera: properly enable touch to focus mode" into cm-11.0
-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);