-
参数配置模块的示例代码-尼康 d5600 高清电子书下载
资源介绍
4.3 参数配置模块的示例代码
相关模块流程图
配置压缩参数(NET_DVR_COMPRESSIONCFG_V30)
#include
#include
#include "Windows.h"
#include "HCNetSDK.h"
using namespace std;
void main() {
//---------------------------------------
// 初始化
NET_DVR_Init();
//设置连接时间与重连时间
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
//---------------------------------------
// 注册设备
LONG lUserID;
NET_DVR_DEVICEINFO_V30 struDeviceInfo;
lUserID = NET_DVR_Login_V30("192.0.0.64", 8000, "admin", "12345", &struDeviceInfo);
if (lUserID < 0)
{
printf("Login error, %d\n", NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
int iRet;
//获取压缩参数
DWORD dwReturnLen;
NET_DVR_COMPRESSIONCFG_V30 struParams = {0};
iRet = NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_COMPRESSCFG_V30, struDeviceInfo.byStartChan, &struParams, \
sizeof(NET_DVR_COMPRESSIONCFG_V30), &dwReturnLen);
if (!iRet)
{
printf("NET_DVR_GetDVRConfig NET_DVR_GET_COMPRESSCFG_V30 error.\n");
NET_DVR_Logout(lUserID);
NET_DVR_Cleanup();