/* 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 { /// /// The class that describes a source description item. /// public class SourceDescriptionItem { /// /// Get the type. /// public int Type { get; private set; } /// /// Get the text. /// public string Text { get; private set; } /// /// Get the length of the item. /// public int ItemLength { get { return (Text.Length + 2); } } /// /// Initialize a new instance of the SourceDescriptionItem class. /// public SourceDescriptionItem() { } /// /// 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) { Type = buffer[offset]; if (Type != 0) { int length = buffer[offset + 1]; Text = Utils.ConvertBytesToString(buffer, offset + 2, length); } } } }