fixed stream memory allocation issue

pull/60/head
Miroslav Pivovarsky 2024-06-27 22:26:55 +02:00
parent d5199c98ee
commit eaab5da67e
1 changed files with 10 additions and 0 deletions

View File

@ -30,7 +30,17 @@ Camera::Camera(Configuration* i_conf, Logs* i_log, int8_t i_FlashPin) {
StreamOnOff = false; StreamOnOff = false;
frameBufferSemaphore = xSemaphoreCreateMutex(); frameBufferSemaphore = xSemaphoreCreateMutex();
FrameBufferDuplicate = (camera_fb_t*)heap_caps_malloc(sizeof(camera_fb_t), MALLOC_CAP_SPIRAM); FrameBufferDuplicate = (camera_fb_t*)heap_caps_malloc(sizeof(camera_fb_t), MALLOC_CAP_SPIRAM);
if (FrameBufferDuplicate != NULL) {
memset(FrameBufferDuplicate, 0, sizeof(camera_fb_t));
FrameBufferDuplicate->buf = NULL;
}
FrameBufferExif = (camera_fb_t*)heap_caps_malloc(sizeof(camera_fb_t), MALLOC_CAP_SPIRAM); FrameBufferExif = (camera_fb_t*)heap_caps_malloc(sizeof(camera_fb_t), MALLOC_CAP_SPIRAM);
if (FrameBufferExif != NULL) {
memset(FrameBufferExif, 0, sizeof(camera_fb_t));
FrameBufferExif->buf = NULL;
}
StreamSendingPhoto = false; StreamSendingPhoto = false;
PhotoExifData.header = NULL; PhotoExifData.header = NULL;