Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
1
SDK V4.5.2
API Document
Ver. 2.0.0.110302.003
2
Revision History Version
Number
Date Author Note
2.0 2011/03/31 Shawn Ho First draft of the ATL sample code manual
2.0.1 2011/04/28 Rafael Chen First draft of the API interface manul
2.1.0 2011/5/12 Rafael Chen 1. Add new comment for
LiveView_AttachSession and PlayBack_OpenRecord
2. Revise sample code description
2.2.0 2011/10/11 Gami Yang 1. Add comment for new supported APIs :
(Querying records/event logs, PTZ
preset, ...etc.)
2.3.0 2011/12/08 Mike Su 1. Modify comment due to Titan support
2. Add comment for new supported
APIS( C#/VS 2010 compatible APIs, Evport
video)
2.4.0 2012/02/16 Gami Yang 1. Add comment for Playback_Seek
2.5.0 2012/08/30 Gami Yang 1. Add comment for new supported APIs(Talk
and event notification, etc.)
3.0.0 2013/03/22 Gami Yang 1. Add comment for new supported
APIS(Getting the associated device of digital
input and image scaling)
3.1.0 2013/8/12 Gami Yang 1. Add comment for new supported
APIS(Metadata, backup. Open sequenced
record)
4.0.0 2014/04/30 Eugen Chen 1. Support Crystal TiTan NVR
4.1.0 2014/05/22 Eugen Chen 1. Support 64 Channel LiveView
2. Support 5x5 LiveView in ActiveX
4.2.0 2014/09/05 Eugen Chen 1. Support dual record
4.3.0 2015/02/12 Eugen Chen/
Jeff Hsu
1. Mainconsole privacy mask
4.4.0 2015/03/16 Jeff Hsu 1. Manconsole 96 channel LiveView
4.5.0 2015/07/24 Jeff Hsu 1. Support Crystal 3.0
4.5.1 2015/07/31 Jeff Hsu 1. Support ActiveX OSD time format 12 or 24
2. Add new interface :
Create_Handle_With_DeviceInfo,
Info_UpdateDeviceInfo
4.5.2 2015/08/27 Jeff Hsu 1. Add event filter
3
Support server version
MainConsole 5.0.31 or above
Mini2 02.02.0001.0004 or above
Solo 02.02.0002.0004 or above
Titan 01.06.0000.0213 or above
Crystal 03.00.0000.0033 or above
Add interface from 4.5.1 to 4.5.2
Event_DuplicateFilter
Content Scope Introduction .................................................................................................................................. 1 API Interface ........................................................................................................................................... 2
Create_HandleWChar ..................................................................................................... 2
Create_Handle_And_Event_Subscribe .......................................................................... 4
Create_Handle_With_DeviceInfo .................................................................................. 6
Destroy_Handle .............................................................................................................. 7
Info_GetServerInfo ......................................................................................................... 9
Info_ReleaseServerInfo ................................................................................................ 10
Info_GetDeviceList_CS ................................................................................................ 11
Info_ReleaseDeviceList_CS ......................................................................................... 12
Info_GetDeviceList_Ext ............................................................................................... 12
Info_ReleaseDeviceList_Ext ........................................................................................ 14
Info_GetDeviceCapability_Ext .................................................................................... 15
Info_GetDeviceOrder ................................................................................................... 16
Info_GetDIOStatus_Ext ............................................................................................... 17
Info_GetDOPrivilegeExt .............................................................................................. 18
Info_GetDIAssociatedDevice ....................................................................................... 19
Info_GetPTZPreset_CS_Ext ........................................................................................ 20
Info_ReleasePTZPreset_CS_Ext .................................................................................. 21
Info_GetPTZInfo_CS ................................................................................................... 22
Info_ReleasePTZInfo_CS ............................................................................................ 23
Info_GetPTZCapabilityExt .......................................................................................... 24
Info_GetSensorProfileList_CS1 ................................................................................... 25
Info_ReleaseSensorProfileList_CS1 ............................................................................ 26
Info_GetSensorProfileList_Ext .................................................................................... 26
Info_ReleaseSensorProfileList_CS .............................................................................. 28
Info_GetRecordDateList .............................................................................................. 29
Info_GetRangedRecordDateList .................................................................................. 30
Info_ReleaseRecordDateList ........................................................................................ 32
Info_GetRecordDateListExt ......................................................................................... 33
Info_GetScheduleLogs ................................................................................................. 33
Info_ReleaseScheduleLogs .......................................................................................... 35
Info_GetScheduleLogsList ........................................................................................... 36
Info_ReleaseScheduleLogsList .................................................................................... 37
Info_GetRecordLogsExt ............................................................................................... 38
4
Info_ReleaseRecordLogsExt ........................................................................................ 39
Info_GetRecordLogsListExt ........................................................................................ 40
Info_ReleaseRecordLogsListExt .................................................................................. 41
Info_GetSequencedRecord ........................................................................................... 41
Info_ReleaseSequencedRecord .................................................................................... 43
Info_QueryEvents ......................................................................................................... 44
Info_ReleaseEvents ...................................................................................................... 46
Info_QueryEventExt ..................................................................................................... 47
Info_ReleaseEventsExt ................................................................................................. 48
Info_GetMetadataLog .................................................................................................. 49
Info_ReleaseMetadataLog ............................................................................................ 51
Info_GetMetadataSourceList........................................................................................ 52
Info_ReleaseMetadataSourceList ................................................................................. 53
Info_GetBackupFileSize .............................................................................................. 54
Info_UpdateDeviceInfo ................................................................................................ 56
Control_PTZ_CS_Ext .................................................................................................. 56
Control_PTZ_PTZDeviceID_CS_Ext .......................................................................... 58
Control_DigitalOutput_Ext .......................................................................................... 59
Control_SetPatrol ......................................................................................................... 60
Talk_Enable .................................................................................................................. 61
Talk_Disable ................................................................................................................. 63
Talk_SendAudioPacket ................................................................................................ 64
Talk_GetEnableID ........................................................................................................ 66
Event_Subscribe ........................................................................................................... 67
Event_Unsubscribe ....................................................................................................... 69
Event_SubscribeExt...................................................................................................... 70 Event_UnsubscribeExt ................................................................................................................. 71 Event_DuplicateFilter ................................................................................................................... 72
LiveView_CreatePlayer ................................................................................................ 73
LiveView_DestroyPlayer .............................................................................................. 74
LiveView_AttachSessionExtExt .................................................................................. 75
LiveView_DetachSessionExtExt .................................................................................. 77
LiveView_AttachRawVideoSession ............................................................................. 78
LiveView_SetAudioOn ................................................................................................ 80
LiveView_SetAudioOff ................................................................................................ 81
LiveView_GetSessionAudioStatus ............................................................................... 82
LiveView_GetSessionCurrentImage ............................................................................ 83
LiveView_ReleaseSessionCurrentImage ...................................................................... 84
LiveView_SubscribeMetadata ...................................................................................... 85
LiveView_UnsubscribeMetadata .................................................................................. 87
Playback_CreatePlayer ................................................................................................. 87
Playback_DestroyPlayer ............................................................................................... 89
PlayBack_AttachSession1ExtExt ................................................................................. 90
PlayBack_DetachSessionExtExt .................................................................................. 92
PlayBack_AttachRawVideoSession ............................................................................. 93
PlayBack_Seek ............................................................................................................. 95
PlayBack_OpenRecord ................................................................................................. 96
5
PlayBack_OpenSequencedRecord ............................................................................... 97
PlayBack_Play .............................................................................................................. 99
PlayBack_ReversePlay ............................................................................................... 100
PlayBack_Pause.......................................................................................................... 101
PlayBack_StepForward .............................................................................................. 102
PlayBack_StepBackward ............................................................................................ 103
PlayBack_Next ........................................................................................................... 104
PlayBack_Previous ..................................................................................................... 105
PlayBack_SetSpeed .................................................................................................... 106
PlayBack_GetSpeed ................................................................................................... 107
PlayBack_GetTime ..................................................................................................... 108
PlayBack_GetPlayerState ........................................................................................... 109
PlayBack_ExportVideo ............................................................................................... 110
PlayBack_StopExport .................................................................................................. 112
PlayBack_ExportVideo_Ext ........................................................................................ 113
PlayBack_StopExport_Ext .......................................................................................... 114
PlayBack_GetExportFormatList ................................................................................. 115
PlayBack_ReleaseExportFormatList ........................................................................... 117
Playback_GetSessionCurrentImage ............................................................................ 118
PlayBack_ReleaseSessionCurrentImage ..................................................................... 119
Backup_Initial ............................................................................................................ 120
Backup_Uninit ............................................................................................................ 122
Backup_GetBackupFileItemList ................................................................................ 123
Backup_ReleaseBackupFileItemList .......................................................................... 124
Backup_SetBackupDestinationDir ............................................................................. 125
Backup_Start .............................................................................................................. 126
Backup_Pause ............................................................................................................. 127
Backup_Resume ......................................................................................................... 128
Backup_Abort ............................................................................................................. 129
Utility_SaveSnapShotImage ....................................................................................... 130
Utility_AddImageWaterMark ..................................................................................... 132
Utility_AddVideoWaterMark ..................................................................................... 133
Utility_ScaleImage ..................................................................................................... 134
Np_DateTime ............................................................................................................. 136
Np_Frame ................................................................................................................... 138
Np_ID ......................................................................................................................... 139
Np_ID_Ext.................................................................................................................. 140
Np_IDList ................................................................................................................... 141
Np_Period ................................................................................................................... 142
Np_SensorProfile........................................................................................................ 143
Np_SubDevice ............................................................................................................ 144
Np_Device .................................................................................................................. 145
Np_DeviceGroup ........................................................................................................ 146
Np_DeviceList ............................................................................................................ 147
Np_LogConditions ..................................................................................................... 148
Np_OperationLog ....................................................................................................... 149
Np_ConfigurationLog ................................................................................................ 150
6
Np_Log ....................................................................................................................... 151
Np_ScheduleLogItem ................................................................................................. 152
Np_RecordLogItem .................................................................................................... 153
Np_RecordLogItemExt .............................................................................................. 154
Np_ScheduleLogList .................................................................................................. 154
Np_ScheduleLogListList ............................................................................................ 156
Np_RecordLogList ..................................................................................................... 156 Np_RecordLogListExt................................................................................................................ 157
Np_SequencedRecordList .......................................................................................... 157
Np_SequencedRecord ................................................................................................ 159
Np_Event .................................................................................................................... 160
Np_EventList .............................................................................................................. 161
Np_RecordDateList .................................................................................................... 162
Np_MetadatalogList ................................................................................................... 163
Np_MetadatalogItem .................................................................................................. 164
Np_MetadataSearchCriterion ..................................................................................... 165
Np_MetadataSourceList ............................................................................................. 166
Np_MetadataSource ................................................................................................... 167
Np_MetadataChannelList ........................................................................................... 168
Np_MetadataChannel ................................................................................................. 169
Np_PTZContinuousMove .......................................................................................... 170
Np_PTZRectangle ...................................................................................................... 172
Np_PTZPreset ............................................................................................................ 173
Np_PTZParameter ...................................................................................................... 174
Np_PTZControlParam ................................................................................................ 175
Np_TalkAudioFormat ................................................................................................. 176
Np_ServerInfo_MainConsole ..................................................................................... 177
Np_ServerInfo ............................................................................................................ 179
Np_ExportContent ...................................................................................................... 180
Np_ExportProfile........................................................................................................ 181
Np_ExportProfileList ................................................................................................. 182
Np_ExportFormat ....................................................................................................... 183
Np_ExportFormatList ................................................................................................. 184
Np_SensorProfile........................................................................................................ 185
Np_SensorProfile_CS ................................................................................................. 186
Np_SensorProfile_CS1 ............................................................................................... 186
Np_SensorProfile_CS_List ........................................................................................ 188
Np_SensorProfile_CS1_List ...................................................................................... 189
Np_SubDevice_CS ..................................................................................................... 189
Np_SubDevice_Ext .................................................................................................... 191
Np_SubDevice_CS_List ............................................................................................. 192
Np_SubDevice_Ext_List ............................................................................................ 193
Np_Device_CS ........................................................................................................... 194
Np_Device_Ext .......................................................................................................... 195
Np_Device_CS_List ................................................................................................... 196
Np_Device_Ext_List .................................................................................................. 197
Np_DeviceGroup_CS ................................................................................................. 198
7
Np_DeviceGroup_Ext ................................................................................................ 199
Np_DeviceGroup_CS_List ......................................................................................... 200
Np_DeviceGroup_Ext_List ........................................................................................ 201
Np_DeviceList_CS ..................................................................................................... 202
Np_DeviceList_Ext .................................................................................................... 203
Np_PTZPreset_CS...................................................................................................... 204
Np_PTZPreset_CS_List ............................................................................................. 205
Np_PTZInfo_CS ......................................................................................................... 206
Np_PTZPresetType_CS .............................................................................................. 207
Np_PTZPatrol_CS ...................................................................................................... 208
Np_PatrolGroup_CS ................................................................................................... 209
Np_PTZParameter_CS ............................................................................................... 210
Np_PTZControlParam_CS .......................................................................................... 211
RecordingLog_Subscribe ........................................................................................... 212
RecordingLog_Unsubscribe ....................................................................................... 213
Np_SourceType .......................................................................................................... 214
Np_ScheduleLogItem ................................................................................................. 215
Sample code ........................................................................................................................................ 216 Liveview Streaming .................................................................................................... 216
PTZ Control ................................................................................................................ 219
View recorded stream ................................................................................................. 221
Playback control ......................................................................................................... 224
1
Scope Introduction
SDK 4.0 is capable of retrieving information from all recording servers, including
MainConsole, NVR mini2, NVRSolo, NVRTitan, and Crystal Titan NVR. This release includes
features for LiveStreaming, Recorded video query, PTZ control, Digital Output control and
Digital Input status. This document provides a introduction for API interface.
2
API Interface
Create_HandleWChar
Purpose Compatibility
Initialize connection to a specific
recording server For all platform
Syntax:
Np_Result_t Create_HandleWChar (void** handle,
Np_ServerType type,
const wchar_t* username,
const wchar_t* passwd,
const wchar_t* ipaddress,
WORD port);
Parameters:
Name Meaning
[OUT] handle Handle pointer (will be used in later
API)
[IN] type
Server type. Supported value in this
version is
kMainConsoleLiveview :
MainConsole Liveview
kMainConsolePlayback :
MainConsole Playback
kCrystal:
Titan/Crystal Server
[IN] username User name for server login
[IN] passwd Password for server login
[IN] ipaddress Server IP address
3
[IN] port Server port
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
It is programmer’s responsibility to release the allocated memory by calling
Destroy_Handle function.
4
Create_Handle_And_Event_Subscribe
Purpose Compatibility
Initialize connection and
subscribe event notification to a
specific recording server.
Mainconsole Family only
Syntax:
Np_Result_t Create_Handle_And_Event_Subscrivbe (void** handle,
Np_ServerType type,
const wchar_t* username,
const wchar_t* passwd,
const wchar_t* ipaddress,
WORD port,
fnEventHandle callback,
void* ctx);
Parameters:
Name Meaning
[OUT] handle Handle pointer (will be used in later
API)
[IN] type
Server type. Supported value in this
version is
kMainConsoleLiveview :
MainConsole Liveview
[IN] username User name for server login
[IN] passwd Password for server login
[IN] ipaddress Server IP address
[IN] port Server port
[IN] callback Callback function, called when
event present.
[IN] ctx Extra information which will be
carried to each callback function
5
call as a parameter. Reserved for
programmer’s usage.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
It is programmer’s responsibility to release the allocated memory by calling
Destroy_Handle function.
6
Create_Handle_With_DeviceInfo
Purpose Compatibility
Initialize connection to a specific
recording server with updating
device list.
Mainconsole Family only
Syntax:
Np_Result_t Create_HandleWChar (void** handle,
Np_ServerType type,
const wchar_t* username,
const wchar_t* passwd,
const wchar_t* ipaddress,
WORD port,
Np_DeviceCapability deviceCapability);
Parameters:
Name Meaning
[OUT] handle Handle pointer (will be used in later
API)
[IN] type
Server type. Supported value in this
version is
kMainConsoleLiveview :
MainConsole Liveview
kMainConsolePlayback :
MainConsole Playback
kCrystal:
Titan/Crystal Server
[IN] username User name for server login
[IN] passwd Password for server login
[IN] ipaddress Server IP address
[IN] port Server port
7
[IN] deviceCapability
The bit wise combination of flags
for the supported capabilities, see
the enum “Np_DeviceCapability” in
NpClient.h for the meaning of each
flag.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
It is programmer’s responsibility to release the allocated memory by calling
Destroy_Handle function.
Destroy_Handle
Purpose Compatibility
Release the memory allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
For all platform
Syntax:
Np_Result_t Destroy_Handle (void* handle)
Parameters:
Name Meaning
[IN] handle
Handle pointer returned by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
8
defined at NpClientDefine.h.
9
Info_GetServerInfo
Purpose Compatibility
Get the information of server
such as version, type, … etc. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetServerInfo (void* handle, Np_ServerInfo& serverInfo);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] serverInfo
The information of the server. Ctrl+Click
the Np_ServerInfo listed above to check
its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and a
new handle is required to be re-created
Remarks:
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseServerInfo function.
10
Info_ReleaseServerInfo
Purpose Compatibility
Release the resources allocated
by Info_GetServerInfo Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseServerInfo (void* handle, Np_ServerInfo&
serverInfo);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] serverInfo
The info structure passed to previous
successful call of Info_GetServerInfo.
After calling this function, the info will
be released and should never be used
again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
11
Info_GetDeviceList_CS
Purpose Compatibility
Get the device list from the
server, including cameras, PTZ
device, and I/O device.
For all platform.
Syntax:
Np_Result_t Info_GetDeviceList_CS (void* handle,
Np_DeviceList_CS & deviceList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] deviceList
The device list of the server. Ctrl+Click the
Np_DeviceList_CS listed above to check its
structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and a
new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseDeviceList_CS function.
12
Info_ReleaseDeviceList_CS
Purpose Compatibility
Release all the resources
allocated by
Info_GetDeviceList_CS.
For all platform.
Syntax:
Np_Result_t Info_ReleaseDeviceList_Ext (void* handle,
Np_DeviceList_Ext& deviceList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] deviceList
The device list passed to previous
successful call of Info_GetDeviceList_CS.
After calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Info_GetDeviceList_Ext
Purpose Compatibility
Get the device list from the
server, including cameras, PTZ
device, and I/O device.
For all platform.
13
Syntax:
Np_Result_t Info_GetDeviceList_Ext (void* handle,
Np_DeviceList_Ext & deviceList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] deviceList
The device list of the server. Ctrl+Click the
Np_DeviceList_Ext listed above to check
its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and a
new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseDeviceList_Ext function.
14
Info_ReleaseDeviceList_Ext
Purpose Compatibility
Release all the resources
allocated by
Info_GetDeviceList_Ext.
For all platform.
Syntax:
Np_Result_t Info_ReleaseDeviceList_Ext (void* handle,
Np_DeviceList_Ext& deviceList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] deviceList
The device list passed to previous
successful call of Info_GetDeviceList_Ext.
After calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
15
Info_GetDeviceCapability_Ext
Purpose Compatibility
Get capability of a device For all platform
Syntax:
Np_Result_t Info_GetDeviceCapability_Ext (void* handle,
Np_ID_Ext id,
long long& capability);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of device, which can be
referred from Np_Device_Ext.
[OUT]status
The bit wise combination of flags for the
supported capabilities, see the enum
“Np_DeviceCapability” in NpClient.h for
the meaning of each flag.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
16
Info_GetDeviceOrder
Purpose Compatibility
Get the order of the specified
device For Titan/Crystal only
Syntax:
Np_Result_t Info_GetDeviceOrder(
void *handle,
Np_ID_Ext id,
int &order);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] id The identification of the device, which
can be referred from Np_Device_Ext.
[OUT] order The order of the device.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
17
Info_GetDIOStatus_Ext
Purpose Compatibility
Get status of a single I/O device For all platform.
Syntax:
Np_Result_t Info_GetDIOStatus_Ext (void* handle,
Np_ID_Ext id,
Np_DIOStatus& status);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of I/O device, which
can be referred from Np_Device_Ext.
[OUT]status
The status of I/O status. The value is
possible
kDIO_OFF
kDIO_ON
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
18
Info_GetDOPrivilegeExt
Purpose Compatibility
Get privilege information of
controlling output pins on specific
device
For all platform.
Syntax:
Np_Result_t Info_GetDOPrivilegeExt (void* handle,
Np_ID_Ext id,
DWORD& dwDOPrivilege);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of I/O device, which
can be referred from Np_Device_Ext.
[OUT]dwDOPrivilege
The bit wise combination of flag for
privilege of each output pin, first bit for
the first pin and so on.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
19
Info_GetDIAssociatedDevice
Purpose Compatibility
Get the identification of the
associated device on the specific
digital input.
Mainconsole Family only.
Syntax:
Np_Result_t Info_GetDIAssocaitedDevice (void* handle,
Np_ID id,
Np_ID& associatedDevice);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id
The identification of digital input device,
which can be referred from
Np_Device_CS.
[OUT]associatedDevice The identification of the associated
device.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
20
Info_GetPTZPreset_CS_Ext
Purpose Compatibility
Get the list of PTZ presets for
specific device. For all platform.
Syntax:
Np_Result_t Info_GetPTZPreset_CS_Ext (void* handle,
Np_ID_Ext id,
Np_PTZPreset_CS_List& ptzPresetList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of PTZ device, which
can be referred from Np_Device_Ext.
[OUT]ptzPresetList
List of PTZ presets. Ctrl+Click the
Np_PTZPreset_CS_List listed above to
check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleasePTZPreset_CS_Ext function.
21
Info_ReleasePTZPreset_CS_Ext
Purpose Compatibility
Release all the resources allocated
by Info_GetPTZPreset_CS_Ext. For all platform.
Syntax:
Np_Result_t Info_ReleasePTZPreset_CS_Ext (void* handle,
Np_PTZPreset_CS_List& ptzPresetList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]ptzPresetList
The list passed to previous successful call
of Info_GetPTZPreset_CS_Ext. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
22
Info_GetPTZInfo_CS
Purpose Compatibility
Get PTZ information for specific
device. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetPTZInfo_CS (void* handle, Np_ID id, Np_PTZInfo_CS &
ptzInfo);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of PTZ device, which
can be referred from Np_Device_CS.
[OUT]ptzPresetList
PTZ information. Ctrl+Click the
Np_PTZInfo_CS listed above to check its
structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
23
Info_ReleasePTZInfo_CS
Purpose Compatibility
Release all the resources allocated
by Info_GetPTZInfo_CS. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleasePTZInfo_CS (void* handle, Np_PTZInfo_CS&
ptzInfo);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]ptzPresetList
The list passed to previous successful call
of Info_GetPTZInfo_CS. After calling this
function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
24
Info_GetPTZCapabilityExt
Purpose Compatibility
Get capability of PTZ operation for
specific device For all platform.
Syntax:
Np_Result_t Info_GetPTZCapabilityExt (void* handle,
Np_ID_Ext id,
long long& ptzCapability);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of PTZ device, which
can be referred from Np_Device_Ext.
[OUT]ptzCapability
The bit wise combination of flags for the
supported capabilities, see the enum
“Np_PTZCap” in NpClient.h for the
meaning of each flag.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
25
Info_GetSensorProfileList_CS1
Purpose Compatibility
Get supported sensor (quality)
profile list for specific device.(Dual
record)
Mainconsole Family only.
Syntax:
Np_Result_t Info_GetSensorProfileList_CS1 (void* handle,
Np_ID id,
Np_SensorProfile_CS1_List&
sensorProfileList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of sensor device, which
can be referred from Np_Device_CS.
[OUT]sensorProfileList
List of supported sensor profile. Ctrl+Click
the Np_SensorProfile_CS1_List listed
above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseSensorProfileList_CS1 function.
26
Info_ReleaseSensorProfileList_CS1
Purpose Compatibility
Release all the resources allocated
by Info_GetSensorProfileList_CS1. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseSensorProfileList_CS1 (void* handle,
Np_SensorProfile_CS1_List& sensorProfileList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]sensorProfileList
The list passed to previous successful call
of Info_GetSensorProfileList_CS1. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Info_GetSensorProfileList_Ext
Purpose Compatibility
Get supported sensor (quality)
profile list for specific device. For all platform.
Syntax:
27
Np_Result_t Info_GetSensorProfileList_Ext (void* handle,
Np_ID_Ext id,
Np_SensorProfile_CS_List& sensorProfileList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of sensor device, which
can be referred from Np_Device_Ext.
[OUT]sensorProfileList
List of supported sensor profile. Ctrl+Click
the Np_SensorProfile_CS_List listed
above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseSensorProfileList_CS function.
28
Info_ReleaseSensorProfileList_CS
Purpose Compatibility
Release all the resources allocated
by Info_GetSensorProfileList_Ext. For all platform.
Syntax:
Np_Result_t Info_ReleaseSensorProfileList_CS (void* handle,
Np_SensorProfile_CS_List& sensorProfileList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]sensorProfileList
The list passed to previous successful call
of Info_GetSensorProfileList_Ext. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
29
Info_GetRecordDateList
Purpose Compatibility
Get list of date in which video(s) are
recorded Mainconsole Family only.
Syntax:
Np_Result_t Info_GetRecordDateList (void* handle,
Np_RecordDateList& recordDateList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]recordDateList List of dates in which videos are
recorded.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseRecordDateList function
Deprecated, this function only supported under MainConsole Playback, use
Info_GetRangedRecordDateList instead.
30
Info_GetRangedRecordDateList
Purpose Compatibility
Get list of date during a specified
period(time range) in which
video(s) are recorded
Mainconsole Family only.
Syntax:
Np_Result_t Info_GetRangedRecordDateList (void* handle,
Np_DateTime* startDate,
Np_DateTime* endDate,
Np_RecordDateList& recordDateList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] startDate
Start date of the query, could be passed
as NULL only under MainConsole
Playback mode.
[IN] endDate
End date of the query, could be passed as
NULL only under MainConsole Playback
mode.
[OUT]recordDateList List of dates in which videos are recorded.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
31
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseRecordDateList function
32
Info_ReleaseRecordDateList
Purpose Compatibility
Release all the resources allocated
by Info_GetRecordDateList /
Info_GetRangedRecordDateList.
Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseRecordDateList (void* handle,
Np_RecordDateList& recordDateList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]recordDateList
The list passed to previous successful call
of Info_GetRecordDateList. After calling
this function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
33
Info_GetRecordDateListExt
Purpose Compatibility
Get list of date in which video(s) are
recorded For Titan/Crystal only
Syntax:
Np_Result_t Info_GetRecordDateList (void* handle,
Np_DateTime& query_month);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] query_month Query a monthly log.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Info_GetScheduleLogs
Purpose Compatibility
Get list of recording schedules in
specific date. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetScheduleLogs (void* handle,
34
Np_DateTime date,
Np_ScheduleLogList& scheduleLogList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] date Date to query, while only the
year/month/day fields are referred.
[OUT]scheduleLogList
List of recording schedules. Ctrl+Click
the Np_ScheduleLogList listed above to
check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This function is MainConsole Playback only. Titan/Corporate don’t have schedule log.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseScheduleLogs function
35
Info_ReleaseScheduleLogs
Purpose Compatibility
Release the resources allocated by
Info_GetScheduleLogs. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseScheduleLogs (void* handle,
Np_ScheduleLogList& scheduleLogList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]scheduleLogList
The list passed to previous successful
call of Info_GetScheduleLogs. After
calling this function, the list will be
released and should never be used
again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This function is MainConsole Playback only. Titan/Corporate servers don’t have
schedule log.
36
Info_GetScheduleLogsList
Purpose Compatibility
Get list of recording schedules in
specific date for dual record. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetScheduleLogsList (void* handle,
Np_DateTime date,
Np_ScheduleLogListList& scheduleLogListList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] date Date to query, while only the
year/month/day fields are referred.
[OUT]scheduleLogListList
List of recording schedules. Ctrl+Click
the Np_ScheduleLogListList listed
above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This function is MainConsole Playback only. Titan/Corporate don’t have schedule log.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
37
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseScheduleLogsList function
Info_ReleaseScheduleLogsList
Purpose Compatibility
Release the resources allocated by
Info_GetScheduleLogsList. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseScheduleLogs (void* handle,
Np_ScheduleLogListList& scheduleLogListList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]scheduleLogList
The list passed to previous successful
call of Info_GetScheduleLogsListList.
After calling this function, the list will
be released and should never be used
again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This function is MainConsole Playback only. Titan/Corporate servers don’t have
schedule log.
38
Info_GetRecordLogsExt
Purpose Compatibility
Get list of recorded videos in
specific date. For all platform.
Syntax:
Np_Result_t Info_GetRecordLogsExt (void* handle,
Np_DateTime date,
Np_RecordLogListExt& scheduleLogList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] date Date to query, while only the
year/month/day fields are referred.
[OUT] scheduleLogList
List of the recorded videos. Ctrl+Click the
Np_RecordLogListExt listed above to
check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseRecordLogsExt function
39
Info_ReleaseRecordLogsExt
Purpose Compatibility
Release the resources allocated by
Info_GetRecordLogsExt. For all platform.
Syntax:
Np_Result_t Info_ReleaseRecordLogsExt (void* handle,
Np_RecordLogListExt& recordLogList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]recordLogList
The list passed to previous successful call
of Info_GetRecordLogsExt. After calling
this function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
40
Info_GetRecordLogsListExt
Purpose Compatibility
Get list of recorded videos in
specific date for dual record. For all platform.
Syntax:
Np_Result_t Info_GetRecordLogsListExt (void* handle,
Np_DateTime date,
Np_RecordLogsListExt& scheduleLogList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] date Date to query, while only the
year/month/day fields are referred.
[OUT] scheduleLogList
List of the recorded videos. Ctrl+Click the
Np_RecordLogListExt listed above to
check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseRecordLogsListExt function
41
Info_ReleaseRecordLogsListExt
Purpose Compatibility
Release the resources allocated by
Info_GetRecordLogsListExt. For all platform.
Syntax:
Np_Result_t Info_ReleaseRecordLogsListExt (void* handle,
Np_RecordLogListExt& recordLogListList);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT]recordLogListList
The list passed to previous successful call
of Info_GetRecordLogsListExt. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Info_GetSequencedRecord
Purpose Compatibility
Get list of recorded videos with
sequence number in specific date. Mainconsole Family only.
42
Syntax:
Np_Result_t Info_GetSequencedRecord (void* handle,
Np_DateTime startTime,
Np_DateTime endTime,
Np_IDList idList,
Np_SequencedRecordList &options)
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] startTime Start date of the query interval
[IN] endTime End date of the query interval
[IN] idList The id list to be queried
[OUT] options
List of the recorded videos with sequence
number. Ctrl+Click the
Np_SequencedRecordList listed above to
check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseSequencedRecord function
This function is MainConsole Playback only.
43
Info_ReleaseSequencedRecord
Purpose Compatibility
Release the resources allocated by
Info_GetSequencedRecord. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseSequencedRecord (void* handle,
Np_SequencedRecordList &options);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] options
The list passed to previous successful call
of Info_GetSequencedRecord. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
44
Info_QueryEvents
Purpose Compatibility
Ouery the list of recording events
during specific time range. Mainconsole Family only.
Syntax:
Np_Result_t Info_QueryEvents (void* handle,
Np_DateTime* startTime,
Np_DateTime* endTime,
int* deviceTypeID,
Np_ID* deviceID,
int* eventID,
Np_EventList& eventList);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] startTime Start time of the range to query. Set it to
NULL for ignoring this criteria
[IN] endTime End time of the range to query, Set it to
NULL for ignoring this criteria
[IN] deviceTypeID
Set to one of the possible value of the
source device type id to narrow down the
result to specific event type. Set it to
NULL for all events. The source device
type id was defined at NpClientDefine.h.
[IN] deviceID ID of the source device to query, set it to
NULL for all devices.
[IN]eventID
Set to one of the possible value of the
eventID field in Np_Event to narrow down
the result to specific event type. Set it to
NULL for all events
45
[OUT]eventList List of the events.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
The query citeria deviceTypeID is only supported by Corporate and Titan recording
servers.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseEvents function
The event possible values are(defined in NpClientDefine.h):
MainConsole
Np_EVENT_GENERAL_MOTION1
Np_EVENT_GENERAL_MOTION2
Np_EVENT_GENERAL_MOTION3
Np_EVENT_GENERAL_MOTION4
Np_EVENT_GENERAL_MOTION5
Np_EVENT_FOREIGN_OBJECT
Np_EVENT_MISSING_OBJECT
Np_EVENT_FOCUS_LOST
Np_EVENT_CAMERA_OCCLUSION
Np_EVENT_GENERAL_MOTION_DEVICE
Np_EVENT_SIGNAL_LOST
Np_EVENT_INPUT_OPENED
Np_EVENT_SYSTEM_HEALTH_UNUSUAL
Np_EVENT_DISK_SPACE_EXHAUSTED
Np_EVENT_RESOURCE_DEPLETED
Np_EVENT_NETWORK_CONGESTION
46
Mini and Mini2
Np_EVENT_SIGNAL_LOST
Np_EVENT_MOTION_START
Np_EVENT_INPUT_OPENED
Info_ReleaseEvents
Purpose Compatibility
Release the resources allocated by
Info_QueryEvents. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseEvents (void* handle, Np_EventList& eventList);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT]eventList
The list passed to previous successful call
of Info_QueryEvents. After calling this
function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
47
Info_QueryEventExt
Purpose Compatibility
Ouery the list of recording events
during specific time range. For Titan/Crystal only
Syntax:
Np_Result_t Info_QueryEvents (void* handle,
Np_DateTime* startTime,
Np_DateTime* endTime,
Np_SourceType* p_type,
unsigned long long* p_server_id ,
unsigned long long* p_device_id ,
int* eventID);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] startTime Start time of the range to query. Set it to
NULL for ignoring this criteria
[IN] endTime End time of the range to query, Set it to
NULL for ignoring this criteria
[IN] deviceTypeID
Set to one of the possible value of the
source device type id to narrow down the
result to specific event type. Set it to
NULL for all events. The source device
type id was defined at NpClientDefine.h.
[IN] deviceID ID of the source device to query, set it to
NULL for all devices.
[IN]eventID
Set to one of the possible value of the
eventID field in Np_Event to narrow down
the result to specific event type. Set it to
NULL for all events
48
[OUT]eventList List of the events.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
The query citeria deviceTypeID is only supported by Corporate and Titan recording
servers.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseEventsExt function
The event possible values are(defined in NpClientDefine.h):
Titan/Crystal
Np_EVENT_MOTION_START
Np_EVENT_CONNECTION_LOST
Np_EVENT_DISK_ABNORMAL
Np_EVENT_INPUT_OPENED
Info_ReleaseEventsExt
Purpose Compatibility
Release the resources allocated by
Info_QueryEventsExt. For Titan/Crystal only
Syntax:
Np_Result_t Info_ReleaseEvents (void* handle, Np_EventList& eventList);
49
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT]eventList
The list passed to previous successful call
of Info_QueryEventsExt. After calling this
function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Info_GetMetadataLog
Purpose Compatibility
Get list of metadata logs from
specific criteria. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetMetadataLog (void* handle,
Np_MetadataSearchCriterion criterion,
Np_MetadatalogList& list,
bool& isLogExceedMaxLimit);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] criterion Data structure specify the information of
query criteria. See
50
Np_MetadataSearchCriterion for more
detail
[OUT] list List of logs. The maximum number of logs
in each query is 10000.
[OUT] isLogExceedMaxLimit Set this flag to true if the number of
queried logs is larger than 10000
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseMetadataLogs function
This function is MainConsole Playback only.
51
Info_ReleaseMetadataLog
Purpose Compatibility
Release the resources allocated by
Info_GetMetadataLog. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseMetadataLog (void* handle,
Np_MetadatalogList& metadataLogList);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar /
[OUT] options
The list passed to previous successful call
of Info_GetMetadataLog. After calling this
function, the list will be released and
should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h
This function is MainConsole Playback only.
52
Info_GetMetadataSourceList
Purpose Compatibility
Get list of metadata source. Mainconsole Family only.
Syntax:
Np_Result_t Info_GetMetadataSourceList (void* handle,
Np_MetadataSourceList& list);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] list List of metadata sources
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Info_ReleaseMetadataSourceList function
This function is MainConsole Playback only.
53
Info_ReleaseMetadataSourceList
Purpose Compatibility
Release the resources allocated by
Info_GetMetadataSourceList. Mainconsole Family only.
Syntax:
Np_Result_t Info_ReleaseMetadataSourceList (void* handle,
Np_MetadataSourceList& list);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar /
[OUT] options
The list passed to previous successful call
of Info_GetMetadataSourceList. After
calling this function, the list will be
released and should never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
54
Info_GetBackupFileSize
Purpose Compatibility
Preview the total size of backup
files Mainconsole Family only.
Syntax:
Np_Result_t Info_GetBackupFileSize (void* handle,
Np_DateTime startTime,
Np_DateTime endTime,
Np_IDList backupIdList,
Np_SequencedRecordList &seqRecordList,
bool isIncluedExeFile,
unsigned long long& size);;
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] startTime, The start time of interval
[IN] endTime, The end time of interval
[IN] backupIdList, The list of camera device id
[IN] seqRecordList, Records to be backuped.
[IN] isIncluedExeFile, Reserved
[OUT] size The total size of backup files
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
55
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
This function is MainConsole Playback only.
56
Info_UpdateDeviceInfo
Update Device list Mainconsole Family only.
Syntax:
Np_Result_t Control_PTZ_CS_Ext (void* handle,
Np_DeviceCapability deviceCapability);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] deviceCapability
The bit wise combination of flags for the
supported capabilities, see the enum
“Np_DeviceCapability” in NpClient.h for
the meaning of each flag.
Control_PTZ_CS_Ext
Purpose Compatibility
Use PTZ operation of the camera For all platform.
Syntax:
Np_Result_t Control_PTZ_CS_Ext (void* handle,
Np_ID_Ext id,
Np_PTZControlParam_CS *param);
Parameters:
57
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id
The identify of Camera device. This id
information can be referred from
Np_Device_Ext.
[IN] param
The operation of PTZ. Ctrl+click
Np_PTZControlParam_CS for its
definition.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
58
Control_PTZ_PTZDeviceID_CS_Ext
Purpose Compatibility
Use PTZ operation of the camera
by the ID of “PTZ device” For all platform.
Syntax:
Np_Result_t Control_PTZ_PTZDeviceID_CS_Ext (void* handle,
Np_ID_Ext id,
Np_PTZControlParam_CS *param);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] id
The identity of PTZ device. This id
information is retrieved from the devices
in PTZDevices field of Np_Device_Ext.
[IN] param
The operation of PTZ. Ctrl+click
Np_PTZControlParam_CS for its
definition.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
59
Control_DigitalOutput_Ext
Purpose Compatibility
Set/unset the digital output pin For all platform.
Syntax:
Np_Result_t Control_DigitalOutput_Ext (void* handle,
Np_ID_Ext id,
bool turnOn);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] id
The identity of digital ouput device(pin).
This id information is retrieved from the
devices in DODevices field of
Np_Device_Ext.
[IN] turnOn Flag indicating the pin should be set or
unset.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
60
Control_SetPatrol
Purpose Compatibility
Change the patrol setting Mainconsole Family only.
Syntax:
Np_Result_t Control_SetPatrol( void *handle,
Np_ID id,
const Np_PTZPatrol_CS &info);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id
The identity of PTZ device. This id
information is retrieved from the devices
in PTZDevices field of Np_Device_CS.
[IN] info The patrol setting.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
61
Talk_Enable
Purpose Compatibility
Get the supported audio format
of the device, and initialize to
send audio packet to it.
Mainconsole Family only.
Syntax:
Np_Result_t Talk_Enable (void* handle, Np_ID* id, Np_TalkAudioFormat
&fmt );
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] id The identification of camera device, which
can be referred from Np_Device_CS
[OUT] fmt
The audio format that device supports.
Ctrl+Click the Np_TalkAudioFormat listed
above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
SDK will stop this function automatically while users don’t call Talk_SendAudioPacket
function to send a audio packet to the device in one minute or there are client to
enable Talk function.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
62
Only supported on win32 platform.
63
Talk_Disable
Purpose Compatibility
Stop sending the audio packet to
the device. Mainconsole Family only.
Syntax:
Np_Result_t LiveView_DisableTalk (void* handle );
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Only supported on win32 platform.
64
Talk_SendAudioPacket
Purpose Compatibility
Send the audio packet to the
device. Mainconsole Family only.
Syntax:
Np_Result_t LiveView_TalkToDevice (void* handle, char* buf, int size);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] buf The buffer of the audio packet.
[IN] size The size of the audio packet.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This function only supported PCM audio format.
Talk will be disabled if users don’t call Talk_SendAudioPacket function to send audio
packets to the device in a minute or there are other clients enabled Talk.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
65
If the return value is Np_Result_SOCKET_ERROR, it means that Talk was disabled and
need to enable again.
Only supported on win32 platform.
66
Talk_GetEnableID
Purpose Compatibility
Get the identification of the camera
device that is enabled to receive
audio from SDK.
Mainconsole Family only.
Syntax:
Np_Result_t Talk_GetEnableID (void* handle,
Np_ID& id);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] id
The identification of camera device,
which can be referred from
Np_Device_CS.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
Only supported on win32 platform.
67
Event_Subscribe
Purpose Compatibility
Subscribe event notification from
server. Mainconsole Family only.
Syntax:
Np_Result_t Event_Subscribe (void* handle,
void** session,
fnEventHandle callback,
void* ctx);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] session Session of the subscriber.
[IN] callback Callback function, called when event
present.
[IN]ctx
Extra information which will be carried to
each callback function call as a parameter.
Reserved for programmer’s usage.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
68
a new handle is required to be re-created.
The event possible values are(defined in NpClientDefine.h):
MainConsole
Np_EVENT_SMART_GUARD_ON_SCREEN_DISPLAY_START
Np_EVENT_SMART_GUARD_ON_SCREEN_DISPLAY_STOP
Np_EVENT_SMART_GUARD_SOUND_ALERT_START
Np_EVENT_SMART_GUARD_SOUND_ALERT_STOP
Np_EVENT_RECORD_STATUS_UPDATE
Np_EVENT_COUNTING
Np_EVENT_COUNTING_STOP
Np_EVENT_SERVER_CONNECTION_LOST
Np_EVENT_DEVICE_TREELIST_UPDATED
Np_EVENT_SYSTEM_HEALTH_UNUSUAL
Np_EVENT_DISK_SPACE_EXHAUSTED
Np_EVENT_RESOURCE_DEPLETED
Np_EVENT_NETWORK_CONGESTION
Np_EVENT_TALK_BE_RESERVED
Np_EVENT_EMAP_POPUP_AND_UPDATE_EVENT_START
Np_EVENT_EMAP_POPUP_AND_UPDATE_EVENT_STOP
Mini and Mini2
Np_EVENT_RECORD_STATUS_UPDATE
Np_EVENT_SIGNAL_LOST
Np_EVENT_SIGNAL_RESTORE
Np_EVENT_MOTION_START
Np_EVENT_MOTION_STOP
Np_EVENT_SERVER_CONNECTION_LOST:
Np_EVENT_INPUT_OPENED
Np_EVENT_INPUT_CLOSED
Np_EVENT_CONNECTION_LOST
Np_EVENT_DEVICE_TREELIST_UPDATED
Np_EVENT_DISK_ABNORMAL
Np_EVENT_DISK_SPACE_EXHAUSTED
Np_EVENT_DAILY_REPORT
Np_UNABLE_ACCESS_FTP
Np_UNFINISHED_BACKUP
Np_EVENT_EMAP_POPUP_AND_UPDATE_EVENT_START
69
Np_EVENT_EMAP_POPUP_AND_UPDATE_EVENT_STOP
Event_Unsubscribe
Purpose Compatibility
Unsubscribe the event
notification. Mainconsole Family only.
Syntax:
Np_Result_t Event_Unsubscribe (void* session);
Parameters:
Name Meaning
[IN] session Session created by the call of
Event_Subscribe.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
70
Event_SubscribeExt
Purpose Compatibility
Subscribe event notification from
server. For Titan/Crystal only
Syntax:
Np_Result_t Event_Subscribe (void* handle,
void** session,
fnEventHandle callback,
void* ctx);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] session Session of the subscriber.
[IN] callback Callback function, called when event
present.
[IN]ctx
Extra information which will be carried to
each callback function call as a parameter.
Reserved for programmer’s usage.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
71
The event possible values are(defined in NpClientDefine.h):
Titan/Crystal
Np_EVENT_MOTION_START
Np_EVENT_CONNECTION_LOST
Np_EVENT_INPUT_OPENED
Np_EVENT_SERVER_CONNECTION_LOST
Np_EVENT_DEVICE_TREELIST_UPDATED
Np_EVENT_DISK_ABNORMAL
Event_UnsubscribeExt
Purpose Compatibility
Unsubscribe the event
notification. For Titan/Crystal only
Syntax:
Np_Result_t Event_Unsubscribe (void* session);
Parameters:
Name Meaning
[IN] session Session created by the call of
Event_SubscribeExt.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
72
Event_DuplicateFilter
Filter same event won’t callback
during the timer. Mainconsole Family only.
Syntax:
Np_Result_t Event_DuplicateFilter (void* handle,
Int timer);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] timer Set the time to make sure the same event
won’t callback.
73
LiveView_CreatePlayer
Purpose Compatibility
Build the player for the server, the
player can own multiple camera
session
For all platform.
Syntax:
Np_Result_t LiveView_CreatePlayer (void* handle,
void** player);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[OUT] player The player of liveview
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
LiveView_DestroyPlayer function.
74
LiveView_DestroyPlayer
Purpose Compatibility
Destroy the player For all platform.
Syntax:
Np_Result_t LiveView_DestroyPlayer (void* player);
Parameters:
Name Meaning
[IN] player The player that created by
LiveView_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
75
LiveView_AttachSessionExtExt
Purpose Compatibility
See the live image of the camera
with specific pixel format For all platform.
Syntax:
Np_Result_t LiveView_AttachSessionExtExt (void* player,
void** session,
Np_ID_Ext id,
Np_StreamProfile profile,
Np_PixelFormat videoPixalFormat,
fnVideoHandle vcb,
void* vctx,
fnAudioHandle acb,
void* actx,
fnErrorHandle ecb,
void* ectx);
Parameters:
[IN] player Player allocated by
LiveView_CreatePlayer
[OUT] session Session of the camera
[IN] id
This id information is retrieved from
the devices in SensorDevices field of
Np_Device_Ext.
[IN] videoPixelFormat
Pixel format, possible values are:
kPixelFormatYUV420P
kPixelFormatRGB24
kPixelFormatBGR24
[IN] profile
Desired stream profile. The
supported values are
kProfileNormal
kProfileOriginal
76
kProfileLow
kProfileMinimum
[IN] vcb Callback function for receiving image
[IN] vctx Reserved for programmer’s usage
[IN] acb Callback function for audio retrieval
[IN] actx Reserved for programmer’s usage
[IN] ecb Callback function for receive image
[IN] ectx Reserved for programmer’s usage
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
LiveView_DetachSessionExtExt function.
fnVideoHandle , fnAudioHandle, and fnErrorHandle are function pointers and their
definition can be found at NpClient.h.
77
LiveView_DetachSessionExtExt
Purpose Compatibility
Disconnect the specified camera For all platform.
Syntax:
Np_Result_t LiveView_DetachSessionExtExt (void* player,
void* session);
Parameters:
Name Meaning
[IN] player The player created by
LiveView_CreatePlayer
[IN] session The session the returned by
LiveView_AttachSessionExtExt
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
78
LiveView_AttachRawVideoSession
Purpose Compatibility
See the live image of the camera
in raw data(not decoded),
allowing programmer to decode
image frame via their own
decoder.
Mainconsole Family only.
Syntax:
Np_Result_t LiveView_AttachRawVideoSession (void* player,
void** session,
Np_ID id,
Np_StreamProfile profile,
fnRawVideoHandle vcb,
void* vctx,
fnAudioHandle acb,
void* actx,
fnErrorHandle ecb,
void* ectx);
Parameters:
Only describe id, vcb here, for the rest, please refer to LiveView_AttachSessionExtExt.
Name Meaning
[IN] id
This id information is retrieved from
the devices in SensorDevices field
of Np_Device_CS.
[IN] vcb Callback function for receiving raw
image
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
79
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
LiveView_DetachSessionExtExt function.
fnRawVideoHandle , fnAudioHandle, and fnErrorHandle are function pointers and
their definition can be found at NpClient.h.
80
LiveView_SetAudioOn
Purpose Compatibility
Turn on audio for specific
LiveView session, default is off. For all platform.
Syntax:
Np_Result_t LiveView_SetAudioOn (void* player, void* session);
Parameters:
Name Meaning
[IN] player The player that created by
LiveView_CreatePlayer
[IN] session The session that created by
LiveView_AttachSessionExtExt
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Only one session can be set audio on at a time. Therefore, If turn one on, others will
be set audio off automatically.
81
LiveView_SetAudioOff
Purpose Compatibility
Turn off audio for all LiveView
sessions. For all platform.
Syntax:
Np_Result_t LiveView_SetAudioOff (void* player);
Parameters:
Name Meaning
[IN] player The player that created by
LiveView_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
82
LiveView_GetSessionAudioStatus
Purpose Compatibility
Get audio status of a session. Mainconsole Family only.
Syntax:
Np_Result_t LiveView_GetSessionAudioStatus (void* player, void* session.
Np_AudioStatus &status );
Parameters:
Name Meaning
[IN] player The player that created by
LiveView_CreatePlayer
[IN] session
The session that created by
LiveView_AttachSessionExtExt
LiveView_AttachRawVideoSession
[OUT] status
Audio status of session. The value is
possible
kAUDIO_OFF
kAUDIO_ON
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
83
LiveView_GetSessionCurrentImage
Purpose Compatibility
Get the latest image of a session. For all platform.
Syntax:
Np_Result_t LiveView_GetSessionCurrentImage (void* player, void* session.
Np_Frame &frame );
Parameters:
Name Meaning
[IN] player The player that created by
LiveView_CreatePlayer
[IN] session
The session that created by
LiveView_AttachSessionExtExt
LiveView_AttachRawVideoSession
[OUT] frame
The information of the latest receive
frame. Ctrl+Click the Np_Frame
listed above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
LiveView_ReleaseSessionCurrentImage function.
84
LiveView_ReleaseSessionCurrentImage
Purpose Compatibility
Release all the resources allocated by
LiveView_GetSessionCurrentImage. For all platform.
Syntax:
Np_Result_t LiveView_ReleaseSessionCurrentImage (void* player, Np_Frame
&frame);
Parameters:
Name Meaning
[IN] player Player pointer created by
LiveView_CreatePlayer
[OUT] frame
The variable passed to previous
successful call of
LiveView_GetSessionCurrentImage.
After calling this function, the list
will be released and should never
be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
85
LiveView_SubscribeMetadata
Purpose Compatibility
Subscribe metadata notification
from server. Mainconsole Family only.
Syntax:
Np_Result_t LiveView_SubscribeMetadata (void* handle,
fnMetadataHandle mcb,
void* mctx);
Parameters:
Name Meaning
[IN] handle
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe
[IN] mcb Callback function, called when metadata
present.
[IN] mctx
Extra information which will be carried to
each callback function call as a parameter.
Reserved for programmer’s usage.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
86
LiveView_UnsubscribeMetadata function.
87
LiveView_UnsubscribeMetadata
Purpose Compatibility
Unsubscribe the metadata
notification and release the
memory allocated by
LiveView_SubscribeMetadata
Mainconsole Family only.
Syntax:
Np_Result_t LiveView_SubscribeMetadata (void* handle);
Parameters:
Name Meaning
[IN] session
The handle allocated by
Create_HandleWChar /
Create_Handle_And_Event_Subscribe.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
Playback_CreatePlayer
88
Purpose Compatibility
Create playback channel For all platform.
Syntax:
Np_Result_t Playback_CreatePlayer (void* handle,
void** player);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] player Player pointer for requesting recorded
video
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
This SDK supports playback capability from multiple video servers.
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Playback_DestroyPlayer function.
89
Playback_DestroyPlayer
Purpose Compatibility
Destroy playback player For all platform.
Syntax:
Np_Result_t Playback_DestroyPlayer (void* player);
Parameters:
Name Meaning
[IN] player Player pointer created by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
90
PlayBack_AttachSession1ExtExt
Purpose Compatibility
Select the channel for viewing
recorded video with specific pixel
format
For all platform.
Syntax:
Np_Result_t PlayBack_AttachSession1ExtExt (void* player,
void** session,
Np_ID_Ext id,
Np_PixelFormat videoPixalFormat,
int recordIndex,
fnVideoHandle vcb,
void* vctx,
fnAudioHandle acb,
void* actx,
fnErrorHandle ecb,
void* ectx);
Parameters:
Name Meaning
[IN] player Player pointer created by
Playback_CreatePlayer
[OUT] session Session of the camera
[IN] id
This id information is retrieved from
the devices in SensorDevices field
of Np_Device_Ext.
[IN] videoPixalFormat
Pixel format, possible values are:
kPixelFormatYUV420P
kPixelFormatRGB24
kPixelFormatBGR24
[IN] recordIndex Dual record index
91
[IN] vcb Callback function for image
retrieval
[IN] vctx Reserved for programmer’s usage
[IN] acb Callback function for audio retrieval
[IN] actx Reserved for programmer’s usage
[IN] ecb The callback function for receive
image
[IN] ectx Reserved for programmer’s usage
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
PlayBack_DetachSessionExtExt function.
fnVideoHandle , fnAudioHandle, and fnErrorHandle are function pointers and their
definition can be found at NpClient.h.
92
PlayBack_DetachSessionExtExt
Purpose Compatibility
Disconnect the specified session For all platform.
Syntax:
Np_Result_t PlayBack_DetachSessionExtExt (void* player,
void* session);
Parameters:
Name Meaning
[IN] player Player pointer created by
Playback_CreatePlayer
[IN] session Session pointer returned by
PlayBack_AttachSession1ExtExt
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
93
PlayBack_AttachRawVideoSession
Purpose Compatibility
Select the channel for viewing
recorded video in raw data(not
decoded), allowing programmer
to decode video frame via their
own decoder.
Mainconsole Family only.
Syntax:
Np_Result_t PlayBack_AttachRawVideoSession (void* player,
void** session,
Np_ID id,
fnRawVideoHandle vcb,
void* vctx,
fnAudioHandle acb,
void* actx,
fnErrorHandle ecb,
void* ectx);
Parameters:
Only describe id and vcb here, for the rest, please refer to Playback_AttachSession.
Name Meaning
[IN] id
The identification of PTZ device,
which can be referred from
Np_Device_CS.
[IN] vcb Callback function for receiving raw
image
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
94
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Playback_DetachSessionExtExt function.
fnRawVideoHandle , fnAudioHandle, and fnErrorHandle are function pointers and
their definition can be found at NpClient.h.
95
PlayBack_Seek
Purpose Compatibility
Seek current opened record to
specific time. For all platform.
Syntax:
Np_Result_t PlayBack_Seek (void* player , Np_DateTime time);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
[IN] time Time to seek to.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
If SDK connects to Titan/Corporate server, the state of the player will be changed to
pause after calling this function.
96
PlayBack_OpenRecord
Purpose Compatibility
Open recorded video for all
sessions attached on a specified
player
For all platform.
Syntax:
Np_Result_t PlayBack_OpenRecord (void* player,
Np_DateTime startTime,
Np_DateTime endTime);
Parameters:
Name Meaning
[IN] player Player pointer allocated by
Playback_CreatePlayer
[IN] startTime Start time of the video
[IN] endTime End time of the video
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
97
PlayBack_OpenSequencedRecord
Purpose Compatibility
Open recorded video for all
sessions attached on a specified
player
Mainconsole Family only.
Syntax:
Np_Result_t PlayBack_OpenSequencedRecord (void* player,
Np_DateTime startTime,
Np_DateTime endTime,
Np_SequencedRecordList &seqRecordList);
Parameters:
Name Meaning
[IN] player Player pointer allocated by
Playback_CreatePlayer
[IN] startTime Start time of the video
[IN] endTime End time of the video
[IN] seqRecordList Records to be opened
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
It will return Np_ERROR_CONNECT_SUCCESS to fnErrorHandle function to notify the
98
action is completed.
This function is MainConsole Playback only.
99
PlayBack_Play
Purpose Compatibility
Start to play the video For all platform.
Syntax:
Np_Result_t PlayBack_Play (void* player);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
100
PlayBack_ReversePlay
Purpose Compatibility
Play I-Frame at a recorded video
reversely For all platform.
Syntax:
Np_Result_t PlayBack_ReversePlay (void* player);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
This function is only supported by Corporate and Titan recording servers.
Not being supported in SDK 4.0
101
PlayBack_Pause
Purpose Compatibility
Pause the video For all platform.
Syntax:
Np_Result_t PlayBack_Pause (void* player);
Parameters:
Name Meaning
[IN] player Player pointer allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
102
PlayBack_StepForward
Purpose Compatibility
Retrieve image at the next 0.03
second For all platform.
Syntax:
Np_Result_t PlayBack_StepForward (void* player);
Parameters:
Name Meaning
[IN] player Player pointer allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
103
PlayBack_StepBackward
Purpose Compatibility
To see the next 0.03 second
image of current time For all platform.
Syntax:
Np_Result_t PlayBack_StepBackward (void* player);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
you need create a new handle.
104
PlayBack_Next
Purpose Compatibility
Retrieve image at the next minute For all platform.
Syntax:
Np_Result_t PlayBack_Next (void* player);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
105
PlayBack_Previous
Purpose Compatibility
To see the next one minute image
of current time For all platform.
Syntax:
Np_Result_t PlayBack_Previous (void* player);
Parameters:
Name Meaning
[IN] player The player allocated by
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
106
PlayBack_SetSpeed
Purpose Compatibility
Set the speed of playing video For all platform.
Syntax:
Np_Result_t PlayBack_SetSpeed (void* player,
float speed);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[IN] speed Speed of video play
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
107
PlayBack_GetSpeed
Purpose Compatibility
Get the speed of the video player For all platform.
Syntax:
Np_Result_t PlayBack_GetSpeed (void* player,
float &speed);
Parameters:
Name Meaning
[IN] player Player pointer retrieved by
Playback_CreatePlayer
[OUT] speed Speed of the video player
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
108
PlayBack_GetTime
Purpose Compatibility
Time instance of the current
displayed image For all platform.
Syntax:
Np_Result_t PlayBack_GetTime (void* player,
Np_DateTime &time);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[OUT] time Time instance of the current image
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
109
PlayBack_GetPlayerState
Purpose Compatibility
Get player status(playing/ paused
/ stopped) Mainconsole Family only.
Syntax:
Np_Result_t PlayBack_GetPlayerState(void* player, Np_PlayerState &state);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[OUT] state
Status of player, possible values are:
kStateStopped
kStatePaused
kStateRunning
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
110
PlayBack_ExportVideo
Purpose Compatibility
Export the content of specific
playback session to a video file Mainconsole Family only.
Syntax:
Np_Result_t PlayBack_ExportVideo (void* player,
Np_ExportContent content,
const wchar_t* filename,
int format,
int profile,
fnExportHandle ecb, void* ectx,
fnOSDHandle ocb, void* octx);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[IN]content
Data structure specify the
information of the content to
export. See Np_ExportContent for
more detail
[IN]filename File path of the output video file
[IN]format
Format identifier number of the
output video, get the support
format/profile list via
PlayBack_GetExportFormatList
[IN]profile
Profile identifier number under the
specified format, get the support
format/profile list via
PlayBack_GetExportFormatList
111
[IN]ecb Callback function for export
event/progress notification
[IN]ectx Reserved for programmer’s usage
[IN]ocb Callback function for OSD blending
[IN] octx Reserved for programmer’s usage
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
112
PlayBack_StopExport
Purpose Compatibility
Stop/Cancel the export procedure
triggered by previous call of
PlayBack_ExportVideo
Mainconsole Family only.
Syntax:
Np_Result_t PlayBack_StopExport (void* player);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
113
PlayBack_ExportVideo_Ext
Purpose Compatibility
Export the content of specific
playback session to a video file For Titan/Crystal only
Syntax:
Np_Result_t PlayBack_ExportVideo (void* player,
Np_ExportContent content,
const wchar_t* filename,
int format,
int profile,
fnExportHandleExt ecb, void* ectx,
fnOSDHandleExt ocb, void* octx);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[IN]content
Data structure specify the
information of the content to
export. See Np_ExportContent for
more detail
[IN]filename File path of the output video file
[IN]format
Format identifier number of the
output video, get the support
format/profile list via
PlayBack_GetExportFormatList
[IN]profile
Profile identifier number under the
specified format, get the support
format/profile list via
PlayBack_GetExportFormatList
114
[IN]ecb Callback function for export
event/progress notification
[IN]ectx Reserved for programmer’s usage
[IN]ocb Callback function for OSD blending
[IN] octx Reserved for programmer’s usage
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
PlayBack_StopExport_Ext
Purpose Compatibility
Stop/Cancel the export procedure
triggered by previous call of
PlayBack_ExportVideo_Ext
For Titan/Crystal only
Syntax:
Np_Result_t PlayBack_StopExport (void* p_handle);
Parameters:
Name Meaning
[IN] p_handle The handle allocated by
Create_HandleWChar
115
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
PlayBack_GetExportFormatList
Purpose Compatibility
Get supported export format list
for current OS and server type For all platform.
Syntax:
Np_Result_t PlayBack_GetExportFormatList(void* player, Np_ExportFormatList&
fmtlist);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[OUT] fmtlist
List of the result formats, see
Np_ExportFormatList for more
detail.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
116
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
PlayBack_ReleaseExportFormatList function.
117
PlayBack_ReleaseExportFormatList
Purpose Compatibility
Release all the resource allocated
by PlayBack_GetExportFormatList For all platform.
Syntax:
Np_Result_t PlayBack_ReleaseExportFormatList(void* player,
Np_ExportFormatList& fmtlist);
Parameters:
Name Meaning
[IN] player Player pointer retrieved from
Playback_CreatePlayer
[OUT] fmtlist
The format list passed to
previous successful call of
PlayBack_GetExportFormatList
. After calling this function, the
list will be released and should
never be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
118
Playback_GetSessionCurrentImage
Purpose Compatibility
Get the latest receive image of a
session. For all platform.
Syntax:
Np_Result_t Playback_GetSessionCurrentImage (void* player, void* session.
Np_Frame &frame );
Parameters:
Name Meaning
[IN] player The player that created by
PlayBack_CreatePlayer
[IN] session
The session that created by
PlayBack_AttachSession1ExtExt
PlayBack_AttachRawVideoSession
[OUT] frame
The information of the latest receive
frame. Ctrl+Click the Np_Frame
listed above to check its structure
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, this handle should be destroyed and
a new handle is required to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
PlayBack_ReleaseSessionCurrentImage function.
119
PlayBack_ReleaseSessionCurrentImage
Purpose Compatibility
Release all the resources allocated by
PlayBack_GetSessionCurrentImage. For all platform.
Syntax:
Np_Result_t PlayBack_ReleaseSessionCurrentImage (void* player, Np_Frame
&frame);
Parameters:
Name Meaning
[IN] player Player pointer created by
PlayBack_CreatePlayer
[OUT] frame
The variable passed to previous
successful call of
PlayBack_GetSessionCurrentImage.
After calling this function, the list
will be released and should never
be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
120
Backup_Initial
Purpose Compatibility
Initialize the backup setting. Mainconsole Family only.
Syntax:
Np_Result_t Backup_Initial (void* handle,
Np_DateTime startTime,
Np_DateTime endTime,
Np_IDList backupIdList,
Np_SequencedRecordList &seqRecordList,
bool includeEventLog,
bool includeCounterLog,
bool includeSystemLog,
bool includeMatadataRecord,
bool includeExeFiles,
fnBackupHandle bcb,
void* bctx
);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[IN] startTime, The start time of backup interval
[IN] endTime,, The end time of backup interval
[IN] backupIdList The camera id list of backup
[IN] seqRecordList Specify the overlapping records
121
[IN] includeEventLog The flag for including event logs or
not
[IN] includeCounterLog The flag for including counter logs
or not
[IN] includeSystemLog The flag for including system logs or
not
[IN] includeMatadataRecord The flag for including m logs or not
[IN] includeExeFiles Reserved
[IN] bcb Callback function for backup event
notification
[IN] bctx Reserved for programmer’s usage
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
If the return value is Np_Result_FATAL_ERROR, the handle should be destroyed and
a new handle needs to be re-created.
It is programmer’s responsibility to release the allocated memory by calling
Backup_Uninit function.
This function is MainConsole Playback only.
122
Backup_Uninit
Purpose Compatibility
Uninitialize the backup setting
and release the memory allocated
by Backup_Initial.
Mainconsole Family only.
Syntax:
Np_Result_t Backup_Uninit (void* handle);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
123
Backup_GetBackupFileItemList
Purpose Compatibility
Get backup file list Mainconsole Family only.
Syntax:
Np_Result_t Backup_GetBackupFileItemList (void* handle,
Np_BackupItemList& backupItemList);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] backupItemList The list of file items
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
It is programmer’s responsibility to release the allocated memory by calling
Backup_ReleaseBackupFileItemList function.
This function is MainConsole Playback only.
124
Backup_ReleaseBackupFileItemList
Purpose Compatibility
Release all the resources
allocated by
Backup_GetBackupFileItemList
Mainconsole Family only.
Syntax:
Np_Result_t Backup_ReleaseBackupFileItemList (void* handle,
Np_BackupItemList& backupItemList);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] backupItemList
The variable passed to previous
successful call of
Backup_GetBackupFileItemList.
After calling this function, the list
will be released and should never
be used again.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
125
Backup_SetBackupDestinationDir
Purpose Compatibility
Specify the path to save files Mainconsole Family only.
Syntax:
Np_Result_t Backup_SetBackupDestinationDir (void* handle,
const wchar_t* dir);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
[OUT] dir The saving path of backup files
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
126
Backup_Start
Purpose Compatibility
Start to backup files. Mainconsole Family only.
Syntax:
Np_Result_t Backup_Start (void* handle);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
127
Backup_Pause
Purpose Compatibility
Pause the backup procedure
triggered by previous call of
Backup_Start
Mainconsole Family only.
Syntax:
Np_Result_t Backup_Pause (void* handle);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
128
Backup_Resume
Purpose Compatibility
Restart the backup procedure
triggered by previous call of
Backup_Pause
Mainconsole Family only.
Syntax:
Np_Result_t Backup_Resume (void* handle);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
129
Backup_Abort
Purpose Compatibility
Cancel the backup procedure
triggered by previous call of
Backup_Start
Mainconsole Family only.
Syntax:
Np_Result_t Backup_Abort (void* handle);
Parameters:
Name Meaning
[IN] handle The handle allocated by
Create_HandleWChar
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
This function is MainConsole Playback only.
130
Utility_SaveSnapShotImage
Purpose Compatibility
Save snapshot image to a file. For all platform.
Syntax:
Np_Result_t Utility_SaveSnapShotImage(const wchar_t* filename,
const char* buffer,
int len,
int width,
int height);
Parameters:
Name Meaning
[IN] filename Full path of the destination image
file.
[IN] buffer Image buffer of the snapshot image
in RGB24 format.
[IN] len Length of image buffer, in byte, only
for verification.
[IN] width Width of the image.
[IN] height Height of the image.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
131
Only support Windows BMP and JPEG format, the format of the saved image
depends on the file extension specified in the “filename” parameter. (“.bmp” for
Windows BMP and “.jpg”/”.jpeg” for JPEG).
132
Utility_AddImageWaterMark
Purpose Compatibility
Add MD5 watermark to a saved
image file For all platform.
Syntax:
Np_Result_t Utility_AddImageWaterMark(const wchar_t* filename,
Np_DateTime &time,
const wchar_t* cameraname);
Parameters:
Name Meaning
[IN] filename Full path of the image file.
[IN] time Time of current image.
[IN] cameraname Camera name of the source device.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
Only support Windows BMP and JPEG format image, while the format is retrieved via
file extension of the parameter “filename”.(“.bmp” for Windows BMP and
“.jpg”/”.jpeg” for JPEG).
133
Utility_AddVideoWaterMark
Purpose Compatibility
Add MD5 watermark to a saved
video file For all platform.
Syntax:
Np_Result_t Utility_AddVideoWaterMark(const wchar_t* filename,
Np_DateTime &start_time,
Np_DateTime &end_time,
const wchar_t* cameraname);
Parameters:
Name Meaning
[IN] filename Full path of the video file.
[IN] start_time Start time of current video.
[IN]end_time End time of current video.
[IN] cameraname Camera name of the source device.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
Only support Windows AVI、ASF and MOV format image, while the format is
retrieved via file extension of the parameter “filename”.(“.avi” for Windows AVI and
“.asf” for ASF, “.mov” for MOV).
134
Utility_ScaleImage
Purpose Compatibility
Scale a image or transform its
color space. For all platform.
Syntax:
Np_Result_t Utility_ScaleImage(unsigned char *p_dst,
int dst_width,
int dst_height,
int dst_stride,
Np_PixelFormat dst_format,
unsigned char *p_src,
int src_width,
int src_height,
int src_stride,
Np_PixelFormat src_format);
Parameters:
Name Meaning
[OUT] p_dst The buffer of the target image.
[IN] dist_width The width of the target image.
[IN] dist_height The height of the target image.
[IN] dist_stride The stride of the target image
[IN]dst_format
The pixel format of the target
image, , possible values are:
kPixelFormatYUV420P
kPixelFormatRGB24
kPixelFormatBGR24
135
[IN] p_src The buffer of the source image.
[IN] src_width The width of the source image.
[IN] src_height The height of the source image.
[IN] src_stride The stride of the source image
[IN] src_format
The pixel format of the source
image, possible values are:
kPixelFormatYUV420P
kPixelFormatRGB24
kPixelFormatBGR24
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
136
Np_DateTime
Syntax:
typedef struct {
WORD year;
WORD month;
WORD day;
WORD hour;
WORD minute;
WORD second;
WORD millisecond;
} Np_DateTime;
Member:
Name Meaning
year In Anno Domini (AD). This value
ranges from 1601 to 30827.
month
This value is 1-to-1 mapping to
calendar month.
1 : January
2 : February
3 : March
4 : April
5 : May
6 : June
7 : July
8 : August
9 : September
10 : October
11 : November
12 : December
day The day of the month, ranging from
1 to 31.
137
hour Keeping in 24-hour clock
minute Ranging from 0 to 59
second Ranging from 0 to 59
millisecond Ranging from 0 to 999.
138
Np_Frame
Syntax:
typedef struct {
Np_DateTime time;
char* buffer;
int len;
int width;
int height;
} Np_Frame;
Member:
Name Meaning
time The time of the image.
buffer The buffer of the image.
len The size of the image buffer.
width The width of the image.
height The height of the image.
139
Np_ID
Syntax:
typedef struct {
int centralID;
int localID;
} Np_ID;
Member:
Name Meaning
centralID Identity of the server
localID Identity of the camera in a server
140
Np_ID_Ext
Syntax:
typedef struct {
long long centralID;
long long localID;
} Np_ID_Ext;
Member:
Name Meaning
centralID Identity of the server
localID Identity of the camera in a server
141
Np_IDList
Syntax:
typedef struct {
int size;
Np_ID* IDList;
} Np_IDList;
Member:
Name Meaning
size The size of list.
IDList Pointer of the array of the identity,
in format of Np_ID.
142
Np_Period
Syntax:
struct Np_Period{
Np_DateTime startTime;
Np_DateTime endTime;
};
Member:
Name Meaning
startTime The start time of the period.
endTime The end time of the period.
143
Np_SensorProfile
Syntax:
typedef struct {
Np_StreamProfile profile;
std::wstring frameRate;
std::wstring bitrate;
std::wstring resolution;
std::wstring codec;
std::wstring quality;
} Np_SensorProfile;
Member:
Name Meaning
profile Enumeration indicating quality level
of the profile.
frameRate Frame rate
bitrate Bit rate
resolution Resolution
codec Codec
quality Quality
144
Np_SubDevice
Syntax:
typedef struct {
Np_ID ID;
std::wstring name;
std::wstring description;
} Np_SubDevice;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID
name Device Name
description Device Description
145
Np_Device
Syntax:
typedef struct {
Np_ID ID;
std::wstring name;
std::wstring description;
std::vector<Np_SubDevice> SensorDevices;
std::vector<Np_SubDevice> PTZDevices;
std::vector<Np_SubDevice> AudioDevices;
std::vector<Np_SubDevice> DIDevices;
std::vector<Np_SubDevice> DODevices;
} Np_Device;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID
name Device Name
description Device Description
SensorDevices Additional devices associated to
this device
PTZDevices PTZ devices associated to this
device
AudioDevices Audio devices associated to this
device
DIDevices Digital Input devices associated to
this device
DODevices Digital Output devices associated to
this device
146
Np_DeviceGroup
Syntax:
typedef struct {
std::wstring name;
std::wstring description;
std::vector<Np_Device> Camera;
std::vector<Np_Device> IOBox;
} Np_DeviceGroup;
Member:
Name Meaning
name Server Name
description Server Description
Camera Cameras connected to the server
IOBOX Digital Input/Output box connected
to the server
147
Np_DeviceList
Syntax:
typedef struct {
std::vector<Np_DeviceGroup> PhysicalGroup;
std::vector<Np_DeviceGroup> LogicalGroup;
} Np_DeviceList;
Member:
Name Meaning
PhysicalGroup
A representation of the device
group with their physical
connection order
LogicalGroup
A representation of the device
group with a user-defined
relationship
Remarks:
Only Physical Group would be used by MainConsole Liveview and Playback.
148
Np_LogConditions
Syntax:
typedef struct {
bool operationLog;
bool configurationLog;
} Np_LogConditions;
Member:
Name Meaning
operationLog Whether the log is
Np_OperationLog
configurationLog Whether the log is
Np_ConfigurationLog
Remark:
Not being supported in SDK 4.0
149
Np_OperationLog
Syntax:
typedef struct {
Np_DateTime occurTime;
Np_ID sourceID;
int eventID;
std::wstring description;
} Np_OperationLog;
Member:
Name Meaning
occurTime Event occurrence time
sourceID Source device which generates this
event
eventID Event Identity
Description Log Description
Remark:
Not being supported in SDK 4.0
150
Np_ConfigurationLog
Syntax:
typedef struct {
Np_DateTime occurTime;
Np_ID sourceID;
int eventID;
std::wstring description;
std::wstring user;
std::wstring behavier;
} Np_ConfigurationLog;
Member:
Name Meaning
occurTime Event occurrence time
SourceID Source device which generates this
event
eventID Event Identity
description Log Description
User User name
Behavior Reserved for future use
Remark:
Not being supported in SDK 4.0
151
Np_Log
Syntax:
typedef struct {
std::vector<Np_OperationLog> opLog;
std::vector<Np_ConfigurationLog> cnfgLog;
} Np_Log;
Member:
Name Meaning
opLog A set of Np_OperationLog
cnfgLog A set of Np_ConfigurationLog
Remark:
Not being supported in SDK 4.0
152
Np_ScheduleLogItem
Syntax:
typedef struct {
Np_ID ID;
Np_DateTime startTime;
Np_DateTime endTime;
Np_ScheduleType type;
} Np_ScheduleLogItem;
Member:
Name Meaning
ID ID of the source device.
startTime System time of server when the
recording schedule starts.
endTime System time of server when the
recording schedule ends.
type
Type of the recording schedule, which
could be the following values:
kScheduleRecordOnly
kScheduleRecordMovingOnly
kScheduleRecordOnEvent
kScheduleRecordBoost
Other values in the enumeration
Np_ScheduleType are reserved.
153
Np_RecordLogItem
Syntax:
typedef struct {
Np_ID ID;
Np_DateTime startTime;
Np_DateTime endTime;
} Np_RecordLogItem;
Member:
Name Meaning
ID ID of the source device.
startTime System time of server when the
recorded video starts.
endTime System time of server when the
recorded video ends.
154
Np_RecordLogItemExt
Syntax:
typedef struct {
Np_ID_Ext ID;
Np_DateTime startTime;
Np_DateTime endTime;
} Np_RecordLogItem;
Member:
Name Meaning
ID ID of the source device.
startTime System time of server when the
recorded video starts.
endTime System time of server when the
recorded video ends.
Np_ScheduleLogList
Syntax:
typedef struct {
int size;
Np_ScheduleLogItem* logList;
} Np_ScheduleLogList;
Member:
Name Meaning
size Size of the list.
logList Pointer to array of
Np_ScheduleLogItem, containing
155
the entries of recording schedule.
156
Np_ScheduleLogListList
Syntax:
typedef struct {
int size;
Np_ScheduleLogList* logListList;
} Np_ScheduleLogListList;
Member:
Name Meaning
size Size of the list.
logListList
Pointer to array of
Np_ScheduleLogList, containing the
entries of recording schedule.
Np_RecordLogList
Syntax:
typedef struct {
int size;
Np_RecordLogItem* logList;
} Np_RecordLogList;
Member:
Name Meaning
size Size of the list.
logList
Pointer to array of
Np_RecordLogItem, containing the
log entries of video.
157
Np_RecordLogListExt
Syntax:
typedef struct {
int size;
Np_RecordLogItemExt* logList;
} Np_RecordLogList;
Member:
Name Meaning
size Size of the list.
logList
Pointer to array of
Np_RecordLogItemExt, containing
the log entries of video.
Np_SequencedRecordList
Syntax:
typedef struct {
int size;
Np_SequencedRecord *items;
} Np_RecordLogList;
Member:
Name Meaning
size Size of the list.
items
Pointer to array of
Np_SequencedRecord, containing
the log entries of video.
158
159
Np_SequencedRecord
Syntax:
struct Np_SequencedRecord{
Np_ID id;
Np_Period seqPeriod;
int startSeq;
int endSeq;
}
Member:
Name Meaning
id ID of the source device.
seqPeriod The time interval of the record.
startSeq The begin of sequence number
with respect to the record
endSeq; The end of sequence number with
respect to the record
160
Np_Event
Syntax:
typedef struct {
Np_DateTime occurTime;
Np_ID sourceID;
int eventID;
wchar_t* auxiliaryCode;
wchar_t* description;
wchar_t* sourceName;
} Np_Event;
Member:
Name Meaning
occurTime Time when the event present.
sourceID ID of the source device.
eventID Event type.
auxuliaryCode Reserved.
description Description of the event if any.
sourceName Reserved.
161
Np_EventList
Syntax:
typedef struct {
int size;
Np_Event* list;
} Np_EventList;
Member:
Name Meaning
size Size of the list.
list Array of Np_Event for the events.
162
Np_RecordDateList
Syntax:
typedef struct {
int size;
Np_DateTime* dateList;
} Np_RecordDateList;
Member:
Name Meaning
size Size of the list.
dateList Pointer of the array of the dates, in
format of Np_DateTime.
163
Np_MetadatalogList
Syntax:
typedef struct {
int size;
Np_MetadatalogItem* metadataList;
}Np_MetadatalogList;
Member:
Name Meaning
size Size of the list.
metadataList Pointer of the array of the logs, in
format of Np_MetadatalogItem.
164
Np_MetadatalogItem
Syntax:
typedef struct {
Np_IDList cameraIDList;
Np_DateTime metadataTime;
Np_ID metadataDeviceID;
int codepage;
int textDataLen;
char* textData;
} Np_MetadatalogItem;
Member:
Name Meaning
cameraIDList The list of camera device id that
need to display the metadata.
metadataTime The received time of metadata
metadataDeviceID The id of source metadata channel
device
codepage
The codepage of text. The
definition of codepage number is
equal to Windows.
textDataLen The length of the text.
textData The text of metadata.
165
Np_MetadataSearchCriterion
Syntax:
typedef struct {
Np_DateTime* startTime;
Np_DateTime* endTime;
Np_IDList metadataDeviceID;
wchar_t* keyWord;
bool usingRE;
} Np_MetadataSearchCriterion;
Member:
Name Meaning
startTime Start time of the query. Set it to
NULL for ignoring this criteria
endTime End time of the query Set it to NULL
for ignoring this criteria
metadataDeviceID; The source metadata channel id of
the query.
keyWord The keyword of the query. Set it to
NULL for ignoring this criteria
usingRE The keyWord is the format of
regular expression
166
Np_MetadataSourceList
Syntax:
typedef struct {
size_t size;
Np_MetadataSource* items;
} Np_MetadataSourceList;;
Member:
Name Meaning
size Size of the list.
items
Pointer of the array of the
metadata sources, in format of
Np_MetadataSource.
167
Np_MetadataSource
Syntax:
typedef struct {
Np_ID id;
wchar_t* name;
wchar_t* ip;
long port;
Np_MetadataSourceType type;
Np_MetadataChannelList channels;
} Np_MetadataSource;
Member:
Name Meaning
id The id of metadata source device.
name The name of metadata source
device.
ip The ip of metadata source device.
port The port of metadata source
device.
type
The type of metadata source
device, including
kMetadataNone
kMetadataPOS
kMetadataAccessControl
kMetadataLPR
channels The channels of metadata source
168
Np_MetadataChannelList
Syntax:
typedef struct {
size_t size;
Np_MetadataChannel* items;
}Np_MetadataChannelList;;
Member:
Name Meaning
size Size of the list.
items Pointer of the array of the channels,
in format of Np_MetadataChannel.
169
Np_MetadataChannel
Syntax:
typedef struct {
Np_ID id;
wchar_t* name;
}Np_MetadataChannel;
Member:
Name Meaning
id; The id of metadata channel device
name The name of metadata channel
device.
170
Np_PTZContinuousMove
Syntax:
typedef struct {
Np_PanDirection pan;
Np_TiltDirection tilt;
Np_ZoomDirection zoom;
Np_FocusDirection ocus;
int panSpeed;
int tiltSpeed;
int zoomSpeed;
int focusSpeed;
} Np_PTZContinuousMove;;
Member:
Name Meaning
pan
Direction of the pan operation. This
field can be:
kNoPan
kPanLeft
kPanRight
tilt
Direction of the tile operation. This
field can be:
kNoTilt
kTiltUp
kTiltDown
zoom
This field can be:
kNoZoom
kZoomIn
kZoomOut
focus
This field can be:
kNoFocus
kFocusNear
kFocusFar
171
panSpeed Reserved
tiltSpeed Reserved
zoomSpeed Reserved
focusSpeed Reserved
172
Np_PTZRectangle
Syntax:
typedef struct {
int currentWidth;
int currentHeight;
int leftupX;
int leftupY;
int targetWidth;
int targetHeight;
int speed;
} Np_PTZRectangle;
Member:
Name Meaning
currentWidth Width of the displayed UI
currentHeight Height of the displayed UI
leftupX X-axis readout of the upper-left
corner of the rectangle
leftupY Y-axis readout of the upper-left
corner of the rectangle
targetWidth Rectangle width specified by
operator
targetWidth Rectangle height specified by
operator
Speed Ranging from 1 to 100
Remark:
This function is selectively supported by IP camera. If this function is supported,
operator can specify a rectangle and the visible range after zooming will be equivalent
to the rectangle. Since user draws the rectangle on the UI which carries the image, the
input parameters are in the unit of this UI
Not being supported in SDK 4.0.0.
173
Np_PTZPreset
Syntax:
typedef struct {
int presetNo;
std::wstring presetName;
} Np_PTZPreset;
Member:
Name Meaning
presetNO Preset index number
presetName Preset name
174
Np_PTZParameter
Syntax:
typedef union {
Np_PTZContinuousMove* move;
Np_PTZRectangle* rectangle;
Np_PTZPreset* preset;
} Np_PTZParameter;
Member:
Name Meaning
move Continuous move control
parameter
rectangle Rectangle move control parameter
preset Preset control parameter
175
Np_PTZControlParam
Syntax:
typedef struct {
Np_PTZCommand command;
Np_PTZParameter param;
} Np_PTZControlParam;
Member:
Name Meaning
command
Command type for PTZ execution,
including
kPTZStop
kPTZContinuousMove
kPTZAutoFocus
kPTZHome
kPTZRectangle
kPTZPresetGo
kPTZPresetSet
kPTZPresetClear
param Parameter of the execution
command
176
Np_TalkAudioFormat
Syntax:
typedef struct {
int channels;
int bitsPerSample;
int sampleRate;
int sampleRequest;
} Np_TalkAudioFormat;
Member:
Name Meaning
channels The number of audio
channels.
bitPerSample The number of bits in each
sample.
sampleRate The number of sample per
second.
sampleRequest The number of sample in a
audio packet.
177
Np_ServerInfo_MainConsole
Syntax:
typedef struct {
wchar_t* serverType;
wchar_t* serverVersion;
wchar_t* modelType;
wchar_t* oemName;
int sessionNumber;
int maximumChannel;
int allowSmartGuard;
int allowPOS;
int allowCounting;
int allowEMap;
int dbType;
} Np_ServerInfo_MainConsole;
Member:
Name Meaning
serverType
Mainly “Main Console” for PC
version and “NVRMini” for
NAS version
serverVersion
Version information of the
server, 4 digits separated by
comma(‘,’) or dot(‘.’).
modelType “Main Console” or “Main
Console Lite”
oemName
Vender and version
information for specific OEM
project if any.
sessionNumber User session number kept by
server
maximumChannel Maximum number of
supported channel
178
allowSmartGuard
Flag indicating whether smart
guard is supported or not, 0
means not supported
allowPOS
Flag indicating whether POS is
supported or not, 0 means not
supported
allowCounting
Flag indicating whether
Counting is supported or not,
0 means not supported
allowEMap
Flag indicating whether EMap
is supported or not, 0 means
not supported
dbType
Type of recording database,
possible values are:
-1(Unknown)
0( For MainConsole)
1(For NAS)
2(For Old MainConsole)
179
Np_ServerInfo
Syntax:
typedef union {
Np_ServerInfo_MainConsole *serverInfoMC;
} Np_ServerInfo;
Member:
Name Meaning
serverInfoMC
Server information for
MainConsole series (LiveView
or Playback), see
Np_ServerInfo_MainConsole
for detail.
Remark:
Server information for Corporate-type server is currently unavailable.
180
Np_ExportContent
Syntax:
typedef struct {
Np_ID id;
Np_DateTime startTime;
Np_DateTime endTime;
bool excludeAudio;
int width;
int height;
} Np_ExportContent;
Member:
Name Meaning
id
Identification of the camera
with the video content to
export. The session of this
camera must be attached and
“OpenRecord”ed.
startTime Start time of the video
endTime End time of the video
excludeAudio Flag for excluding audio data
or not
width Width of the original video
frame
height Height of the original video
frame
181
Np_ExportProfile
Syntax:
typedef struct {
int profile;
wchar_t* description;
} Np_ExportProfile;
Member:
Name Meaning
profile Profile identifier number
description Description of the profile
182
Np_ExportProfileList
Syntax:
typedef struct {
size_t size;
Np_ExportProfile* items;
} Np_ExportProfileList;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
183
Np_ExportFormat
Syntax:
typedef struct {
int format;
wchar_t* description;
Np_ExportProfileList supportedProfile;
} Np_ExportFormat;
Member:
Name Meaning
format Format identifier number
description Description of the format
supportedProfile List of supported profiles
under certain format
184
Np_ExportFormatList
Syntax:
typedef struct {
size_t size;
Np_ExportFormat* items;
} Np_ExportFormatList;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
185
Np_SensorProfile
Syntax:
typedef struct {
Np_StreamProfile profile;
std::wstring frameRate;
std::wstring bitrate;
std::wstring resolution;
std::wstring codec;
std::wstring quality;
} Np_SensorProfile;
Member:
Name Meaning
profile Enumeration indicating quality level
of the profile.
frameRate Frame rate
bitrate Bit rate
resolution Resolution
codec Codec
quality Quality
186
Np_SensorProfile_CS
Syntax:
typedef struct {
Np_StreamProfile profile;
wchar_t* frameRate;
wchar_t* bitrate;
wchar_t* resolution;
wchar_t* codec;
wchar_t* quality;
} Np_SensorProfile_CS;
Member:
Name Meaning
profile Enumeration indicating quality level
of the profile.
frameRate Frame rate
bitrate Bit rate
resolution Resolution
codec Codec
quality Quality
Np_SensorProfile_CS1
Syntax:
typedef struct {
Np_StreamProfile profile;
wchar_t* frameRate;
wchar_t* bitrate;
187
wchar_t* resolution;
wchar_t* codec;
wchar_t* quality;
wchar_t* profile_name_alias;
wchar_t* raw_source;
wchar_t* resolution_height;
wchar_t* resolution_width;
wchar_t* source_stream;
} Np_SensorProfile_CS1;
Member:
Name Meaning
profile Enumeration indicating quality level
of the profile.
frameRate Frame rate
bitrate Bit rate
resolution Resolution
codec Codec
quality Quality
profile_name_alias Profile name
raw_source Raw source
resolution_height Resolution height
resolution_width Resolution Width
source_stream Source stream
188
Np_SensorProfile_CS_List
Syntax:
typedef struct {
size_t size;
Np_SensorProfile_CS* items;
} Np_SensorProfile_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
189
Np_SensorProfile_CS1_List
Syntax:
typedef struct {
size_t size;
Np_SensorProfile_CS1* items;
} Np_SensorProfile_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
Np_SubDevice_CS
Syntax:
typedef struct {
Np_ID ID;
wchar_t* name;
wchar_t* description;
} Np_SubDevice_CS;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID
name Device Name
description Device Description
190
191
Np_SubDevice_Ext
Syntax:
typedef struct {
Np_ID_Ext ID;
wchar_t* name;
wchar_t* description;
} Np_SubDevice_Ext;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID_Ext
name Device Name
description Device Description
192
Np_SubDevice_CS_List
Syntax:
typedef struct {
size_t size;
Np_SubDevice_CS* items;
} Np_SubDevice_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
193
Np_SubDevice_Ext_List
Syntax:
typedef struct {
size_t size;
Np_SubDevice_Ext* items;
} Np_SubDevice_Ext_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
194
Np_Device_CS
Syntax:
typedef struct {
Np_ID ID;
wchar_t* name;
wchar_t* description;
Np_SubDevice_CS_List SensorDevices;
Np_SubDevice_CS_List PTZDevices;
Np_SubDevice_CS_List AudioDevices;
Np_SubDevice_CS_List DIDevices;
Np_SubDevice_CS_List DODevices;
} Np_Device_CS;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID
name Device Name
description Device Description
SensorDevices Additional devices associated to
this device
PTZDevices PTZ devices associated to this
device
AudioDevices Audio devices associated to this
device
DIDevices Digital Input devices associated to
this device
DODevices Digital Output devices associated to
this device
195
Np_Device_Ext
Syntax:
typedef struct {
Np_ID_Ext ID;
wchar_t* name;
wchar_t* description;
Np_SubDevice_Ext_List SensorDevices;
Np_SubDevice_Ext_List PTZDevices;
Np_SubDevice_Ext_List AudioDevices;
Np_SubDevice_Ext_List DIDevices;
Np_SubDevice_Ext_List DODevices;
} Np_Device_Ext;
Member:
Name Meaning
ID Device Identity which can be
referred from Np_ID_Ext
name Device Name
description Device Description
SensorDevices Additional devices associated to
this device
PTZDevices PTZ devices associated to this
device
AudioDevices Audio devices associated to this
device
DIDevices Digital Input devices associated to
this device
DODevices Digital Output devices associated to
this device
196
Np_Device_CS_List
Syntax:
typedef struct {
size_t size;
Np_Device_CS* items;
} Np_Device_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
197
Np_Device_Ext_List
Syntax:
typedef struct {
size_t size;
Np_Device_Ext* items;
} Np_Device_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
198
Np_DeviceGroup_CS
Syntax:
typedef struct {
wchar_t* name; //server name
wchar_t* description;
Np_Device_CS_List Camera;
Np_Device_CS_List IOBox;
} Np_DeviceGroup_CS;
Member:
Name Meaning
name Server Name
description Server Description
Camera Cameras connected to the server
IOBOX Digital Input/Output box connected
to the server
199
Np_DeviceGroup_Ext
Syntax:
typedef struct {
wchar_t* name; //server name
wchar_t* description;
Np_Device_Ext_List Camera;
Np_Device_Ext_List IOBox;
} Np_DeviceGroup_Ext;
Member:
Name Meaning
name Server Name
description Server Description
Camera Cameras connected to the server
IOBOX Digital Input/Output box connected
to the server
200
Np_DeviceGroup_CS_List
Syntax:
typedef struct {
size_t size;
Np_DeviceGroup_CS* items;
} Np_DeviceGroup_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
201
Np_DeviceGroup_Ext_List
Syntax:
typedef struct {
size_t size;
Np_DeviceGroup_Ext* items;
} Np_DeviceGroup_Ext_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
202
Np_DeviceList_CS
Syntax:
typedef struct {
Np_DeviceGroup_CS_List PhysicalGroup;
Np_DeviceGroup_CS_List LogicalGroup;
} Np_DeviceList_CS;
Member:
Name Meaning
PhysicalGroup
A representation of the device
group with their physical
connection order
LogicalGroup
A representation of the device
group with a user-defined
relationship
Remarks:
Only Physical Group would be used by MainConsole Liveview , MainConsole Playback
and Corporate/Titan currently.
203
Np_DeviceList_Ext
Syntax:
typedef struct {
Np_DeviceGroup_Ext_List PhysicalGroup;
Np_DeviceGroup_Ext_List LogicalGroup;
} Np_DeviceList_Ext;
Member:
Name Meaning
PhysicalGroup
A representation of the device
group with their physical
connection order
LogicalGroup Reserved
204
Np_PTZPreset_CS
Syntax:
typedef struct {
int presetNo;
wchar_t* presetName;
} Np_PTZPreset_CS;
Member:
Name Meaning
presetNO Preset index number
presetName Preset name
205
Np_PTZPreset_CS_List
Syntax:
typedef struct {
size_t size;
Np_PTZPreset_CS* items;
} Np_PTZPreset_CS_List;
Member:
Name Meaning
size Size of the list
items Pointer to array of list items
206
Np_PTZInfo_CS
Syntax:
typedef struct {
Np_PTZPresetType_CS ptzPresetType;
Np_PTZPreset_CS_List ptzPresetList;
Np_PTZPatrol_CS ptzPatrol;
} Np_PTZInfo_CS;
Member:
Name Meaning
ptzPresetType Preset type
ptzPresetList Preset list
ptzPatrol Patrol information
207
Np_PTZPresetType_CS
Syntax:
typedef struct {
bool allowSetPresetByIndex;
bool allowClearAllPreset;
size_t maxPresetNumber;
} Np_PTZInfo_CS;
Member:
Name Meaning
allowSetPresetByIndex
Flag indicating whether adding new
preset to specify preset slot is
supported or not. 0 means not
supported.
allowClearAllPreset
Flag indicating whether clearing all
presets is supported or not. 0
means not supported.
maxPresetNumber Maximum number of preset points
supported
208
Np_PTZPatrol_CS
Syntax:
typedef struct {
bool isPatrolStartEnabled;
bool isPatrolStopEnabled;
bool m_is_patrol_enable;
int m_active_group_index;
int m_event_trigger_group_index
WORD m_max_patrol_group_number;
Np_PatrolGroup_CS m_group[MAX_GROUP_AMOUNT];
} Np_PTZInfo_CS;
Member:
Name Meaning
isPatrolStartEnabled Flag indicating whether the device
has the ability to start patrol or not.
isPatrolStopEnabled Flag indicating whether the device
has the ability to stop patrol or not.
m_is_patrol_enable Flag indicating whether the device
is starting patrol or not.
m_active_group_index The index of activated group
m_event_trigger_group_index Reserved
m_max_patrol_group_number Maximum number of patrol groups
supported
m_group The Information of each group
209
Np_PatrolGroup_CS
Syntax:
typedef struct {
int m_preset_point[MAX_PATROL_POINT];
int m_preset_count;
int m_period;
int m_time;
int m_next_point;
wchar_t m_name[MAX_GROUP_NAME_LENGTH];
} Np_PatrolGroup_CS;
Member:
Name Meaning
m_preset_point The index of preset points in the
group
m_preset_count The count of preset points in the
group
m_period The period time of the group
m_time Reserved
m_next_point Reserved.
m_name The group name
210
Np_PTZParameter_CS
Syntax:
typedef union {
Np_PTZContinuousMove* move;
Np_PTZRectangle* rectangle;
Np_PTZPreset_CS* preset;
} Np_PTZParameter_CS;
Member:
Name Meaning
move Continuous move control
parameter
rectangle Rectangle move control parameter
preset Preset control parameter
211
Np_PTZControlParam_CS
Syntax:
typedef struct {
Np_PTZCommand command;
Np_PTZParameter_CS param;
} Np_PTZControlParam_CS;
Member:
Name Meaning
command
Command type for PTZ execution,
including
kPTZStop
kPTZContinuousMove
kPTZAutoFocus
kPTZHome
kPTZRectangle
kPTZPresetGo
kPTZPresetSet
kPTZPresetClear
param Parameter of the execution
command
212
RecordingLog_Subscribe
Purpose Compatibility
Subscribe the callback for the
recording log none
Syntax:
Np_Result_t RecordingLog_Subscribe(
void *p_handle,
void **pp_session,
fnRecordLogHandle callback,
void *p_ctx);
Parameters:
Name Meaning
[IN] p_handle The handle allocated by
Create_HandleWChar.
[OUT] pp_session The created session.
[IN] callback The function used to callback.
[IN] p_ctx The parameter of the callback function.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
Remarks:
It is programmer’s responsibility to release the allocated memory by calling
RecordingLog_Unsubscribe function.
213
RecordingLog_Unsubscribe
Purpose Compatibility
Unsubscribe the callback session none
Syntax:
Np_Result_t RecordingLog_Unsubscribe(void *p_session);
Parameters:
Name Meaning
[IN] p_session The session to be unsubscribed.
Return Value:
Np_Result_OK represents the success of the function call. Any positive value
represents the failure of the function. The detailed meaning of the error value is
defined at NpClientDefine.h.
214
Np_SourceType
Syntax:
enum Np_SourceType
{
kSourceCamera = 0,
kSourceDigitalInput = 1,
kSourceMetaData = 2,
kSourceServer = 3,
kSourceALL = 4
};
215
Np_ScheduleLogItem
Syntax:
typedef struct ST_Np_ScheduleLogItem
{
Np_ID ID;
Np_DateTime startTime;
Np_DateTime endTime;
Np_ScheduleType type;
} Np_ScheduleLogItem;
Member:
Name Meaning
ID ID of the source device.
startTime System time of server when the
recorded video starts.
endTime System time of server when the
recorded video ends.
type
Type of the recording schedule,
which could be the following
values:
kScheduleRecordOnly
kScheduleRecordMovingOnly
kScheduleRecordOnEvent
kScheduleRecordBoost
Other values in the enumeration
Np_ScheduleType are reserved.
216
Sample code
The sample code is written by QT, to demonstrate how to utilize our SDK.
Liveview Streaming
This liveview stream creation flow and code segment as below:
#include "NpClient.h"
#include "SDKExport.h"
Np_DeviceList_Ext m_deviceList;
//Server IP
wchar_t *m_IP = L"localhost";
//LiveView Port that was set on server
unsigned short m_LiveViewPort = 5250;
wchar_t *m_Password = L"admin";
void *m_pHandle = NULL;
void *m_pPlayer = NULL;
void *m_pSession = NULL;
Np_ServerType m_Type = kCrystal;
wchar_t *m_UserName = L"admin";
Np_PixelFormat m_videoPixelFormat;
static void VideoHandle(
Np_DateTime time,
char *buffer,
int len,
int width,
int height,
Create
handle
Retrieve
device list
Create
player
Attach
Session
217
void *ctx)
{
//Callback function for receiving image
}
static void AudioHandle(
Np_DateTime time,
char *buffer,
int len,
int bitsPerSample,
int samplesPerSec,
int channels,
void *ctx)
{
//Callback function for receiving audio
}
static void ErrorHandle(Np_Error error, void *ctx)
{
//Callback function for error
}
void onCreateLiveStream()
{
Np_Result_t result = Create_HandleWChar(
&m_pHandle,
m_Type,
m_UserName,
m_Password,
m_IP,
m_LiveViewPort);
if (Np_Result_OK == result)
{
result = Info_GetDeviceList_Ext(m_pHandle, m_deviceList);
if (
Np_Result_OK == result &&
m_deviceList.PhysicalGroup.size > 0 &&
218
m_deviceList.PhysicalGroup.items[0].Camera.size > 0)
{
result = LiveView_CreatePlayer(m_pHandle, &m_pPlayer);
if (Np_Result_OK == result)
{
//Get the liveview stream of the first camera
Np_ID_Ext id
= m_deviceList.PhysicalGroup.items[0].Camera.items[0].ID;
result = LiveView_AttachSessionExtExt(
m_pPlayer,
&m_pSession,
id,
kProfileNormal,
m_videoPixelFormat,
VideoHandle, NULL,
AudioHandle, NULL,
ErrorHandle, NULL);
}
}
}
}
219
PTZ Control
The following is an example to control device to tilt up. Our SDK interface,
Control_PTZ_PTZDeviceID_CS_Ext is responsible for controlling the PTZ device. This
interface requires an Np_PTZControlParam_CS to indicate the movement, which can
be either directional move, home, or preset depending on Camera’s capability.
void onPTZUp()
{
Np_PTZControlParam_CS ptzParam;
Np_PTZContinuousMove ptzMoveDirection;
memset(&ptzParam, 0, sizeof(ptzParam));
memset(&ptzMoveDirection, 0, sizeof(ptzMoveDirection));
//ptzMoveDirection indicates the direction of the movement
ptzMoveDirection.tilt = kTiltUp;
//ptzParam.command specifies the command to drive the PTZ
ptzParam.command = kPTZContinuousMove;
ptzParam.param.move = &ptzMoveDirection;
//Select the camera of interest and provide the specified command
Np_ID_Ext id;
id.centralID = ui.leCentralID->text().toULongLong();
id.localID = ui.leLocalID->text().toULongLong();
Control_PTZ_PTZDeviceID_CS_Ext(m_handle, id, &ptzParam);
TesterSleep(300);
StopPTZ(ptzParam, ptzMoveDirection);
}
//The function is to stop previous ptz.
void StopPTZ(
Np_PTZControlParam_CS ptzControlParam,
const Np_PTZContinuousMove& ptzMoveCommand)
{
ptzControlParam.command = kPTZStop;
//Stop the previous PTZ command
220
Np_ID_Ext id;
id.centralID = ui.leCentralID->text().toULongLong();
id.localID = ui.leLocalID->text().toULongLong();
Control_PTZ_PTZDeviceID_CS_Ext(m_handle, id, &ptzControlParam);
}
221
View recorded stream
This recorded stream creation flow is similar to the liveview one and the sample code
is shown below :
#include "NpClient.h"
#include "SDKExport.h"
Np_DeviceList_Ext m_deviceList;
//Server IP
wchar_t *m_IP = L"localhost";
wchar_t *m_Password = L"admin";
void *m_pHandle = NULL;
//LiveView Port that was set on server
unsigned short m_PlaybackPort = 5250;
void *m_pPlayer = NULL;
void *m_pSession = NULL;
Np_ServerType m_Type = kCrystal;
wchar_t *m_UserName = L"admin";
Np_PixelFormat m_videoPixelFormat;
static void VideoHandle(
Np_DateTime time,
char *buffer,
int len,
int width,
int height,
void *ctx)
{
//Callback function for receiving image
}
static void AudioHandle(
Np_DateTime time,
char *buffer,
int len,
int bitsPerSample,
222
int samplesPerSec,
int channels,
void *ctx)
{
//Callback function for receiving audio
}
static void ErrorHandle(Np_Error error, void *ctx)
{
//Callback function for error
}
void onCreatePlaybackStream()
{
Np_Result_t result = Create_HandleWChar(
&m_pHandle,
m_Type,
m_UserName,
m_Password,
m_IP,
m_PlaybackPort);
if (Np_Result_OK == result)
{
result = Info_GetDeviceList_Ext(m_pHandle, m_deviceList);
if (
Np_Result_OK == result &&
m_deviceList.PhysicalGroup.size > 0 &&
m_deviceList.PhysicalGroup.items[0].Camera.size > 0)
{
result = PlayBack_CreatePlayer(m_pHandle, &m_pPlayer);
if (Np_Result_OK == result)
{
//Get the recorded stream of the first camera
Np_ID_Ext id
= m_deviceList.PhysicalGroup.items[0].Camera.items[0].ID;
result = PlayBack_AttachSessionExtExt(
m_pPlayer,
223
&m_pSession,
id,
m_videoPixelFormat,
VideoHandle, NULL,
AudioHandle, NULL,
ErrorHandle, NULL);
if (Np_Result_OK == result)
{
Np_DateTime startTime, endTime;
memset(&startTime, 0, sizeof(startTime));
memset(&endTime, 0, sizeof(endTime));
//video 2011/4/7 15"32:44 ~ 2011/4/7 15:2:54
startTime.year = 2011;
startTime.month = 4;
startTime.day = 7;
startTime.hour = 15;
startTime.minute = 32;
startTime.second = 44;
endTime.year = 2011;
endTime.month = 4;
endTime.day = 7;
endTime.hour = 15;
endTime.minute = 32;
endTime.second = 54;
PlayBack_OpenRecord(m_pPlayer, startTime, endTime);
}
}
}
}
}
After creating the stream, PlayBack_Play needs to be called to start the video.
224
Playback control
Regarding of the control of pause, stepforward/stepbackward, previous/next,
speedup/speeddown, the interface usage and the corresponding parameters are
identical to PlayBack_Play.