forked from xiaozhi/xiaozhi-esp32
* Adapt boards to v2 partition tables * fix esp log error * fix display style * reset emotion after download assets * fix compiling * update assets default url * Add user only tools * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * bump to 2.0.0 * fix compiling errors --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
38 lines
843 B
C++
38 lines
843 B
C++
#ifndef ESP32_CAMERA_H
|
|
#define ESP32_CAMERA_H
|
|
|
|
#include <esp_camera.h>
|
|
#include <lvgl.h>
|
|
#include <thread>
|
|
#include <memory>
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/queue.h>
|
|
|
|
#include "camera.h"
|
|
|
|
struct JpegChunk {
|
|
uint8_t* data;
|
|
size_t len;
|
|
};
|
|
|
|
class Esp32Camera : public Camera {
|
|
private:
|
|
camera_fb_t* fb_ = nullptr;
|
|
std::string explain_url_;
|
|
std::string explain_token_;
|
|
std::thread encoder_thread_;
|
|
|
|
public:
|
|
Esp32Camera(const camera_config_t& config);
|
|
~Esp32Camera();
|
|
|
|
virtual void SetExplainUrl(const std::string& url, const std::string& token);
|
|
virtual bool Capture();
|
|
// 翻转控制函数
|
|
virtual bool SetHMirror(bool enabled) override;
|
|
virtual bool SetVFlip(bool enabled) override;
|
|
virtual std::string Explain(const std::string& question);
|
|
};
|
|
|
|
#endif // ESP32_CAMERA_H
|