Fixes to pass test.

This commit is contained in:
Dieter Tschanz 2024-10-20 18:01:26 +02:00
parent 8da004362d
commit b9bb4a7a65
2 changed files with 6 additions and 5 deletions

View file

@ -41,9 +41,10 @@ APIConnection::APIConnection(std::unique_ptr<socket::Socket> sock, APIServer *pa
#endif
#ifdef USE_CAMERA
if (camera::Camera::global_camera != nullptr)
if (camera::Camera::global_camera != nullptr) {
this->image_reader_ =
std::unique_ptr<camera::CameraImageReader>{camera::Camera::global_camera->create_image_reader()};
}
#endif
}
void APIConnection::start() {

View file

@ -152,12 +152,12 @@ class ESP32Camera : public Component, public camera::Camera {
void dump_config() override;
float get_setup_priority() const override;
/* public API (specific) */
void start_stream(camera::CameraRequester requester);
void stop_stream(camera::CameraRequester requester);
void request_image(camera::CameraRequester requester);
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_image_callback(std::function<void(std::shared_ptr<camera::CameraImage>)> &&callback);
void add_image_callback(std::function<void(std::shared_ptr<camera::CameraImage>)> &&callback) override;
void add_stream_start_callback(std::function<void()> &&callback);
void add_stream_stop_callback(std::function<void()> &&callback);
camera::CameraImageReader *create_image_reader() override;