#pragma once #include #include #include #include #include #include "spdlog/spdlog.h" // 模拟的检测结果结构体(对应未来的 YOLO 结果) struct DetectionResult { int x; int y; int width; int height; std::string label; float confidence; }; class VideoPipeline { public: VideoPipeline(); ~VideoPipeline(); // 启动视频流处理 void Start(const std::string& inputUrl, const std::string& outputUrl); void StartTest(const std::string& filePath, const std::string& outputUrl); // 停止处理 void Stop(); private: void processLoop(std::string inputUrl, std::string outputUrl, bool isFileSource); // 占位算法函数:模拟推理 std::vector mockInference(const cv::Mat& frame); // 绘图函数 void drawOverlay(cv::Mat& frame, const std::vector& results); std::atomic running_; std::thread processingThread_; };