Exemplo n.º 1
0
 public void Send(RtpPacket packet)
 {
     try
     {
         foreach (var item in this.pc)
         {
             RtpParticipant current = item;
             if (current.Active)
             {
                 IPEndPoint rTPEndpoint = current.RTPEndpoint;
                 byte[]     array       = current.PrepareSendRTP(packet);
                 if (array != null)
                 {
                     this.client.Send(array, rTPEndpoint);
                     short num = current.SequenceNumber;
                     num += 1;
                     current.SequenceNumber = num;
                     uint num2 = current.PacketCount;
                     num2 += 1u;
                     current.PacketCount = num2;
                     current.OctetCount += packet.DataSize;
                 }
             }
         }
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 2
0
 public bool RemoveParticipant(RtpParticipant participant)
 {
     lock (_objLock)
     {
         int c = this.pc.RemoveAll(t => t.SSRC == participant.SSRC);
         return(c > 0 ? true : false);
     }
 }
Exemplo n.º 3
0
 public void AddParticipant(RtpParticipant participant)
 {
     lock (_objLock)
     {
         try
         {
             participant.OnRTCPTimer = new RtpParticipant.RTCPTimerCallBack(this.OnRTCPTimerCallBack);
             this.pc.Add(participant);
         }
         catch
         {
         }
     }
 }
Exemplo n.º 4
0
 public virtual void AddParticipant(RtpParticipant participant)
 {
     lock (_objLock)
     {
         try
         {
             Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
             socket.Bind(participant.RTPEndpoint);
             ParticipantContainer participantContainer = new ParticipantContainer(participant, socket);
             this.participants.Add(participantContainer);
             this.CreateSocketArrays();
             if (participant.IsRTCPActive)
             {
                 Socket socket2 = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                 socket2.Bind(participant.RTCPEndpoint);
                 participantContainer.RtcpSocket = socket2;
             }
         }
         catch
         {
         }
     }
 }
Exemplo n.º 5
0
 public bool OnRTCPTimerCallBack(RtpParticipant participant)
 {
     return(true);
 }
Exemplo n.º 6
0
 public ParticipantContainer()
 {
     this.rtpSocket   = null;
     this.rtcpSocket  = null;
     this.participant = null;
 }
Exemplo n.º 7
0
 public ParticipantContainer(RtpParticipant p, Socket socket)
 {
     this.rtcpSocket  = null;
     this.rtpSocket   = socket;
     this.participant = p;
 }