Exemple #1
0
 public VideoRTPFramer(RTPStream client,
                       byte rtpPayloadType,
                       uint rtpTimestampFrequency,
                       string rtpPayloadFormatName) :
     base(client, rtpPayloadType, rtpTimestampFrequency, rtpPayloadFormatName)
 {
 }
        public MultiFramedRTPFramer(RTPStream client, byte rtpPayloadType,
                                    uint rtpTimestampFrequency,
                                    string rtpPayloadFormatName,
                                    uint numChannels = 1) :
            base(rtpPayloadType, rtpTimestampFrequency, rtpPayloadFormatName, numChannels)
        {
            _client = client;

            _outputBuffer  = new PacketBuffer(1000, RTP_PAYLOAD_MAX_SIZE);
            _maxPacketSize = RTP_PAYLOAD_MAX_SIZE;             // save value, in case subclasses need it	setPacketSizes((RTP_PAYLOAD_PREFERRED_SIZE), (RTP_PAYLOAD_MAX_SIZE));
        }
Exemple #3
0
        public async override Task SendSRReport(RTPStream stream, RTPSessionState[] sessions)
        {
            RTPSessionState session = new RTPSessionState()
            {
                TCP            = false,
                RTPTransport   = RtpUdpClient,
                RTCPTransport  = RtcpUdpClient,
                RTPIPEndPoint  = new IPEndPoint(_address, _rtpPort),
                RTCPIPEndPoint = new IPEndPoint(_address, _rtcpPort),
                OctetCount     = 0,
                PacketsCount   = 0
            };

            var sr = new RTCPSRPacket(stream, session);
            await sr.sendReport();
        }
        public bool ParseReport(RTCPPacket packet, RTPStream stream, IPEndPoint fromAddress)
        {
            uint reportBlocksSize = (uint)(packet.ReportCount * (6 * 4));
            int  length           = (int)packet.Reader.BaseStream.Length - (int)packet.Reader.BaseStream.Position;

            if (length < reportBlocksSize)
            {
                return(false);
            }

            for (int i = 0; i < packet.ReportCount; ++i)
            {
                uint senderSSRC = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32()));
                if (_logger.IsTraceEnabled)
                {
                    _logger.Trace("\tSSRC/CSRC: {0:x8}", packet.SenderSSRC);
                }

                // We care only about reports about our own transmission, not others'
                if (senderSSRC == stream.SSRC())
                {
                    var RR = new RTCPRRRecord()
                    {
                        SenderSSRC      = senderSSRC,
                        LossStats       = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32())),
                        HighestReceived = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32())),
                        Jitter          = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32())),
                        TimeLastSR      = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32())),
                        TimeSinceLastSR = unchecked ((uint)IPAddress.NetworkToHostOrder(packet.Reader.ReadInt32()))
                    };
                    stream.Transsmitions.noteIncomingRR(RR.SenderSSRC, fromAddress,
                                                        RR.LossStats,
                                                        RR.HighestReceived,
                                                        RR.Jitter,
                                                        RR.TimeLastSR,
                                                        RR.TimeSinceLastSR);

                    RRRecords.Add(RR);
                }
            }
            return(true);
        }
        public RTPTransmissionStat(RTPStream stream, uint ssrc)
        {
            _stream = stream;
            SSRC    = ssrc;
            fLastPacketNumReceived = 0;
            fPacketLossRatio       = 0;
            fTotNumPacketsLost     = 0;
            fJitter        = 0;
            fLastSRTime    = 0;
            fDiffSR_RRTime = 0;
            fAtLeastTwoRRsHaveBeenReceived = false;
            fFirstPacket         = true;
            fTotalOctetCount_hi  = 0;
            fTotalOctetCount_lo  = 0;
            fTotalPacketCount_hi = 0;
            fTotalPacketCount_lo = 0;
            fTimeCreated         = new TimeVal();

            RTPTime.GetTimestamp(ref fTimeCreated);

            fLastOctetCount  = _stream.OctetCount();
            fLastPacketCount = _stream.PacketCount();
        }
 public RTCPSRPacket(RTPStream stream, RTPSessionState session)
 {
     _stream  = stream;
     _session = session;
     _fOutBuf = new PacketBuffer(RTCPConstants.preferredRTCPPacketSize, RTCPConstants.maxRTCPPacketSize, RTCPConstants.maxRTCPPacketSize);
 }
Exemple #7
0
 public RTPTransmissionStatsDB(RTPStream stream)
 {
     _stream = stream;
 }