|
|
@@ -242,18 +242,18 @@ esp_err_t CImageBasis::SendJPGtoHTTP(httpd_req_t *_req, const int quality)
|
|
|
if (_req == nullptr || !ImageOkay()) return ESP_FAIL;
|
|
|
SendJPGHTTP send;
|
|
|
send.req = _req; send.res = ESP_OK; send.size = 0;
|
|
|
- send.buf = static_cast<char*>(malloc_psram_heap("JPEG HTTP stream buffer", HTTP_BUFFER_SENT, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
|
|
+ send.buf = static_cast<char*>(malloc_internal_heap("JPEG HTTP stream buffer", HTTP_BUFFER_SENT, MALLOC_CAP_8BIT));
|
|
|
if (send.buf == nullptr) return ESP_ERR_NO_MEM;
|
|
|
uint8_t* image = RGBImageLock();
|
|
|
if (image == nullptr) {
|
|
|
- free_psram_heap("JPEG HTTP stream buffer", send.buf);
|
|
|
+ free_internal_heap("JPEG HTTP stream buffer", send.buf);
|
|
|
return ESP_FAIL;
|
|
|
}
|
|
|
const int encoded = stbi_write_jpg_to_func(writejpgtohttphelp, &send, width, height, channels, image, quality);
|
|
|
if (!encoded && send.res == ESP_OK) send.res = ESP_FAIL;
|
|
|
flushJPGHTTPBuffer(&send);
|
|
|
RGBImageRelease();
|
|
|
- free_psram_heap("JPEG HTTP stream buffer", send.buf);
|
|
|
+ free_internal_heap("JPEG HTTP stream buffer", send.buf);
|
|
|
return send.res;
|
|
|
}
|
|
|
|