1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 08:32:26 +01:00

Introduce base Camera class to support alternative camera implementations (#9285)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
DT-art1
2025-07-07 05:45:00 +02:00
committed by GitHub
parent bdd52dbaa4
commit e49b89a051
27 changed files with 254 additions and 132 deletions

View File

@@ -6,7 +6,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include "esphome/components/esp32_camera/esp32_camera.h"
#include "esphome/components/camera/camera.h"
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
#include "esphome/core/preferences.h"
@@ -32,7 +32,7 @@ class CameraWebServer : public Component {
void loop() override;
protected:
std::shared_ptr<esphome::esp32_camera::CameraImage> wait_for_image_();
std::shared_ptr<camera::CameraImage> wait_for_image_();
esp_err_t handler_(struct httpd_req *req);
esp_err_t streaming_handler_(struct httpd_req *req);
esp_err_t snapshot_handler_(struct httpd_req *req);
@@ -40,7 +40,7 @@ class CameraWebServer : public Component {
uint16_t port_{0};
void *httpd_{nullptr};
SemaphoreHandle_t semaphore_;
std::shared_ptr<esphome::esp32_camera::CameraImage> image_;
std::shared_ptr<camera::CameraImage> image_;
bool running_{false};
Mode mode_{STREAM};
};