//constructor to set all of these variables from an RTP model pass
 public ClientModel(int rand, Video vid, RTPmodel rtp)
 {
     id              = rand;
     seq             = 1;
     _video          = vid;
     _RTPmodel       = rtp;
     _timer          = new RTSPtimer(rand);
     _timer.Interval = interval;
 }
示例#2
0
        private void Time_Process(Object obj, ElapsedEventArgs args)
        {
            RTSPtimer t = (RTSPtimer)obj;

            for (int i = 0; i < _ClientModels.Count; i++)
            {
                if (_ClientModels.ElementAt(i).Get_ID() == t.Get_ID())
                {
                    _ClientModels.ElementAt(i).Inc_Seq();
                    RTPmodel   rtp      = _ClientModels.ElementAt(i).Get_RTP();
                    IPEndPoint ep       = rtp.Get_EndPoint();
                    Video      vid      = _ClientModels.ElementAt(i).Get_Video();
                    byte[]     rcv      = vid.Get_NextFrame();
                    RTPpacket  rtp_pack = new RTPpacket(rcv, _ClientModels.ElementAt(i).Get_Seq(), rcv.Length);

                    if (_view.Get_Check())
                    {
                        Add_Server(rtp_pack.Get_Header() + "\r\n");
                    }
                    rtp.Send_Data(rtp_pack.Get_Bytes());
                }
            }
        }