#pragma once #include #include #include #include #include #include #include #include #include // opencv #include #include #include #include #include #include "Util/logger.h" #include "DataSource.h" using namespace toolkit; using namespace std; //using namespace cv; namespace MIVA { class recorder { using Ptr = std::shared_ptr; public: recorder() {} ~recorder() {} static std::shared_ptr CreateNew(); void Start(); void Finish(); void ConsumerData(std::string Pid,cv::Mat& frame); std::string GetFileName(std::string Pid); std::shared_ptr GetVideoWriter(std::string Pid); private: struct Writer{ std::string fileName = ""; std::shared_ptr videoWriter = nullptr; }; map videoWriters; public: bool enable = true; std::string outDir = ""; std::string Dir = "./video/"; }; } // namespace name