@@ -55,7 +55,12 @@ void ProjectConfig::initConfig() {
55
55
.href = 0 ,
56
56
.framesize = 4 ,
57
57
.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,
59
64
};
60
65
}
61
66
@@ -132,6 +137,12 @@ void ProjectConfig::cameraConfigSave() {
132
137
putInt (" framesize" , this ->config .camera .framesize );
133
138
putInt (" quality" , this ->config .camera .quality );
134
139
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 );
135
146
}
136
147
137
148
bool ProjectConfig::reset () {
@@ -198,7 +209,12 @@ void ProjectConfig::load() {
198
209
this ->config .camera .href = getInt (" href" , 0 );
199
210
this ->config .camera .framesize = getInt (" framesize" , 4 );
200
211
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);
202
218
203
219
this ->_already_loaded = true ;
204
220
this ->notify (ObserverEvent::configLoaded);
@@ -238,13 +254,23 @@ void ProjectConfig::setCameraConfig(uint8_t* vflip,
238
254
uint8_t * href,
239
255
uint8_t * quality,
240
256
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,
241
262
bool shouldNotify) {
242
263
log_d (" Updating camera config" );
243
264
this ->config .camera .vflip = *vflip;
244
265
this ->config .camera .href = *href;
245
266
this ->config .camera .framesize = *framesize;
246
267
this ->config .camera .quality = *quality;
247
268
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;
248
274
249
275
log_d (" Updating Camera config" );
250
276
if (shouldNotify)
@@ -372,9 +398,10 @@ std::string ProjectConfig::MDNSConfig_t::toRepresentation() {
372
398
std::string ProjectConfig::CameraConfig_t::toRepresentation () {
373
399
std::string json = Helpers::format_string (
374
400
" \" 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 }" ,
376
402
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 );
378
405
return json;
379
406
}
380
407
0 commit comments