派生自 development/c++

pansen
2019-03-07 d3b7bbe7102cd089680a828f5d8f6402c8cf6342
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef APPPIPECONTROLLER_H
#define APPPIPECONTROLLER_H
 
#include <basic/pipe/PipeController.h>
#include <basic/pipe_element/ffmpeg/FfmpegElement.h>
#include <basic/pipe_element/ImageShowElement.h>
#include <basic/util/curl/HttpRequestWithCrul.hpp>
#include "ImageDrawElement.h"
#include "FaceRpcElement.h"
#include "FaceExtractElement.h"
#include "YoloRpcElement.h"
#include "RecordVideoElement.h"
#include <TriggerElement.h>
#include <QtCore/QDateTime>
#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:
    /***
     * 用于快速视频结构化
     * @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<int, std::vector<LActRuleWeekRecord>> &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<std::string, bool> recordRetMap;
 
    TriggerElement triggerElement;
    std::atomic<bool> bUp;
 
    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