|
@@ -103,28 +103,6 @@ update_process_pipeline()
|
|
.balance = { balance_red, 1.0f, balance_blue },
|
|
.balance = { balance_red, 1.0f, balance_blue },
|
|
};
|
|
};
|
|
|
|
|
|
- struct mp_process_pipeline_state pipeline_state = {
|
|
|
|
- .camera = state_io.camera,
|
|
|
|
- .configuration = state_io.configuration,
|
|
|
|
- .burst_length = state_io.burst_length,
|
|
|
|
- .preview_width = state_io.preview_width,
|
|
|
|
- .preview_height = state_io.preview_height,
|
|
|
|
- .device_rotation = state_io.device_rotation,
|
|
|
|
- .gain_is_manual = state_io.gain.manual,
|
|
|
|
- .gain = state_io.gain.value,
|
|
|
|
- .gain_max = state_io.gain.max,
|
|
|
|
- .balance_red = balance_red,
|
|
|
|
- .balance_blue = balance_blue,
|
|
|
|
- .exposure_is_manual = state_io.exposure.manual,
|
|
|
|
- .exposure = state_io.exposure.value,
|
|
|
|
- .has_auto_focus_continuous = state_io.focus.control != 0,
|
|
|
|
- .has_auto_focus_start = state_io.can_af_trigger,
|
|
|
|
- .flash_enabled = state_io.flash_enabled,
|
|
|
|
- .control_gain = state_io.gain.control != 0,
|
|
|
|
- .control_exposure = state_io.exposure.control != 0,
|
|
|
|
- .control_focus = state_io.focus.control != 0,
|
|
|
|
- .control_flash = true,
|
|
|
|
- };
|
|
|
|
mp_process_pipeline_update_state(&new_state);
|
|
mp_process_pipeline_update_state(&new_state);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -242,7 +220,9 @@ update_controls()
|
|
state_io.gain.manual = state_io.gain.manual_req;
|
|
state_io.gain.manual = state_io.gain.manual_req;
|
|
}
|
|
}
|
|
|
|
|
|
- if (state_io.gain.manual && state_io.gain.value != state_io.gain.value_req) {
|
|
|
|
|
|
+ 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(state_io.camera,
|
|
state_io.gain.control,
|
|
state_io.gain.control,
|
|
state_io.gain.value_req);
|
|
state_io.gain.value_req);
|
|
@@ -267,6 +247,19 @@ update_controls()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+do_aaa()
|
|
|
|
+{
|
|
|
|
+ if (!state_io.exposure.manual && state_io.exposure.auto_control == 0) {
|
|
|
|
+ int step = state_io.gain.value / 16;
|
|
|
|
+ if (step < 1) {
|
|
|
|
+ step = 1;
|
|
|
|
+ }
|
|
|
|
+ state_io.gain.value_req = state_io.gain.value;
|
|
|
|
+ state_io.gain.value_req += step * state_io.stats.exposure;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static void
|
|
static void
|
|
on_frame(MPBuffer buffer, void *_data)
|
|
on_frame(MPBuffer buffer, void *_data)
|
|
{
|
|
{
|
|
@@ -276,6 +269,7 @@ on_frame(MPBuffer buffer, void *_data)
|
|
}
|
|
}
|
|
|
|
|
|
// Only update controls right after a frame was captured
|
|
// Only update controls right after a frame was captured
|
|
|
|
+ do_aaa();
|
|
update_controls();
|
|
update_controls();
|
|
|
|
|
|
// When the mode is switched while capturing we get a couple blank frames,
|
|
// When the mode is switched while capturing we get a couple blank frames,
|
|
@@ -536,6 +530,10 @@ update_state(MPPipeline *pipeline, const mp_state_io *new_state)
|
|
state_io.focus.manual_req = new_state->focus.manual_req;
|
|
state_io.focus.manual_req = new_state->focus.manual_req;
|
|
|
|
|
|
state_io.flash_enabled = new_state->flash_enabled;
|
|
state_io.flash_enabled = new_state->flash_enabled;
|
|
|
|
+
|
|
|
|
+ state_io.stats.exposure = new_state->stats.exposure;
|
|
|
|
+ state_io.stats.whitebalance = new_state->stats.whitebalance;
|
|
|
|
+ state_io.stats.focus = new_state->stats.focus;
|
|
}
|
|
}
|
|
|
|
|
|
update_process_pipeline();
|
|
update_process_pipeline();
|