9 #include <esp_camera.h> 10 #include <freertos/FreeRTOS.h> 11 #include <freertos/queue.h> 14 namespace esp32_camera {
78 CameraImage(camera_fb_t *buffer, uint8_t requester);
92 void set_image(std::shared_ptr<CameraImage> image);
93 size_t available()
const;
94 uint8_t *peek_data_buffer();
95 void consume_data(
size_t consumed);
110 void set_data_pins(std::array<uint8_t, 8> pins);
111 void set_vsync_pin(uint8_t pin);
112 void set_href_pin(uint8_t pin);
113 void set_pixel_clock_pin(uint8_t pin);
114 void set_external_clock(uint8_t pin, uint32_t
frequency);
115 void set_i2c_pins(uint8_t sda, uint8_t scl);
116 void set_reset_pin(uint8_t pin);
117 void set_power_down_pin(uint8_t pin);
120 void set_jpeg_quality(uint8_t quality);
121 void set_vertical_flip(
bool vertical_flip);
122 void set_horizontal_mirror(
bool horizontal_mirror);
123 void set_contrast(
int contrast);
124 void set_brightness(
int brightness);
125 void set_saturation(
int saturation);
129 void set_aec2(
bool aec2);
130 void set_ae_level(
int ae_level);
131 void set_aec_value(uint32_t aec_value);
134 void set_agc_value(uint8_t agc_value);
139 void set_test_pattern(
bool test_pattern);
141 void set_max_update_interval(uint32_t max_update_interval);
142 void set_idle_update_interval(uint32_t idle_update_interval);
145 void setup()
override;
146 void loop()
override;
147 void dump_config()
override;
148 float get_setup_priority()
const override;
150 void add_image_callback(std::function<
void(std::shared_ptr<CameraImage>)> &&f);
154 void update_camera_parameters();
156 void add_stream_start_callback(std::function<
void()> &&callback);
157 void add_stream_stop_callback(std::function<
void()> &&callback);
161 bool has_requested_image_()
const;
162 bool can_return_image_()
const;
164 static void framebuffer_task(
void *pv);
168 camera_config_t config_{};
170 bool vertical_flip_{
true};
171 bool horizontal_mirror_{
true};
180 uint32_t aec_value_{300};
183 uint8_t agc_value_{0};
188 bool test_pattern_{
false};
190 uint32_t max_update_interval_{1000};
191 uint32_t idle_update_interval_{15000};
193 esp_err_t init_error_{ESP_OK};
195 uint8_t single_requesters_{0};
196 uint8_t stream_requesters_{0};
203 uint32_t last_idle_request_{0};
204 uint32_t last_update_{0};
std::shared_ptr< CameraImage > current_image_
std::shared_ptr< CameraImage > image_
ESP32CameraStreamStopTrigger(ESP32Camera *parent)
void add_stream_start_callback(std::function< void()> &&callback)
QueueHandle_t framebuffer_get_queue_
ESP32Camera * global_esp32_camera
BedjetMode mode
BedJet operating mode.
void add_stream_stop_callback(std::function< void()> &&callback)
camera_fb_t * get_raw_buffer()
uint8_t * get_data_buffer()
bool was_requested_by(CameraRequester requester) const
ESP32CameraStreamStartTrigger(ESP32Camera *parent)
CameraImage(camera_fb_t *buffer, uint8_t requester)
QueueHandle_t framebuffer_return_queue_
Implementation of SPI Controller mode.