-
Notifications
You must be signed in to change notification settings - Fork 1
/
HIK_SDK.h
118 lines (105 loc) · 2.89 KB
/
HIK_SDK.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
#ifndef __HIK_SDK_H__
#define __HIK_SDK_H__
#endif
#include <stdio.h>
#include "HCNetSDK.h"
typedef void (*PlaybackCallBack)(LONG lPlayHandle,DWORD dwDataType,BYTE *pBuffer,DWORD dwBufSize,DWORD dwUser);
class HIK_SDK{
private:
HIK_SDK();
~HIK_SDK();
public:
static HIK_SDK &GetHikSdkInstance(){
static HIK_SDK instance ;
return instance;
}
public:
/*
Description: Get recoder file from nvr by time
paramS:
[in] loginInfo,ip,port,username,password...
[out] deviceInfo
return:
errcode 0:success else:failed
*/
int Init(NET_DVR_USER_LOGIN_INFO loginInfo,NET_DVR_DEVICEINFO_V40& deviceInfo);
/*
Description: Get recoder file from nvr by time
paramS:
[in] startTime:
[in] stopTime
[in] chan: channel number
[in] fileName: filename include the path
return:
errcode 0:success else:failed
*/
int SaveFileByTime(NET_DVR_TIME startTime,NET_DVR_TIME stopTime,LONG chanl, char* fileName);
/*
Description:Save file by name
paramS:
[in] NVRFileName :file on NVR
[in] destFileName :file saved on local
return:
errcode 0:success else:failed
*/
int SaveFileByName( char* NVRFileName, char* destFileName );
/*
Description:Playback recoder by name
paramS:
[in] NVRFileName :file on NVR
[in] callback: callback function realize by user
return:
errcode 0:success else:failed
*/
int PlayBackByName(char* NVRFileName,PlaybackCallBack callback);
/*
Description:Playback recoder from nvr by time
paramS:
[in] startTime:
[in] stopTime
[in] chan: channel number
[in] callback 取流回调函数,由调用者实现此函数,可以对数据做编码、保存等操作
return:
errcode 0:success else:failed
*/
int PlayBackByTime(NET_DVR_TIME startTime,NET_DVR_TIME stopTime,LONG chanl,PlaybackCallBack callback);
/*
Description: Release Source
paramS:
return:
errcode 0:success else:failed
*/
int Destory();
/*
Description search file from nvr by time
paramS:
[in] startTime:
[in] stopTime
[in] chan: channel number
[out] file founded
return:
errcode 0:success else:failed
*/
int FindFile(NET_DVR_TIME startTime,NET_DVR_TIME stopTime,LONG chanl, NET_DVR_FIND_DATA& struFileData);
/*
Description get config from HIK DVR
paramS:
[in]command
[in]group: channel group num,start at 0, each group contain 64 channel
[out] device config
return:
errcode 0:success else:failed
*/
int GetDVRConfig(DWORD command, LONG group, NET_DVR_IPPARACFG_V40 &deviceCfg);
/*
Description get Port from HIK DVR
paramS:
[in]command
[out] device config
return:
errcode 0:success else:failed
*/
int GetPort(DWORD command, NET_DVR_NAT_CFG &deviceCfg );
private:
LONG m_UserID;
};