Ejemplo n.º 1
0
 void getChannel(Session.Channel chnl, BVCU_PUOneChannelInfo channel)
 {
     chnl.channelName = channel.szName;
     BVCU.AVDirection avDir = BVCU.GetAVDirection(channel.iMediaDir);
     chnl.audioPlayback = avDir.audioRecv;
     chnl.speak         = avDir.audioSnd;
     chnl.video         = avDir.videoRecv;
     chnl.ptzIdx        = channel.iPTZIndex;
     chnl.channelNo     = channel.iChannelIndex;
 }
Ejemplo n.º 2
0
        void Cmd_OnGetPuList(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iOnlineStatus, IntPtr ptPUOneChannelInfo, int iFinished)
        {
            BVCU_PUOneChannelInfo puOneChannelInfo = (BVCU_PUOneChannelInfo)Marshal.PtrToStructure(ptPUOneChannelInfo, typeof(BVCU_PUOneChannelInfo));

            Byte[] bpuid   = new Byte[BVCU.BVCU_MAX_ID_LEN + 1];
            Byte[] bpuname = new Byte[BVCU.BVCU_MAX_NAME_LEN + 1];
            Marshal.Copy(ptPuId, bpuid, 0, BVCU.BVCU_MAX_ID_LEN + 1);
            Marshal.Copy(ptPuName, bpuname, 0, BVCU.BVCU_MAX_ID_LEN + 1);
            string spuid   = System.Text.Encoding.UTF8.GetString(bpuid).Split('\0')[0];
            string spuname = System.Text.Encoding.UTF8.GetString(bpuname).Split('\0')[0];

            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
                return;
            }
            Channel chnl = new Channel();

            getChannel(chnl, puOneChannelInfo);
            m_session.OnGetPu(spuname, spuid, iOnlineStatus, chnl);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Pu status change
        /// </summary>
        private void onNotifyChannelInfo(BVCU_PUChannelInfo puChannelInfo, BVCU_PUOneChannelInfo puOneChannelInfo)
        {
            bool bNeedClearGps = false;
            bool bNeedClearTsp = false;

            if (puChannelInfo.iOnlineStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
            {
                m_dialog.clearDialog(puChannelInfo.szPUID, puOneChannelInfo.iChannelIndex);
                bNeedClearGps = m_dialog.clearGpsDialog(puChannelInfo.szPUID, puOneChannelInfo.iChannelIndex);
                bNeedClearTsp = m_dialog.clearTspDialog(puChannelInfo.szPUID, puOneChannelInfo.iChannelIndex);
                m_session.clearGpsDataList(puChannelInfo.szPUID, puOneChannelInfo.iChannelIndex, bNeedClearGps | bNeedClearTsp);
                //m_session.OnRemovePu(puChannelInfo.szPUID);
            }

            Channel chnl = m_session.getChannel(puChannelInfo.szPUID, puOneChannelInfo.iChannelIndex);

            if (null == chnl)
            {
                chnl = new Channel();
            }

            getChannel(chnl, puOneChannelInfo);
            m_session.OnGetPu(puChannelInfo.szPUName, puChannelInfo.szPUID, puChannelInfo.iOnlineStatus, chnl);
        }
Ejemplo n.º 4
0
        void Cmd_OnGetPuList(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iStatus, ref BVCU_PUOneChannelInfo channel, int iFinished)
        {
            string puId   = Marshal.PtrToStringAnsi(ptPuId, BVCU.BVCU_MAX_ID_LEN + 1).Split('\0')[0];
            string puName = Marshal.PtrToStringAnsi(ptPuName, BVCU.BVCU_MAX_NAME_LEN + 1).Split('\0')[0];

            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
            }
            Session.Channel chnl = new Session.Channel();
            if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
            {
                chnl.online = false;
            }
            else
            {
                chnl.online = true;
            }
            getChannel(chnl, channel);
            m_session.OnGetPu(puName, puId, chnl);

            /*if (channel.szName.Equals("gps"))
             * {
             *  chnl = new Session.Channel();
             *  channel.szName = "TSP";
             *  channel.iPTZIndex = 15;
             *  channel.iMediaDir = 32;
             *  channel.iChannelIndex = 65792;
             *  if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
             *  {
             *      chnl.online = false;
             *  }
             *  else
             *  {
             *      chnl.online = true;
             *  }
             *  getChannel(chnl, channel);
             *  m_session.OnGetPu(puName, puId, chnl);
             * }*/
        }
Ejemplo n.º 5
0
        void Server_ProcNotifyChannelInfo(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iStatus, ref BVCU_PUOneChannelInfo channel, int iFinished)
        {
            string puId   = Marshal.PtrToStringAnsi(ptPuId, BVCU.BVCU_MAX_ID_LEN + 1).Split('\0')[0];
            string puName = Marshal.PtrToStringAnsi(ptPuName, BVCU.BVCU_MAX_NAME_LEN + 1).Split('\0')[0];

            if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
            {
                m_session.OnRemovePu(puId);
            }
            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
            }
            Session.Channel chnl = new Session.Channel();
            getChannel(chnl, channel);
            m_session.OnGetPu(puName, puId, chnl);
            return;
        }