summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-07-08 08:37:49 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-07-08 09:36:24 +0200
commitce0b82326432e5694d8d7e5bf5f005aecf70b621 (patch)
treef7ba73736b41a043d0f5fa6b5464be153c879770
parentaf7679deed2ab22401b6cb1c7d4d3e86b539d521 (diff)
downloaddevice_samsung_i9300-ce0b82326432e5694d8d7e5bf5f005aecf70b621.zip
device_samsung_i9300-ce0b82326432e5694d8d7e5bf5f005aecf70b621.tar.gz
device_samsung_i9300-ce0b82326432e5694d8d7e5bf5f005aecf70b621.tar.bz2
camera: add ISO support
Change-Id: I0a6c8fa3c9546b8275ace7f9dc5509aa94f7956e
-rw-r--r--BoardConfig.mk3
-rw-r--r--camerawrapper/CameraWrapper.cpp17
2 files changed, 16 insertions, 4 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 64f88ca..63d39b1 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -88,6 +88,9 @@ BOARD_USES_FIMGAPI := true
#BOARD_HDMI_STD := STD_1080P
#BOARD_HDMI_DDC_CH := DDC_CH_I2C_2
+# Camera
+COMMON_GLOBAL_CFLAGS += -DSAMSUNG_CAMERA_HARDWARE
+
# OMX
BOARD_HAVE_CODEC_SUPPORT := SAMSUNG_CODEC_SUPPORT
COMMON_GLOBAL_CFLAGS += -DSAMSUNG_CODEC_SUPPORT
diff --git a/camerawrapper/CameraWrapper.cpp b/camerawrapper/CameraWrapper.cpp
index 759b265..d4661a0 100644
--- a/camerawrapper/CameraWrapper.cpp
+++ b/camerawrapper/CameraWrapper.cpp
@@ -91,10 +91,7 @@ static int check_vendor_module()
return rv;
}
-const static char * video_preview_sizes[] = {
- "1920x1080,1280x720,640x480",
- "640x480,352x288,320x240,176x144"
-};
+const static char * iso_values[] = {"auto,ISO100,ISO200,ISO400,ISO800","auto"};
static char * camera_fixup_getparams(int id, const char * settings)
{
@@ -102,6 +99,7 @@ static char * camera_fixup_getparams(int id, const char * settings)
params.unflatten(android::String8(settings));
// fix params here
+ params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);
android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string());
@@ -116,6 +114,17 @@ char * camera_fixup_setparams(int id, const char * settings)
params.unflatten(android::String8(settings));
// fix params here
+ if(params.get("iso")) {
+ const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
+ if(strcmp(isoMode, "ISO100") == 0)
+ params.set(android::CameraParameters::KEY_ISO_MODE, "100");
+ else if(strcmp(isoMode, "ISO200") == 0)
+ params.set(android::CameraParameters::KEY_ISO_MODE, "200");
+ else if(strcmp(isoMode, "ISO400") == 0)
+ params.set(android::CameraParameters::KEY_ISO_MODE, "400");
+ else if(strcmp(isoMode, "ISO800") == 0)
+ params.set(android::CameraParameters::KEY_ISO_MODE, "800");
+ }
android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string());