|
@@ -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;
|