auto: Use helper function to set value.

This commit is contained in:
Pavel Machek
2024-09-03 13:41:00 +02:00
parent d0e4e318c1
commit dcc73a1647

View File

@@ -374,6 +374,14 @@ clamp_control(controlstate *control)
} }
} }
static void
update_control(controlstate *control)
{
clamp_control(control);
mp_io_pipeline_set_control_int32(control, control->value_req);
control->value = control->value_req;
}
static int focus; static int focus;
static int focus_phase; static int focus_phase;
@@ -553,18 +561,9 @@ process_aaa()
} }
} }
clamp_control(&state_proc.gain); update_control(&state_proc.gain);
clamp_control(&state_proc.dgain); update_control(&state_proc.dgain);
clamp_control(&state_proc.exposure); update_control(&state_proc.exposure);
mp_io_pipeline_set_control_int32(&state_proc.gain.control,
state_proc.gain.value_req);
mp_io_pipeline_set_control_int32(&state_proc.dgain.control,
state_proc.dgain.value_req);
mp_io_pipeline_set_control_int32(&state_proc.exposure.control,
state_proc.exposure.value_req);
state_proc.gain.value = state_proc.gain.value_req;
state_proc.dgain.value = state_proc.dgain.value_req;
state_proc.exposure.value = state_proc.exposure.value_req;
} }
if (auto_balance) { if (auto_balance) {