Esempio n. 1
0
 /// <summary>
 /// 开始预览
 /// </summary>
 /// <param name="Handle"></param>
 /// <returns></returns>
 public bool StartPreview(IntPtr Handle)
 {
     if (string.IsNullOrEmpty(this.Ip))
     {
         return(false);
     }
     HWPlayer.HWPlayer_Init(true);
     hVideoHandle = HWPlayer.HWPlayer_Open(new StringBuilder(string.Format("rtsp://{0}:8557/PSIA/Streaming/channels/2?videoCodecType=H.264", this.Ip)), 1);
     if (hVideoHandle != IntPtr.Zero)
     {
         HWPlayer.HWPlayer_SetPlayWnd(hVideoHandle, Handle);
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// 关闭设备
        /// </summary>
        /// <returns></returns>
        public bool Close()
        {
            uint uRes = DeviceInterface.HWTC_DisconnectCamera(this.pHandle);

            if ((DeviceInterface.FEEKBACK_TYPE)uRes == DeviceInterface.FEEKBACK_TYPE.RESULT_OK)
            {
                //关闭视频预览
                HWPlayer.HWPlayer_Quit();
                ForGlobal.g_DeviceTable = null;
                return(true);
            }
            else
            {
                ErrorStr = uRes.ToString();
                return(false);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 停止预览
 /// </summary>
 /// <returns></returns>
 public bool StopPreview()
 {
     return(HWPlayer.HWPlayer_Close(hVideoHandle));
 }