Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for payload feedback reports that do not require any additional feedback control
 /// indication parameters (e.g. Picture Loss Indication reports).
 /// </summary>
 /// <param name="feedbackMessageType">The payload specific feedback type.</param>
 public RTCPFeedback(uint senderSsrc, uint mediaSsrc, PSFBFeedbackTypesEnum feedbackMessageType)
 {
     Header              = new RTCPHeader(feedbackMessageType);
     SenderSSRC          = senderSsrc;
     MediaSSRC           = mediaSsrc;
     SENDER_PAYLOAD_SIZE = 8;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Extract and load the RTCP header from an RTCP packet.
        /// </summary>
        /// <param name="packet"></param>
        public RTCPHeader(byte[] packet)
        {
            if (packet.Length < HEADER_BYTES_LENGTH)
            {
                throw new ApplicationException(
                          "The packet did not contain the minimum number of bytes for an RTCP header packet.");
            }

            UInt16 firstWord = BitConverter.ToUInt16(packet, 0);

            if (BitConverter.IsLittleEndian)
            {
                firstWord = NetConvert.DoReverseEndian(firstWord);
                Length    = NetConvert.DoReverseEndian(BitConverter.ToUInt16(packet, 2));
            }
            else
            {
                Length = BitConverter.ToUInt16(packet, 2);
            }

            Version     = Convert.ToInt32(firstWord >> 14);
            PaddingFlag = Convert.ToInt32((firstWord >> 13) & 0x1);
            PacketType  = (RTCPReportTypesEnum)(firstWord & 0x00ff);

            if (IsFeedbackReport())
            {
                if (PacketType == RTCPReportTypesEnum.RTPFB)
                {
                    FeedbackMessageType = (RTCPFeedbackTypesEnum)((firstWord >> 8) & 0x1f);
                }
                else
                {
                    PayloadFeedbackMessageType = (PSFBFeedbackTypesEnum)((firstWord >> 8) & 0x1f);
                }
            }
            else
            {
                ReceptionReportCount = Convert.ToInt32((firstWord >> 8) & 0x1f);
            }
        }
Ejemplo n.º 3
0
 public RTCPHeader(PSFBFeedbackTypesEnum feedbackType)
 {
     PacketType = RTCPReportTypesEnum.PSFB;
     PayloadFeedbackMessageType = feedbackType;
 }