This commit is contained in:
jomjol
2021-01-01 10:13:00 +01:00
parent 9c8f64f602
commit c59826471c
28 changed files with 263 additions and 106 deletions

View File

@@ -192,7 +192,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
LEDOnOff(true);
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Start");
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Start");
#endif
if (delay > 0)
@@ -203,7 +203,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
}
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LightOn");
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LightOn");
#endif
camera_fb_t * fb = esp_camera_fb_get();
@@ -220,7 +220,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
esp_camera_fb_return(fb);
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After fb_get");
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After fb_get");
#endif
LEDOnOff(false);
@@ -237,7 +237,9 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
_zwImage.LoadFromMemory(zwischenspeicher, _size);
free(zwischenspeicher);
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LoadFromMemory");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LoadFromMemory");
#endif
stbi_uc* p_target;
stbi_uc* p_source;
@@ -248,7 +250,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
#ifdef DEBUG_DETAIL_ON
std::string _zw = "Targetimage: " + std::to_string((int) _Image->rgb_image) + " Size: " + std::to_string(_Image->width) + ", " + std::to_string(_Image->height);
_zw = _zw + " _zwImage: " + std::to_string((int) _zwImage.rgb_image) + " Size: " + std::to_string(_zwImage.width) + ", " + std::to_string(_zwImage.height);
if (debug_detail_heap) LogFile.WriteToFile(_zw);
LogFile.WriteToFile(_zw);
#endif
for (int x = 0; x < width; ++x)
@@ -262,13 +264,13 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
}
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After Copy To Target");
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After Copy To Target");
#endif
free(buf);
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Done");
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Done");
#endif
return ESP_OK;
@@ -338,9 +340,7 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
FILE * fp = OpenFileAndWait(nm.c_str(), "wb");
if (fp == NULL) /* If an error occurs during the file creation */
{
#ifdef DEBUG_DETAIL_ON
fprintf(stderr, "fopen() failed for '%s'\n", nm.c_str());
#endif
}
else
{

View File

@@ -45,6 +45,4 @@ class CCamera {
extern CCamera Camera;
extern bool debug_detail_heap;
#endif

View File

@@ -11,7 +11,7 @@
#define SCRATCH_BUFSIZE2 8192
char scratch2[SCRATCH_BUFSIZE2];
// #define DEBUG_DETAIL_ON
//#define DEBUG_DETAIL_ON
@@ -33,8 +33,7 @@ void PowerResetCamera(){
esp_err_t handler_lightOn(httpd_req_t *req)
{
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOn - Start");
LogFile.WriteToFile("handler_lightOn");
LogFile.WriteHeapInfo("handler_lightOn - Start");
printf("handler_lightOn uri:\n"); printf(req->uri); printf("\n");
#endif
@@ -43,7 +42,7 @@ esp_err_t handler_lightOn(httpd_req_t *req)
httpd_resp_send(req, resp_str, strlen(resp_str));
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOn - Done");
LogFile.WriteHeapInfo("handler_lightOn - Done");
#endif
return ESP_OK;
@@ -52,8 +51,7 @@ esp_err_t handler_lightOn(httpd_req_t *req)
esp_err_t handler_lightOff(httpd_req_t *req)
{
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOff - Start");
LogFile.WriteToFile("handler_lightOff");
LogFile.WriteHeapInfo("handler_lightOff - Start");
printf("handler_lightOff uri:\n"); printf(req->uri); printf("\n");
#endif
Camera.LightOnOff(false);
@@ -61,7 +59,7 @@ esp_err_t handler_lightOff(httpd_req_t *req)
httpd_resp_send(req, resp_str, strlen(resp_str));
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOff - Done");
LogFile.WriteHeapInfo("handler_lightOff - Done");
#endif
return ESP_OK;
@@ -70,8 +68,7 @@ esp_err_t handler_lightOff(httpd_req_t *req)
esp_err_t handler_capture(httpd_req_t *req)
{
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture - Start");
LogFile.WriteToFile("handler_capture");
LogFile.WriteHeapInfo("handler_capture - Start");
#endif
int quality;
@@ -89,7 +86,7 @@ esp_err_t handler_capture(httpd_req_t *req)
ressult = Camera.CaptureToHTTP(req);
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture - Done");
LogFile.WriteHeapInfo("handler_capture - Done");
#endif
return ressult;
@@ -98,7 +95,8 @@ esp_err_t handler_capture(httpd_req_t *req)
esp_err_t handler_capture_with_ligth(httpd_req_t *req)
{
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_with_ligth - Start");
LogFile.WriteHeapInfo("handler_capture_with_ligth - Start");
LogFile.WriteToFile("handler_capture_with_ligth");
char _query[100];
@@ -140,7 +138,7 @@ esp_err_t handler_capture_with_ligth(httpd_req_t *req)
Camera.LightOnOff(false);
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_with_ligth - Done");
LogFile.WriteHeapInfo("handler_capture_with_ligth - Done");
#endif
return ressult;
@@ -151,8 +149,7 @@ esp_err_t handler_capture_with_ligth(httpd_req_t *req)
esp_err_t handler_capture_save_to_file(httpd_req_t *req)
{
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_save_to_file - Start");
LogFile.WriteToFile("handler_capture_save_to_file");
LogFile.WriteHeapInfo("handler_capture_save_to_file - Start");
#endif
char _query[100];
@@ -206,7 +203,7 @@ esp_err_t handler_capture_save_to_file(httpd_req_t *req)
httpd_resp_send(req, resp_str, strlen(resp_str));
#ifdef DEBUG_DETAIL_ON
if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_save_to_file - Done");
LogFile.WriteHeapInfo("handler_capture_save_to_file - Done");
#endif
return ressult;

View File

@@ -13,7 +13,4 @@ void register_server_camera_uri(httpd_handle_t server);
void PowerResetCamera();
extern bool debug_detail_heap;
#endif