Skip to content

Commit af71190

Browse files
committed
Enhance Connect method documentation and signature
Updated the `Connect` method in the `RTSPClient` class to improve XML documentation, including a new user certificate selection callback parameter. Changed the method to accept a `Uri` object instead of a string URL and updated the logging statement accordingly. The method now calls an overloaded version that takes the `Uri` directly, while RTP transport initialization remains unchanged.
1 parent b84cfb2 commit af71190

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

src/SharpRTSPClient/RTSPClient.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,35 @@ public RTSPClient(ILoggerFactory loggerFactory)
139139
}
140140

141141
/// <summary>
142-
/// Connect.
142+
/// Connects to the specified RTSP server.
143143
/// </summary>
144144
/// <param name="url">URL to connect to.</param>
145145
/// <param name="rtpTransport">Type of the RTP transport <see cref="RTPTransport"/>.</param>
146146
/// <param name="username">User name.</param>
147147
/// <param name="password">Password.</param>
148148
/// <param name="mediaRequest">Media request type <see cref="MediaRequest>."/></param>
149149
/// <param name="playbackSession">Playback session.</param>
150+
/// <param name="userCertificateSelectionCallback">Callback for user certificate selection.</param>
150151
public void Connect(string url, RTPTransport rtpTransport, string username = null, string password = null, MediaRequest mediaRequest = MediaRequest.VIDEO_AND_AUDIO, bool playbackSession = false, System.Net.Security.RemoteCertificateValidationCallback userCertificateSelectionCallback = null)
151152
{
152-
_logger.LogDebug("Connecting to {url} ", url);
153-
_uri = new Uri(url);
153+
Connect(new Uri(url), rtpTransport, username, password, mediaRequest, playbackSession, userCertificateSelectionCallback);
154+
}
155+
156+
/// <summary>
157+
/// Connects to the specified RTSP server.
158+
/// </summary>
159+
/// <param name="uri">The URI of the RTSP server.</param>
160+
/// <param name="rtpTransport">Type of the RTP transport <see cref="RTPTransport"/>.</param>
161+
/// <param name="username">User name.</param>
162+
/// <param name="password">Password.</param>
163+
/// <param name="mediaRequest">Media request type <see cref="MediaRequest>."/></param>
164+
/// <param name="playbackSession">Playback session.</param>
165+
/// <param name="userCertificateSelectionCallback">Callback for user certificate selection.</param>
166+
public void Connect(Uri uri, RTPTransport rtpTransport, string username, string password, MediaRequest mediaRequest, bool playbackSession, System.Net.Security.RemoteCertificateValidationCallback userCertificateSelectionCallback)
167+
{
168+
_logger.LogDebug("Connecting to {url} ", uri);
169+
170+
_uri = uri;
154171

155172
_playbackSession = playbackSession;
156173

0 commit comments

Comments
 (0)