summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorDaniel Hillenbrand <codeworkx@cyanogenmod.org>2013-09-21 20:57:18 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-09-21 20:57:18 +0000
commit992c7e14318ac46ae4721dc6c8be30afc1fe3b34 (patch)
tree9350af69ae7975f54c07adaa4fdca2fb36fac2b2 /camera
parentfb323f33f4aebc1bcc6c03756424adfb0e700160 (diff)
parent98d50c6ba12aab110fddb9bbcc97bc3d2d1dd34b (diff)
downloaddevice_samsung_smdk4412-common-992c7e14318ac46ae4721dc6c8be30afc1fe3b34.zip
device_samsung_smdk4412-common-992c7e14318ac46ae4721dc6c8be30afc1fe3b34.tar.gz
device_samsung_smdk4412-common-992c7e14318ac46ae4721dc6c8be30afc1fe3b34.tar.bz2
Merge "camera: add image-stabilization parameter" into cm-10.2
Diffstat (limited to 'camera')
-rw-r--r--camera/exynos_camera.c32
-rw-r--r--camera/exynos_camera.h4
2 files changed, 36 insertions, 0 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index a6c6d19..0c840dd 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -135,6 +135,9 @@ struct exynos_camera_preset exynos_camera_presets_smdk4x12[] = {
.iso = "auto",
.iso_values = "auto,ISO100,ISO200,ISO400,ISO800",
+
+ .image_stabilization = "off",
+ .image_stabilization_values = "on,off",
},
.mbus_resolutions = NULL,
.mbus_resolutions_count = 0,
@@ -210,6 +213,9 @@ struct exynos_camera_preset exynos_camera_presets_smdk4x12[] = {
.iso = "auto",
.iso_values = "auto",
+
+ .image_stabilization = "off",
+ .image_stabilization_values = "off",
},
.mbus_resolutions = (struct exynos_camera_mbus_resolution *) &exynos_camera_mbus_resolutions_s5k6a3_smdk4x12,
.mbus_resolutions_count = 8,
@@ -523,6 +529,13 @@ int exynos_camera_params_init(struct exynos_camera *exynos_camera, int id)
exynos_param_string_set(exynos_camera, "iso-values",
exynos_camera->config->presets[id].params.iso_values);
+ // Image stabilization (Anti-shake)
+
+ exynos_param_string_set(exynos_camera, "image-stabilization",
+ exynos_camera->config->presets[id].params.image_stabilization);
+ exynos_param_string_set(exynos_camera, "image-stabilization-values",
+ exynos_camera->config->presets[id].params.image_stabilization_values);
+
// Camera
exynos_param_float_set(exynos_camera, "focal-length",
@@ -604,6 +617,9 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
char *iso_string;
int iso;
+ char *image_stabilization_string;
+ int image_stabilization;
+
int w, h;
char *k;
int rc;
@@ -1072,6 +1088,22 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
}
}
+ // Image stabilization (Anti-shake)
+
+ image_stabilization_string = exynos_param_string_get(exynos_camera, "image-stabilization");
+ if (image_stabilization_string != NULL) {
+ if (strcmp(image_stabilization_string, "on") == 0)
+ image_stabilization = ANTI_SHAKE_STILL_ON;
+ else
+ image_stabilization = ANTI_SHAKE_OFF;
+
+ if (image_stabilization != exynos_camera->image_stabilization || force) {
+ exynos_camera->image_stabilization = image_stabilization;
+ rc = exynos_v4l2_s_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_ANTI_SHAKE, image_stabilization);
+ if (rc < 0)
+ ALOGE("%s: Unable to set image-stabilization", __func__);
+ }
+ }
ALOGD("%s: Preview size: %dx%d, picture size: %dx%d, recording size: %dx%d", __func__, preview_width, preview_height, picture_width, picture_height, recording_width, recording_height);
return 0;
diff --git a/camera/exynos_camera.h b/camera/exynos_camera.h
index 9db8dfb..547b90f 100644
--- a/camera/exynos_camera.h
+++ b/camera/exynos_camera.h
@@ -172,6 +172,9 @@ struct exynos_camera_params {
char *iso;
char *iso_values;
+
+ char *image_stabilization; // Anti-shake
+ char *image_stabilization_values;
};
struct exynos_camera_preset {
@@ -417,6 +420,7 @@ struct exynos_camera {
int effect;
int iso;
int metering;
+ int image_stabilization;
};
struct exynos_camera_addrs {