예제 #1
0
        public override void ReadDataFromBuffer(BufferChunk buffer)
        {
            // Make sure ItemCount and Data length agree
            if(Header.Length * 4 != Rtp.SSRC_SIZE + SenderReport.SIZE + 
                ReceiverReport.SIZE * Header.ItemCount)
            {
                Debug.Assert(false, "Header length and item count disagree!");
                throw new RtcpPacketException("Header length and item count disagree!");
            }

            // Read ssrc
            SSRC = buffer.NextUInt32();

            // Parse SenderReport
            sr.ReadDataFromBuffer(buffer);

            // Process Reports
            if(Header.ItemCount > 0)
            {
                receiverReports = new ArrayList();

                for(int rrCount = 0; rrCount < Header.ItemCount; rrCount++)
                {
                    ReceiverReport rr = new ReceiverReport();
                    rr.ReadDataFromBuffer(buffer);

                    receiverReports.Add(rr);
                }
            }
        }
예제 #2
0
        public override void ReadDataFromBuffer(BufferChunk buffer)
        {
            // Make sure ItemCount and Data length agree
            if(Header.Length * 4 != Header.ItemCount * ReceiverReport.SIZE + Rtp.SSRC_SIZE)
            {
                Debug.Assert(false, "Header length and item count disagree!");
                throw new RtcpPacketException("Header length and item count disagree!");
            }

            // Store Reporter SSRC
            SSRC = buffer.NextUInt32();

            // Process Reports
            for(int rrCount = 0; rrCount < Header.ItemCount; rrCount++)
            {
                ReceiverReport rr = new ReceiverReport();
                rr.ReadDataFromBuffer(buffer);

                receiverReports.Add(rr);
            }
        }