forked from willku1024/Qt-CamWatch-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideowindow.h
69 lines (62 loc) · 1.53 KB
/
videowindow.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
#ifndef VIDEOWINDOW_H
#define VIDEOWINDOW_H
#include <QWidget>
#include <QPaintEvent>
#include <QImage>
#include <QPushButton>
#include <QStackedLayout>
#include <QCloseEvent>
#include <QByteArray>
#include <QTcpSocket>
#include <videothread.h>
#include <QMessageBox>
#include <QKeyEvent>
extern "C"
{
#include "avilib.h"
}
class VideoWindow : public QWidget
{
Q_OBJECT
public:
explicit VideoWindow(QWidget *parent = nullptr);
void drawAllBtn();
void drawBackground();
void drawCameraPic();
virtual ~VideoWindow();
protected:
void paintEvent(QPaintEvent *event);
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
QImage paintImg;
QPushButton *startBtn;
QPushButton *pauseBtn;
QPushButton *fullScreenBtn;
QPushButton *photoBtn;
QPushButton *videoBtn;
QPushButton *stopRecordBtn;
QPushButton *exitBtn;
QStackedLayout *stackedLay_1;
QStackedLayout *stackedLay_2;
QWidget * parentWinPtr = nullptr;
QRect winRect;
VideoThread *th = nullptr;
QString ipAddr;
int portNum;
bool isMonitor = false;
bool isVideo = false;
avi_t * avi = NULL;
signals:
void closeWindow(VideoWindow *);
public slots:
void fullScreenBtnSlot(bool ok);
void startBtnSlot();
void pauseBtnSlot();
void photoBtnSlot();
void videoBtnSlot();
void stopRecordBtnSlot();
void hasConnectedSlot(bool isConn);
void hasDataArrivedSlot(QByteArray frame);
};
#endif // VIDEOWINDOW_H