Skip to content

Commit

Permalink
add FlickerPeriod (bluenviron/mediamtx#3463) (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Aug 18, 2024
1 parent 01891a2 commit 54b80e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 54b80e5

Please sign in to comment.