|
ESPHome 2026.8.0-dev
|
#include <esp32_camera.h>
Public Member Functions | |
| ESP32Camera () | |
| void | set_data_pins (std::array< uint8_t, 8 > pins) |
| void | set_vsync_pin (uint8_t pin) |
| void | set_href_pin (uint8_t pin) |
| void | set_pixel_clock_pin (uint8_t pin) |
| void | set_external_clock (uint8_t pin, uint32_t frequency) |
| void | set_i2c_pins (uint8_t sda, uint8_t scl) |
| void | set_i2c_id (i2c::InternalI2CBus *i2c_bus) |
| void | set_reset_pin (uint8_t pin) |
| void | set_power_down_pin (uint8_t pin) |
| void | set_pixel_format (ESP32CameraPixelFormat format) |
| void | set_frame_size (ESP32CameraFrameSize size) |
| void | set_jpeg_quality (uint8_t quality) |
| void | set_vertical_flip (bool vertical_flip) |
| void | set_horizontal_mirror (bool horizontal_mirror) |
| void | set_contrast (int contrast) |
| void | set_brightness (int brightness) |
| void | set_saturation (int saturation) |
| void | set_special_effect (ESP32SpecialEffect effect) |
| void | set_aec_mode (ESP32GainControlMode mode) |
| void | set_aec2 (bool aec2) |
| void | set_ae_level (int ae_level) |
| void | set_aec_value (uint32_t aec_value) |
| void | set_agc_mode (ESP32GainControlMode mode) |
| void | set_agc_value (uint8_t agc_value) |
| void | set_agc_gain_ceiling (ESP32AgcGainCeiling gain_ceiling) |
| void | set_wb_mode (ESP32WhiteBalanceMode mode) |
| void | set_test_pattern (bool test_pattern) |
| void | set_max_update_interval (uint32_t max_update_interval) |
| void | set_idle_update_interval (uint32_t idle_update_interval) |
| void | set_frame_buffer_mode (camera_grab_mode_t mode) |
| void | set_frame_buffer_count (uint8_t fb_count) |
| void | set_frame_buffer_location (camera_fb_location_t fb_location) |
| void | setup () override |
| void | loop () override |
| void | dump_config () override |
| void | start_stream (camera::CameraRequester requester) override |
| void | stop_stream (camera::CameraRequester requester) override |
| void | request_image (camera::CameraRequester requester) override |
| void | update_camera_parameters () |
| void | add_listener (camera::CameraListener *listener) override |
| Add a listener to receive camera events. | |
| camera::CameraImageReader * | create_image_reader () override |
Public Member Functions inherited from esphome::camera::Camera | |
| Camera () | |
| virtual | ~Camera () |
Public Member Functions inherited from esphome::EntityBase | |
| const StringRef & | get_name () const |
| bool | has_own_name () const |
| uint32_t | get_object_id_hash () const |
| StringRef | get_object_id_to (std::span< char, OBJECT_ID_MAX_LEN > buf) const |
| Get object_id with zero heap allocation For static case: returns StringRef to internal storage (buffer unused) For dynamic case: formats into buffer and returns StringRef to buffer. | |
| size_t | write_object_id_to (char *buf, size_t buf_size) const |
| Write object_id directly to buffer, returns length written (excluding null) Useful for building compound strings without intermediate buffer. | |
| bool | is_internal () const |
| ESPDEPRECATED ("set_internal() is undefined behavior at runtime — components and Home Assistant are NOT " "notified. Use the 'internal:' YAML key instead. Will be removed in 2027.3.0.", "2026.3.0") void set_internal(bool internal) | |
| bool | is_disabled_by_default () const |
| EntityCategory | get_entity_category () const |
| const char * | get_device_class_to (std::span< char, MAX_DEVICE_CLASS_LENGTH > buffer) const |
| template<typename T = int> | |
| StringRef | get_device_class_ref () const |
| template<typename T = int> | |
| std::string | get_device_class () const |
| ESPDEPRECATED ("Use get_device_class_to() instead. Will be removed in ESPHome 2026.9.0", "2026.3.0") StringRef get_device_class_ref() const | |
| ESPDEPRECATED("Use get_device_class_to() instead. Will be removed in ESPHome 2026.9.0", "2026.3.0") std StringRef | get_unit_of_measurement_ref () const |
| ESPDEPRECATED("Use get_unit_of_measurement_ref() instead for better performance (avoids string copy). Will be " "removed in ESPHome 2026.9.0", "2026.3.0") std const char * | get_icon_to (std::span< char, MAX_ICON_LENGTH > buffer) const |
| Get the unit of measurement as std::string (deprecated, prefer get_unit_of_measurement_ref()) | |
| template<typename T = int> | |
| StringRef | get_icon_ref () const |
| template<typename T = int> | |
| std::string | get_icon () const |
| ESPDEPRECATED ("Use get_icon_to() instead. Will be removed in ESPHome 2026.9.0", "2026.3.0") StringRef get_icon_ref() const | |
| ESPDEPRECATED("Use get_icon_to() instead. Will be removed in ESPHome 2026.9.0", "2026.3.0") std uint32_t | get_device_id () const |
| Device * | get_device () const |
| bool | has_state () const |
| void | set_has_state (bool state) |
| ESPDEPRECATED ("Use make_entity_preference<T>() instead, or preferences won't be migrated. " "See https://github.com/esphome/backlog/issues/85. Will be removed in 2027.1.0.", "2026.7.0") uint32_t get_preference_hash() | |
| Get a unique hash for storing preferences/settings for this entity. | |
| template<typename T > | |
| ESPPreferenceObject | make_entity_preference (uint32_t version=0) |
| Create a preference object for storing this entity's state/settings. | |
Public Member Functions inherited from esphome::Component | |
| virtual float | get_setup_priority () const |
| priority of setup(). | |
| float | get_actual_setup_priority () const |
| void | set_setup_priority (float priority) |
| void | call () |
| virtual void | on_shutdown () |
| virtual void | on_safe_shutdown () |
| virtual bool | teardown () |
| Called during teardown to allow component to gracefully finish operations. | |
| virtual void | on_powerdown () |
| Called after teardown is complete to power down hardware. | |
| uint8_t | get_component_state () const |
| void | reset_to_construction_state () |
| Reset this component back to the construction state to allow setup to run again. | |
| bool | is_in_loop_state () const |
| Check if this component has completed setup and is in the loop state. | |
| bool | is_idle () const |
| Check if this component is idle. | |
| void | mark_failed () |
| Mark this component as failed. | |
| void | mark_failed (const LogString *message) |
| void | disable_loop () |
| Disable this component's loop. | |
| void | enable_loop () |
| Enable this component's loop. | |
| void | enable_loop_soon_any_context () |
| Thread and ISR-safe version of enable_loop() that can be called from any context. | |
| bool | is_failed () const |
| bool | is_ready () const |
| virtual bool | can_proceed () |
| bool | status_has_warning () const |
| bool | status_has_error () const |
| void | status_set_warning () |
| void | status_set_warning (const char *message) |
| void | status_set_warning (const LogString *message) |
| void | status_set_error () |
| void | status_set_error (const LogString *message) |
| void | status_clear_warning () |
| void | status_clear_error () |
| void | status_momentary_warning (const char *name, uint32_t length=5000) |
| Set warning status flag and automatically clear it after a timeout. | |
| void | status_momentary_error (const char *name, uint32_t length=5000) |
| Set error status flag and automatically clear it after a timeout. | |
| bool | has_overridden_loop () const |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| Get the integration where this component was declared as a LogString for logging. | |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
Protected Member Functions | |
| bool | has_requested_image_ () const |
| bool | can_return_image_ () const |
Protected Member Functions inherited from esphome::EntityBase | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | configure_entity_ (const char *name, uint32_t object_id_hash, uint32_t entity_fields) |
| Combined entity setup from codegen: set name, object_id hash, entity string indices, and flags. | |
| void | set_device_ (Device *device) |
| ESPPreferenceObject | make_entity_preference_ (size_t size, uint32_t version) |
| Non-template helper for make_entity_preference() to avoid code bloat. | |
| void | calc_object_id_ () |
Protected Member Functions inherited from esphome::Component | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | set_component_source_ (uint8_t index) |
| Set where this component was loaded from for some debug messages. | |
| virtual void | call_setup () |
| void | call_dump_config_ () |
| void | enable_loop_slow_path_ () |
| void | set_component_state_ (uint8_t state) |
| Helper to set component state (clears state bits and sets new state) | |
| bool | set_status_flag_ (uint8_t flag) |
| Helper to set a status LED flag on both this component and the app. | |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a const char* name. | |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a numeric ID (zero heap allocation). | |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| bool | cancel_interval (const char *name) |
| Cancel an interval function. | |
| bool | cancel_interval (uint32_t id) |
| bool | cancel_interval (InternalSchedulerID id) |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a const char* name. | |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a numeric ID (zero heap allocation). | |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| bool | cancel_timeout (const char *name) |
| Cancel a timeout function. | |
| bool | cancel_timeout (uint32_t id) |
| bool | cancel_timeout (InternalSchedulerID id) |
| void | defer (const char *name, std::function< void()> &&f) |
| Defer a callback to the next loop() call with a const char* name. | |
| void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. | |
| void | defer (uint32_t id, std::function< void()> &&f) |
| Defer a callback with a numeric ID (zero heap allocation) | |
| bool | cancel_defer (const char *name) |
| Cancel a defer callback using the specified name, name must not be empty. | |
| bool | cancel_defer (uint32_t id) |
| void | status_clear_warning_slow_path_ () |
| void | status_clear_error_slow_path_ () |
Static Protected Member Functions | |
| static void | framebuffer_task (void *pv) |
Protected Attributes | |
| camera_config_t | config_ {} |
| bool | vertical_flip_ {true} |
| bool | horizontal_mirror_ {true} |
| int | contrast_ {0} |
| int | brightness_ {0} |
| int | saturation_ {0} |
| ESP32SpecialEffect | special_effect_ {ESP32_SPECIAL_EFFECT_NONE} |
| ESP32GainControlMode | aec_mode_ {ESP32_GC_MODE_AUTO} |
| bool | aec2_ {false} |
| int | ae_level_ {0} |
| uint32_t | aec_value_ {300} |
| ESP32GainControlMode | agc_mode_ {ESP32_GC_MODE_AUTO} |
| uint8_t | agc_value_ {0} |
| ESP32AgcGainCeiling | agc_gain_ceiling_ {ESP32_GAINCEILING_2X} |
| ESP32WhiteBalanceMode | wb_mode_ {ESP32_WB_MODE_AUTO} |
| bool | test_pattern_ {false} |
| uint32_t | max_update_interval_ {1000} |
| uint32_t | idle_update_interval_ {15000} |
| esp_err_t | init_error_ {ESP_OK} |
| std::shared_ptr< ESP32CameraImage > | current_image_ |
| std::atomic< uint8_t > | single_requesters_ {0} |
| std::atomic< uint8_t > | stream_requesters_ {0} |
| QueueHandle_t | framebuffer_get_queue_ |
| QueueHandle_t | framebuffer_return_queue_ |
| std::vector< camera::CameraListener * > | listeners_ |
| uint32_t | last_idle_request_ {0} |
| uint32_t | last_update_ {0} |
| uint32_t | last_log_time_ {0} |
| uint16_t | frame_count_ {0} |
| i2c::InternalI2CBus * | i2c_bus_ {nullptr} |
| RAMAllocator< camera_fb_t > | fb_allocator_ {RAMAllocator<camera_fb_t>::ALLOC_INTERNAL} |
Protected Attributes inherited from esphome::EntityBase | |
| StringRef | name_ |
| uint32_t | object_id_hash_ {} |
| Device * | device_ {} |
| struct esphome::EntityBase::EntityFlags | flags_ |
| uint8_t | device_class_idx_ {} |
| uint8_t | uom_idx_ {} |
| uint8_t | icon_idx_ {} |
Protected Attributes inherited from esphome::Component | |
| uint8_t | component_source_index_ {0} |
| Index into component source PROGMEM lookup table (0 = not set) | |
| uint8_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS} |
| Warn threshold in centiseconds (max 2550ms) | |
| uint8_t | component_state_ {0x00} |
| State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion. | |
| volatile bool | pending_enable_loop_ {false} |
| ISR-safe flag for enable_loop_soon_any_context. | |
| ComponentRuntimeStats | runtime_stats_ |
Additional Inherited Members | |
Static Public Member Functions inherited from esphome::camera::Camera | |
| static Camera * | instance () |
| The singleton instance of the camera implementation. | |
Static Protected Attributes inherited from esphome::camera::Camera | |
| static Camera * | global_camera = nullptr |
Definition at line 122 of file esp32_camera.h.
| esphome::esp32_camera::ESP32Camera::ESP32Camera | ( | ) |
Definition at line 298 of file esp32_camera.cpp.
|
inlineoverridevirtual |
Add a listener to receive camera events.
Implements esphome::camera::Camera.
Definition at line 181 of file esp32_camera.h.
|
protected |
Definition at line 516 of file esp32_camera.cpp.
|
overridevirtual |
Implements esphome::camera::Camera.
Definition at line 486 of file esp32_camera.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 122 of file esp32_camera.cpp.
|
staticprotected |
Definition at line 517 of file esp32_camera.cpp.
|
protected |
Definition at line 515 of file esp32_camera.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 186 of file esp32_camera.cpp.
|
overridevirtual |
Implements esphome::camera::Camera.
Definition at line 485 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_ae_level | ( | int | ae_level | ) |
Definition at line 445 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_aec2 | ( | bool | aec2 | ) |
Definition at line 444 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_aec_mode | ( | ESP32GainControlMode | mode | ) |
Definition at line 443 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_aec_value | ( | uint32_t | aec_value | ) |
Definition at line 446 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_agc_gain_ceiling | ( | ESP32AgcGainCeiling | gain_ceiling | ) |
Definition at line 450 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_agc_mode | ( | ESP32GainControlMode | mode | ) |
Definition at line 448 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_agc_value | ( | uint8_t | agc_value | ) |
Definition at line 449 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_brightness | ( | int | brightness | ) |
Definition at line 439 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_contrast | ( | int | contrast | ) |
Definition at line 438 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_data_pins | ( | std::array< uint8_t, 8 > | pins | ) |
Definition at line 314 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_external_clock | ( | uint8_t | pin, |
| uint32_t | frequency ) |
Definition at line 327 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_frame_buffer_count | ( | uint8_t | fb_count | ) |
Definition at line 464 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_frame_buffer_location | ( | camera_fb_location_t | fb_location | ) |
Definition at line 468 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_frame_buffer_mode | ( | camera_grab_mode_t | mode | ) |
Definition at line 463 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_frame_size | ( | ESP32CameraFrameSize | size | ) |
Definition at line 346 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_horizontal_mirror | ( | bool | horizontal_mirror | ) |
Definition at line 437 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_href_pin | ( | uint8_t | pin | ) |
Definition at line 325 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_i2c_id | ( | i2c::InternalI2CBus * | i2c_bus | ) |
Definition at line 336 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_i2c_pins | ( | uint8_t | sda, |
| uint8_t | scl ) |
Definition at line 331 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_idle_update_interval | ( | uint32_t | idle_update_interval | ) |
Definition at line 459 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_jpeg_quality | ( | uint8_t | quality | ) |
Definition at line 435 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_max_update_interval | ( | uint32_t | max_update_interval | ) |
Definition at line 456 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_pixel_clock_pin | ( | uint8_t | pin | ) |
Definition at line 326 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_pixel_format | ( | ESP32CameraPixelFormat | format | ) |
Definition at line 404 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_power_down_pin | ( | uint8_t | pin | ) |
Definition at line 343 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_reset_pin | ( | uint8_t | pin | ) |
Definition at line 342 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_saturation | ( | int | saturation | ) |
Definition at line 440 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_special_effect | ( | ESP32SpecialEffect | effect | ) |
Definition at line 441 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_test_pattern | ( | bool | test_pattern | ) |
Definition at line 454 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_vertical_flip | ( | bool | vertical_flip | ) |
Definition at line 436 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_vsync_pin | ( | uint8_t | pin | ) |
Definition at line 324 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::set_wb_mode | ( | ESP32WhiteBalanceMode | mode | ) |
Definition at line 452 of file esp32_camera.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 87 of file esp32_camera.cpp.
|
overridevirtual |
Implements esphome::camera::Camera.
Definition at line 473 of file esp32_camera.cpp.
|
overridevirtual |
Implements esphome::camera::Camera.
Definition at line 479 of file esp32_camera.cpp.
| void esphome::esp32_camera::ESP32Camera::update_camera_parameters | ( | ) |
Definition at line 487 of file esp32_camera.cpp.
|
protected |
Definition at line 204 of file esp32_camera.h.
|
protected |
Definition at line 203 of file esp32_camera.h.
|
protected |
Definition at line 202 of file esp32_camera.h.
|
protected |
Definition at line 205 of file esp32_camera.h.
|
protected |
Definition at line 209 of file esp32_camera.h.
|
protected |
Definition at line 207 of file esp32_camera.h.
|
protected |
Definition at line 208 of file esp32_camera.h.
|
protected |
Definition at line 198 of file esp32_camera.h.
|
protected |
Definition at line 193 of file esp32_camera.h.
|
protected |
Definition at line 197 of file esp32_camera.h.
|
protected |
Definition at line 219 of file esp32_camera.h.
|
protected |
Definition at line 235 of file esp32_camera.h.
|
protected |
Definition at line 230 of file esp32_camera.h.
|
protected |
Definition at line 222 of file esp32_camera.h.
|
protected |
Definition at line 223 of file esp32_camera.h.
|
protected |
Definition at line 196 of file esp32_camera.h.
|
protected |
Definition at line 233 of file esp32_camera.h.
|
protected |
Definition at line 216 of file esp32_camera.h.
|
protected |
Definition at line 218 of file esp32_camera.h.
|
protected |
Definition at line 226 of file esp32_camera.h.
|
protected |
Definition at line 229 of file esp32_camera.h.
|
protected |
Definition at line 227 of file esp32_camera.h.
|
protected |
Definition at line 224 of file esp32_camera.h.
|
protected |
Definition at line 215 of file esp32_camera.h.
|
protected |
Definition at line 199 of file esp32_camera.h.
|
protected |
Definition at line 220 of file esp32_camera.h.
|
protected |
Definition at line 200 of file esp32_camera.h.
|
protected |
Definition at line 221 of file esp32_camera.h.
|
protected |
Definition at line 213 of file esp32_camera.h.
|
protected |
Definition at line 195 of file esp32_camera.h.
|
protected |
Definition at line 211 of file esp32_camera.h.