2 Commits b4aaa2c47e ... a2f57c02ac

Tác giả SHA1 Thông báo Ngày
  Kristian Vos a2f57c02ac Refactor camera control functions to use MPControl, store fd in MPControl 11 tháng trước cách đây
  Kristian Vos b4aaa2c47e Refactor camera control functions to use MPControl, store fd in MPControl 11 tháng trước cách đây
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/io_pipeline.c

+ 6 - 1
src/io_pipeline.c

@@ -220,8 +220,12 @@ start_focus()
                 focus_continuous_task = mp_camera_control_set_bool_bg(
                         mpcamera, &state_io.focus.control, 1);
         } else if (state_io.can_af_trigger) {
+                // TODO improve
+                MPControl auto_focus_start_control;
+                auto_focus_start_control.id = V4L2_CID_AUTO_FOCUS_START;
+                auto_focus_start_control.fd = state_io.camera->sensor_fd;
                 start_focus_task = mp_camera_control_set_bool_bg(
-                        mpcamera, V4L2_CID_AUTO_FOCUS_START, 1);
+                        mpcamera, &auto_focus_start_control, 1);
         }
 }
 
@@ -413,6 +417,7 @@ on_frame(MPBuffer buffer, void *_data)
 static void
 init_controls()
 {
+        MPControl focus_control;
         if (mp_camera_query_control(
                 state_io.camera->sensor_fd, V4L2_CID_FOCUS_ABSOLUTE, &focus_control)) {
                 state_io.focus.control = focus_control;