aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp')
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/ReportBlock.cs79
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpAppPacket.cs68
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpByePacket.cs59
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpListener.cs203
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpPacket.cs37
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpReceiverReportPacket.cs68
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSenderReportPacket.cs105
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSourceDescriptionPacket.cs57
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionBlock.cs65
-rw-r--r--MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionItem.cs60
10 files changed, 0 insertions, 801 deletions
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/ReportBlock.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/ReportBlock.cs
deleted file mode 100644
index dddd77179..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/ReportBlock.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public class ReportBlock
- {
- /// <summary>
- /// Get the length of the block.
- /// </summary>
- public int BlockLength { get { return (24); } }
- /// <summary>
- /// Get the synchronization source.
- /// </summary>
- public string SynchronizationSource { get; private set; }
- /// <summary>
- /// Get the fraction lost.
- /// </summary>
- public int FractionLost { get; private set; }
- /// <summary>
- /// Get the cumulative packets lost.
- /// </summary>
- public int CumulativePacketsLost { get; private set; }
- /// <summary>
- /// Get the highest number received.
- /// </summary>
- public int HighestNumberReceived { get; private set; }
- /// <summary>
- /// Get the inter arrival jitter.
- /// </summary>
- public int InterArrivalJitter { get; private set; }
- /// <summary>
- /// Get the timestamp of the last report.
- /// </summary>
- public int LastReportTimeStamp { get; private set; }
- /// <summary>
- /// Get the delay since the last report.
- /// </summary>
- public int DelaySinceLastReport { get; private set; }
-
- /// <summary>
- /// Initialize a new instance of the ReportBlock class.
- /// </summary>
- public ReportBlock() { }
-
- /// <summary>
- /// Unpack the data in a packet.
- /// </summary>
- /// <param name="buffer">The buffer containing the packet.</param>
- /// <param name="offset">The offset to the first byte of the packet within the buffer.</param>
- /// <returns>An ErrorSpec instance if an error occurs; null otherwise.</returns>
- 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);
-
-
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpAppPacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpAppPacket.cs
deleted file mode 100644
index 990b6dd94..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpAppPacket.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Text;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- class RtcpAppPacket : RtcpPacket
- {
- /// <summary>
- /// Get the synchronization source.
- /// </summary>
- public int SynchronizationSource { get; private set; }
- /// <summary>
- /// Get the name.
- /// </summary>
- public string Name { get; private set; }
- /// <summary>
- /// Get the identity.
- /// </summary>
- public int Identity { get; private set; }
- /// <summary>
- /// Get the variable data portion.
- /// </summary>
- public string Data { get; private set; }
-
- public override void Parse(byte[] buffer, int offset)
- {
- base.Parse(buffer, offset);
- SynchronizationSource = Utils.Convert4BytesToInt(buffer, offset + 4);
- Name = Utils.ConvertBytesToString(buffer, offset + 8, 4);
- Identity = Utils.Convert2BytesToInt(buffer, offset + 12);
-
- int dataLength = Utils.Convert2BytesToInt(buffer, offset + 14);
- if (dataLength != 0)
- Data = Utils.ConvertBytesToString(buffer, offset + 16, dataLength);
- }
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("Application Specific.\n");
- sb.AppendFormat("Version : {0} .\n", Version);
- sb.AppendFormat("Padding : {0} .\n", Padding);
- sb.AppendFormat("Report Count : {0} .\n", ReportCount);
- sb.AppendFormat("PacketType: {0} .\n", Type);
- sb.AppendFormat("Length : {0} .\n", Length);
- sb.AppendFormat("SynchronizationSource : {0} .\n", SynchronizationSource);
- sb.AppendFormat("Name : {0} .\n", Name);
- sb.AppendFormat("Identity : {0} .\n", Identity);
- sb.AppendFormat("Data : {0} .\n", Data);
- sb.AppendFormat(".\n");
- return sb.ToString();
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpByePacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpByePacket.cs
deleted file mode 100644
index c79ea31a8..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpByePacket.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System.Collections.ObjectModel;
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Text;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public class RtcpByePacket :RtcpPacket
- {
- public Collection<string> SynchronizationSources { get; private set; }
- public string ReasonForLeaving { get; private set; }
- public override void Parse(byte[] buffer, int offset)
- {
- base.Parse(buffer, offset);
- SynchronizationSources = new Collection<string>();
- int index = 4;
-
- while (SynchronizationSources.Count < ReportCount)
- {
- SynchronizationSources.Add(Utils.ConvertBytesToString(buffer, offset + index, 4));
- index += 4;
- }
-
- if (index < Length)
- {
- int reasonLength = buffer[offset + index];
- ReasonForLeaving = Utils.ConvertBytesToString(buffer, offset + index + 1, reasonLength);
- }
- }
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("ByeBye .\n");
- sb.AppendFormat("Version : {0} .\n", Version);
- sb.AppendFormat("Padding : {0} .\n", Padding);
- sb.AppendFormat("Report Count : {0} .\n", ReportCount);
- sb.AppendFormat("PacketType: {0} .\n", Type);
- sb.AppendFormat("Length : {0} .\n", Length);
- sb.AppendFormat("SynchronizationSources : {0} .\n", SynchronizationSources);
- sb.AppendFormat("ReasonForLeaving : {0} .\n", ReasonForLeaving);
- sb.AppendFormat(".\n");
- return sb.ToString();
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpListener.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpListener.cs
deleted file mode 100644
index 2c54f0665..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpListener.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using MediaBrowser.Model.Logging;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public class RtcpListener
- {
- private readonly ILogger _logger;
- private Thread _rtcpListenerThread;
- private AutoResetEvent _rtcpListenerThreadStopEvent = null;
- private UdpClient _udpClient;
- private IPEndPoint _multicastEndPoint;
- private IPEndPoint _serverEndPoint;
- private TransmissionMode _transmissionMode;
-
- public RtcpListener(String address, int port, TransmissionMode mode,ILogger logger)
- {
- _logger = logger;
- _transmissionMode = mode;
- switch (mode)
- {
- case TransmissionMode.Unicast:
- _udpClient = new UdpClient(new IPEndPoint(IPAddress.Parse(address), port));
- _serverEndPoint = new IPEndPoint(IPAddress.Any, 0);
- break;
- case TransmissionMode.Multicast:
- _multicastEndPoint = new IPEndPoint(IPAddress.Parse(address), port);
- _serverEndPoint = new IPEndPoint(IPAddress.Any, 0);
- _udpClient = new UdpClient();
- _udpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1);
- _udpClient.ExclusiveAddressUse = false;
- _udpClient.Client.Bind(new IPEndPoint(IPAddress.Any, port));
- _udpClient.JoinMulticastGroup(_multicastEndPoint.Address);
- break;
- }
- //StartRtcpListenerThread();
- }
-
- public void StartRtcpListenerThread()
- {
- // Kill the existing thread if it is in "zombie" state.
- if (_rtcpListenerThread != null && !_rtcpListenerThread.IsAlive)
- {
- StopRtcpListenerThread();
- }
-
- if (_rtcpListenerThread == null)
- {
- _logger.Info("SAT>IP : starting new RTCP listener thread");
- _rtcpListenerThreadStopEvent = new AutoResetEvent(false);
- _rtcpListenerThread = new Thread(new ThreadStart(RtcpListenerThread));
- _rtcpListenerThread.Name = string.Format("SAT>IP tuner RTCP listener");
- _rtcpListenerThread.IsBackground = true;
- _rtcpListenerThread.Priority = ThreadPriority.Lowest;
- _rtcpListenerThread.Start();
- }
- }
-
- public void StopRtcpListenerThread()
- {
- if (_rtcpListenerThread != null)
- {
- if (!_rtcpListenerThread.IsAlive)
- {
- _logger.Info("SAT>IP : aborting old RTCP listener thread");
- _rtcpListenerThread.Abort();
- }
- else
- {
- _rtcpListenerThreadStopEvent.Set();
- if (!_rtcpListenerThread.Join(400 * 2))
- {
- _logger.Info("SAT>IP : failed to join RTCP listener thread, aborting thread");
- _rtcpListenerThread.Abort();
- }
- }
- _rtcpListenerThread = null;
- if (_rtcpListenerThreadStopEvent != null)
- {
- _rtcpListenerThreadStopEvent.Close();
- _rtcpListenerThreadStopEvent = null;
- }
- }
- }
-
- private void RtcpListenerThread()
- {
- try
- {
- bool receivedGoodBye = false;
- try
- {
- _udpClient.Client.ReceiveTimeout = 400;
- IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Any, 0);
- while (!receivedGoodBye && !_rtcpListenerThreadStopEvent.WaitOne(1))
- {
- byte[] packets = _udpClient.Receive(ref serverEndPoint);
- if (packets == null)
- {
- continue;
- }
-
- int offset = 0;
- while (offset < packets.Length)
- {
- switch (packets[offset + 1])
- {
- case 200: //sr
- var sr = new RtcpSenderReportPacket();
- sr.Parse(packets, offset);
- offset += sr.Length;
- break;
- case 201: //rr
- var rr = new RtcpReceiverReportPacket();
- rr.Parse(packets, offset);
- offset += rr.Length;
- break;
- case 202: //sd
- var sd = new RtcpSourceDescriptionPacket();
- sd.Parse(packets, offset);
- offset += sd.Length;
- break;
- case 203: // bye
- var bye = new RtcpByePacket();
- bye.Parse(packets, offset);
- receivedGoodBye = true;
- OnPacketReceived(new RtcpPacketReceivedArgs(bye));
- offset += bye.Length;
- break;
- case 204: // app
- var app = new RtcpAppPacket();
- app.Parse(packets, offset);
- OnPacketReceived(new RtcpPacketReceivedArgs(app));
- offset += app.Length;
- break;
- }
- }
-
- }
- }
- finally
- {
- switch (_transmissionMode)
- {
- case TransmissionMode.Multicast:
- _udpClient.DropMulticastGroup(_multicastEndPoint.Address);
- _udpClient.Close();
- break;
- case TransmissionMode.Unicast:
- _udpClient.Close();
- break;
- }
- }
- }
- catch (ThreadAbortException)
- {
- }
- catch (Exception ex)
- {
- _logger.Info(string.Format("SAT>IP : RTCP listener thread exception"), ex);
- return;
- }
- _logger.Info("SAT>IP : RTCP listener thread stopping");
- }
- public delegate void PacketReceivedHandler(object sender, RtcpPacketReceivedArgs e);
- public event PacketReceivedHandler PacketReceived;
- public class RtcpPacketReceivedArgs : EventArgs
- {
- public Object Packet { get; private set; }
-
- public RtcpPacketReceivedArgs(Object packet)
- {
- Packet = packet;
- }
- }
- protected void OnPacketReceived(RtcpPacketReceivedArgs args)
- {
- if (PacketReceived != null)
- {
- PacketReceived(this, args);
- }
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpPacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpPacket.cs
deleted file mode 100644
index 0a949eb7e..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpPacket.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public abstract class RtcpPacket
- {
- public int Version { get; private set; }
- public bool Padding { get; private set; }
- public int ReportCount { get; private set; }
- public int Type { get; private set; }
- public int Length { get; private set; }
-
- public virtual void Parse(byte[] buffer, int offset)
- {
- Version = buffer[offset] >> 6;
- Padding = (buffer[offset] & 0x20) != 0;
- ReportCount = buffer[offset] & 0x1f;
- Type = buffer[offset + 1];
- Length = (Utils.Convert2BytesToInt(buffer, offset + 2) * 4) + 4;
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpReceiverReportPacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpReceiverReportPacket.cs
deleted file mode 100644
index abb863652..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpReceiverReportPacket.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System.Collections.ObjectModel;
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Text;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public class RtcpReceiverReportPacket :RtcpPacket
- {
- public string SynchronizationSource { get; private set; }
- public Collection<ReportBlock> ReportBlocks { get; private set; }
- public byte[] ProfileExtension { get; private set; }
- public override void Parse(byte[] buffer, int offset)
- {
- base.Parse(buffer, offset);
- SynchronizationSource = Utils.ConvertBytesToString(buffer, offset + 4, 4);
-
- ReportBlocks = new Collection<ReportBlock>();
- int index = 8;
-
- while (ReportBlocks.Count < ReportCount)
- {
- ReportBlock reportBlock = new ReportBlock();
- reportBlock.Process(buffer, offset + index);
- ReportBlocks.Add(reportBlock);
- index += reportBlock.BlockLength;
- }
-
- if (index < Length)
- {
- ProfileExtension = new byte[Length - index];
-
- for (int extensionIndex = 0; index < Length; index++)
- {
- ProfileExtension[extensionIndex] = buffer[offset + index];
- extensionIndex++;
- }
- }
- }
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("Receiver Report.\n");
- sb.AppendFormat("Version : {0} .\n", Version);
- sb.AppendFormat("Padding : {0} .\n", Padding);
- sb.AppendFormat("Report Count : {0} .\n", ReportCount);
- sb.AppendFormat("PacketType: {0} .\n", Type);
- sb.AppendFormat("Length : {0} .\n", Length);
- sb.AppendFormat("SynchronizationSource : {0} .\n", SynchronizationSource);
- sb.AppendFormat(".\n");
- return sb.ToString();
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSenderReportPacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSenderReportPacket.cs
deleted file mode 100644
index dda5d6a03..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSenderReportPacket.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-using System.Collections.ObjectModel;
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Text;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- public class RtcpSenderReportPacket : RtcpPacket
- {
- #region Properties
- /// <summary>
- /// Get the synchronization source.
- /// </summary>
- public int SynchronizationSource { get; private set; }
- /// <summary>
- /// Get the NPT timestamp.
- /// </summary>
- public long NPTTimeStamp { get; private set; }
- /// <summary>
- /// Get the RTP timestamp.
- /// </summary>
- public int RTPTimeStamp { get; private set; }
- /// <summary>
- /// Get the packet count.
- /// </summary>
- public int SenderPacketCount { get; private set; }
- /// <summary>
- /// Get the octet count.
- /// </summary>
- public int SenderOctetCount { get; private set; }
- /// <summary>
- /// Get the list of report blocks.
- /// </summary>
- public Collection<ReportBlock> ReportBlocks { get; private set; }
- /// <summary>
- /// Get the profile extension data.
- /// </summary>
- public byte[] ProfileExtension { get; private set; }
- #endregion
-
- public override void Parse(byte[] buffer, int offset)
- {
- base.Parse(buffer, offset);
- SynchronizationSource = Utils.Convert4BytesToInt(buffer, offset + 4);
- NPTTimeStamp = Utils.Convert8BytesToLong(buffer, offset + 8);
- RTPTimeStamp = Utils.Convert4BytesToInt(buffer, offset + 16);
- SenderPacketCount = Utils.Convert4BytesToInt(buffer, offset + 20);
- SenderOctetCount = Utils.Convert4BytesToInt(buffer, offset + 24);
-
- ReportBlocks = new Collection<ReportBlock>();
- int index = 28;
-
- while (ReportBlocks.Count < ReportCount)
- {
- ReportBlock reportBlock = new ReportBlock();
- reportBlock.Process(buffer, offset + index);
- ReportBlocks.Add(reportBlock);
- index += reportBlock.BlockLength;
- }
-
- if (index < Length)
- {
- ProfileExtension = new byte[Length - index];
-
- for (int extensionIndex = 0; index < Length; index++)
- {
- ProfileExtension[extensionIndex] = buffer[offset + index];
- extensionIndex++;
- }
- }
- }
-
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("Sender Report.\n");
- sb.AppendFormat("Version : {0} .\n", Version);
- sb.AppendFormat("Padding : {0} .\n", Padding);
- sb.AppendFormat("Report Count : {0} .\n", ReportCount);
- sb.AppendFormat("PacketType: {0} .\n", Type);
- sb.AppendFormat("Length : {0} .\n", Length);
- sb.AppendFormat("SynchronizationSource : {0} .\n", SynchronizationSource);
- sb.AppendFormat("NTP Timestamp : {0} .\n", Utils.NptTimestampToDateTime(NPTTimeStamp));
- sb.AppendFormat("RTP Timestamp : {0} .\n", RTPTimeStamp);
- sb.AppendFormat("Sender PacketCount : {0} .\n", SenderPacketCount);
- sb.AppendFormat("Sender Octet Count : {0} .\n", SenderOctetCount);
- sb.AppendFormat(".\n");
- return sb.ToString();
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSourceDescriptionPacket.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSourceDescriptionPacket.cs
deleted file mode 100644
index 0a95a4413..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/RtcpSourceDescriptionPacket.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System.Collections.ObjectModel;
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Text;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- class RtcpSourceDescriptionPacket :RtcpPacket
- { /// <summary>
- /// Get the list of source descriptions.
- /// </summary>
- public Collection<SourceDescriptionBlock> Descriptions;
- public override void Parse(byte[] buffer, int offset)
- {
- base.Parse(buffer, offset);
- Descriptions = new Collection<SourceDescriptionBlock>();
-
- int index = 4;
-
- while (Descriptions.Count < ReportCount)
- {
- SourceDescriptionBlock descriptionBlock = new SourceDescriptionBlock();
- descriptionBlock.Process(buffer, offset + index);
- Descriptions.Add(descriptionBlock);
- index += descriptionBlock.BlockLength;
- }
- }
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("Source Description.\n");
- sb.AppendFormat("Version : {0} .\n", Version);
- sb.AppendFormat("Padding : {0} .\n", Padding);
- sb.AppendFormat("Report Count : {0} .\n", ReportCount);
- sb.AppendFormat("PacketType: {0} .\n", Type);
- sb.AppendFormat("Length : {0} .\n", Length);
- sb.AppendFormat("Descriptions : {0} .\n", Descriptions);
-
- sb.AppendFormat(".\n");
- return sb.ToString();
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionBlock.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionBlock.cs
deleted file mode 100644
index bf56087cd..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionBlock.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-using System.Collections.ObjectModel;
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- class SourceDescriptionBlock
- {
- /// <summary>
- /// Get the length of the block.
- /// </summary>
- public int BlockLength { get { return (blockLength + (blockLength % 4)); } }
-
- /// <summary>
- /// Get the synchronization source.
- /// </summary>
- public string SynchronizationSource { get; private set; }
- /// <summary>
- /// Get the list of source descriptioni items.
- /// </summary>
- public Collection<SourceDescriptionItem> Items;
-
- private int blockLength;
-
- public void Process(byte[] buffer, int offset)
- {
- SynchronizationSource = Utils.ConvertBytesToString(buffer, offset, 4);
- Items = new Collection<SourceDescriptionItem>();
- int index = 4;
- bool done = false;
- do
- {
- SourceDescriptionItem item = new SourceDescriptionItem();
- item.Process(buffer, offset + index);
-
- if (item.Type != 0)
- {
- Items.Add(item);
- index += item.ItemLength;
- blockLength += item.ItemLength;
- }
- else
- {
- blockLength++;
- done = true;
- }
- }
- while (!done);
- }
- }
-}
diff --git a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionItem.cs b/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionItem.cs
deleted file mode 100644
index 5dd033642..000000000
--- a/MediaBrowser.Server.Startup.Common/LiveTv/TunerHosts/SatIp/Rtcp/SourceDescriptionItem.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (C) <2007-2016> <Kay Diefenthal>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp.Rtcp
-{
- /// <summary>
- /// The class that describes a source description item.
- /// </summary>
- public class SourceDescriptionItem
- {
- /// <summary>
- /// Get the type.
- /// </summary>
- public int Type { get; private set; }
- /// <summary>
- /// Get the text.
- /// </summary>
- public string Text { get; private set; }
-
- /// <summary>
- /// Get the length of the item.
- /// </summary>
- public int ItemLength { get { return (Text.Length + 2); } }
-
- /// <summary>
- /// Initialize a new instance of the SourceDescriptionItem class.
- /// </summary>
- public SourceDescriptionItem() { }
-
- /// <summary>
- /// Unpack the data in a packet.
- /// </summary>
- /// <param name="buffer">The buffer containing the packet.</param>
- /// <param name="offset">The offset to the first byte of the packet within the buffer.</param>
- /// <returns>An ErrorSpec instance if an error occurs; null otherwise.</returns>
- 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);
- }
- }
- }
-}