recorder.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <memory>
  3. #include <string>
  4. #include <vector>
  5. #include <map>
  6. #include <list>
  7. // #include "cnstream_core.hpp"
  8. #include "cnstream_frame.hpp"
  9. #include "cnstream_module.hpp"
  10. #include "easyinfer/model_loader.h"
  11. #include "easytrack/easy_track.h"
  12. #include "video.hpp"
  13. namespace cnstream{
  14. // Pointer for frame info
  15. using CNFrameInfoPtr = std::shared_ptr<CNFrameInfo>;
  16. /// Pointer for infer object
  17. using CNInferObjectPtr = std::shared_ptr<CNInferObject>;
  18. class Recorder : public cnstream::Module, public cnstream::ModuleCreator<Recorder>
  19. {
  20. using super = cnstream::Module;
  21. private:
  22. Recorder(const Recorder &) = delete;
  23. Recorder &operator=(Recorder const &) = delete;
  24. std::shared_ptr<video> m_Video;
  25. int m_dst_width;
  26. int m_dst_height;
  27. int m_frame_rate;
  28. // 视频的最长时间
  29. int m_videoMaxTime;
  30. // 视频头尾缓存时间
  31. int m_cacheTime;
  32. string m_enc_type;
  33. string m_outputDir;
  34. public:
  35. explicit Recorder(const std::string &name);
  36. bool Open(cnstream::ModuleParamSet paramSet) override;
  37. void Close() override;
  38. int Process(std::shared_ptr<cnstream::CNFrameInfo> data) override;
  39. };
  40. }