设备网络 SDK
编程指南
(For Android)
V5.2
设备网络 SDK 编程指南
I
声 明
非常感谢您购买我公司的产品,如果您有什么疑问或需要请随时联系我们。
我们已尽量保证手册内容的完整性与准确性,但也不免出现技术上不准确、与产品功能及操作不相符
或印刷错误等情况,如有任何疑问或争议,请以我司最终解释为准。
产品和手册将实时进行更新,恕不另行通知。
本手册中内容仅为用户提供参考指导作用,请以 SDK 实际内容为准。
II
设备网络 SDK 编程指南
目 录
声 明 .........................................................................................................................................................................I
目 录 ........................................................................................................................................................................II
1 SDK 简介 .............................................................................................................................................................6
1.1 SDK 概述 ...............................................................................................................................................6
1.2 适用范围 ..............................................................................................................................................7
2 SDK 版本更新 .....................................................................................................................................................9
3 函数说明 ......................................................................................................................................................... 10
3.1 SDK 初始化 ........................................................................................................................................ 10
3.1.1 初始化 SDK NET_DVR_Init ...................................................................................................... 10
3.1.2 释放 SDK 资源 NET_DVR_Cleanup ......................................................................................... 10
3.2 SDK 本地功能 .................................................................................................................................... 10
本地参数配置 ......................................................................................................................................... 10
3.2.1 获取 SDK 本地参数 NET_DVR_GetSDKLocalConfig ................................................................ 10
3.2.2 设置 SDK 本地参数 NET_DVR_SetSDKLocalConfig ................................................................ 11
连接和接收超时时间及重连设置 ......................................................................................................... 11
3.2.3 设置网络连接超时时间 NET_DVR_SetConnectTime ............................................................ 11
3.2.4 设置重连功能 NET_DVR_SetReconnect ................................................................................. 11
3.2.5 设置接收超时时间 NET_DVR_SetRecvTimeOut .................................................................... 11
SDK 版本信息和日志 .............................................................................................................................. 12
3.2.6 获取 SDK 版本信息 NET_DVR_GetSDKVersion ...................................................................... 12
3.2.7 获取 SDK 的版本号和 build 信息 NET_DVR_GetSDKBuildVersion ........................................ 12
3.2.8 启用写日志文件 NET_DVR_SetLogToFile............................................................................... 12
异常消息回调 ......................................................................................................................................... 13
3.2.9 注册接收异常、重连消息回调函数 NET_DVR_SetExceptionCallBack ................................. 13
获取错误信息 ......................................................................................................................................... 14
3.2.10 返回最后操作的错误码 NET_DVR_GetLastError................................................................... 14
3.2.11 返回最后操作的错误信息 NET_DVR_GetErrorMsg .............................................................. 14
3.3 用户注册 ........................................................................................................................................... 14
3.3.1 设备的动态 IP 和端口解析 NET_DVR_GetAddrInfoByServer ................................................ 14
3.3.2 通过解析服务器,获取设备的动态 IP 地址和端口号 NET_DVR_GetDVRIPByResolveSvr_EX
................................................................................................................................................. 15
3.3.3 激活设备 NET_DVR_ActivateDevice ....................................................................................... 15
3.3.4 用户注册设备 NET_DVR_Login_V30 ...................................................................................... 16
3.3.5 用户注销 NET_DVR_Logout_V30 ........................................................................................... 16
3.4 获取设备能力集 ............................................................................................................................... 16
3.4.1 获取设备能力集 NET_DVR_GetXMLAbility ........................................................................... 16
3.5 实时预览 ............................................................................................................................................17
强制 I 帧 ..................................................................................................................................................17
3.5.1 主码流动态产生一个关键帧 NET_DVR_MakeKeyFrame .......................................................17
3.5.2 子码流动态产生一个关键帧 NET_DVR_MakeKeyFrameSub .................................................17
III
设备网络 SDK 编程指南
实时预览 ................................................................................................................................................. 18
3.5.3 实时预览 NET_DVR_RealPlay_V40 ......................................................................................... 18
3.5.4 停止预览 NET_DVR_StopRealPlay .......................................................................................... 18
显示参数配置 ......................................................................................................................................... 19
3.5.5 获取预览视频显示参数 NET_DVR_ClientGetVideoEffect ..................................................... 19
3.5.6 设置预览视频显示参数 NET_DVR_ClientSetVideoEffect ...................................................... 19
零通道预览 ............................................................................................................................................. 19
3.5.7 开始零通道预览 NET_DVR_ZeroStartPlay ............................................................................. 19
3.5.8 停止零通道预览 NET_DVR_ZeroStopPlay ...............................................................................20
客户端录像 ..............................................................................................................................................20
3.5.9 捕获预览数据并保存到指定文件中 NET_DVR_SaveRealData ..............................................20
3.5.10 停止数据捕获 NET_DVR_StopSaveRealData .......................................................................... 21
3.6 设备抓图 ........................................................................................................................................... 21
3.6.1 单帧数据捕获并保存成 JPEG 图片 NET_DVR_CaptureJPEGPicture ..................................... 21
3.6.2 单帧数据捕获并保存成 JPEG 存放在指定的内存空间中
NET_DVR_CaptureJPEGPicture_NEW ...................................................................................... 21
3.7 布防、撤防 ....................................................................................................................................... 22
设置报警等信息上传的回调函数 ......................................................................................................... 22
3.7.1 注册回调函数,接收设备报警消息 NET_DVR_SetDVRMessageCallBack_V30 ................... 22
布防撤防 ................................................................................................................................................. 23
3.7.2 建立报警上传通道,获取报警等信息 NET_DVR_SetupAlarmChan_V41............................ 23
3.7.3 撤销报警上传通道 NET_DVR_CloseAlarmChan_V30 ............................................................ 23
3.8 远程参数配置 ................................................................................................................................... 24
通用参数配置 ......................................................................................................................................... 24
3.8.1 获取设备配置信息 NET_DVR_GetDVRConfig ........................................................................ 24
3.8.2 设置设备配置信息 NET_DVR_SetDVRConfig ..........................................................................25
3.8.3 批量获取配置信息 NET_DVR_GetDeviceConfig .....................................................................26
3.8.4 批量设置配置信息 NET_DVR_SetDeviceConfig ......................................................................26
报警输出配置 .......................................................................................................................................... 27
3.8.5 获取设备报警输出 NET_DVR_GetAlarmOut_V30 .................................................................. 27
3.8.6 设置设备报警输出 NET_DVR_SetAlarmOut .......................................................................... 28
设备支持的云台协议 ............................................................................................................................. 28
3.8.7 获取设备支持的云台协议 NET_DVR_GetPTZProtocol .......................................................... 28
3.9 录像文件回放、下载、锁定及备份................................................................................................ 28
刷新录像索引 ......................................................................................................................................... 28
3.9.1 即时刷新录像索引 NET_DVR_UpdateRecordIndex ............................................................... 28
录像文件的查找 ..................................................................................................................................... 29
3.9.2 根据文件类型、时间查找设备录像文件 NET_DVR_FindFile_V30 ...................................... 29
3.9.3 逐个获取查找到的文件信息 NET_DVR_FindNextFile_V30 .................................................. 29
3.9.4 关闭文件查找,释放资源 NET_DVR_FindClose_V30 .......................................................... 29
按事件查找录像 ..................................................................................................................................... 30
3.9.5 按事件查找录像 NET_DVR_FindFileByEvent ......................................................................... 30
3.9.6 逐个获取查找到的文件信息 NET_DVR_FindNextEvent ....................................................... 30
3.9.7 关闭文件查找,释放资源 NET_DVR_FindClose_V30 .......................................................... 31
IV
设备网络 SDK 编程指南
回放录像文件 ......................................................................................................................................... 31
3.9.8 注册回调函数,捕获录像数据 NET_DVR_SetPlayDataCallBack .......................................... 31
3.9.9 按文件名回放录像文件 NET_DVR_PlayBackByName .......................................................... 31
3.9.10 按时间回放录像文件 NET_DVR_PlayBackByTime ............................................................... 32
3.9.11 控制录像回放的状态 NET_DVR_PlayBackControl_V40 ....................................................... 32
3.9.12 获取回放取流进度 NET_DVR_GetPlayBackPos ..................................................................... 33
3.9.13 停止回放录像文件 NET_DVR_StopPlayBack ........................................................................ 33
下载录像文件 ......................................................................................................................................... 33
3.9.14 按文件名下载录像文件 NET_DVR_GetFileByName ............................................................. 33
3.9.15 按时间下载录像文件 NET_DVR_GetFileByTime .................................................................. 34
3.9.16 控制录像下载的状态 NET_DVR_PlayBackControl_V40 ........................................................ 34
3.9.17 获取当前下载录像文件的进度 NET_DVR_GetDownloadPos ............................................... 35
3.9.18 停止下载录像文件 NET_DVR_StopGetFile ........................................................................... 35
3.10 云台控制 ........................................................................................................................................... 35
云台控制操作 ......................................................................................................................................... 35
3.10.1 云台控制操作(需先启动预览)NET_DVR_PTZControl ...................................................... 35
3.10.2 云台控制操作(不用启动预览)NET_DVR_PTZControl_Other ........................................... 36
3.10.3 带速度的云台控制操作(需先启动预览)NET_DVR_PTZControlWithSpeed ..................... 37
3.10.4 带速度的云台控制操作(不用启动预览)NET_DVR_PTZControlWithSpeed_Other .......... 37
云台预置点操作 ..................................................................................................................................... 38
3.10.5 云台预置点操作,需先启动预览 NET_DVR_PTZPreset ....................................................... 38
3.10.6 云台预置点操作 NET_DVR_PTZPreset_Other ....................................................................... 38
云台巡航操作 ......................................................................................................................................... 39
3.10.7 云台巡航操作,需先启动预览 NET_DVR_PTZPCruise ......................................................... 39
3.10.8 云台巡航操作 NET_DVR_PTZPCruise_Other ......................................................................... 39
云台轨迹操作 ......................................................................................................................................... 40
3.10.9 云台轨迹操作,需先启动预览 NET_DVR_PTZTrack ............................................................. 40
3.10.10 云台轨迹操作 NET_DVR_PTZTrack_Other ............................................................................. 40
云台区域缩放控制 ................................................................................................................................. 41
3.10.11 云台图象区域选择放大或缩小 NET_DVR_PTZSelZoomIn .................................................... 41
3.10.12 云台图像区域选择放大或缩小 NET_DVR_PTZSelZoomIn_Ex .............................................. 41
3.11 语音转发 ........................................................................................................................................... 41
3.11.1 获取当前生效的音频对讲音频压缩参数 NET_DVR_GetCurrentAudioCompress................ 41
3.11.2 启动语音转发,获取编码后的音频数据 NET_DVR_StartVoiceCom_MR_V30 ................... 42
3.11.3 转发语音数据 NET_DVR_VoiceComSendData ....................................................................... 42
3.11.4 停止语音转发 NET_DVR_StopVoiceCom ............................................................................... 42
3.12 数据透传 ........................................................................................................................................... 43
透明通道 ................................................................................................................................................. 43
3.12.1 建立透明通道 NET_DVR_SerialStart_V40 .............................................................................. 43
3.12.2 通过透明通道向设备串口发送数据 NET_DVR_SerialSend .................................................. 43
3.12.3 断开透明通道 NET_DVR_SerialStop....................................................................................... 44
向串口发送数据 ..................................................................................................................................... 44
3.12.4 直接向串口发送数据,不需要建立透明通道 NET_DVR_SendToSerialPort ........................ 44
3.12.5 直接向 232 串口发送数据,不需要建立透明通道 NET_DVR_SendTo232Port................... 44
- 1
- 2
- 3
- 4
- 5
前往页