summaryrefslogtreecommitdiffstats
path: root/camera/exynos_exif.c
diff options
context:
space:
mode:
authorDheeraj CVR <cvr.dheeraj@gmail.com>2013-12-14 10:54:53 -0600
committerslickrick <rsalinas1@mail.usf.edu>2013-12-14 09:05:00 -0800
commita50844d698f0fbdcaacffb8b52381d44752d85c8 (patch)
treee517f78950274763d389ccdcfc072cebc41a750b /camera/exynos_exif.c
parent6595112a242dc49c4a485da819e39f5d539fc331 (diff)
downloaddevice_samsung_smdk4412-common-a50844d698f0fbdcaacffb8b52381d44752d85c8.tar.gz
device_samsung_smdk4412-common-a50844d698f0fbdcaacffb8b52381d44752d85c8.tar.bz2
device_samsung_smdk4412-common-a50844d698f0fbdcaacffb8b52381d44752d85c8.zip
smdk4412-common: camera: squashed updates from cm-10.2
smdk4412-common: camera: fix EXIF attributes for S5C73M3 sensor S5C73M3 sensor which is the back camera, doesn't return the EXIF attributes using V4L2 IOCTL. This sensor interleaves YUV and JPEG frames along with Metadata which contains the EXIF information. This patch does the following: Manually extract the EXIF information from the interleaved metadata and implement ISO, Flash, Exposure, Exposure Time and Exposure Bias EXIF attributes for S5C73M3. Fix incorrect Exposure EXIF attribute that was reporting as 1'. Change-Id: Id9faa64af498645099cccc9cbf28f2dbdfecd254 smdk4412-common: camera: fix scene mode snapshot capture crashes Few Scene Modes (like Night, High Sensitivity) if set as default, after the camera opens, require the scene mode to be set when the stream is turned on inorder to properly take effect. Not doing so will result in crashes while trying to capture the snapshot. Change-Id: I9e6b67c59699495da6922ac737232f58d98c2b40 smdk4412-common: camera: reorganize camera parameters Few Scene modes require Flash and few don't. However all of the scene modes require the focus to be AUTO. Reorganize the camera parameters to set the Flash and Focus modes based on the scene mode. Changes adapted from Exynos5 Camera HAL. Change-Id: If3ab62a1d8aecf84d2a04d1e899f71d4315a66ea Conflicts: camera/exynos_camera.c smdk4412-common: camera: several fixes for autofocus Setting the AutoFocus off using V4L2_CID_CAMERA_SET_AUTO_FOCUS will reset the AF position of the sensor and this was done whenever autofocus was completed. This totally defeated the purpose of touch to focus since the sensor AF position was being reset after focus and had to be refocussed while taking the snapshot. This also led to several issues with third party applications since this kind of focus behaviour was not intended. S5C73M3 Back camera Interleaves YUV and JPEG along with metadata. This metadata contains the AutoFocus result. Hence we could parse the autofocus result instead of using V4L2 IOCTL, which is more efficient. Also, the sensor exhibits issues when AutoExposure and AutoWhite Balance locks are used with Flash ON. Improper locking could lead to freezing of the sensor while taking a snapshot. Hence, only lock AEAWB when flash is OFF and unlock them after AutoFocus finishes. Change-Id: Ief28005dcacd0f8f04990ef8eafebff4a2f109d5 smdk4412-common: camera: enable ZSL mode on front camera We are querying FIMC2 for the capture output and hence we have no reason to restart the preview to have the preview resolution match the capture resolution, which is not how Zero Shutter Lag works. We could have different resolutions for the preview and capture, hence don't stop the preview for resizing. Change-Id: Iaf2b4d0c51dbedb9516b7c3cdde09aa18cd95f73 smdk4412-common: camera: fix incorrect jpeg thumbnail height Change-Id: I139823883d91ddaa48e2516511539ff5fe150e25 smdk4412-common: camera: fix heap corruption Change-Id: I0111615b9d4552a7880598a83bc98060fa900b13 smdk4412-common: camera: include support for face detection Change-Id: I1d176bdf17abdcf0c593fceb01808348b87b75ce
Diffstat (limited to 'camera/exynos_exif.c')
-rw-r--r--camera/exynos_exif.c109
1 files changed, 66 insertions, 43 deletions
diff --git a/camera/exynos_exif.c b/camera/exynos_exif.c
index b0d1656..486b256 100644
--- a/camera/exynos_exif.c
+++ b/camera/exynos_exif.c
@@ -262,63 +262,68 @@ int exynos_exif_attributes_create_params(struct exynos_camera *exynos_camera,
attributes->focal_length.num = exynos_camera->camera_focal_length;
attributes->focal_length.den = EXIF_DEF_FOCAL_LEN_DEN;
- shutter_speed = 100;
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_TV,
- &shutter_speed);
- if (rc < 0)
- ALOGE("%s: Unable to get shutter speed", __func__);
+ // Only Query the Front Camera Sensor for EXIF Attributes.
+ if (exynos_camera->camera_fimc_is) {
+ rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_EXPTIME,
+ &exposure_time);
+ if (rc < 0)
+ ALOGE("%s: Unable to get exposure time", __func__);
- attributes->shutter_speed.num = shutter_speed;
- attributes->shutter_speed.den = 100;
-
- attributes->exposure_time.num = 1;
- attributes->exposure_time.den = APEX_SHUTTER_TO_EXPOSURE(shutter_speed);
+ attributes->exposure_time.den = exposure_time;
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_ISO,
- &iso_speed);
- if (rc < 0)
- ALOGE("%s: Unable to get iso", __func__);
+ rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_ISO,
+ &iso_speed);
+ if (rc < 0)
+ ALOGE("%s: Unable to get iso", __func__);
- attributes->iso_speed_rating = iso_speed;
+ attributes->iso_speed_rating = iso_speed;
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_FLASH,
- &flash_results);
- if (rc < 0)
- ALOGE("%s: Unable to get flash", __func__);
+ rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_FLASH,
+ &flash_results);
+ if (rc < 0)
+ ALOGE("%s: Unable to get flash", __func__);
- attributes->flash = flash_results;
+ attributes->flash = flash_results;
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_BV,
+ rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_BV,
(int *) &bv);
- if (rc < 0) {
- ALOGE("%s: Unable to get bv", __func__);
- goto bv_static;
- }
+ if (rc < 0) {
+ ALOGE("%s: Unable to get bv", __func__);
+ goto bv_static;
+ }
- rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_EBV,
- (int *) &ev);
- if (rc < 0) {
- ALOGE("%s: Unable to get ebv", __func__);
- goto bv_static;
- }
+ rc = exynos_v4l2_g_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_EXIF_EBV,
+ (int *) &ev);
+ if (rc < 0) {
+ ALOGE("%s: Unable to get ebv", __func__);
+ goto bv_static;
+ }
- goto bv_ioctl;
+ goto bv_ioctl;
bv_static:
- exposure = exynos_param_int_get(exynos_camera, "exposure-compensation");
- if (exposure < 0)
- exposure = EV_DEFAULT;
+ exposure = exynos_param_int_get(exynos_camera, "exposure-compensation");
+ if (exposure < 0)
+ exposure = EV_DEFAULT;
+
+ av = APEX_FNUM_TO_APERTURE((double) attributes->fnumber.num /
+ attributes->fnumber.den);
+ tv = APEX_EXPOSURE_TO_SHUTTER((double) attributes->exposure_time.num /
+ attributes->exposure_time.den);
+ sv = APEX_ISO_TO_FILMSENSITIVITY(iso_speed);
+ bv = av + tv - sv;
+ ev = exposure - EV_DEFAULT;
- av = APEX_FNUM_TO_APERTURE((double) attributes->fnumber.num /
- attributes->fnumber.den);
- tv = APEX_EXPOSURE_TO_SHUTTER((double) attributes->exposure_time.num /
- attributes->exposure_time.den);
- sv = APEX_ISO_TO_FILMSENSITIVITY(iso_speed);
- bv = av + tv - sv;
- ev = exposure - EV_DEFAULT;
bv_ioctl:
- attributes->brightness.num = bv;
+ attributes->brightness.num = bv;
+ }
+
+ attributes->shutter_speed.num = APEX_EXPOSURE_TO_SHUTTER(attributes->exposure_time.den);
+ attributes->shutter_speed.den = 100;
+
+ attributes->exposure_time.num = 1;
+
attributes->brightness.den = EXIF_DEF_APEX_DEN;
if (exynos_camera->scene_mode == SCENE_MODE_BEACH_SNOW) {
@@ -450,6 +455,24 @@ complete:
return rc;
}
+int exynos_exif_create(struct exynos_camera *exynos_camera, struct exynos_exif *exif)
+{
+ int rc;
+
+ rc = exynos_exif_attributes_create_params(exynos_camera, exif);
+ if (rc < 0) {
+ ALOGE("%s: Unable to create exif parameters", __func__);
+ goto error;
+ }
+
+ goto complete;
+error:
+ rc = -1;
+
+complete:
+ return rc;
+}
+
void exynos_exif_stop(struct exynos_camera *exynos_camera,
struct exynos_exif *exif)
{