派生自 development/c++

pansen
2019-03-07 979bc003bce710bf300bc2bd87a8278585678763
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
#ifndef VIDEOMOVECAPTUREELEMENT_H
#define VIDEOMOVECAPTUREELEMENT_H
 
#include <basic/pipe/TimerElement.h>
#include <opencv2/opencv.hpp>
#include "VideoChangeScore.h"
 
//#include <basic/pipe/my_timer.hpp>
 
struct CvCapture_FFMPEG;
struct CvVideoWriter_FFMPEG;
 
class VideoMoveCaptureElement : public basic::PipeElement {
public:
    VideoMoveCaptureElement(const std::string &path, const std::string &outPath,
                            int fps = 30, int reOpenTime = -1, int gpuIndex = -1
    );
 
    cv::Mat getImage() const;
 
    int getOutPutInterval() const;
 
    void setOutPutInterval(int value);
 
    int getChangeLevel() const;
 
    bool getBYoloDetect() const;
 
    int getOutPutIndex() const;
 
    void startRecord(int startFrame);//too large?no int?
 
    void endRecord(int endFrame);
 
private:
    void threadFunc();
 
    void threadInitial();
 
    void threadClosing();
 
    void openVideo();
 
private:
    CvCapture_FFMPEG *capture;
    std::string path;
    std::string m_pathOut;
    cv::Mat image;
    int gpuIndex;
    int outPutIndex;
    int outPutInterval;
    int reopenTime;
 
    VideoChangeScore videoChangeScore;
    int nChangeLevel;
 
    bool bYoloDetect;
 
    int m_nFrame;
public:
    int getM_nFrame() const;
 
//    my_module_space::Timer _timer;
//    my_module_space::Timer _timerTotal;
};
 
#endif // VIDEOMOVECAPTUREELEMENT_H