// // Created by ps on 18-9-26. // #ifndef RTSPANALYSMANAGER #define RTSPANALYSMANAGER #include #include #include "RtspCaptureElement.h" #include "RtspImageRedis.h" //#include "../GB28181DecoderModel/VideoCaptureElementWithRtp.h" #include "pushStream/PushStreamAppPipeController.h" //#include #include #include #include "RtspAnalysServer.h" //#include //#include //using BASICGB28181::VideoCaptureElementWithRtp; //用来实现recordVideo的RPC的接口类 class RtspAnalysManager : public ::RtspAnalys::RtspAnalysServer { public: RtspAnalysManager() : m_maxCount(50), m_currentCount(0) { m_lDBTool = new LDBTool; init(); } RtspAnalysManager(LDBTool *_dbTool); virtual ::std::string recordVideo(const ::std::string &, const ::Ice::Current & = ::Ice::emptyCurrent); virtual ~RtspAnalysManager(); int addCamera(const std::string &, const std::string &rtsp); int removeCamera(const std::string &); int removeAll(); int getMaxCamCount(); int getCurrentCamCount(); // 根据camId保存img到Redis,img的Key为imageName bool SaveImageToRedis(const std::string &camId, const std::string &imageName, const cv::Mat &img); private: void init(); private: RWLock m_imgRedisCRwLock; LDBTool *m_lDBTool; int m_GB28181_Enable; //保存CamID和RtspCaptureElement的映射关系 std::map m_controllers; //保存CamID和VideoCaptureElementWithRtp的映射关系 // std::map m_controllers_videoCapElem; std::map m_controllers_videoCapElem; //保存CamID和RtspImageRedisElement的映射关系 std::map m_imgRedisControllers; //当前摄像头的数量 int m_currentCount; // 摄像头的最大数量 int m_maxCount; }; #endif //VIDEOANALYSFROMHC_RTSPANALYSELEMENT_H