1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #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"
- 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);
- private:
- std::shared_ptr<Monitor> monitor = nullptr;
- std::shared_ptr<ThreadPool> pool = nullptr;
- bool stop_ = false;
- };
- } // namespace gsd
- #endif
|