/// <summary> /// 远程 /// </summary> /// <param name="para"></param> /// <returns></returns> public bool StopRemoteBackplayByTime() { SDK_Hik.NET_DVR_StopPlayBack(m_lPlayHandle); m_lPlayHandle = -1; SDK_Hik.NET_DVR_Logout_V30(m_lUserID); m_lUserID = -1; PicPlayMain.Refresh(); return(false); }
public override bool VideoClose() { VideoEnvironment_ZHSR.ZHSR_Main_Callback_Event -= VideoEnvironment_ZHSR_ZHSR_Main_Callback_Event; SDK_ZHSRSDK.win_sta_stop_task(VideoEnvironment_ZHSR.Session, Monitor_Guid); VideoPlayCallback(new VideoPlayCallbackValue { evType = Enum_VideoPlayEventType.VideoClose }); CommonMethod.Common.Delay_Millisecond(300); PicPlayMain.Refresh(); return(true); }
/// <summary> /// 视频播放区域改变 /// </summary> private void CloundSee_VideoLPRECTChanged() { SDK_JCSDK.LPRECT rectMain = new SDK_JCSDK.LPRECT(); Rectangle rect1 = PicPlayMain.RectangleToScreen(PicPlayMain.ClientRectangle); rectMain.Left = rect1.Left; rectMain.Right = rect1.Right; rectMain.Top = rect1.Top; rectMain.Bottom = rect1.Bottom; intptrCloundSee_PlayRect = Marshal.AllocHGlobal(Marshal.SizeOf(rectMain)); Marshal.StructureToPtr(rectMain, intptrCloundSee_PlayRect, true); }
public bool StopRemoteBackplayByTime() { //停止回放 SDK_ZLNetSDK.ZLNET_StopPlayBack(lPlayHandle); DebugRelevant.DebugLog(this, "ZLNET_StopPlayBack"); lPlayHandle = 0; //登出设备 SDK_ZLNetSDK.ZLNET_Logout(m_nDeviceID); DebugRelevant.DebugLog(this, "ZLNET_Logout"); m_nDeviceID = 0; PicPlayMain.Refresh(); BackplayStatus = VideoRemoteBackplayStatus.StandBy; return(false); }
public bool StartRemoteBackplayByTime(VideoRemotePlayByTimePara para) { if (lPlayHandle > 0) { SDK_ZLNetSDK.ZLNET_StopPlayBack(lPlayHandle); lPlayHandle = 0; PicPlayMain.Refresh(); } VideoInfo vInfo = para.CameraInfo.VideoInfo; CameraInfo cInfo = para.CameraInfo; if (CurrentVideoInfo != null && CurrentVideoInfo.VideoServerIP == para.CameraInfo.VideoInfo.VideoServerIP && CurrentVideoInfo.DVSConnectPort == para.CameraInfo.VideoInfo.DVSConnectPort && m_nDeviceID > 0) { //表示与前一次预览是同一台视频 并且登陆成功 不在重复进行登陆操作 CurrentVideoInfo = vInfo; CurrentCameraInfo = cInfo; DebugRelevant.DebugLog(this, "相同设备,并且登陆成功,不重复登陆"); } else { if (m_nDeviceID > 0) { SDK_ZLNetSDK.ZLNET_Logout(m_nDeviceID); DebugRelevant.DebugLog(this, "ZLNET_Logout"); m_nDeviceID = 0; } CurrentVideoInfo = vInfo; CurrentCameraInfo = cInfo; //登陆设备 int err = 0; SDK_ZLNetSDK.ZLNET_DEVICEINFO zlDevice = new SDK_ZLNetSDK.ZLNET_DEVICEINFO(); m_nDeviceID = SDK_ZLNetSDK.ZLNET_LoginEx(CurrentVideoInfo.DVSAddress, Convert.ToUInt16(CurrentVideoInfo.DVSConnectPort), CurrentVideoInfo.UserName, CurrentVideoInfo.Password, 0, (IntPtr)0, ref zlDevice, ref err); if (m_nDeviceID == 0) { DebugRelevant.DebugLog(this, "ZLNET_LoginEx Excepion,error:" + err); return(false); } DebugRelevant.DebugLog(this, "ZLNET_LoginEx Sueecss"); } //调用按照时间回放接口 //ZLNET_PlayBackByTimeV3 SDK_ZLNetSDK.ZLNET_PLAY_BY_TIME_PARAM sdkpara = new SDK_ZLNetSDK.ZLNET_PLAY_BY_TIME_PARAM { nChannel = CurrentCameraInfo.Channel - 1, tmStart = SDK_ZLNetSDK.ConvertToNetTime(para.StartPlayTime), tmEnd = SDK_ZLNetSDK.ConvertToNetTime(para.EndPlayTime), hWnd = IntPtrPlayMain, nStreamType = 2, nMediaFlag = 0, }; downLoadPosCallBack = new SDK_ZLNetSDK.fZLDownLoadPosCallBack(DownLoadPosCallBack); dataCallback = new SDK_ZLNetSDK.fZLDataCallBack(DataCallback); IntPtr iPosUser = Marshal.StringToHGlobalAnsi("iPosUser"); IntPtr iData = Marshal.StringToHGlobalAnsi("iData"); lPlayHandle = SDK_ZLNetSDK.ZLNET_PlayBackByTimeV3(m_nDeviceID, ref sdkpara, downLoadPosCallBack, iPosUser, dataCallback, iData); if (lPlayHandle == 0) { SDK_ZLNetSDK.ZLNET_Logout(m_nDeviceID); m_nDeviceID = 0; UInt32 erroe = SDK_ZLNetSDK.ZLNET_GetLastError(); DebugRelevant.DebugLog(this, "ZLNET_PlayBackByTimeV3 Exception,error:" + erroe); return(false); } DebugRelevant.DebugLog(this, "ZLNET_PlayBackByTimeV3 Success"); BackplayStatus = VideoRemoteBackplayStatus.RemoteBackplayByTimeStarted; //回放控制 return(false); }