派生自 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
#ifndef NEWRECORDVIDEOELEMENT_H
#define NEWRECORDVIDEOELEMENT_H
//#include <basic/pipe/PipeElement.h>
#include <basic/pipe_element/ffmpeg/FfmpegElement.h>
#include "HiredisTool.h"
//struct ImgInfo
//{
//    std::string time;
//    cv::Mat img;
//};
class NewRecordVideoElement {
 
public:
 
    NewRecordVideoElement(){}
    NewRecordVideoElement(std::string camid);
 
    ~NewRecordVideoElement();
 
    void setSdkTrigger(bool isTrigger);
    void pushImgBuf(const std::string& time,cv::Mat& img);
 
//private:
//    virtual void threadFunc() override;
//    virtual void threadInitial() override;
private:
    void recordInit(int videoMin, int videoMax);
    void Record();
 
    int fileMin;
    int fileMax;
    bool sdkTrigger;
    int triggerDelay;
 
#define RECORD_STOP (0)
#define RECORD_DOING (1)
#define RECORD_ENDING (2)
    int recordStatus;
    int videoLength;
    int recordDelay;
private:
    std::string startRecord();
    void doRecord();
    void endRecord();
    void getImg(ImgInfo& info);
    std::string getFileName(const std::string& timeStamp);
    std::string makeDir(const std::string& timeStamp);
 
    ffmpeg::VideoEncodeElement videoEncoderElement;
    std::string camID;
    std::string m_cutPath;
    std::queue<ImgInfo> m_imgBufQue;
    HiredisTool m_hiredisTool;
    std::string m_filename;
    bool m_bSaveWH;
};
 
#endif // RECORDVIDEOELEMENT_H