Skip to content

Commit 4c9ab6e

Browse files
committed
Clean up setting grab mode and default framesizes
- stop handling non-psram scenarios.
1 parent 1ba62fe commit 4c9ab6e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

esp32-cam-webserver.ino

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,12 @@ void StartCamera() {
335335
config.pin_reset = RESET_GPIO_NUM;
336336
config.xclk_freq_hz = xclk * 1000000;
337337
config.pixel_format = PIXFORMAT_JPEG;
338+
// Low(ish) default framesize and quality
339+
config.frame_size = FRAMESIZE_SVGA;
340+
config.jpeg_quality = 12;
341+
config.fb_location = CAMERA_FB_IN_PSRAM;
342+
config.fb_count = 2;
338343
config.grab_mode = CAMERA_GRAB_LATEST;
339-
// Pre-allocate large buffers
340-
if(psramFound()){
341-
config.frame_size = FRAMESIZE_UXGA;
342-
config.jpeg_quality = 10;
343-
config.fb_count = 2;
344-
} else {
345-
config.frame_size = FRAMESIZE_SVGA;
346-
config.jpeg_quality = 12;
347-
config.fb_count = 1;
348-
}
349344

350345
#if defined(CAMERA_MODEL_ESP_EYE)
351346
pinMode(13, INPUT_PULLUP);
@@ -410,8 +405,6 @@ void StartCamera() {
410405
// set initial frame rate
411406
#if defined(DEFAULT_RESOLUTION)
412407
s->set_framesize(s, DEFAULT_RESOLUTION);
413-
#else
414-
s->set_framesize(s, FRAMESIZE_SVGA);
415408
#endif
416409

417410
/*

0 commit comments

Comments
 (0)