Exemplo n.º 1
0
        internal void UpdateRtcpData()
        {
            SenderReport sr = new SenderReport();

            sr.BytesSent   = bytesSent;
            sr.PacketCount = packetsSent;

            // andrew --  Note: this differs from the RTP spec (see Perkins, page 108)
            sr.Time = (ulong)DateTime.Now.Ticks;

            sr.TimeStamp = 0; // XXX, obviously, we don't track this...

            rtpSession.AddSenderReport(ssrc, sr);

            //  Add source description...
            rtpSession.AddSdes(ssrc, sdes);
        }
Exemplo n.º 2
0
 public SenderReportEventArgs(uint ssrc, SenderReport senderReport)
 {
     this.ssrc = ssrc;
     this.senderReport = senderReport;
 }
Exemplo n.º 3
0
 private void AddSenderReport(uint ssrc, SenderReport sr)
 {
     cpb.Add_SenderReport(ssrc, sr);
 }
Exemplo n.º 4
0
 void RtpSender.IRtpSession.AddSenderReport(uint ssrc, SenderReport sr)
 {
     AddSenderReport(ssrc, sr);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Construct a SenderReport packet from an existing RtcpPacket
 /// </summary>
 /// <param name="packet">Packet to process</param>
 public SrPacket(RtcpPacket packet) : base(Rtcp.PacketType.SR)
 {
     sr = new SenderReport();
     ProcessPacket(packet);
 }
Exemplo n.º 6
0
        public SrPacket(uint ssrc, SenderReport sr) : base(Rtcp.PacketType.SR)
        {
            if(sr == null)
            {
                throw new RtcpPacketException("Need a real SenderReport, not null");
            }

            SSRC = ssrc;
            this.sr = sr;
        }
Exemplo n.º 7
0
 public void Add_SenderReport(uint ssrc, SenderReport sr)
 {
     senderReportPackets.Enqueue(new SrPacket(ssrc, sr));
 }
Exemplo n.º 8
0
 public SenderReportEventArgs(uint ssrc, SenderReport senderReport)
 {
     this.ssrc         = ssrc;
     this.senderReport = senderReport;
 }
Exemplo n.º 9
0
        internal void UpdateRtcpData()
        {
            SenderReport sr = new SenderReport();
            sr.BytesSent = bytesSent;
            sr.PacketCount = packetsSent;

            // andrew --  Note: this differs from the RTP spec (see Perkins, page 108)
            sr.Time = (ulong)DateTime.Now.Ticks;

            sr.TimeStamp = 0; // XXX, obviously, we don't track this...

            rtpSession.AddSenderReport(ssrc, sr);

            //  Add source description...
            rtpSession.AddSdes(ssrc, sdes);
        }
Exemplo n.º 10
0
        public void updateSenderState(SenderReport report, long when)
        {

            if (when <= lastSendUpdate)
                return; // duplicate

            if (lastSendUpdate != 0)
            {
                double bytesSentThisInterval = (report.BytesSent - this.bytesSent);
                double packetsSentThisInterval = (report.PacketCount - this.packetsSent);

                double seconds = ((double)(when - lastSendUpdate)) / TimeSpan.TicksPerSecond;

                // convert to bits and kilobits
                dataRate = 8 * bytesSentThisInterval / seconds / 1000.0;
                packetRate = packetsSentThisInterval / seconds;
            }

            // update state
            this.bytesSent = report.BytesSent;
            this.packetsSent = report.PacketCount;
            this.lastSendUpdate = when;
        }
Exemplo n.º 11
0
        private void RaiseSenderReportReceivedEvent(uint ssrc,SenderReport senderReport)
        {
            object[] args = { this, new RtpEvents.SenderReportEventArgs(ssrc, senderReport) };

            EventThrower.QueueUserWorkItem(new RtpEvents.RaiseEvent(RtpEvents.RaiseSenderReportEvent), args);
        }
Exemplo n.º 12
0
        public SrPacket(uint ssrc, SenderReport sr) : base(Rtcp.PacketType.SR)
        {
            if(sr == null)
            {
                throw new RtcpPacketException(Strings.NeedARealSenderReport);
            }

            SSRC = ssrc;
            this.sr = sr;
        }