internal void StopRealPlay(int playHandle) { if (Dvr.IsHik) { NetDvrDll.NET_DVR_StopRealPlay(playHandle); } else { UsntDvrDll.USNTDVR_StopRealPlay(playHandle); } }
internal int RealPlay_V30(ref NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 realDataCallBack, IntPtr pUser, int bBlocked) { if (Dvr.IsHik) { return(NetDvrDll.NET_DVR_RealPlay_V30(Dvr.Handle, ref lpClientInfo, realDataCallBack, pUser, bBlocked)); } else { return(UsntDvrDll.USNTDVR_RealPlay_V30(Dvr.Handle, ref lpClientInfo, realDataCallBack, pUser, bBlocked)); } }
public void Logout() { if (Handle >= 0) { if (IsHik) { NetDvrDll.NET_DVR_Logout_V30(Handle); } else { UsntDvrDll.USNTDVR_Logout_V30(Handle); } Console.WriteLine("Logout Handle: " + Handle); } Handle = -1; }
public bool Login(string ip, int port, string user, string pass) { Logout(); Handle = NetDvrDll.NET_DVR_Login_V30(ip, (ushort)port, user, pass, out DeviceInfo); if (Handle >= 0) { IsHik = true; Console.WriteLine("Handle : " + Handle); return(true); } else { Handle = UsntDvrDll.USNTDVR_Login_V30(ip, (ushort)port, user, pass, out DeviceInfo); if (Handle >= 0) { IsHik = false; return(true); } } return(false); }
internal void GetError() { if (Dvr.Handle < 0) { throw new CanNotLoginException("设备登陆失败!"); } if (Dvr.IsHik) { int errorNo = NetDvrDll.NET_DVR_GetLastError(); if (errorNo != 0) { throw new InvalidOperationException("Hik Error NO." + errorNo); } } else { int errorNo = UsntDvrDll.USNTDVR_GetLastError(); if (errorNo != 0) { throw new InvalidOperationException("Usnt Error NO." + errorNo); } } }
protected Engine() { NetDvrDll.NET_DVR_Init(); UsntDvrDll.USNTDVR_Init(); }