#ifndef APPPIPECONTROLLER_H #define APPPIPECONTROLLER_H #include #include #include #include #include "ImageDrawElement.h" #include "FaceRpcElement.h" #include "FaceExtractElement.h" #include "YoloRpcElement.h" #include "RecordVideoElement.h" #include #include #include "PerimeterElement.h" #include "JudgmentRetrogradeTool.h" #include "NewRecordVideoElement.h" #include "PersonElement.h" #include "PerStaticElement.h" #include #include "DBStruct.h" #include "SaveVideoRpc.h" class VideoCaptureElementNotDecoder : public ffmpeg::VideoCaptureElement { using ffmpeg::VideoCaptureElement::VideoCaptureElement; private: virtual void timerFunc() override { fireConnectors(); } virtual void threadInitial() override {} virtual void threadClosing() override {} private: bool m_decoderRet = {false}; }; class AppPipeController : public PipeController { public: /*** * 用于快速视频结构化 * @param folderPath 任务根目录,用于做共享内存id * @param json 参数为rtsp流地址 sdk是否启用的标识 */ // AppPipeController(std::string folderPath, const Json::Value &json); AppPipeController(std::string folderPath, const SdkRuleMap &ruleMap); // AppPipeController(int index, const Json::Value &json, bool RecordVideoEnable = false); // AppPipeController(std::string camId, const Json::Value &json, bool RecordVideoEnable); AppPipeController(std::string camId, const SdkRuleMap &ruleMap, bool RecordVideoEnable); virtual ~AppPipeController(); bool resetVideoCapturePath(std::string path); bool getRunning(); std::string getRtmp(); void setfdfsClient(FastFdsWithLock *p_fdfsClient); void setWeekRule(const std::map> &weekRuleMap); private: void init(); private://Perimete PerimeterElement perimeterElement; // TriggerElement peTriggerElement; void initPerimeter(); private://Crowd PerimeterElement crowdElement; //TriggerElement crowdTriggerElement; void initCrowd(); void RecordVideo(); private://KeepRight JudgmentRetrogradeTool leftJudgment; JudgmentRetrogradeTool rightJudgment; // TriggerElement leftTriggerElement; // TriggerElement rightTriggerElement; void initKeepRight(); private: PerStaticElement perStaticElement; void initPerStatic(); private://Perimete PerimeterElement perHubElement; // TriggerElement peTriggerElement; void initPerHub(); private: SaveVideoRpcClient_t m_rpcClient; VideoCaptureElementNotDecoder videoCaptureElement; // ffmpeg::VideoCaptureElement videoCaptureElement; YoloRpcElement yoloRpcElement; FaceRpcElement faceRpcElement; FaceExtractElement faceExtractElement; ImageDrawElement imageDrawElement; // RecordVideoElement recordVideoElement; // NewRecordVideoElement newRecordVideoElement; PersonElement personElement; int m_index; std::string m_camId; std::string m_folderPath; // Json::Value m_json; // Json::Value m_json_Record; // Json::FastWriter m_fastWriter; FastFdsWithLock *fdfsClient; bool bRecordVideoEnable; std::map recordRetMap; TriggerElement triggerElement; std::atomic bUp; QDateTime m_dt; std::map> m_weekRuleMap; SdkRuleMap m_sdkRuleMap; std::string m_localIp; std::string getFullFileName(); std::mutex mutex; bool m_bSetWH; HiredisTool m_hiredisTool; }; #endif // APPPIPECONTROLLER_H