summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjt1134 <jt1134@gmail.com>2012-09-17 01:06:37 -0500
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-10-14 08:30:13 -0700
commit4740deddfa4cb5717058c8eba48077e0a1da83e9 (patch)
tree7f0aa64bf9acc0daea15df02bbafb093d85eaecc
parenta0e8c13e4c1b858151536853fbca5fd4d126281e (diff)
downloaddevice_samsung_aries-common-4740deddfa4cb5717058c8eba48077e0a1da83e9.zip
device_samsung_aries-common-4740deddfa4cb5717058c8eba48077e0a1da83e9.tar.gz
device_samsung_aries-common-4740deddfa4cb5717058c8eba48077e0a1da83e9.tar.bz2
libcamera: allow changing of ISO modes
Patch-set2: make code not suck as much Patch-set3: add BOARD_CAMERA_HAVE_ISO Patch-set4: actually include BoardConfig change Change-Id: Id452c079c7dbb7ece4a68f27aa82c14463b5db2e
-rw-r--r--BoardConfigCommon.mk1
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp39
2 files changed, 39 insertions, 1 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index f3992d8..30058de 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -50,6 +50,7 @@ USE_CAMERA_STUB := false
ifeq ($(USE_CAMERA_STUB),false)
BOARD_CAMERA_LIBRARIES := libcamera
endif
+BOARD_CAMERA_HAVE_ISO := true
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 161daf0..d66f12f 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -339,7 +339,6 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
ip.set("sharpness", SHARPNESS_DEFAULT);
ip.set("contrast", CONTRAST_DEFAULT);
ip.set("saturation", SATURATION_DEFAULT);
- ip.set("iso", "auto");
ip.set("metering", "center");
ip.set("wdr", 0);
@@ -349,6 +348,9 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
ip.set("blur", 0);
}
+ p.set("iso-values", "auto,ISO50,ISO100,ISO200,ISO400,ISO800,ISO1600");
+ p.set("iso", "auto");
+
p.set(CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE, "51.2");
p.set(CameraParameters::KEY_VERTICAL_VIEW_ANGLE, "39.4");
@@ -1562,6 +1564,41 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
}
}
+ // ISO
+ const char *new_iso_str = params.get("iso");
+ ALOGV("%s : new_iso_str %s", __func__, new_iso_str);
+ if (new_iso_str != NULL) {
+ int new_iso = -1;
+
+ if (!strcmp(new_iso_str, "auto")) {
+ new_iso = ISO_AUTO;
+ } else if (!strcmp(new_iso_str, "ISO50")) {
+ new_iso = ISO_50;
+ } else if (!strcmp(new_iso_str, "ISO100")) {
+ new_iso = ISO_100;
+ } else if (!strcmp(new_iso_str, "ISO200")) {
+ new_iso = ISO_200;
+ } else if (!strcmp(new_iso_str, "ISO400")) {
+ new_iso = ISO_400;
+ } else if (!strcmp(new_iso_str, "ISO800")) {
+ new_iso = ISO_800;
+ } else if (!strcmp(new_iso_str, "ISO1600")) {
+ new_iso = ISO_1600;
+ } else {
+ ALOGE("ERR(%s):Invalid iso value(%s)", __func__, new_iso_str);
+ ret = UNKNOWN_ERROR;
+ }
+
+ if (0 <= new_iso) {
+ if (mSecCamera->setISO(new_iso) < 0) {
+ ALOGE("ERR(%s):Fail on mSecCamera->setISO(new_iso(%d))", __func__, new_iso);
+ ret = UNKNOWN_ERROR;
+ } else {
+ mParameters.set("iso", new_iso_str);
+ }
+ }
+ }
+
// whitebalance
const char *new_white_str = params.get(CameraParameters::KEY_WHITE_BALANCE);
ALOGV("%s : new_white_str %s", __func__, new_white_str);