diff --git a/camera.cpp b/camera.cpp index 00d7092..b9c8177 100644 --- a/camera.cpp +++ b/camera.cpp @@ -328,6 +328,13 @@ static void fill_dynamic_controls(ControlList *ctrls, const parameters_t *params } ctrls->set(controls::AeExposureMode, exposure_mode); + if (params->flicker_period != 0) { + ctrls->set(controls::AeFlickerMode, controls::FlickerManual); + ctrls->set(controls::AeFlickerPeriod, params->flicker_period); + } else { + ctrls->set(controls::AeFlickerMode, controls::FlickerAuto); + } + int awb_mode; if (strcmp(params->awb, "incandescent") == 0) { awb_mode = controls::AwbIncandescent; diff --git a/parameters.c b/parameters.c index 9805d2f..7bde2e6 100644 --- a/parameters.c +++ b/parameters.c @@ -149,6 +149,8 @@ bool parameters_unserialize(parameters_t *params, const uint8_t *buf, size_t buf } } free(decoded_val); + } else if (strcmp(key, "FlickerPeriod") == 0) { + params->flicker_period = atoi(val); } else if (strcmp(key, "TextOverlayEnable") == 0) { params->text_overlay_enable = (strcmp(val, "1") == 0); } else if (strcmp(key, "TextOverlay") == 0) { diff --git a/parameters.h b/parameters.h index 36ced18..b8a1357 100644 --- a/parameters.h +++ b/parameters.h @@ -41,6 +41,7 @@ typedef struct { char *af_speed; float lens_position; window_t *af_window; + unsigned int flicker_period; bool text_overlay_enable; char *text_overlay;