ESPHome  2022.6.2
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
esphome::esp32_camera::ESP32Camera Class Reference

#include <esp32_camera.h>

Inheritance diagram for esphome::esp32_camera::ESP32Camera:
esphome::Component esphome::EntityBase

Public Member Functions

 ESP32Camera (const std::string &name)
 
 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_reset_pin (uint8_t pin)
 
void set_power_down_pin (uint8_t pin)
 
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 setup () override
 
void loop () override
 
void dump_config () override
 
float get_setup_priority () const override
 
void add_image_callback (std::function< void(std::shared_ptr< CameraImage >)> &&f)
 
void start_stream (CameraRequester requester)
 
void stop_stream (CameraRequester requester)
 
void request_image (CameraRequester requester)
 
void update_camera_parameters ()
 
void add_stream_start_callback (std::function< void()> &&callback)
 
void add_stream_stop_callback (std::function< void()> &&callback)
 
- Public Member Functions inherited from esphome::Component
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed ()
 
virtual bool can_proceed ()
 
bool status_has_warning ()
 
bool status_has_error ()
 
void status_set_warning ()
 
void status_set_error ()
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 
- Public Member Functions inherited from esphome::EntityBase
 EntityBase ()
 
 EntityBase (std::string name)
 
const std::string & get_name () const
 
void set_name (const std::string &name)
 
const std::string & get_object_id ()
 
uint32_t get_object_id_hash ()
 
bool is_internal () const
 
void set_internal (bool internal)
 
bool is_disabled_by_default () const
 
void set_disabled_by_default (bool disabled_by_default)
 
EntityCategory get_entity_category () const
 
void set_entity_category (EntityCategory entity_category)
 
const std::string & get_icon () const
 
void set_icon (const std::string &name)
 

Protected Member Functions

bool has_requested_image_ () const
 
bool can_return_image_ () const
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 
- Protected Member Functions inherited from esphome::EntityBase
virtual uint32_t hash_base ()
 The hash_base() function has been deprecated. More...
 
void calc_object_id_ ()
 

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< CameraImagecurrent_image_
 
uint8_t single_requesters_ {0}
 
uint8_t stream_requesters_ {0}
 
QueueHandle_t framebuffer_get_queue_
 
QueueHandle_t framebuffer_return_queue_
 
CallbackManager< void(std::shared_ptr< CameraImage >)> new_image_callback_
 
CallbackManager< void()> stream_start_callback_ {}
 
CallbackManager< void()> stream_stop_callback_ {}
 
uint32_t last_idle_request_ {0}
 
uint32_t last_update_ {0}
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ = nullptr
 
- Protected Attributes inherited from esphome::EntityBase
std::string name_
 
std::string object_id_
 
std::string icon_
 
uint32_t object_id_hash_
 
bool internal_ {false}
 
bool disabled_by_default_ {false}
 
EntityCategory entity_category_ {ENTITY_CATEGORY_NONE}
 

Detailed Description

Definition at line 96 of file esp32_camera.h.

Constructor & Destructor Documentation

◆ ESP32Camera() [1/2]

esphome::esp32_camera::ESP32Camera::ESP32Camera ( const std::string &  name)

Definition at line 177 of file esp32_camera.cpp.

◆ ESP32Camera() [2/2]

esphome::esp32_camera::ESP32Camera::ESP32Camera ( )

Definition at line 190 of file esp32_camera.cpp.

Member Function Documentation

◆ add_image_callback()

void esphome::esp32_camera::ESP32Camera::add_image_callback ( std::function< void(std::shared_ptr< CameraImage >)> &&  f)

Definition at line 282 of file esp32_camera.cpp.

◆ add_stream_start_callback()

void esphome::esp32_camera::ESP32Camera::add_stream_start_callback ( std::function< void()> &&  callback)

Definition at line 285 of file esp32_camera.cpp.

◆ add_stream_stop_callback()

void esphome::esp32_camera::ESP32Camera::add_stream_stop_callback ( std::function< void()> &&  callback)

Definition at line 288 of file esp32_camera.cpp.

◆ can_return_image_()

bool esphome::esp32_camera::ESP32Camera::can_return_image_ ( ) const
protected

Definition at line 326 of file esp32_camera.cpp.

◆ dump_config()

void esphome::esp32_camera::ESP32Camera::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 46 of file esp32_camera.cpp.

◆ framebuffer_task()

void esphome::esp32_camera::ESP32Camera::framebuffer_task ( void *  pv)
staticprotected

Definition at line 327 of file esp32_camera.cpp.

◆ get_setup_priority()

float esphome::esp32_camera::ESP32Camera::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 174 of file esp32_camera.cpp.

◆ has_requested_image_()

bool esphome::esp32_camera::ESP32Camera::has_requested_image_ ( ) const
protected

Definition at line 325 of file esp32_camera.cpp.

◆ loop()

void esphome::esp32_camera::ESP32Camera::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 127 of file esp32_camera.cpp.

◆ request_image()

void esphome::esp32_camera::ESP32Camera::request_image ( CameraRequester  requester)

Definition at line 299 of file esp32_camera.cpp.

◆ set_ae_level()

void esphome::esp32_camera::ESP32Camera::set_ae_level ( int  ae_level)

Definition at line 263 of file esp32_camera.cpp.

◆ set_aec2()

void esphome::esp32_camera::ESP32Camera::set_aec2 ( bool  aec2)

Definition at line 262 of file esp32_camera.cpp.

◆ set_aec_mode()

void esphome::esp32_camera::ESP32Camera::set_aec_mode ( ESP32GainControlMode  mode)

Definition at line 261 of file esp32_camera.cpp.

◆ set_aec_value()

void esphome::esp32_camera::ESP32Camera::set_aec_value ( uint32_t  aec_value)

Definition at line 264 of file esp32_camera.cpp.

◆ set_agc_gain_ceiling()

void esphome::esp32_camera::ESP32Camera::set_agc_gain_ceiling ( ESP32AgcGainCeiling  gain_ceiling)

Definition at line 268 of file esp32_camera.cpp.

◆ set_agc_mode()

void esphome::esp32_camera::ESP32Camera::set_agc_mode ( ESP32GainControlMode  mode)

Definition at line 266 of file esp32_camera.cpp.

◆ set_agc_value()

void esphome::esp32_camera::ESP32Camera::set_agc_value ( uint8_t  agc_value)

Definition at line 267 of file esp32_camera.cpp.

◆ set_brightness()

void esphome::esp32_camera::ESP32Camera::set_brightness ( int  brightness)

Definition at line 257 of file esp32_camera.cpp.

◆ set_contrast()

void esphome::esp32_camera::ESP32Camera::set_contrast ( int  contrast)

Definition at line 256 of file esp32_camera.cpp.

◆ set_data_pins()

void esphome::esp32_camera::ESP32Camera::set_data_pins ( std::array< uint8_t, 8 >  pins)

Definition at line 194 of file esp32_camera.cpp.

◆ set_external_clock()

void esphome::esp32_camera::ESP32Camera::set_external_clock ( uint8_t  pin,
uint32_t  frequency 
)

Definition at line 207 of file esp32_camera.cpp.

◆ set_frame_size()

void esphome::esp32_camera::ESP32Camera::set_frame_size ( ESP32CameraFrameSize  size)

Definition at line 219 of file esp32_camera.cpp.

◆ set_horizontal_mirror()

void esphome::esp32_camera::ESP32Camera::set_horizontal_mirror ( bool  horizontal_mirror)

Definition at line 255 of file esp32_camera.cpp.

◆ set_href_pin()

void esphome::esp32_camera::ESP32Camera::set_href_pin ( uint8_t  pin)

Definition at line 205 of file esp32_camera.cpp.

◆ set_i2c_pins()

void esphome::esp32_camera::ESP32Camera::set_i2c_pins ( uint8_t  sda,
uint8_t  scl 
)

Definition at line 211 of file esp32_camera.cpp.

◆ set_idle_update_interval()

void esphome::esp32_camera::ESP32Camera::set_idle_update_interval ( uint32_t  idle_update_interval)

Definition at line 277 of file esp32_camera.cpp.

◆ set_jpeg_quality()

void esphome::esp32_camera::ESP32Camera::set_jpeg_quality ( uint8_t  quality)

Definition at line 253 of file esp32_camera.cpp.

◆ set_max_update_interval()

void esphome::esp32_camera::ESP32Camera::set_max_update_interval ( uint32_t  max_update_interval)

Definition at line 274 of file esp32_camera.cpp.

◆ set_pixel_clock_pin()

void esphome::esp32_camera::ESP32Camera::set_pixel_clock_pin ( uint8_t  pin)

Definition at line 206 of file esp32_camera.cpp.

◆ set_power_down_pin()

void esphome::esp32_camera::ESP32Camera::set_power_down_pin ( uint8_t  pin)

Definition at line 216 of file esp32_camera.cpp.

◆ set_reset_pin()

void esphome::esp32_camera::ESP32Camera::set_reset_pin ( uint8_t  pin)

Definition at line 215 of file esp32_camera.cpp.

◆ set_saturation()

void esphome::esp32_camera::ESP32Camera::set_saturation ( int  saturation)

Definition at line 258 of file esp32_camera.cpp.

◆ set_special_effect()

void esphome::esp32_camera::ESP32Camera::set_special_effect ( ESP32SpecialEffect  effect)

Definition at line 259 of file esp32_camera.cpp.

◆ set_test_pattern()

void esphome::esp32_camera::ESP32Camera::set_test_pattern ( bool  test_pattern)

Definition at line 272 of file esp32_camera.cpp.

◆ set_vertical_flip()

void esphome::esp32_camera::ESP32Camera::set_vertical_flip ( bool  vertical_flip)

Definition at line 254 of file esp32_camera.cpp.

◆ set_vsync_pin()

void esphome::esp32_camera::ESP32Camera::set_vsync_pin ( uint8_t  pin)

Definition at line 204 of file esp32_camera.cpp.

◆ set_wb_mode()

void esphome::esp32_camera::ESP32Camera::set_wb_mode ( ESP32WhiteBalanceMode  mode)

Definition at line 270 of file esp32_camera.cpp.

◆ setup()

void esphome::esp32_camera::ESP32Camera::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 15 of file esp32_camera.cpp.

◆ start_stream()

void esphome::esp32_camera::ESP32Camera::start_stream ( CameraRequester  requester)

Definition at line 291 of file esp32_camera.cpp.

◆ stop_stream()

void esphome::esp32_camera::ESP32Camera::stop_stream ( CameraRequester  requester)

Definition at line 295 of file esp32_camera.cpp.

◆ update_camera_parameters()

void esphome::esp32_camera::ESP32Camera::update_camera_parameters ( )

Definition at line 300 of file esp32_camera.cpp.

Field Documentation

◆ ae_level_

int esphome::esp32_camera::ESP32Camera::ae_level_ {0}
protected

Definition at line 172 of file esp32_camera.h.

◆ aec2_

bool esphome::esp32_camera::ESP32Camera::aec2_ {false}
protected

Definition at line 171 of file esp32_camera.h.

◆ aec_mode_

ESP32GainControlMode esphome::esp32_camera::ESP32Camera::aec_mode_ {ESP32_GC_MODE_AUTO}
protected

Definition at line 170 of file esp32_camera.h.

◆ aec_value_

uint32_t esphome::esp32_camera::ESP32Camera::aec_value_ {300}
protected

Definition at line 173 of file esp32_camera.h.

◆ agc_gain_ceiling_

ESP32AgcGainCeiling esphome::esp32_camera::ESP32Camera::agc_gain_ceiling_ {ESP32_GAINCEILING_2X}
protected

Definition at line 177 of file esp32_camera.h.

◆ agc_mode_

ESP32GainControlMode esphome::esp32_camera::ESP32Camera::agc_mode_ {ESP32_GC_MODE_AUTO}
protected

Definition at line 175 of file esp32_camera.h.

◆ agc_value_

uint8_t esphome::esp32_camera::ESP32Camera::agc_value_ {0}
protected

Definition at line 176 of file esp32_camera.h.

◆ brightness_

int esphome::esp32_camera::ESP32Camera::brightness_ {0}
protected

Definition at line 166 of file esp32_camera.h.

◆ config_

camera_config_t esphome::esp32_camera::ESP32Camera::config_ {}
protected

Definition at line 161 of file esp32_camera.h.

◆ contrast_

int esphome::esp32_camera::ESP32Camera::contrast_ {0}
protected

Definition at line 165 of file esp32_camera.h.

◆ current_image_

std::shared_ptr<CameraImage> esphome::esp32_camera::ESP32Camera::current_image_
protected

Definition at line 187 of file esp32_camera.h.

◆ framebuffer_get_queue_

QueueHandle_t esphome::esp32_camera::ESP32Camera::framebuffer_get_queue_
protected

Definition at line 190 of file esp32_camera.h.

◆ framebuffer_return_queue_

QueueHandle_t esphome::esp32_camera::ESP32Camera::framebuffer_return_queue_
protected

Definition at line 191 of file esp32_camera.h.

◆ horizontal_mirror_

bool esphome::esp32_camera::ESP32Camera::horizontal_mirror_ {true}
protected

Definition at line 164 of file esp32_camera.h.

◆ idle_update_interval_

uint32_t esphome::esp32_camera::ESP32Camera::idle_update_interval_ {15000}
protected

Definition at line 184 of file esp32_camera.h.

◆ init_error_

esp_err_t esphome::esp32_camera::ESP32Camera::init_error_ {ESP_OK}
protected

Definition at line 186 of file esp32_camera.h.

◆ last_idle_request_

uint32_t esphome::esp32_camera::ESP32Camera::last_idle_request_ {0}
protected

Definition at line 196 of file esp32_camera.h.

◆ last_update_

uint32_t esphome::esp32_camera::ESP32Camera::last_update_ {0}
protected

Definition at line 197 of file esp32_camera.h.

◆ max_update_interval_

uint32_t esphome::esp32_camera::ESP32Camera::max_update_interval_ {1000}
protected

Definition at line 183 of file esp32_camera.h.

◆ new_image_callback_

CallbackManager<void(std::shared_ptr<CameraImage>)> esphome::esp32_camera::ESP32Camera::new_image_callback_
protected

Definition at line 192 of file esp32_camera.h.

◆ saturation_

int esphome::esp32_camera::ESP32Camera::saturation_ {0}
protected

Definition at line 167 of file esp32_camera.h.

◆ single_requesters_

uint8_t esphome::esp32_camera::ESP32Camera::single_requesters_ {0}
protected

Definition at line 188 of file esp32_camera.h.

◆ special_effect_

ESP32SpecialEffect esphome::esp32_camera::ESP32Camera::special_effect_ {ESP32_SPECIAL_EFFECT_NONE}
protected

Definition at line 168 of file esp32_camera.h.

◆ stream_requesters_

uint8_t esphome::esp32_camera::ESP32Camera::stream_requesters_ {0}
protected

Definition at line 189 of file esp32_camera.h.

◆ stream_start_callback_

CallbackManager<void()> esphome::esp32_camera::ESP32Camera::stream_start_callback_ {}
protected

Definition at line 193 of file esp32_camera.h.

◆ stream_stop_callback_

CallbackManager<void()> esphome::esp32_camera::ESP32Camera::stream_stop_callback_ {}
protected

Definition at line 194 of file esp32_camera.h.

◆ test_pattern_

bool esphome::esp32_camera::ESP32Camera::test_pattern_ {false}
protected

Definition at line 181 of file esp32_camera.h.

◆ vertical_flip_

bool esphome::esp32_camera::ESP32Camera::vertical_flip_ {true}
protected

Definition at line 163 of file esp32_camera.h.

◆ wb_mode_

ESP32WhiteBalanceMode esphome::esp32_camera::ESP32Camera::wb_mode_ {ESP32_WB_MODE_AUTO}
protected

Definition at line 179 of file esp32_camera.h.


The documentation for this class was generated from the following files: