Refactor camera control functions to use MPControl, store fd in MPControl

This commit is contained in:
Kristian Vos
2024-08-03 15:44:34 +02:00
committed by Martijn Braam
parent cd392d85cd
commit 3280c1d113
7 changed files with 121 additions and 147 deletions

View File

@@ -378,9 +378,9 @@ static void
process_aaa()
{
bool auto_exposure =
!state_proc.exposure.manual && state_proc.exposure.auto_control == 0;
!state_proc.exposure.manual && state_proc.exposure.auto_control.id == 0;
bool auto_focus =
!state_proc.focus.manual && state_proc.focus.auto_control == 0;
!state_proc.focus.manual && state_proc.focus.auto_control.id == 0;
bool auto_balance = TRUE;
if (!auto_exposure && !auto_focus && !auto_balance) {
return;
@@ -445,9 +445,9 @@ process_aaa()
clamp_control(&state_proc.gain);
clamp_control(&state_proc.exposure);
mp_io_pipeline_set_control_int32(state_proc.gain.control,
mp_io_pipeline_set_control_int32(&state_proc.gain.control,
state_proc.gain.value_req);
mp_io_pipeline_set_control_int32(state_proc.exposure.control,
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.exposure.value = state_proc.exposure.value_req;