5PC11X: libcamera: move lens to default position when preview starts
After taking a picture, the focus is maintained.
So if user change from camera mode to video mode after taking
a picture very closely to object,
focus in video mode is not normal.
So move lens to default position when preview starts.
Change-Id: I3e41acbb22ad8a754755feae304c287dce690425
Signed-off-by: kyoungho.yun <kyoungho.yun@samsung.com>
diff --git a/include/videodev2_samsung.h b/include/videodev2_samsung.h
old mode 100644
new mode 100755
index 56d1a4d..0a7d7c3
--- a/include/videodev2_samsung.h
+++ b/include/videodev2_samsung.h
@@ -476,6 +476,7 @@
#define V4L2_CID_CAMERA_SENSOR_MODE (V4L2_CID_PRIVATE_BASE + 116)
#define V4L2_CID_ESD_INT (V4L2_CID_PRIVATE_BASE + 117)
#define V4L2_CID_CAMERA_GET_FLASH_ONOFF (V4L2_CID_PRIVATE_BASE + 118)
+#define V4L2_CID_CAMERA_RETURN_FOCUS (V4L2_CID_PRIVATE_BASE + 119)
/* Pixel format FOURCC depth Description */
/* 12 Y/CbCr 4:2:0 64x32 macroblocks */
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
old mode 100644
new mode 100755
index b71a2ce..4a30dd7
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -991,6 +991,8 @@
// It is a delay for a new frame, not to show the previous bigger ugly picture frame.
ret = fimc_poll(&m_events_c);
CHECK(ret);
+ ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_RETURN_FOCUS, 0);
+ CHECK(ret);
#ifdef SWP1_CAMERA_ADD_ADVANCED_FUNCTION
LOGV("%s: got the first frame of the preview\n", __func__);