1
0

2 Commitit b4aaa2c47e ... a2f57c02ac

Tekijä SHA1 Viesti Päivämäärä
  Kristian Vos a2f57c02ac Refactor camera control functions to use MPControl, store fd in MPControl 5 kuukautta sitten
  Kristian Vos b4aaa2c47e Refactor camera control functions to use MPControl, store fd in MPControl 5 kuukautta sitten
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  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;