Пример #1
0
        /// <summary>
        /// Event handler for an RTP packet being received by the RTP session.
        /// Used for measuring transmission statistics.
        /// </summary>
        internal void RecordRtpPacketReceived(RTPPacket rtpPacket)
        {
            LastActivityAt = DateTime.Now;
            IsTimedOut     = false;
            PacketsReceivedCount++;
            OctetsReceivedCount += (uint)rtpPacket.Payload.Length;

            if (m_receptionReport == null)
            {
                m_receptionReport = new ReceptionReport(rtpPacket.Header.SyncSource);
            }

            m_receptionReport.RtpPacketReceived(rtpPacket.Header.SequenceNumber, rtpPacket.Header.Timestamp, DateTimeToNtpTimestamp32(DateTime.Now));
        }
Пример #2
0
        /// <summary>
        /// Event handler for an RTP packet being received by the RTP session.
        /// </summary>
        internal void RtpPacketReceived(RTPPacket rtpPacket)
        {
            RTPLastActivityAt = DateTime.Now;
            PacketsReceivedCount++;
            OctetsReceivedCount += (uint)rtpPacket.Payload.Length;

            if (m_receptionReport == null)
            {
                m_receptionReport = new ReceptionReport(rtpPacket.Header.SyncSource);
            }

            bool ready = m_receptionReport.RtpPacketReceived(rtpPacket.Header.SequenceNumber, rtpPacket.Header.Timestamp, DateTimeToNtpTimestamp32(DateTime.Now));

            if (!m_isClosed && ready == true && m_rtcpReportTimer == null)
            {
                // Send the initial RTCP sender report once the first RTP packet arrives.
                SendReportTimerCallback(null);
            }
        }