Skip to content

Commit

Permalink
Clean up setting grab mode and default framesizes
Browse files Browse the repository at this point in the history
- stop handling non-psram scenarios.
  • Loading branch information
easytarget committed May 8, 2022
1 parent 1ba62fe commit 4c9ab6e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions esp32-cam-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,12 @@ void StartCamera() {
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = xclk * 1000000;
config.pixel_format = PIXFORMAT_JPEG;
// Low(ish) default framesize and quality
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_LATEST;
// Pre-allocate large buffers
if(psramFound()){
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 10;
config.fb_count = 2;
} else {
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.fb_count = 1;
}

#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
Expand Down Expand Up @@ -410,8 +405,6 @@ void StartCamera() {
// set initial frame rate
#if defined(DEFAULT_RESOLUTION)
s->set_framesize(s, DEFAULT_RESOLUTION);
#else
s->set_framesize(s, FRAMESIZE_SVGA);
#endif

/*
Expand Down

0 comments on commit 4c9ab6e

Please sign in to comment.