diff options
author | athurh <athurh@gmail.com> | 2012-07-26 16:55:48 +0200 |
---|---|---|
committer | athurh <athurh@gmail.com> | 2012-07-26 16:55:48 +0200 |
commit | 74f6e5616a0eedd686e4ea9d9f063bdb7ad4b4f0 (patch) | |
tree | 023522408ae0748f91e416bbef413439f5efea87 /camera | |
parent | c0d9dfc4065cb59e7f1413a66740ba712e6bc912 (diff) | |
download | device_samsung_galaxys2-common-74f6e5616a0eedd686e4ea9d9f063bdb7ad4b4f0.zip device_samsung_galaxys2-common-74f6e5616a0eedd686e4ea9d9f063bdb7ad4b4f0.tar.gz device_samsung_galaxys2-common-74f6e5616a0eedd686e4ea9d9f063bdb7ad4b4f0.tar.bz2 |
camera: Fix ISO speed values
Diffstat (limited to 'camera')
-rw-r--r-- | camera/CameraWrapper.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp index f91604a..c360705 100644 --- a/camera/CameraWrapper.cpp +++ b/camera/CameraWrapper.cpp @@ -91,7 +91,7 @@ static int check_vendor_module() return rv; } -const static char * iso_values[] = {"auto,ISO100,ISO200,ISO400,ISO800","auto"}; +const static char * iso_values[] = {"auto,ISO50,ISO100,ISO200,ISO400,ISO800","auto"}; static char * camera_fixup_getparams(int id, const char * settings) { @@ -99,8 +99,8 @@ static char * camera_fixup_getparams(int id, const char * settings) params.unflatten(android::String8(settings)); // fix params here -#warning "Reimplement KEY_SUPPORTED_ISO_MODES" -// params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]); + + params.set("iso-values", iso_values[id]); android::String8 strParams = params.flatten(); char *ret = strdup(strParams.string()); @@ -114,20 +114,22 @@ char * camera_fixup_setparams(int id, const char * settings) android::CameraParameters params; 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"); + + const char* isoMode = params.get("iso"); + if(isoMode) { + if(!strcmp(isoMode, "ISO50")) + params.set("iso", "50"); + else if(!strcmp(isoMode, "ISO100")) + params.set("iso", "100"); + else if(!strcmp(isoMode, "ISO200")) + params.set("iso", "200"); + else if(!strcmp(isoMode, "ISO400")) + params.set("iso", "400"); + else if(!strcmp(isoMode, "ISO800")) + params.set("iso", "800"); } -*/ + android::String8 strParams = params.flatten(); char *ret = strdup(strParams.string()); @@ -144,7 +146,7 @@ int camera_set_preview_window(struct camera_device * device, { ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); - if(!device) + if(!device || !window) return -EINVAL; return VENDOR_CALL(device, set_preview_window, window); |