-
回放和下载模块的示例代码-尼康 d5600 高清电子书
资源介绍
4.2 回放和下载模块的示例代码
相关模块流程图
示例一:查找录像文件并下载
#include
#include
#include "Windows.h"
#include "HCNetSDK.h"
using namespace std;
int saveRecordFile(int userId,char * srcfile,char * destfile)
{
int bRes = 1;
int hPlayback = 0;
if( (hPlayback = NET_DVR_GetFileByName(userId, srcfile, destfile)) < 0 )
{
printf( "GetFileByName failed. error[%d]\n", NET_DVR_GetLastError());
bRes= -1;
return bRes;
}
if(!NET_DVR_PlayBackControl(hPlayback, NET_DVR_PLAYSTART, 0, NULL))
{
printf("play back control failed [%d]\n",NET_DVR_GetLastError());
bRes=-1;
return bRes;
}
int nPos = 0;
for(nPos = 0; nPos < 100&&nPos>=0; nPos = NET_DVR_GetDownloadPos(hPlayback))
{
Sleep(5000); //millisecond
}
printf("have got %d\n", nPos);
if(!NET_DVR_StopGetFile(hPlayback))
{
printf("failed to stop get file [%d]\n",NET_DVR_GetLastError());
bRes = -1;
return bRes;
}
printf("%s\n",srcfile);
- 上一篇: 实时预览模块流程-尼康 d5600 高清电子书
- 下一篇: 海康威视智能交通摄像头抓拍调试软件