summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;