123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #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"
- using namespace std;
- namespace gsd
- {
- class MonitorPlugin: public enable_shared_from_this<MonitorPlugin>, public PluginBase
- {
- private:
- MonitorPlugin(): PluginBase(){
- }
- public:
- using Ptr = std::shared_ptr<MonitorPlugin>;
-
- ~MonitorPlugin(){}
- /**
- * @description: CreateNew
- * @return {*}
- */
- static std::shared_ptr<MonitorPlugin> CreateNew();
- /**
- * @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: 发送请求
- * @param {CNStreamInferData Ptr} data
- * @return {*}
- */
- bool sendRequest(CNStreamInferData::Ptr data);
- private:
- std::shared_ptr<Monitor> monitor = nullptr;
- std::shared_ptr<ThreadPool> pool = nullptr;
- bool stop_ = false;
- };
- } // namespace gsd
- #endif
|