summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-08-02 16:39:59 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2013-08-02 16:42:29 +0700
commitae4340f17f6a9e7b8863600b6074a6b13c3996cf (patch)
tree7c5f18bb2440a4ba9807afc565048ca5bc83dd54 /libcamera
parentad85cfbf87899b5fe44131ef96eb873872da5f33 (diff)
downloaddevice_samsung_aries-common-ae4340f17f6a9e7b8863600b6074a6b13c3996cf.zip
device_samsung_aries-common-ae4340f17f6a9e7b8863600b6074a6b13c3996cf.tar.gz
device_samsung_aries-common-ae4340f17f6a9e7b8863600b6074a6b13c3996cf.tar.bz2
libcamera: touch-to-focus fixes
- Do not send command to camera unless preview is started (fix 4.3 AOSP camera crash) - Send touch AF command regardless of previous state (required to actually trigger touch AF at the new area) Change-Id: I51a8f80ce1ec38f1052e4660f708be8649478a88
Diffstat (limited to 'libcamera')
-rwxr-xr-xlibcamera/SecCamera.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
index 598f732..dc7cfa1 100755
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -2357,7 +2357,8 @@ int SecCamera::setTouchAFStartStop(int start_stop)
{
ALOGV("%s(touch_af_start_stop (%d))", __func__, start_stop);
- if (m_touch_af_start_stop != start_stop) {
+ if (m_flag_camera_start) {
+ // We need to send this command regardless of previous state to trigger AF
m_touch_af_start_stop = start_stop;
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_TOUCH_AF_START_STOP, start_stop) < 0) {
ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_TOUCH_AF_START_STOP", __func__);
@@ -2659,14 +2660,16 @@ int SecCamera::setObjectPosition(int x, int y)
{
ALOGV("%s(setObjectPosition(x=%d, y=%d))", __func__, x, y);
- if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_X, x) < 0) {
- ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_X", __func__);
- return -1;
- }
+ if (m_flag_camera_start) {
+ if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_X, x) < 0) {
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_X", __func__);
+ return -1;
+ }
- if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_Y, y) < 0) {
- ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_Y", __func__);
- return -1;
+ if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_Y, y) < 0) {
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_Y", __func__);
+ return -1;
+ }
}
return 0;