Fix burst length calculation

This commit is contained in:
Martijn Braam
2023-07-20 16:55:39 +02:00
parent b86c816c34
commit 2a7a5d37e6

View File

@@ -62,7 +62,6 @@ update_process_pipeline()
state_io.camera, state_io.exposure.control); state_io.camera, state_io.exposure.control);
} }
MPControl control;
float balance_red = 1.0f; float balance_red = 1.0f;
float balance_blue = 1.0f; float balance_blue = 1.0f;
if (state_io.red.control && state_io.blue.control) { if (state_io.red.control && state_io.blue.control) {
@@ -128,7 +127,7 @@ capture(MPPipeline *pipeline, const void *data)
mp_camera_control_get_int32(state_io.camera, V4L2_CID_GAIN); mp_camera_control_get_int32(state_io.camera, V4L2_CID_GAIN);
gain_norm = (float)state_io.gain.value / (float)state_io.gain.max; gain_norm = (float)state_io.gain.value / (float)state_io.gain.max;
state_io.burst_length = (int)fmax(sqrtf(gain_norm) * 10, 2) + 1; state_io.burst_length = (int)fmax(sqrtf(gain_norm) * 10, 2) + 1;
state_io.burst_length = MIN(1, state_io.burst_length); state_io.burst_length = MAX(1, state_io.burst_length);
state_io.captures_remaining = state_io.burst_length; state_io.captures_remaining = state_io.burst_length;
// Change camera mode for capturing // Change camera mode for capturing