MonitorPlugin.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef __MONITORPLUGIN_HPP_
  2. #define __MONITORPLUGIN_HPP_
  3. #include <iostream>
  4. #include "UtilBase.hpp"
  5. #include "requests.hpp"
  6. #include "Monitor.hpp"
  7. #include "HttpClient.hpp"
  8. #include "TcpPlugin.hpp"
  9. #include "InfineFilter.hpp"
  10. #include "HttpPlugin.hpp"
  11. #include "PluginSubscriber.hpp"
  12. #include "HepuPlugin.hpp"
  13. using namespace std;
  14. namespace gsd
  15. {
  16. class MonitorPlugin: public PluginSubscriber<MonitorPlugin>, public PluginBase
  17. {
  18. private:
  19. MonitorPlugin(): PluginBase(){
  20. }
  21. public:
  22. using Ptr = std::shared_ptr<MonitorPlugin>;
  23. ~MonitorPlugin(){}
  24. /**
  25. * @description: getPtr
  26. * @return {*}
  27. */
  28. static std::shared_ptr<MonitorPlugin> getPtr();
  29. /**
  30. * @description: 初始化
  31. * @return {*}
  32. */
  33. virtual bool Init();
  34. /**
  35. * @description: StartTask
  36. * @return {*}
  37. */
  38. virtual bool StartTask();
  39. /**
  40. * @description: 释放
  41. * @return {*}
  42. */
  43. virtual void Destroy();
  44. /**
  45. * @description:
  46. * @return {*}
  47. */
  48. virtual bool Alive();
  49. /**
  50. * @description: 处理数据的进程
  51. * @return {*}
  52. */
  53. void MonitorProThrd();
  54. /**
  55. * @description: 消费数据
  56. * @param {Ptr&} result
  57. * @return {*}
  58. */
  59. bool ConsumeData(FrameInferData::Ptr& result);
  60. /**
  61. * @description: 消费数据 Hepu 4.7.17
  62. * @param {Ptr&} result
  63. * @return {*}
  64. */
  65. bool ConsumeData1(FrameInferData::Ptr& result, HepuTarget::Ptr& target);
  66. /**
  67. * @description: 消费数据 Hepu 4.7.31
  68. * @param {Ptr&} result
  69. * @return {*}
  70. */
  71. bool ConsumeData2(FrameInferData::Ptr& result, HepuTarget2::Ptr& target);
  72. /**
  73. * @description: 保存视频记录
  74. * @param {HistoryVideo&} historyVideo
  75. * @return {*}
  76. */
  77. bool SaveVideoRecord(HistoryVideo& historyVideo);
  78. /**
  79. * @description: RestPlugin
  80. * @return {*}
  81. */
  82. virtual bool RestPlugin();
  83. private:
  84. std::shared_ptr<Monitor> monitor = nullptr;
  85. std::shared_ptr<ThreadPool> pool = nullptr;
  86. bool stop_ = false;
  87. };
  88. } // namespace gsd
  89. #endif