Ejemplo n.º 1
0
 internal void StopRealPlay(int playHandle)
 {
     if (Dvr.IsHik)
     {
         NetDvrDll.NET_DVR_StopRealPlay(playHandle);
     }
     else
     {
         UsntDvrDll.USNTDVR_StopRealPlay(playHandle);
     }
 }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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);
         }
     }
 }
Ejemplo n.º 6
0
 protected Engine()
 {
     NetDvrDll.NET_DVR_Init();
     UsntDvrDll.USNTDVR_Init();
 }