-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rtspwindow.h
208 lines (160 loc) · 6.03 KB
/
rtspwindow.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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#ifndef RTSPWINDOW_H
#define RTSPWINDOW_H
#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QSettings>
#include <settingsform.h>
#include <QXmlStreamReader>
#include <QComboBox>
#include <pantilcmd.h>
#include <QtGui>
#if defined(_WIN32)
#pragma warning( disable : 4996)
#else
#endif
#include "include/HCNetSDK.h"
#include "include/PlayM4.h"
class QVideoProbe;
namespace Ui {
class RtspWindow;
}
class RtspWindow : public QMainWindow
{
Q_OBJECT
public:
explicit RtspWindow(QWidget *parent = nullptr);
~RtspWindow();
/*******PANTIL CMD************/
static void PanTilTopLeft_pressed();
static void PanTilUp_pressed();
static void PanTilTopRight_pressed();
static void PanTilRight_pressed();
static void PanTilBottomRight_pressed();
static void PanTilDown_pressed();
static void PanTilBottomLeft_pressed();
static void PanTilLeft_pressed();
/*******PANTIL CMD************/
/*******HCNetSDK**************/
void LoginInfo(qint16 Port, QString sDeviceAddress, QString sUserName, QString sPassword, bool StreamChoice);
void Play();
/*******HCNetSDK**************/
private slots:
void on_ComboBxCam_currentIndexChanged(const QString &arg1);
void on_action_Streaming_Channels_1_triggered();
void on_action_Streaming_Channels_2_triggered();
void on_action_Streaming_Channels_3_triggered();
void on_actionMetadata_triggered();
void on_SnapshotBtn_pressed();
void on_PtzSliderSpeed_valueChanged(int value);
void on_actionPreset_triggered();
void on_actionPatrol_triggered();
void on_comboBxPresset_editTextChanged(const QString &arg1);
void on_comboBxPatrol_editTextChanged(const QString &arg1);
void on_comboBxPresset_textActivated(const QString &arg1);
void on_comboBxPatrol_textActivated(const QString &arg1);
void on_actionReboot_triggered();
void on_RecordBtn_toggled(bool checked);
void HideMenu();
void on_actionmain_stream_triggered();
void on_actionsub_stream_triggered();
void on_actionClose_triggered();
void on_actionConfigure_triggered();
void on_PauseBtn_toggled(bool checked);
void on_actionReconnect_triggered();
private:
Ui::RtspWindow *ui;
bool SnapErr = false;
bool IsShown = false;
void PlayRtsp(QString Camuri);
void blink();
void CallPresset(int Presset);
static QString RtspUri;
static QNetworkAccessManager *manager;
static QString CamIp;
static QString CamPort;
static QString CamUser;
static QString CamPass;
static QString CamPortHttp;
static bool ShowXML;
static QString Chanel;
static unsigned int PtzSpeed;
void LoadPreset();
void LoadPatrol();
static QString SetXMLReq(int pan,int tilt,int zoom);
void setStatusInfo(const QString &info);
void displayErrorMessage(QString Err);
void SetmediaRecorder();
void HikRtsp(unsigned char *pBuffer,unsigned int dwBufSize);
static void DisplayError(QString Source, unsigned int ErrMess);
static void CALLBACK RemoteDisplayCBFun(int nPort, char *pBuf, int size, int width, int height,int stamp, int type, int reserved);
static void CALLBACK EncryptTypeCBFun(int nPort, ENCRYPT_INFO* pEncryptInfo, void* nUser, int nReserved2);
//QVideoProbe *m_videoProbe = nullptr;
QSettings settings;
SettingsForm SetFrm;
QStringList PresetList;
void Sleep(int MSecs);
QTimer *ShowHideTimer;
bool MenubarHasFocus(QMenuBar *menu);
QString GetWinState();
QRect TopLeft;
QRect TopRight;
QRect BottomRight;
QRect BottomLeft;
static PanTilCmd *PTCmd;
static void SendPTZ(int pan,int tilt,int zoom);
/*******HCNetSDK**************/
static qint16 CamPortSdk;
static bool IsNVR;
NET_DVR_CLIENTINFO ClientInfo = {0};
NET_DVR_PREVIEWINFO struPlayInfo = {0};
NET_DVR_DEVICEINFO_V40 struDeviceInfo = {0};
int lRealPlayHandle;
static int lUserID;
static int lChannel;
static int lPort; //Global Player port NO.
static int hWnd;
//device data
// Stream type 0-main stream,1-sub stream,2-third stream,3-forth
int StreamType = 0;
//µÇ½É豸ºó·µ»ØµÄÓû§ID£»²»´æÈëÎļþ
int m_iuserid;
//µÇ½É豸ºó·µ»ØÉ豸ÐÅÏ¢£»²»´æÈëÎļþ
NET_DVR_DEVICEINFO_V30 m_deviceinfo;
//É豸Ãû³Æ£¬´æÈëÎļþ
QString m_qdevicename;
//É豸IP£¬´æÈëÎļþ
QString m_qip;
//É豸¶Ë¿Ú,´æÈëÎļþ
int m_qiport;
//Óû§Ãû£¬´æÈëÎļþ
QString m_qusername;
//Óû§ÃÜÂ룬´æÈëÎļþ
QString m_qpassword;
//²¼·ÀÖÐ >=0 ·ñÔò -1
int m_ideployed;
//¶à²¥ipµØÖ·
QString m_multiCast;
//×ÓÊôÐÔͨµÀ½ÚµãÁÐ±í£¬ÆäÄÚÈÝÒ²Òª´æÈëÎļþ£»
//QList<ChannelData> m_qlistchanneldata;
void __stdcall RealDataCallBack(int lRealHandle,int dwDataType,unsigned char *pBuffer,int dwBufSize, void* dwUser);
static void __stdcall g_ExceptionCallBack(int dwType, int lUserID, int lHandle, void *pUser);
static void CALLBACK SetDecCallBack(int nPort,char * pBuf,int nSize,FRAME_INFO * pFrameInfo, void* nUser,int nReserved2);
static void CALLBACK g_RealDataCallBack_V30(int lRealHandle, int dwDataType, unsigned char *pBuffer,int dwBufSize,void* dwUser);
/*******HCNetSDK**************/
public slots:
void replyFinished (QNetworkReply *reply);
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
//void processFrame(QVideoFrame frame, int levels);
//void processFrame(const QVideoFrame &frame);
protected slots:
protected:
void mouseMoveEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void keyPressEvent(QKeyEvent *e) override;
void resizeEvent(QResizeEvent *event) override;
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;
};
#endif // RTSPWINDOW_H