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 static extern int NET_DVR_RealPlay_V30(int lUserID, ref NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 fRealDataCallBack_V30, IntPtr pUser, bool bBlocked);
public void Start(CameraInfo camera, CardOutType cardOutType, int id) { CurrentCardOutType = cardOutType; CurrentCardOutId = id; IsValidChannel = false; NET_DVR_CLIENTINFO struClientInfo; //定义预览参数结构体 struClientInfo.lChannel = camera.ChannelNo; struClientInfo.lLinkMode = 0; struClientInfo.hPlayWnd = IntPtr.Zero; //camera.Handle; int m_iSubWndIndex = 1000; //用户数据 struClientInfo.sMultiCastIP = "0.0.0.0"; // 实时预览 不回调 // m_lPlayHandle = HCNetSDK.NET_DVR_RealPlay_V30(_deviceInfo.ServiceID, ref struClientInfo, null, m_iSubWndIndex, true); //实时预览 回调 _cameraInfo = camera; ListPorts = new Dictionary<int, IntPtr>(); switch (cardOutType) { case CardOutType.DefaultDisplay: stream_callback = new RealDataCallBack_V30(g_DefaultRealDataCallBack_V30); break; case CardOutType.SynGroup: stream_callback = new RealDataCallBack_V30(g_SynGroupRealDataCallBack_V30); break; case CardOutType.GroupSwitch: stream_callback = new RealDataCallBack_V30(g_GroupSwitchRealDataCallBack_V30); break; case CardOutType.ProgSwitch: stream_callback = new RealDataCallBack_V30(g_ProgSwitchRealDataCallBack_V30); break; default: stream_callback = new RealDataCallBack_V30(g_RealDataCallBack_V30); break; } GCHandle aa = GCHandle.Alloc(stream_callback); GCHandle bb = GCHandle.Alloc(serial_callback); m_lPlayHandle = HCNetSDK.NET_DVR_RealPlay_V30(_deviceInfo.ServiceID, ref struClientInfo, stream_callback, m_iSubWndIndex, true); //m_lPlayHandle = HCNetSDK.NET_DVR_RealPlay_V30(_deviceInfo.ServiceID, ref struClientInfo, null, m_iSubWndIndex, true); camera.PlayHandle = m_lPlayHandle; int SerialHandle = -1; if (!ListSerialHandle.ContainsKey(_deviceInfo.DeviceId)) { serial_callback = new HCNetSDK.SerialDataCallBack(g_SerialDataCallBack); SerialHandle = HCNetSDK.NET_DVR_SerialStart(_deviceInfo.ServiceID, 1, serial_callback, (uint)m_iSubWndIndex); if (SerialHandle != -1) { ListSerialHandle.Add(_deviceInfo.DeviceId, SerialHandle); } } camera.SerialHandle = SerialHandle; _cameraInfo = camera; if (m_lPlayHandle > -1) { IsValidChannel = true; } processFile = AppDomain.CurrentDomain.BaseDirectory + "Temp\\"; if (!Directory.Exists(processFile)) { Directory.CreateDirectory(processFile); } TempPath = processFile; processFile = processFile + "delectfile.jpg"; _cameraInfo = camera; if (thread == null) { stopEvent = new ManualResetEvent(false); thread = new Thread(WorkerThread); thread.Name = camera.Name; thread.Start(); } }
public static extern int USNTDVR_RealPlay_V30(int lUserID, ref NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 realDataCallBack, IntPtr pUser, int bBlocked);
public static int USNTDVR_RealPlay_V30(int lUserID, ref NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 realDataCallBack, IntPtr pUser, int bBlocked) { if (_isX64) { return(USNTDvrDll64.USNTDVR_RealPlay_V30(lUserID, ref lpClientInfo, realDataCallBack, pUser, bBlocked)); } else { return(USNTDvrDll32.USNTDVR_RealPlay_V30(lUserID, ref lpClientInfo, realDataCallBack, pUser, bBlocked)); } }
public static extern int NET_DVR_RealPlay_V30(int lUserID, ref NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 fRealDataCallBack_V30, int pUser, bool bBlocked);