public int ConnectRealPlay( ref DEV_INFO pDev, int nChannel)
        {
            if(m_iPlayhandle != -1)
            {

                if (0 != XMSDK.H264_DVR_StopRealPlay(m_iPlayhandle, (uint)this.Handle))
                {
                    //TRACE("H264_DVR_StopRealPlay fail m_iPlayhandle = %d", m_iPlayhandle);
                }
                if(m_bSound)
                {
                    OnCloseSound();
                }
            }

            H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO();

            playstru.nChannel = nChannel;
            playstru.nStream = 0;
            playstru.nMode = 0;
            playstru.hWnd=this.Handle;
            m_iPlayhandle = XMSDK.H264_DVR_RealPlay(pDev.lLoginID, ref playstru);
            if(m_iPlayhandle <= 0 )
            {
                Int32 dwErr = XMSDK.H264_DVR_GetLastError();
                    StringBuilder sTemp = new StringBuilder("");
                    sTemp.AppendFormat("access {0} channel{1} fail, dwErr = {2}",pDev.szDevName,nChannel, dwErr);
                    MessageBox.Show(sTemp.ToString());
            }
            else
            {
                XMSDK.H264_DVR_MakeKeyFrame(pDev.lLoginID, nChannel, 0);
            }
            m_lLogin = pDev.lLoginID;
            m_iChannel = nChannel;
            return m_iPlayhandle;
        }
Exemplo n.º 2
0
        public int ConnectRealPlay(ref DEV_INFO pDev, int nChannel)
        {
            if (m_iPlayhandle != -1)
            {
                if (0 != XMSDK.H264_DVR_StopRealPlay(m_iPlayhandle, (uint)this.Handle))
                {
                    //TRACE("H264_DVR_StopRealPlay fail m_iPlayhandle = %d", m_iPlayhandle);
                }
                if (m_bSound)
                {
                    OnCloseSound();
                }
            }

            H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO();

            playstru.nChannel = nChannel;
            playstru.nStream  = 0;
            playstru.nMode    = 0;
            playstru.hWnd     = this.Handle;
            m_iPlayhandle     = XMSDK.H264_DVR_RealPlay(pDev.lLoginID, ref playstru);
            if (m_iPlayhandle <= 0)
            {
                Int32         dwErr = XMSDK.H264_DVR_GetLastError();
                StringBuilder sTemp = new StringBuilder("");
                sTemp.AppendFormat("access {0} channel{1} fail, dwErr = {2}", pDev.szDevName, nChannel, dwErr);
                MessageBox.Show(sTemp.ToString());
            }
            else
            {
                XMSDK.H264_DVR_MakeKeyFrame(pDev.lLoginID, nChannel, 0);
            }
            m_lLogin   = pDev.lLoginID;
            m_iChannel = nChannel;
            return(m_iPlayhandle);
        }
Exemplo n.º 3
0
 public static extern int H264_DVR_RealPlay(int lLoginID, ref H264_DVR_CLIENTINFO lpClientInfo);
Exemplo n.º 4
0
 public static extern int H264_DVR_RealPlay(int lLoginID, ref H264_DVR_CLIENTINFO lpClientInfo);