RtcpPacket.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. Copyright (C) <2007-2016> <Kay Diefenthal>
  3. SatIp.RtspSample is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. SatIp.RtspSample is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with SatIp.RtspSample. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
  15. {
  16. public abstract class RtcpPacket
  17. {
  18. public int Version { get; private set; }
  19. public bool Padding { get; private set; }
  20. public int ReportCount { get; private set; }
  21. public int Type { get; private set; }
  22. public int Length { get; private set; }
  23. public virtual void Parse(byte[] buffer, int offset)
  24. {
  25. Version = buffer[offset] >> 6;
  26. Padding = (buffer[offset] & 0x20) != 0;
  27. ReportCount = buffer[offset] & 0x1f;
  28. Type = buffer[offset + 1];
  29. Length = (Utils.Convert2BytesToInt(buffer, offset + 2) * 4) + 4;
  30. }
  31. }
  32. }