diff options
author | Javier Ferrer <javi.f.o@gmail.com> | 2013-09-17 23:49:39 +0200 |
---|---|---|
committer | Javier Ferrer <javi.f.o@gmail.com> | 2013-09-20 00:56:11 +0200 |
commit | 98d50c6ba12aab110fddb9bbcc97bc3d2d1dd34b (patch) | |
tree | 9d74abc4738fe91a044e4056f8ab67762add553e /camera | |
parent | 30219ee2b54042acc48d379c5674cb71d5c2d192 (diff) | |
download | device_samsung_smdk4412-common-98d50c6ba12aab110fddb9bbcc97bc3d2d1dd34b.zip device_samsung_smdk4412-common-98d50c6ba12aab110fddb9bbcc97bc3d2d1dd34b.tar.gz device_samsung_smdk4412-common-98d50c6ba12aab110fddb9bbcc97bc3d2d1dd34b.tar.bz2 |
camera: add image-stabilization parameter
Focal will find it and will enable it before taking shot, disabling it after the shot is taken.
Change-Id: I476f2d13e6662f211d395d432c855d70ba53d61f
Diffstat (limited to 'camera')
-rw-r--r-- | camera/exynos_camera.c | 32 | ||||
-rw-r--r-- | camera/exynos_camera.h | 4 |
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 { |