Exemplo n.º 1
0
        public override void ParseData(byte[] buffer, ref uint offset)
        {
            base.Version = (uint)(buffer[offset] >> 6);
            byte padding;

            if ((buffer[offset] >> 5 & 1) == 1)
            {
                padding = 1;
            }
            else
            {
                padding = 0;
            }
            base.Padding = (padding != 0);
            this.receptionReportCount = (uint)(buffer[offset] & 31);
            offset += 1u;
            int packetType = (int)buffer[offset];

            offset         += 1u;
            base.PacketType = (RtcpType)packetType;

            this.length  = (uint)((uint)buffer[offset] << 8);
            offset      += 1u;
            this.length |= (uint)buffer[offset];
            offset      += 1u;

            this.SSRC = this.getUint(buffer, ref offset);
            for (uint num = 0u; num < this.receptionReportCount; num += 1u)
            {
                RtcpReportBlock rTCPReportBlock = new RtcpReportBlock();
                rTCPReportBlock.ParseData(buffer, ref offset);
                this.reportBlocks.Add(rTCPReportBlock);
            }
        }
Exemplo n.º 2
0
        public override void ParseData(byte[] buffer, ref uint offset)
        {
            base.Version = (uint)(buffer[offset] >> 6);
            byte padding;

            if ((buffer[offset] >> 5 & 1) == 1)
            {
                padding = 1;
            }
            else
            {
                padding = 0;
            }
            base.Padding = (padding != 0);
            this.receptionReportCount = (uint)(buffer[offset] & 31);
            offset += 1;
            int packetType = (int)buffer[offset];

            offset         += 1;
            base.PacketType = (RtcpType)packetType;
            this.length     = (uint)((uint)buffer[offset] << 8);
            offset         += 1;
            this.length    |= (uint)buffer[offset];
            offset         += 1;
            this.ssrc       = this.getUint(buffer, ref offset);
            this.ntpTimestampIntegerPart  = this.getUint(buffer, ref offset);
            this.ntpTimestampFractionPart = this.getUint(buffer, ref offset);
            double    num       = this.ntpTimestampIntegerPart;
            double    num2      = this.ntpTimestampFractionPart / 4294967295.0;
            ValueType valueType = default(DateTime);

            valueType = new DateTime(1900, 1, 1);
            ValueType valueType2 = valueType;

            valueType2        = ((DateTime)valueType2).AddSeconds(num + num2);
            this.ntpTime      = valueType2;
            this.rtpTimestamp = this.getUint(buffer, ref offset);
            this.packetCount  = this.getUint(buffer, ref offset);
            this.octetCount   = this.getUint(buffer, ref offset);

            for (int i = 0; i < this.receptionReportCount; i += 1)
            {
                RtcpReportBlock rTCPReportBlock = new RtcpReportBlock();
                rTCPReportBlock.ParseData(buffer, ref offset);
                this.reportBlocks.Add(rTCPReportBlock);
            }
        }