// // Created by ps on 18-9-26. // #ifndef VIDEOANALYSFROMHC_RTSPANALYSELEMENT_H #define VIDEOANALYSFROMHC_RTSPANALYSELEMENT_H #include #include #include #include #include #include "NsqMsgTool.hpp" class RtspAnalysElement { public: // RtspAnalysElement(); RtspAnalysElement(LDBTool *_dbTool); virtual ~RtspAnalysElement(); int addCamera(const std::string &, const std::map &sdkRuleMap); int removeCamera(const std::string &); int removeAll(); int getMaxCamCount(); int getCurrentCamCount(); std::string getRtmp(std::string &); private: void init(); static void OnMsgFunc(void *msgPtr, void *pThisPtr); std::string resetFdfs(std::string ip = "", unsigned int port = 0, std::string content = ""); static std::vector chnString2Vec(std::string str_list); // void setDataByType(Json::Value& json,const SdkRule& rule); private: //nsq BasicMsg::Nsq::NsqMsgConsumer *nsqMsgConsumer; LDBTool *m_lDBTool; int m_GB28181_Enable; std::map controllers; std::atomic currentCount; int maxCount; FastFdsWithLock fdfsClient; std::map sdkRuleMap; void addCamWithSearchRuleMap(const Record_Cam_Dev &item, string rtsp_url); }; #endif //VIDEOANALYSFROMHC_RTSPANALYSELEMENT_H