Browse Source

Fix various compile errors

Kristian Vos 5 months ago
parent
commit
e41dc80a71
4 changed files with 19 additions and 16 deletions
  1. 3 3
      src/camera.c
  2. 2 2
      src/camera.h
  3. 12 11
      src/io_pipeline.c
  4. 2 0
      src/main.h

+ 3 - 3
src/camera.c

@@ -729,7 +729,7 @@ control_impl_int32(libmegapixels_camera *camera,
 }
 
 pid_t
-mp_camera_control_set_int32_bg(libmegapixels_camera *camera, uint32_t id, int32_t v)
+mp_camera_control_set_int32_bg(MPCamera *camera, uint32_t id, int32_t v)
 {
         struct v4l2_ext_control ctrl = {};
         ctrl.id = id;
@@ -742,7 +742,7 @@ mp_camera_control_set_int32_bg(libmegapixels_camera *camera, uint32_t id, int32_
                 .controls = &ctrl,
         };
 
-        int fd = camera->sensor_fd;
+        int fd = camera->camera->sensor_fd;
 
         // fork only after all the memory has been read
         pid_t pid = fork();
@@ -805,7 +805,7 @@ mp_camera_control_get_bool(libmegapixels_camera *camera, uint32_t id)
 }
 
 pid_t
-mp_camera_control_set_bool_bg(libmegapixels_camera *camera, uint32_t id, bool v)
+mp_camera_control_set_bool_bg(MPCamera *camera, uint32_t id, bool v)
 {
         int32_t value = v;
         return mp_camera_control_set_int32_bg(camera, id, value);

+ 2 - 2
src/camera.h

@@ -66,10 +66,10 @@ bool mp_camera_control_try_int32(libmegapixels_camera *camera, uint32_t id, int3
 bool mp_camera_control_set_int32(libmegapixels_camera *camera, uint32_t id, int32_t v);
 int32_t mp_camera_control_get_int32(libmegapixels_camera *camera, uint32_t id);
 // set the value in the background, discards result
-pid_t mp_camera_control_set_int32_bg(libmegapixels_camera *camera, uint32_t id, int32_t v);
+pid_t mp_camera_control_set_int32_bg(MPCamera *camera, uint32_t id, int32_t v);
 
 bool mp_camera_control_try_bool(libmegapixels_camera *camera, uint32_t id, bool *v);
 bool mp_camera_control_set_bool(libmegapixels_camera *camera, uint32_t id, bool v);
 bool mp_camera_control_get_bool(libmegapixels_camera *camera, uint32_t id);
 // set the value in the background, discards result
-pid_t mp_camera_control_set_bool_bg(libmegapixels_camera *camera, uint32_t id, bool v);
+pid_t mp_camera_control_set_bool_bg(MPCamera *camera, uint32_t id, bool v);

+ 12 - 11
src/io_pipeline.c

@@ -131,9 +131,10 @@ mp_io_pipeline_focus()
 }
 
 static void
-set_control_int32(MPPipeline *pipeline, const invoke_set_control *data)
+set_control_int32(MPPipeline *pipeline, const void *data)
 {
-        mp_camera_control_set_int32(state_io.camera, data->control, data->int_value);
+        const invoke_set_control *control_data = (const invoke_set_control *)data;
+        mp_camera_control_set_int32(state_io.camera, control_data->control, control_data->int_value);
 }
 
 void
@@ -222,10 +223,10 @@ start_focus()
 
         if (state_io.focus.control) {
                 focus_continuous_task = mp_camera_control_set_bool_bg(
-                        state_io.camera, state_io.focus.control, 1);
+                        mpcamera, state_io.focus.control, 1);
         } else if (state_io.can_af_trigger) {
                 start_focus_task = mp_camera_control_set_bool_bg(
-                        state_io.camera, V4L2_CID_AUTO_FOCUS_START, 1);
+                        mpcamera, V4L2_CID_AUTO_FOCUS_START, 1);
         }
 }
 
@@ -244,7 +245,7 @@ update_controls()
         }
 
         if (state_io.gain.manual != state_io.gain.manual_req) {
-                mp_camera_control_set_bool_bg(state_io.camera,
+                mp_camera_control_set_bool_bg(mpcamera,
                                               V4L2_CID_AUTOGAIN,
                                               !state_io.gain.manual_req);
                 state_io.gain.manual = state_io.gain.manual_req;
@@ -254,7 +255,7 @@ update_controls()
         if ((state_io.gain.manual ||
              (!state_io.gain.manual && state_io.gain.auto_control == 0)) &&
             state_io.gain.value != state_io.gain.value_req) {
-                mp_camera_control_set_int32_bg(state_io.camera,
+                mp_camera_control_set_int32_bg(mpcamera,
                                                state_io.gain.control,
                                                state_io.gain.value_req);
                 state_io.gain.value = state_io.gain.value_req;
@@ -262,7 +263,7 @@ update_controls()
         }
 
         if (state_io.exposure.manual != state_io.exposure.manual_req) {
-                mp_camera_control_set_bool_bg(state_io.camera,
+                mp_camera_control_set_bool_bg(mpcamera,
                                               V4L2_CID_EXPOSURE_AUTO,
                                               state_io.exposure.manual_req ?
                                                       V4L2_EXPOSURE_MANUAL :
@@ -273,7 +274,7 @@ update_controls()
 
         if (state_io.exposure.manual &&
             state_io.exposure.value != state_io.exposure.value_req) {
-                mp_camera_control_set_int32_bg(state_io.camera,
+                mp_camera_control_set_int32_bg(mpcamera,
                                                state_io.exposure.control,
                                                state_io.exposure.value_req);
                 state_io.exposure.value = state_io.exposure.value_req;
@@ -383,14 +384,14 @@ on_frame(MPBuffer buffer, void *_data)
                         // Restore the auto exposure and gain if needed
                         if (!state_io.exposure.manual) {
                                 mp_camera_control_set_int32_bg(
-                                        state_io.camera,
+                                        mpcamera,
                                         V4L2_CID_EXPOSURE_AUTO,
                                         V4L2_EXPOSURE_AUTO);
                         }
 
                         if (!state_io.gain.manual) {
                                 mp_camera_control_set_bool_bg(
-                                        state_io.camera, V4L2_CID_AUTOGAIN, true);
+                                        mpcamera, V4L2_CID_AUTOGAIN, true);
                         }
 
                         // Go back to preview mode
@@ -428,7 +429,7 @@ init_controls()
 
         if (mp_camera_query_control(state_io.camera, V4L2_CID_FOCUS_AUTO, NULL)) {
                 mp_camera_control_set_bool_bg(
-                        state_io.camera, V4L2_CID_FOCUS_AUTO, true);
+                        mpcamera, V4L2_CID_FOCUS_AUTO, true);
                 state_io.focus.auto_control = V4L2_CID_FOCUS_AUTO;
         } else {
                 state_io.focus.auto_control = 0;

+ 2 - 0
src/main.h

@@ -36,4 +36,6 @@ int remap(int value, int input_min, int input_max, int output_min, int output_ma
 
 bool check_window_active();
 
+void notify_movie_progress(void);
+
 void notify_movie_message(gchar *msg);