#pragma once #include #include #include #include #include #include #include #include #include // opencv #include #include #include #include #include #include "Util/logger.h" #include "DataSource.h" #include "InferVideo.h" #include "Disposition.hpp" using namespace toolkit; using namespace std; //using namespace cv; namespace gsd_ds { class recorder { public: recorder() {} ~recorder() {} /** * @description: 构建New * @return {*} */ static std::shared_ptr CreateNew(); /** * @description: 获取Ptr * @return {*} */ static std::shared_ptr getPtr(); /** * @description: ConsumerData * @param {int} dv_id * @param {int} num * @param {Mat&} frame * @return {*} */ void ConsumerData(int dv_id, int num, cv::Mat& frame); /** * @description: 获取文件名 * @param {string} Pid * @return {*} */ std::string GetFileName(int dv_id); private: struct Writer{ std::shared_ptr videoWriter = nullptr; std::shared_ptr InferVideoWriter = nullptr; }; map videoWriters; public: bool enable = true; bool RecordEnable = true; std::string outDir = ""; std::string Dir = "./video/"; using Ptr = std::shared_ptr; }; } // namespace name