15 jpeg_encode_engine_cfg_t engine_config{};
16 engine_config.timeout_ms = ENCODE_TIMEOUT_MS;
17 esp_err_t err = jpeg_new_encoder_engine(&engine_config, &this->
engine_);
19 ESP_LOGE(TAG,
"Encoder engine setup failed: %s", esp_err_to_name(err));
23 jpeg_encode_memory_alloc_cfg_t memory_config{};
24 memory_config.buffer_direction = JPEG_ENC_ALLOC_OUTPUT_BUFFER;
25 this->
output_ =
static_cast<uint8_t *
>(jpeg_alloc_encoder_mem(frame_size, &memory_config, &this->
output_size_));
27 ESP_LOGE(TAG,
"Failed to allocate %zu byte JPEG output buffer", frame_size);