5#ifdef USE_ESP32_VARIANT_ESP32P4
7#include <driver/jpeg_encode.h>
17 JpegEncoder(jpeg_enc_input_format_t input_format, jpeg_down_sampling_type_t sub_sample, uint8_t quality) {
18 this->
config_.src_type = input_format;
19 this->
config_.sub_sample = sub_sample;
20 this->
config_.image_quality = quality;
28 bool init(uint16_t width, uint16_t height,
size_t frame_size);
34 size_t encode(
const uint8_t *frame,
size_t frame_length);
ESP32-P4 hardware JPEG encoder with one output buffer: one encoded frame at a time.
jpeg_encode_cfg_t config_
uint8_t get_quality() const
jpeg_encoder_handle_t engine_
uint8_t * get_output_buffer() const
Returns the buffer holding the most recently encoded image.
bool init(uint16_t width, uint16_t height, size_t frame_size)
Allocates the encoder engine and its output buffer.
size_t encode(const uint8_t *frame, size_t frame_length)
Encodes one frame into the internal output buffer.
JpegEncoder(jpeg_enc_input_format_t input_format, jpeg_down_sampling_type_t sub_sample, uint8_t quality)