[esp32_camera] Replace std::function callbacks with CameraListener interface (#12165)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-12-02 09:59:32 -06:00
committed by GitHub
co-authored by Copilot
parent deda7a1bf3
commit f9ad832e7b
7 changed files with 78 additions and 56 deletions
+10
View File
@@ -18,6 +18,9 @@
#ifdef USE_LOGGER
#include "esphome/components/logger/logger.h"
#endif
#ifdef USE_CAMERA
#include "esphome/components/camera/camera.h"
#endif
#include <map>
#include <vector>
@@ -36,6 +39,10 @@ class APIServer : public Component,
,
public logger::LogListener
#endif
#ifdef USE_CAMERA
,
public camera::CameraListener
#endif
{
public:
APIServer();
@@ -49,6 +56,9 @@ class APIServer : public Component,
#ifdef USE_LOGGER
void on_log(uint8_t level, const char *tag, const char *message, size_t message_len) override;
#endif
#ifdef USE_CAMERA
void on_camera_image(const std::shared_ptr<camera::CameraImage> &image) override;
#endif
#ifdef USE_API_PASSWORD
bool check_password(const uint8_t *password_data, size_t password_len) const;
void set_password(const std::string &password);