12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #pragma once
- #include <iostream>
- #include <map>
- #include <time.h>
- #include <dirent.h>
- #include <time.h>
- #include <cstdlib>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- // opencv
- #include <opencv2/core.hpp>
- #include <opencv2/videoio.hpp>
- #include <opencv2/highgui.hpp>
- #include <opencv2/imgproc.hpp>
- #include <opencv2/imgproc/types_c.h>
- #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<recorder> CreateNew();
- /**
- * @description: 获取Ptr
- * @return {*}
- */
- static std::shared_ptr<recorder> 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<cv::VideoWriter> videoWriter = nullptr;
- std::shared_ptr<InferVideo> InferVideoWriter = nullptr;
- };
- map<int, Writer> videoWriters;
- public:
- bool enable = true;
- bool RecordEnable = true;
- std::string outDir = "";
- std::string Dir = "./video/";
- using Ptr = std::shared_ptr<recorder>;
- };
- } // namespace name
|