AE stats
This commit is contained in:
@@ -74,6 +74,32 @@ update_process_pipeline()
|
||||
balance_blue = (float)blue / (float)state_io.blue.max;
|
||||
}
|
||||
|
||||
mp_state_proc new_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.control = state_io.gain.control,
|
||||
.gain.value = state_io.gain.value,
|
||||
.gain.max = state_io.gain.max,
|
||||
.gain.manual = state_io.gain.manual,
|
||||
|
||||
.exposure.control = state_io.exposure.control,
|
||||
.exposure.value = state_io.exposure.value,
|
||||
.exposure.max = state_io.exposure.max,
|
||||
.exposure.manual = state_io.exposure.manual,
|
||||
|
||||
.focus.control = state_io.focus.control,
|
||||
.focus.value = state_io.focus.value,
|
||||
.focus.max = state_io.focus.max,
|
||||
.focus.manual = state_io.focus.manual,
|
||||
|
||||
.balance = {balance_red, 1.0f, balance_blue},
|
||||
};
|
||||
|
||||
struct mp_process_pipeline_state pipeline_state = {
|
||||
.camera = state_io.camera,
|
||||
.configuration = state_io.configuration,
|
||||
@@ -96,7 +122,7 @@ update_process_pipeline()
|
||||
.control_focus = state_io.focus.control != 0,
|
||||
.control_flash = true,
|
||||
};
|
||||
mp_process_pipeline_update_state(&pipeline_state);
|
||||
mp_process_pipeline_update_state(&new_state);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -245,7 +271,7 @@ on_frame(MPBuffer buffer, void *_data)
|
||||
if (!check_window_active()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Only update controls right after a frame was captured
|
||||
update_controls();
|
||||
|
||||
@@ -360,8 +386,16 @@ init_controls()
|
||||
state_io.gain.manual =
|
||||
mp_camera_control_get_bool(state_io.camera, V4L2_CID_AUTOGAIN) == 0;
|
||||
|
||||
state_io.exposure.value =
|
||||
mp_camera_control_get_int32(state_io.camera, V4L2_CID_EXPOSURE);
|
||||
if (mp_camera_query_control(state_io.camera, V4L2_CID_EXPOSURE, &control)) {
|
||||
state_io.exposure.control = V4L2_CID_EXPOSURE;
|
||||
state_io.exposure.max = control.max;
|
||||
state_io.exposure.value = mp_camera_control_get_int32(
|
||||
state_io.camera, V4L2_CID_EXPOSURE);
|
||||
|
||||
} else {
|
||||
state_io.exposure.control = 0;
|
||||
}
|
||||
|
||||
state_io.exposure.manual =
|
||||
mp_camera_control_get_int32(state_io.camera,
|
||||
V4L2_CID_EXPOSURE_AUTO) ==
|
||||
|
Reference in New Issue
Block a user