123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #ifndef __MONITORPLUGIN_HPP_
- #define __MONITORPLUGIN_HPP_
- #include <iostream>
- #include "UtilBase.hpp"
- #include "requests.hpp"
- #include "Monitor.hpp"
- #include "HttpClient.hpp"
- #include "TcpPlugin.hpp"
- #include "InfineFilter.hpp"
- #include "HttpPlugin.hpp"
- #include "PluginSubscriber.hpp"
- using namespace std;
- namespace gsd
- {
- class MonitorPlugin: public PluginSubscriber<MonitorPlugin>, public PluginBase
- {
- private:
- MonitorPlugin(): PluginBase(){
- }
- public:
- using Ptr = std::shared_ptr<MonitorPlugin>;
-
- ~MonitorPlugin(){}
- /**
- * @description: getPtr
- * @return {*}
- */
- static std::shared_ptr<MonitorPlugin> getPtr();
- /**
- * @description: 初始化
- * @return {*}
- */
- virtual bool Init();
- /**
- * @description: StartTask
- * @return {*}
- */
- virtual bool StartTask();
- /**
- * @description: 释放
- * @return {*}
- */
- virtual void Destroy();
- /**
- * @description:
- * @return {*}
- */
- virtual bool Alive();
- /**
- * @description: 处理数据的进程
- * @return {*}
- */
- void MonitorProThrd();
- /**
- * @description: 消费数据
- * @param {Ptr&} result
- * @return {*}
- */
- bool ConsumeData(FrameInferData::Ptr& result);
- /**
- * @description: 保存视频记录
- * @param {HistoryVideo&} historyVideo
- * @return {*}
- */
- bool SaveVideoRecord(HistoryVideo& historyVideo);
- /**
- * @description: RestPlugin
- * @return {*}
- */
- virtual bool RestPlugin();
- private:
- std::shared_ptr<Monitor> monitor = nullptr;
- std::shared_ptr<ThreadPool> pool = nullptr;
- bool stop_ = false;
- };
- } // namespace gsd
- #endif
|