bonus-edge-proxy/src/videoService/video_service_manager.h

48 lines
1.2 KiB
C
Raw Normal View History

2025-11-10 10:24:45 +08:00
// src/service/video_service_manager.h (重构后)
2025-10-27 11:06:06 +08:00
#pragma once
2025-11-10 10:24:45 +08:00
// [移除] 不再需要包含具体的模块实现
// #include "algorithm/IntrusionModule.h"
// [保留] 只需要知道 IAnalysisModule 接口
#include "analysis/interfaces/IAnalysisModule.h"
#include "nlohmann/json.hpp"
#include "video_service.h" // (假设 video_service.h 在 service/ 目录下)
2025-10-27 11:06:06 +08:00
#include <memory>
#include <string>
2025-11-04 18:38:05 +08:00
#include <vector>
2025-10-27 11:06:06 +08:00
class VideoServiceManager {
public:
2025-11-04 18:38:05 +08:00
VideoServiceManager() = default;
~VideoServiceManager();
2025-10-27 11:06:06 +08:00
2025-11-04 18:38:05 +08:00
// 禁止拷贝和赋值
VideoServiceManager(const VideoServiceManager &) = delete;
VideoServiceManager &operator=(const VideoServiceManager &) = delete;
2025-10-27 11:06:06 +08:00
2025-11-04 18:38:05 +08:00
/**
2025-11-10 10:24:45 +08:00
* @brief video_config.json
* ()
2025-11-04 18:38:05 +08:00
*/
bool load_config(const std::string &config_path);
2025-10-27 11:06:06 +08:00
2025-11-04 18:38:05 +08:00
/**
2025-11-10 10:24:45 +08:00
* @brief
* ()
2025-11-04 18:38:05 +08:00
*/
void load_and_start();
/**
* @brief
2025-11-10 10:24:45 +08:00
* ()
2025-11-04 18:38:05 +08:00
*/
void stop_all();
2025-10-27 11:06:06 +08:00
private:
2025-11-04 18:38:05 +08:00
std::vector<std::unique_ptr<VideoService>> services_;
2025-11-10 10:24:45 +08:00
// (功能不变)
2025-11-04 18:38:05 +08:00
bool m_enabled = false;
nlohmann::json m_stream_configs_json;
2025-10-27 11:06:06 +08:00
};