示例#1
0
 private AlarmClient GetAlarmClient(IVideoSourceConfig vsConfig)
 {
     if (vsConfig != null && vsConfig.Type.StartsWith("HKDVR"))
     {
         return(CHKDVRDevice.GetAlarmClient(vsConfig.IP, (short)vsConfig.Port, vsConfig.UserName, vsConfig.Password));
     }
     return(null);
 }
示例#2
0
 private AlarmClient GetDVRAlarmClient()
 {
     if (LampConfig != null)
     {
         return(CHKDVRDevice.GetAlarmClient(LampConfig.IP, (short)LampConfig.Port, LampConfig.UserName, LampConfig.Password));
     }
     return(null);
 }
示例#3
0
 private AlarmClient GetAlarmClient()
 {
     if (AlarmOutConfig != null && !AlarmOutConfig.IP.Equals(""))
     {
         return(CHKDVRDevice.GetAlarmClient(AlarmOutConfig.IP, (short)AlarmOutConfig.Port, AlarmOutConfig.UserName, AlarmOutConfig.Password));
     }
     return(null);
 }
示例#4
0
 private AlarmClient GetDVRAlarmClient()
 {
     if (TrumpetConfig != null)
     {
         return(CHKDVRDevice.GetAlarmClient(TrumpetConfig.IP, (short)TrumpetConfig.Port, TrumpetConfig.UserName, TrumpetConfig.Password));
     }
     return(null);
 }
示例#5
0
        public CHKPTZCtrl(CHKDVRRealPlayer player)
            : base()
        {
            mDevice = player.DVRDevice;
            mPlayer = player;

            MinSpeed = 1;
            MaxSpeed = 7;
        }
示例#6
0
        public CHKPTZCtrl(CHKDVRDevice device, int playHandle, int channel)
            : base()
        {
            mDevice     = device;
            mPlayHandle = playHandle;
            mChannel    = channel;

            MinSpeed = 1;
            MaxSpeed = 7;
        }
示例#7
0
        public bool SyncTime(string ip, string username)
        {
            CHKDVRDevice device = GetDevice(ip, username);

            if (device != null)
            {
                return(device.SyncTime());
            }

            return(false);
        }
示例#8
0
        public bool MakeKeyFrame()
        {
            CHKDVRDevice device = DVRDevice;

            if (device != null && device.IsLogin)
            {
                //CLocalSystem.WriteLog("Debug", "Call HKDVRPlayer.MakeKeyFrame()");
                return(HCNetSDKWrap.NET_DVR_MakeKeyFrame(device.UserID, Channel));
            }
            return(false);
        }
示例#9
0
        public override IVideoDevice GetVideoDevice(string ip, int port, string username, string password, bool checkStatus)
        {
            CHKDVRDevice device = base.GetVideoDevice(ip, port, username, password, checkStatus) as CHKDVRDevice;

            if (device != null)
            {
                device.GetRecordFile().OnDownProgress += new RECORDFILE_DOWNPROGRESS(DoRecordFileDownProgress);
            }

            return(device);
        }
示例#10
0
        public virtual IVideoDevice GetVideoDevice(string ip, int port, string username, string password, bool checkStatus)
        {
            CHKDVRDevice device = this.GetVideoDevice(ip, port, username, password) as CHKDVRDevice;

            if (device != null)
            {
                device.AutoCheckStatus = checkStatus;
            }

            return(device);
        }
示例#11
0
        public int GetStatusEventIgnoreCount(string ip, string username)
        {
            CHKDVRDevice device = GetDevice(ip, username);

            if (device != null)
            {
                return(device.StatusEventIgnoreCount);
            }

            return(-1);
        }
示例#12
0
        public bool SetStatusEventIgnoreCount(string ip, string username, int ignoreCount)
        {
            CHKDVRDevice device = GetDevice(ip, username);

            if (device != null)
            {
                device.StatusEventIgnoreCount = ignoreCount;
                return(true);
            }

            return(false);
        }
示例#13
0
        public CHKDVRDevice GetDevice(string ip, string username, string password, bool checkStatus)
        {
            String key = "Device_" + ip + "_" + username;

            lock (mDevices)
            {
                CHKDVRDevice device = (CHKDVRDevice)mDevices[key];
                if (device == null)
                {
                    device = new CHKDVRDevice(null);
                    try
                    {
                        if (device.Login(ip, 8000, username, password))
                        {
                            device.OnPlayStatusChanged += new PLAYSTATUS_CHANGED(DoPlayStatusChange);
                            mDevices.Add(device.Key, device);
                        }
                        else
                        {
                            device.Dispose();
                            return(null);
                        }
                    }
                    catch
                    {
                        device.Dispose();
                        return(null);
                    }
                }
                else if (!device.IsLogin)
                {
                    try
                    {
                        if (!device.Login(ip, 8000, username, password))
                        {
                            mDevices.Remove(device.Key);
                            device.Dispose();
                            return(null);
                        }
                    }
                    catch
                    {
                        mDevices.Remove(device.Key);
                        device.Dispose();
                        return(null);
                    }
                }

                device.AutoCheckStatus = checkStatus;
                return(device);
            }
        }
示例#14
0
        public AlarmClient GetAlarmClient(String ip, String username, String password)
        {
            CHKDVRDevice device = GetDevice(ip, username, password, false);

            lock (mDevices)
            {
                if (device != null)
                {
                    return(device.GetAlarmClient());
                }
                return(null);
            }
        }
示例#15
0
        public bool Download(DateTime startTime, DateTime stopTime, string fileName)
        {
            CHKDVRDevice device = mFactory.GetVideoDevice(IP, 8000, UserName, Password, true) as CHKDVRDevice;

            if (device != null)
            {
                IRecordFile file = device.GetRecordFile();
                if (file != null)
                {
                    return(file.Download(Channel, startTime, stopTime, fileName));
                }
            }
            return(false);
        }
示例#16
0
        public bool Download(string sFileName, string dFileName)
        {
            CHKDVRDevice device = mFactory.GetVideoDevice(IP, 8000, UserName, Password, true) as CHKDVRDevice;

            if (device != null)
            {
                IRecordFile file = device.GetRecordFile();
                if (file != null)
                {
                    return(file.Download(sFileName, dFileName));
                }
            }
            return(false);
        }
示例#17
0
        public bool StopDownload()
        {
            CHKDVRDevice device = mFactory.GetDevice(IP, UserName);

            if (device != null)
            {
                IRecordFile file = device.GetRecordFile();
                if (file != null)
                {
                    return(file.Stop());
                }
            }
            return(false);
        }
示例#18
0
        private IPTZCtrl GetPTZCtrl(IVideoSourceConfig vsConfig)
        {
            CHKDVRDevice      device = null;
            CHKDVRVideoSource vs     = vsConfig.SystemContext.VideoSourceManager.GetVideoSource(vsConfig.Name) as CHKDVRVideoSource;

            if (vs != null)
            {
                device = vs.DVRDevice;
            }
            else
            {
                device = CHKDVRDevice.GetHKDevice(vsConfig.IP, vsConfig.Port, vsConfig.UserName, vsConfig.Password);
            }

            return(device.GetPTZCtrl(vsConfig.Channel));
        }
示例#19
0
        public CHKDVRBackPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, string fileName, IntPtr hWnd)
            : base(config, device, factory)
        {
            RecordFile = new CHKDVRRecordFile(device);
            RecordFile.RemoteFileName = fileName;

            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }
            mType = 1;

            Target = fileName;
        }
示例#20
0
        public CHKDVRBackPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, int channel, ref DateTime startTime, ref DateTime stopTime, IntPtr hWnd)
            : base(config, device, factory)
        {
            RecordFile           = new CHKDVRRecordFile(device);
            RecordFile.Channel   = channel;
            RecordFile.StartTime = startTime;
            RecordFile.StopTime  = stopTime;

            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }

            mType = 2;

            mTStartTime         = startTime;
            mStartTime.dwYear   = startTime.Year;
            mStartTime.dwMonth  = startTime.Month;
            mStartTime.dwDay    = startTime.Day;
            mStartTime.dwHour   = startTime.Hour;
            mStartTime.dwMinute = startTime.Minute;
            mStartTime.dwSecond = startTime.Second;

            mTStopTime         = stopTime;
            mStopTime.dwYear   = stopTime.Year;
            mStopTime.dwMonth  = stopTime.Month;
            mStopTime.dwDay    = stopTime.Day;
            mStopTime.dwHour   = stopTime.Hour;
            mStopTime.dwMinute = stopTime.Minute;
            mStopTime.dwSecond = stopTime.Second;

            Target = (Int32)channel;
        }
示例#21
0
        public CHKDVRRealPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, int channel, uint linkmode, IntPtr hWnd, string multiCastIP)
            : base(config, device, factory)
        {
            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }

            /* 最高位(31)为0表示主码流,为1表示子码流,0-30位表示码流连接方式:0:TCP方式,1:UDP方式,2:多播方式,3 - RTP方式,4—音视频分开 */
            //子码流: 0x80000000
            mClientInfo.lLinkMode    = linkmode;
            mClientInfo.sMultiCastIP = multiCastIP;
            mClientInfo.hPlayWnd     = HWnd;

            PTZCtrl = new CHKPTZCtrl(this);

            Target = (Int32)channel;
        }
示例#22
0
 protected override bool CleanupAction()
 {
     mDVRDevice = null;
     return(true);
 }
示例#23
0
 public RecordFileInfo[] ListFile()
 {
     return(CHKDVRDevice.ListFile(DVRDevice.UserID, Channel, ref mTStartTime, ref mTStopTime));
 }
示例#24
0
 public RecordFileInfo[] ListFile(ref DateTime startTime, ref DateTime stopTime)
 {
     return(CHKDVRDevice.ListFile(DVRDevice.UserID, Channel, ref startTime, ref stopTime));
 }
示例#25
0
 protected override bool InitAction()
 {
     CLocalSystem.WriteDebugLog(string.Format("CPTZAction({0}).InitAction: IP={1}, Port={2}, UserName={3}, Password={4}", Name, PTZConfig.IP, PTZConfig.Port, PTZConfig.UserName, PTZConfig.Password));
     mDVRDevice = CHKDVRDevice.GetHKDevice(PTZConfig.IP, (short)PTZConfig.Port, PTZConfig.UserName, PTZConfig.Password);
     return(mDVRDevice != null);
 }