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