diff options
author | Javier Ferrer <javi.f.o@gmail.com> | 2013-10-08 17:47:29 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-10-08 18:06:12 +0200 |
commit | 199a88beb4c9dc88d11176e6db6e0acdabcc50c7 (patch) | |
tree | 479bebae6728f83f8035bf3baa1e9007e6370e42 /camera | |
parent | ec1a0fa790023e4511bf694891b7e12a6393ca69 (diff) | |
download | device_samsung_smdk4412-common-199a88beb4c9dc88d11176e6db6e0acdabcc50c7.zip device_samsung_smdk4412-common-199a88beb4c9dc88d11176e6db6e0acdabcc50c7.tar.gz device_samsung_smdk4412-common-199a88beb4c9dc88d11176e6db6e0acdabcc50c7.tar.bz2 |
camera: Add AWB and AE lock
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Change-Id: Idea7b7af7eb7adb4e02e6f527dda96e78f3e0f16
Diffstat (limited to 'camera')
-rw-r--r-- | camera/exynos_camera.c | 70 | ||||
-rw-r--r-- | camera/exynos_camera.h | 8 |
2 files changed, 78 insertions, 0 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c index 0c840dd..ef9ee6b 100644 --- a/camera/exynos_camera.c +++ b/camera/exynos_camera.c @@ -113,6 +113,12 @@ struct exynos_camera_preset exynos_camera_presets_smdk4x12[] = { .zoom = 0, .max_zoom = 30, + .auto_exposure_lock_supported = 1, + .auto_exposure_lock = 0, + + .auto_white_balance_lock_supported = 1, + .auto_white_balance_lock = 0, + .flash_mode = "off", .flash_mode_values = "off,auto,on,torch", @@ -191,6 +197,12 @@ struct exynos_camera_preset exynos_camera_presets_smdk4x12[] = { .zoom_supported = 0, + .auto_exposure_lock_supported = 0, + .auto_exposure_lock = 0, + + .auto_white_balance_lock_supported = 0, + .auto_white_balance_lock = 0, + .flash_mode = NULL, .flash_mode_values = NULL, @@ -476,6 +488,28 @@ int exynos_camera_params_init(struct exynos_camera *exynos_camera, int id) exynos_param_string_set(exynos_camera, "zoom-supported", "false"); } + // AE lock + + if (exynos_camera->config->presets[id].params.auto_exposure_lock_supported == 1) { + exynos_param_string_set(exynos_camera, "auto-exposure-lock-supported", "true"); + + if (exynos_camera->config->presets[id].params.auto_exposure_lock) + exynos_param_string_set(exynos_camera, "auto-exposure-lock", "true"); + else + exynos_param_string_set(exynos_camera, "auto-exposure-lock", "false"); + } + + // AWB lock + + if (exynos_camera->config->presets[id].params.auto_white_balance_lock_supported == 1) { + exynos_param_string_set(exynos_camera, "auto-whitebalance-lock-supported", "true"); + + if (exynos_camera->config->presets[id].params.auto_white_balance_lock) + exynos_param_string_set(exynos_camera, "auto-whitebalance-lock", "true"); + else + exynos_param_string_set(exynos_camera, "auto-whitebalance-lock", "false"); + } + // Flash exynos_param_string_set(exynos_camera, "flash-mode", @@ -595,6 +629,15 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force) char *zoom_supported_string; int zoom, max_zoom; + char *ae_lock_supported_string; + char *ae_lock_string; + int ae_lock = 0; + + char *awb_lock_supported_string; + char *awb_lock_string; + int awb_lock = 0; + int aeawb = 0; + char *flash_mode_string; int flash_mode; @@ -884,6 +927,33 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force) } + // AE lock + + ae_lock_supported_string = exynos_param_string_get(exynos_camera, "auto-exposure-lock-supported"); + ae_lock_string = exynos_param_string_get(exynos_camera, "auto-exposure-lock"); + if (ae_lock_supported_string != NULL && ae_lock_string != NULL && strcmp(ae_lock_supported_string, "true") == 0 && strcmp(ae_lock_string, "true") == 0) + ae_lock = 1; + else + ae_lock = 0; + + // AWB lock + + awb_lock_supported_string = exynos_param_string_get(exynos_camera, "auto-whitebalance-lock-supported"); + awb_lock_string = exynos_param_string_get(exynos_camera, "auto-whitebalance-lock"); + if (awb_lock_supported_string != NULL && awb_lock_string != NULL && strcmp(awb_lock_supported_string, "true") == 0 && strcmp(awb_lock_string, "true") == 0) + awb_lock = 1; + else + awb_lock = 0; + + if (ae_lock != exynos_camera->ae_lock || awb_lock != exynos_camera->awb_lock || force) { + exynos_camera->ae_lock = ae_lock; + exynos_camera->awb_lock = awb_lock; + aeawb = (ae_lock ? 0x1 : 0x0) | (awb_lock ? 0x2 : 0x0); + rc = exynos_v4l2_s_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_AEAWB_LOCK_UNLOCK, aeawb); + if (rc < 0) + ALOGE("%s: Unable to set AEAWB lock", __func__); + } + // Flash flash_mode_string = exynos_param_string_get(exynos_camera, "flash-mode"); diff --git a/camera/exynos_camera.h b/camera/exynos_camera.h index 547b90f..8c0977a 100644 --- a/camera/exynos_camera.h +++ b/camera/exynos_camera.h @@ -150,6 +150,12 @@ struct exynos_camera_params { int zoom; int max_zoom; + int auto_exposure_lock_supported; + int auto_exposure_lock; + + int auto_white_balance_lock_supported; + int auto_white_balance_lock; + char *flash_mode; char *flash_mode_values; @@ -412,6 +418,8 @@ struct exynos_camera { int focus_x; int focus_y; int zoom; + int ae_lock; + int awb_lock; int flash_mode; int exposure_compensation; int whitebalance; |