Exemple #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;
     }
 }
Exemple #2
0
 public bool RemoveParticipant(RtpParticipant participant)
 {
     lock (_objLock)
     {
         int c = this.pc.RemoveAll(t => t.SSRC == participant.SSRC);
         return(c > 0 ? true : false);
     }
 }
Exemple #3
0
 public void AddParticipant(RtpParticipant participant)
 {
     lock (_objLock)
     {
         try
         {
             participant.OnRTCPTimer = new RtpParticipant.RTCPTimerCallBack(this.OnRTCPTimerCallBack);
             this.pc.Add(participant);
         }
         catch
         {
         }
     }
 }
Exemple #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
         {
         }
     }
 }
Exemple #5
0
 public bool OnRTCPTimerCallBack(RtpParticipant participant)
 {
     return(true);
 }
Exemple #6
0
 public ParticipantContainer()
 {
     this.rtpSocket   = null;
     this.rtcpSocket  = null;
     this.participant = null;
 }
Exemple #7
0
 public ParticipantContainer(RtpParticipant p, Socket socket)
 {
     this.rtcpSocket  = null;
     this.rtpSocket   = socket;
     this.participant = p;
 }