EasyCVR打包Linux版本报错NET_DVR_DownFileByName_Stop解决
作者:互联网
大家知道EasyCVR是TSINGSEE青犀视频开发的平台中支持协议最多的一款协议融合平台,EasyCVR能够兼容海康、大华的私有SDK,同时也具备GB28181、Ehome协议的级联、语音对讲等特点。根据自己的系统,大家可以自由选择windows版本或者linux版本的软件进行部署。
我们的开发人员对EasyCVR打包Linux版本时,出现了EASY_NET_DVR_DownFileByName_Stop的报错。
int Easy_NET_DVR_StartRemoteConfig(int loginhandle, int channelNum, int year, int month, int day, int hour, int minute, int second, char* path,int size){
char pathArr[128];
memset(pathArr, 0, sizeof(pathArr));
memcpy(pathArr, path, size);
NET_DVR_GET_FIGURE_COND cond;
memset(&cond, 0 ,sizeof(NET_DVR_GET_FIGURE_COND));
cond.dwLength = sizeof(NET_DVR_GET_FIGURE_COND);
cond.dwChannel = channelNum;
cond.struTimePoint.wYear = year;
cond.struTimePoint.byMonth = month;
cond.struTimePoint.byDay = day;
cond.struTimePoint.byHour = hour;
cond.struTimePoint.byMinute = minute;
cond.struTimePoint.bySecond = second;
int ret = NET_DVR_StartRemoteConfig(loginhandle, 6610, &cond, sizeof(cond), EasyDownloadPictureByTimeCallback, path);
if (ret < 0)
{
return ret;
}
sleep(2);
NET_DVR_StopRemoteConfig(ret);
return ret;
}
int EASY_NET_DVR_DownFileByName_Start(int loginhandle, char* srcfile, char* destfile){
int bRes = 1;
int hPlayback = 0;
if( (hPlayback = NET_DVR_GetFileByName(loginhandle, srcfile, destfile)) < 0 ){
printf( "GetFileByName failed. error[%d]\n", NET_DVR_GetLastError());
bRes= -1;
return bRes;
}
int pos = 0;
if(!NET_DVR_PlayBackControl_V40(hPlayback, NET_DVR_PLAYSETPOS, &pos,4,NULL,NULL)){
printf("play back control failed [%d]\n",NET_DVR_GetLastError());
bRes=-1;
return bRes;
}
if(!NET_DVR_PlayBackControl_V40(hPlayback, NET_DVR_PLAYSTART, NULL,0,NULL,NULL)){
printf("play back control failed [%d]\n",NET_DVR_GetLastError());
bRes=-1;
return bRes;
}
return 0;
}
int EASY_NET_DVR_DownFileByName_Stop(int filehandle){
int bRes = 0;
int nPos = NET_DVR_GetDownloadPos(filehandle);
printf("have got %d\n", nPos);
if(!NET_DVR_StopGetFile(filehandle)){
printf("failed to stop get file [%d]\n",NET_DVR_GetLastError());
bRes = -1;
return bRes;
}
if(nPos<0||nPos>100) {
printf("download err [%d]\n",NET_DVR_GetLastError());
bRes=-1;
return bRes;
}else {
return 0;
}
return 0;
}
再次打包无报错:
标签:return,int,Stop,报错,DownFileByName,cond,NET,bRes,DVR 来源: https://www.cnblogs.com/easycvr/p/15250632.html