Skip to content

Commit 8e8bceb

Browse files
committed
F Added support for RTSPS
1 parent 9ccbdf2 commit 8e8bceb

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/SharpRTSPClient/RTSPClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,8 @@ private Uri GetControlUri(Media media)
10931093
{
10941094
string sdpControl = attrib.Value;
10951095

1096-
if (sdpControl.StartsWith("rtsp://", StringComparison.OrdinalIgnoreCase) ||
1096+
if (sdpControl.StartsWith("rtsp://", StringComparison.OrdinalIgnoreCase) ||
1097+
sdpControl.StartsWith("rtsps://", StringComparison.OrdinalIgnoreCase) ||
10971098
sdpControl.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
10981099
{
10991100
// the "track" or "stream id"

src/SharpRTSPServer/RTSPServer.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class RTSPServer : IDisposable
6464
private readonly NetworkCredential _credentials;
6565
private readonly Authentication _authentication;
6666

67+
public bool IsRTSPS { get; set; } = false;
68+
6769
/// <summary>
6870
/// Initializes a new instance of the <see cref="RTSPServer"/> class.
6971
/// </summary>
@@ -128,7 +130,18 @@ private void AcceptConnection()
128130
_logger.LogDebug("Connection from {remoteEndPoint}", oneClient.Client.RemoteEndPoint);
129131

130132
// Hand the incoming TCP connection over to the RTSP classes
131-
var rtspSocket = new RtspTcpTransport(oneClient);
133+
RtspTcpTransport rtspSocket;
134+
135+
if (IsRTSPS)
136+
{
137+
// TODO: untested
138+
rtspSocket = new RtspTcpTlsTransport(oneClient);
139+
}
140+
else
141+
{
142+
rtspSocket = new RtspTcpTransport(oneClient);
143+
}
144+
132145
RtspListener newListener = new RtspListener(rtspSocket, _loggerFactory.CreateLogger<RtspListener>());
133146
newListener.MessageReceived += RTSPMessageReceived;
134147

0 commit comments

Comments
 (0)