Easycvr package Linux version error net_DVR_DownFileByName_Stop

As we all know, easycvr is a protocol integration platform that supports the most protocols among the platforms developed by tsingsee Qingxi video. Easycvr can be compatible with the private SDKs of Haikang and Dahua. At the same time, it also has the characteristics of gb28181, cascading of home protocols, voice intercom and so on. According to your own system, you can freely choose Windows version or Linux version for deployment.

When our developers packaged the Linux version of easycvr, easy appeared_ NET_ DVR_ DownFileByName_ Stop error.

As can be seen from the error, the prompt cannot find easy_NET_DVR_DownFileByName_Stop,
EASY_NET_DVR_DownFileByName_Start, NET_DVR_Startremoteconfig these three defined types.

In the corresponding source_hksdk_corresponding type is not found in the linux.go file, but it is used in the file.

So we need to find the source in the project_hksdk_Linux.go file, merge the missing code in source_hksdk_Add to linux.go. The reference code is as follows:

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;
}

Package again without error:


Read More: