Beispiel #1
0
        /// <summary>
        /// Converts the first 4 bytes of the buffer into member variables
        /// </summary>
        /// <param name="buffer"></param>
        public void ReadDataFromBuffer(BufferChunk buffer)
        {
            int version = buffer[0] >> 6;
            
            if(version != Rtp.VERSION)
            {
                throw new RtcpHeaderException(string.Format("Invalid version: {0}, current: {1}", 
                    version, Rtp.VERSION));
            }

            Padding = Convert.ToBoolean(buffer[0] & PADDING_MASK);
            ItemCount = buffer[0] & ITEMCOUNT_MASK;
            PacketType = buffer[1];
            Length = buffer.GetInt16(2);
        }