-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVideoHandler.h
76 lines (58 loc) · 1.69 KB
/
VideoHandler.h
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
//
// VideoHandler.h
// FlameDetection
//
// Created by liberize on 14-4-6.
// Copyright (c) 2014年 liberize. All rights reserved.
//
#ifndef __FlameDetection__VideoHandler__
#define __FlameDetection__VideoHandler__
#include "common.h"
#include "utils.h"
#include "FlameDetector.h"
#include "Config.h"
#include "videowork.h"
//#include "videowork1.h"
#include "QSound"
#include <QUdpSocket>
class VideoHandler : public QObject
{
Q_OBJECT
private:
static const int WAIT_INTERVAL = 30;
static const int MAX_EXTRA_FRAME_COUNT = 80;
VideoCapture mCapture;
//FlameDetector mDetector;
Mat mOrgFrame, mFrame;
bool mFromCam;
bool mSaveVideo;
bool mSaveKeyFrame;
double mVideoFPS;
string mSaveVideoFile;
VideoWriter mWriter;
bool saveFrame();
QThread *m_thread;
//VideoWork *m_worker;
QThread *m_thread2;
//VideoWork *m_worker2;
QThread *m_thread3;
//VideoWork *m_worker3;
public:
static const int STATUS_FLAME_DETECTED = 0;
static const int STATUS_OPEN_CAP_FAILED = 1;
static const int STATUS_NO_FLAME_DETECTED = 2;
int mVideoChannel;
// VideoHandler(int device, bool saveKeyFrame = false, bool saveVideo = false);
// VideoHandler(const string& file, bool saveKeyFrame = false);
FlameDetector mDetector;
VideoHandler(int device);
VideoHandler(const string& file);
const FlameDetector& getDetector() const { return mDetector; }
double getVideoFPS() const { return mVideoFPS; }
int handle();
void ActivateAlarm();
void DeactivateAlarm();
private slots:
void onTimer();
};
#endif /* defined(__FlameDetection__VideoHandler__) */