/// <summary> /// 停止播放 /// </summary> /// <param name="nvr"></param> /// <param name="session"></param> /// <returns></returns> public int realPlayStop(int nvr, int session) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_CFG)); } if (nvrInfo.session < 1) { return(Convert.ToInt32(NVR_ERROR.NO_LOGIN)); } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_ADP)); } nvrAdp.nvrRealPlayStop(session); return(0); }
/// <summary> /// 关闭实时播放 /// </summary> /// <param name="nvr"></param> /// <param name="session"></param> public void playBackClose(int nvr, int session) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return; } if (nvrInfo.session < 1) { return; } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return; } nvrAdp.playBackClose(session); }
public int playBackCtl(int nvr, int session, PLAY_BACK_CMD cmd, Object parm) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_CFG)); } if (nvrInfo.session < 1) { return(Convert.ToInt32(NVR_ERROR.NO_LOGIN)); } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_ADP)); } return(nvrAdp.playBackCtl(session, cmd, parm)); }
/// <summary> /// 播放历史视频 /// </summary> /// <param name="nvr"></param> /// <param name="channel"></param> /// <param name="start"></param> /// <param name="end"></param> /// <param name="handle"></param> /// <param name="iPlayBack"></param> /// <returns></returns> public int playBackByTime(int nvr, int channel, DateTime start, DateTime end, IntPtr handle, PlayBackEvent iPlayBack) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_CFG)); } if (nvrInfo.session < 1) { return(Convert.ToInt32(NVR_ERROR.NO_LOGIN)); } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_ADP)); } return(nvrAdp.playBackByTime(nvrInfo.session, channel, start, end, handle, iPlayBack)); }
/// <summary> /// 查询一天内的历史视频 /// </summary> /// <param name="nvr"></param> /// <param name="channel"></param> /// <param name="date"></param> public List <DATA_PAIR> searchHistory(int nvr, int channel, DateTime start, DateTime end) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return(null); } if (nvrInfo.session < 1) { return(null); } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return(null); } return(nvrAdp.searchHistory(nvrInfo.session, channel, start, end)); }
/// <summary> /// 变焦控制 /// </summary> /// <param name="nvr"></param> /// <param name="channel"></param> /// <param name="dir"></param> public void zoomStart(int nvr, int channel, ZOOM_DIR dir) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return; } if (nvrInfo.session < 1) { return; } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return; } nvrAdp.nvrZoom(nvrInfo.session, channel, dir); }
/// <summary> /// 停止PTZ /// </summary> /// <param name="nvr"></param> /// <param name="channel"></param> public void ptzStop(int nvr, int channel) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return; } if (nvrInfo.session < 1) { return; } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return; } nvrAdp.nvrPtzStop(nvrInfo.session, channel); }
/// <summary> /// PTZ控制开始 /// </summary> /// <param name="nvr"></param> /// <param name="channel"></param> /// <param name="dir"></param> /// <param name="speed"></param> public void ptzCtlStart(int nvr, int channel, PTZ_DIR dir, int speed) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return; } if (nvrInfo.session < 1) { return; } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return; } nvrAdp.nvrPtzStart(nvrInfo.session, channel, dir, speed); }
/// <summary> /// 实时视频播放 /// </summary> /// <param name="nvr"></param> /// <param name="cha"></param> /// <param name="handle"></param> /// <returns></returns> public int realPlay(int nvr, int cha, IntPtr handle) { NVR_INFO nvrInfo = (NVR_INFO)nvrConfig[nvr]; if (nvrInfo == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_CFG)); } if (nvrInfo.session < 1) { return(Convert.ToInt32(NVR_ERROR.NO_LOGIN)); } NvrInterface nvrAdp = (NvrInterface)nvrAdapters[nvrInfo.type]; if (nvrAdp == null) { return(Convert.ToInt32(NVR_ERROR.NO_NVR_ADP)); } return(nvrAdp.nvrRealPlay(nvrInfo.session, cha, handle)); }