summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorghepeu <ghepeu@gmail.com>2013-05-10 14:33:08 +0200
committerghepeu <ghepeu@gmail.com>2013-05-10 14:33:08 +0200
commit5477489722d17f516d887ef29c694d6ba6e36121 (patch)
treeec6453c2cc77deb0ef8a0f67bc4374c4bac98f90 /camera
parentbcbeb5ebefcbe020751f793af075b3ab2596c899 (diff)
downloaddevice_samsung_galaxys2-common-5477489722d17f516d887ef29c694d6ba6e36121.zip
device_samsung_galaxys2-common-5477489722d17f516d887ef29c694d6ba6e36121.tar.gz
device_samsung_galaxys2-common-5477489722d17f516d887ef29c694d6ba6e36121.tar.bz2
galaxys2-common: camera: exynos_exif.c: fix values of some wrong EXIF tags
* adapt the code to the changes made in Exif.h * calculate ExposureTime from the ShutterSpeedValue: the exposure time read from the camera doesn't seem to work Together with changes in Exif.h, this commit fixes ExposureTime, FNumber, ShutterSpeedValue, ApertureValue, BrightnessValue and MaxApertureValue. The values now match what was generated by the closed camera driver. Credits to tryptophane for ExposureTime and ShutterSpeedValue. Thanks to opaco23 and stone_ship who provided samples. This commit requires http://review.cyanogenmod.org/37370 Change-Id: I16b606e65e895b98f9679ffb6172869c2cbe741c
Diffstat (limited to 'camera')
-rw-r--r--camera/exynos_exif.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/camera/exynos_exif.c b/camera/exynos_exif.c
index bb97a17..72492c4 100644
--- a/camera/exynos_exif.c
+++ b/camera/exynos_exif.c
@@ -81,9 +81,9 @@ int exynos_exif_attributes_create_static(struct exynos_camera *exynos_camera,
av = APEX_FNUM_TO_APERTURE((double) exif_attributes->fnumber.num /
exif_attributes->fnumber.den);
- exif_attributes->aperture.num = av * EXIF_DEF_APEX_DEN;
+ exif_attributes->aperture.num = av;
exif_attributes->aperture.den = EXIF_DEF_APEX_DEN;
- exif_attributes->max_aperture.num = av * EXIF_DEF_APEX_DEN;
+ exif_attributes->max_aperture.num = av;
exif_attributes->max_aperture.den = EXIF_DEF_APEX_DEN;
strcpy((char *) exif_attributes->user_comment, EXIF_DEF_USERCOMMENTS);
@@ -256,17 +256,20 @@ int exynos_exif_attributes_create_params(struct exynos_camera *exynos_camera,
if (rc < 0)
ALOGE("%s: g ctrl failed!", __func__);
- exif_attributes->shutter_speed.num = 1;
- exif_attributes->shutter_speed.den = shutter_speed;
+ exif_attributes->shutter_speed.num = shutter_speed;
+ exif_attributes->shutter_speed.den = 100;
- exposure_time = shutter_speed;
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_EXPTIME,
- &exposure_time);
- if (rc < 0)
- ALOGE("%s: g ctrl failed!", __func__);
+ /* the exposure_time value read from the camera doesn't work
+ * exposure_time = shutter_speed;
+ * rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_EXPTIME,
+ * &exposure_time);
+ * if (rc < 0)
+ * ALOGE("%s: g ctrl failed!", __func__);
+ */
+ // calculate exposure time from the shutter speed value instead
exif_attributes->exposure_time.num = 1;
- exif_attributes->exposure_time.den = exposure_time;
+ exif_attributes->exposure_time.den = APEX_SHUTTER_TO_EXPOSURE(shutter_speed);
rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_ISO,
&iso_speed);
@@ -312,7 +315,7 @@ bv_static:
ev = exposure - EV_DEFAULT;
bv_ioctl:
- exif_attributes->brightness.num = bv * EXIF_DEF_APEX_DEN;
+ exif_attributes->brightness.num = bv;
exif_attributes->brightness.den = EXIF_DEF_APEX_DEN;
if (exynos_camera->scene_mode == SCENE_MODE_BEACH_SNOW) {
@@ -572,7 +575,7 @@ int exynos_exif_create(struct exynos_camera *exynos_camera,
pointer += count;
count = exynos_exif_write_data(pointer, EXIF_TAG_APERTURE,
- EXIF_TYPE_RATIONAL, 1, &offset, exif_ifd_start, &exif_attributes->aperture, sizeof(exif_attributes->shutter_speed));
+ EXIF_TYPE_RATIONAL, 1, &offset, exif_ifd_start, &exif_attributes->aperture, sizeof(exif_attributes->aperture));
pointer += count;
count = exynos_exif_write_data(pointer, EXIF_TAG_BRIGHTNESS,