From d3b7bbe7102cd089680a828f5d8f6402c8cf6342 Mon Sep 17 00:00:00 2001
From: pansen <pansen626@sina.com>
Date: 星期四, 07 三月 2019 14:43:28 +0800
Subject: [PATCH] GB28181集成完成,集成推流模块

---
 QiaoJiaSystem/StructureApp/AppPipeController.h |   69 +++++++++++++++++++++++++++++-----
 1 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/QiaoJiaSystem/StructureApp/AppPipeController.h b/QiaoJiaSystem/StructureApp/AppPipeController.h
index 58f3e55..367af7a 100644
--- a/QiaoJiaSystem/StructureApp/AppPipeController.h
+++ b/QiaoJiaSystem/StructureApp/AppPipeController.h
@@ -15,8 +15,26 @@
 #include "PerimeterElement.h"
 #include "JudgmentRetrogradeTool.h"
 #include "NewRecordVideoElement.h"
+#include "PersonElement.h"
+#include "PerStaticElement.h"
 #include <jsoncpp/json/json.h>
+#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:
@@ -25,11 +43,14 @@
      * @param folderPath 浠诲姟鏍圭洰褰曪紝鐢ㄤ簬鍋氬叡浜唴瀛榠d
      * @param json 鍙傛暟涓簉tsp娴佸湴鍧� sdk鏄惁鍚敤鐨勬爣璇�
      */
-    AppPipeController(std::string folderPath, const Json::Value &json);
+    //  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(int index, const Json::Value &json, bool RecordVideoEnable = false);
 
-    AppPipeController(std::string camId, const Json::Value &json, bool RecordVideoEnable);
+    //  AppPipeController(std::string camId, const Json::Value &json, bool RecordVideoEnable);
+
+    AppPipeController(std::string camId, const SdkRuleMap &ruleMap, bool RecordVideoEnable);
 
     virtual ~AppPipeController();
 
@@ -41,12 +62,14 @@
 
     void setfdfsClient(FastFdsWithLock *p_fdfsClient);
 
+    void setWeekRule(const std::map<int, std::vector<LActRuleWeekRecord>> &weekRuleMap);
+
 private:
     void init();
 
 private://Perimete
     PerimeterElement perimeterElement;
-   // TriggerElement peTriggerElement;
+    // TriggerElement peTriggerElement;
 
     void initPerimeter();
 
@@ -56,6 +79,8 @@
 
     void initCrowd();
 
+    void RecordVideo();
+
 private://KeepRight
     JudgmentRetrogradeTool leftJudgment;
     JudgmentRetrogradeTool rightJudgment;
@@ -63,24 +88,38 @@
 //    TriggerElement leftTriggerElement;
 //    TriggerElement rightTriggerElement;
 
-    void intKeepRight();
+    void initKeepRight();
 
 private:
-    ffmpeg::VideoCaptureElement videoCaptureElement;
+    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;
+//    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::Value m_json;
+//    Json::Value m_json_Record;
+//    Json::FastWriter m_fastWriter;
 
-    Json::FastWriter m_fastWriter;
     FastFdsWithLock *fdfsClient;
 
     bool bRecordVideoEnable;
@@ -91,8 +130,16 @@
 
     QDateTime m_dt;
 
+    std::map<int, std::vector<LActRuleWeekRecord>> m_weekRuleMap;
+    SdkRuleMap m_sdkRuleMap;
+    std::string m_localIp;
+
     std::string getFullFileName();
 
+    std::mutex mutex;
+    bool m_bSetWH;
+    HiredisTool m_hiredisTool;
+
 };
 
 #endif // APPPIPECONTROLLER_H

--
Gitblit v1.8.0