Update server_camera.cpp

Fix building with -D DEBUG_DETAIL_ON 

better alternative to:
https://github.com/jomjol/AI-on-the-edge-device/pull/3160
This commit is contained in:
michael
2024-08-05 23:57:17 +02:00
committed by GitHub
parent f534741205
commit 64bb4f0ff6

View File

@@ -92,11 +92,7 @@ esp_err_t handler_capture(httpd_req_t *req)
if (Camera.getCameraInitSuccessful())
{
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", res, quality);
#endif
// wenn die Kameraeinstellungen durch Erstellen eines neuen Referenzbildes verändert wurden, müssen sie neu gesetzt werden
// If the camera settings were changed by creating a new reference image, they must be reset
if (CFstatus.changedCameraSettings)
{
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
@@ -104,6 +100,10 @@ esp_err_t handler_capture(httpd_req_t *req)
CFstatus.changedCameraSettings = false;
}
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", CCstatus.ImageFrameSize, CCstatus.ImageQuality);
#endif
esp_err_t result;
result = Camera.CaptureToHTTP(req);
@@ -150,11 +150,7 @@ esp_err_t handler_capture_with_light(httpd_req_t *req)
}
}
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", res, quality);
#endif
// wenn die Kameraeinstellungen durch Erstellen eines neuen Referenzbildes verändert wurden, müssen sie neu gesetzt werden
// If the camera settings were changed by creating a new reference image, they must be reset
if (CFstatus.changedCameraSettings)
{
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
@@ -162,6 +158,10 @@ esp_err_t handler_capture_with_light(httpd_req_t *req)
CFstatus.changedCameraSettings = false;
}
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", CCstatus.ImageFrameSize, CCstatus.ImageQuality);
#endif
Camera.LightOnOff(true);
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
vTaskDelay(xDelay);
@@ -232,11 +232,7 @@ esp_err_t handler_capture_save_to_file(httpd_req_t *req)
fn.append("noname.jpg");
}
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", res, quality);
#endif
// wenn die Kameraeinstellungen durch Erstellen eines neuen Referenzbildes verändert wurden, müssen sie neu gesetzt werden
// If the camera settings were changed by creating a new reference image, they must be reset
if (CFstatus.changedCameraSettings)
{
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
@@ -244,6 +240,10 @@ esp_err_t handler_capture_save_to_file(httpd_req_t *req)
CFstatus.changedCameraSettings = false;
}
#ifdef DEBUG_DETAIL_ON
ESP_LOGD(TAG, "Size: %d, Quality: %d", CCstatus.ImageFrameSize, CCstatus.ImageQuality);
#endif
esp_err_t result;
result = Camera.CaptureToFile(fn, delay);