feat: support camera capture to livekit

This commit is contained in:
0Xiao0
2026-05-25 17:21:11 +08:00
parent 4953244c7c
commit fc6302661d
12 changed files with 314 additions and 78 deletions

View File

@ -5,6 +5,8 @@
#include <thread>
#include <memory>
#include <vector>
#include <mutex>
#include <cstdint>
#include <freertos/FreeRTOS.h>
#include <freertos/queue.h>
@ -39,6 +41,10 @@ private:
std::string explain_url_;
std::string explain_token_;
std::thread encoder_thread_;
std::mutex frame_mutex_;
int64_t foreground_capture_protected_until_us_ = 0;
bool CaptureFrame(bool show_preview);
public:
EspVideo(const esp_video_init_config_t& config);
@ -46,6 +52,8 @@ public:
virtual void SetExplainUrl(const std::string& url, const std::string& token);
virtual bool Capture();
virtual bool CaptureBackground() override;
virtual bool CaptureToJpeg(std::string& jpeg_data, bool show_preview = false) override;
// 翻转控制函数
virtual bool SetHMirror(bool enabled) override;
virtual bool SetVFlip(bool enabled) override;