@@ -55,7 +55,12 @@ void ProjectConfig::initConfig() {
5555 .href = 0 ,
5656 .framesize = 4 ,
5757 .quality = 7 ,
58- .brightness = 2 ,
58+ .brightness = BRIGHTNESS,
59+ .simple_auto_exposure_on = SIMPLE_AUTO_EXPOSURE_ON,
60+ .fancy_auto_exposure_on = FANCY_AUTO_EXPOSURE_ON,
61+ .ae_level = AE_LEVEL,
62+ .aec_value = AEC_VALUE,
63+ .auto_gain_on = AUTO_GAIN_ON,
5964 };
6065}
6166
@@ -132,6 +137,12 @@ void ProjectConfig::cameraConfigSave() {
132137 putInt (" framesize" , this ->config .camera .framesize );
133138 putInt (" quality" , this ->config .camera .quality );
134139 putInt (" brightness" , this ->config .camera .brightness );
140+ putInt (" brightness" , this ->config .camera .brightness );
141+ putInt (" simple_auto_exposure_on" , this ->config .camera .fancy_auto_exposure_on );
142+ putInt (" fancy_auto_exposure_on" , this ->config .camera .fancy_auto_exposure_on );
143+ putInt (" ae_level" , this ->config .camera .ae_level );
144+ putInt (" aec_value" , this ->config .camera .aec_value );
145+ putInt (" auto_gain_on " , this ->config .camera .auto_gain_on );
135146}
136147
137148bool ProjectConfig::reset () {
@@ -198,7 +209,12 @@ void ProjectConfig::load() {
198209 this ->config .camera .href = getInt (" href" , 0 );
199210 this ->config .camera .framesize = getInt (" framesize" , 4 );
200211 this ->config .camera .quality = getInt (" quality" , 7 );
201- this ->config .camera .brightness = getInt (" brightness" , 2 );
212+ this ->config .camera .brightness = getInt (" brightness" , BRIGHTNESS);
213+ this ->config .camera .fancy_auto_exposure_on = getInt (" simple_auto_exposure_on" , SIMPLE_AUTO_EXPOSURE_ON);
214+ this ->config .camera .fancy_auto_exposure_on = getInt (" fancy_auto_exposure_on" , FANCY_AUTO_EXPOSURE_ON);
215+ this ->config .camera .ae_level = getInt (" ae_level" , AE_LEVEL);
216+ this ->config .camera .aec_value = getInt (" aec_value" , AEC_VALUE);
217+ this ->config .camera .auto_gain_on = getInt (" auto_gain_on " , AUTO_GAIN_ON);
202218
203219 this ->_already_loaded = true ;
204220 this ->notify (ObserverEvent::configLoaded);
@@ -238,13 +254,23 @@ void ProjectConfig::setCameraConfig(uint8_t* vflip,
238254 uint8_t * href,
239255 uint8_t * quality,
240256 uint8_t * brightness,
257+ bool simple_auto_exposure_on,
258+ bool fancy_auto_exposure_on,
259+ int ae_level,
260+ unsigned int aec_value,
261+ bool auto_gain_on,
241262 bool shouldNotify) {
242263 log_d (" Updating camera config" );
243264 this ->config .camera .vflip = *vflip;
244265 this ->config .camera .href = *href;
245266 this ->config .camera .framesize = *framesize;
246267 this ->config .camera .quality = *quality;
247268 this ->config .camera .brightness = *brightness;
269+ this ->config .camera .simple_auto_exposure_on = simple_auto_exposure_on;
270+ this ->config .camera .fancy_auto_exposure_on = fancy_auto_exposure_on;
271+ this ->config .camera .ae_level = ae_level;
272+ this ->config .camera .aec_value = aec_value;
273+ this ->config .camera .auto_gain_on = auto_gain_on;
248274
249275 log_d (" Updating Camera config" );
250276 if (shouldNotify)
@@ -372,9 +398,10 @@ std::string ProjectConfig::MDNSConfig_t::toRepresentation() {
372398std::string ProjectConfig::CameraConfig_t::toRepresentation () {
373399 std::string json = Helpers::format_string (
374400 " \" camera_config\" : {\" vflip\" : %d,\" framesize\" : %d,\" href\" : "
375- " %d,\" quality\" : %d,\" brightness\" : %d}" ,
401+ " %d,\" quality\" : %d,\" brightness\" : %d, \" simple_auto_exposure_on \" : %d, \" fancy_auto_exposure_on \" : %d, \" ae_level \" : %d, \" aec_value \" : %d, \" auto_gain_on \" : %d }" ,
376402 this ->vflip , this ->framesize , this ->href , this ->quality ,
377- this ->brightness );
403+ this ->brightness , this ->simple_auto_exposure_on , this ->fancy_auto_exposure_on ,
404+ this ->aec_value , this ->ae_level , this ->auto_gain_on );
378405 return json;
379406}
380407
0 commit comments