/* Copyright (C) <2007-2016> SatIp.RtspSample is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SatIp.RtspSample is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SatIp.RtspSample. If not, see . */ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp { public class ReportBlock { /// /// Get the length of the block. /// public int BlockLength { get { return (24); } } /// /// Get the synchronization source. /// public string SynchronizationSource { get; private set; } /// /// Get the fraction lost. /// public int FractionLost { get; private set; } /// /// Get the cumulative packets lost. /// public int CumulativePacketsLost { get; private set; } /// /// Get the highest number received. /// public int HighestNumberReceived { get; private set; } /// /// Get the inter arrival jitter. /// public int InterArrivalJitter { get; private set; } /// /// Get the timestamp of the last report. /// public int LastReportTimeStamp { get; private set; } /// /// Get the delay since the last report. /// public int DelaySinceLastReport { get; private set; } /// /// Initialize a new instance of the ReportBlock class. /// public ReportBlock() { } /// /// Unpack the data in a packet. /// /// The buffer containing the packet. /// The offset to the first byte of the packet within the buffer. /// An ErrorSpec instance if an error occurs; null otherwise. public void Process(byte[] buffer, int offset) { SynchronizationSource = Utils.ConvertBytesToString(buffer, offset, 4); FractionLost = buffer[offset + 4]; CumulativePacketsLost = Utils.Convert3BytesToInt(buffer, offset + 5); HighestNumberReceived = Utils.Convert4BytesToInt(buffer, offset + 8); InterArrivalJitter = Utils.Convert4BytesToInt(buffer, offset + 12); LastReportTimeStamp = Utils.Convert4BytesToInt(buffer, offset + 16); DelaySinceLastReport = Utils.Convert4BytesToInt(buffer, offset + 20); } } }