From 10effcb43fd2272b4c134bcfe4e8c8398f372368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Standa=20Luke=C5=A1?= Date: Wed, 24 Apr 2024 19:04:57 +0000 Subject: [PATCH] Enable generation of SIPSorcery.xml documentation file (#1106) * Enabled GenerateDocumentationFile in SIPSorcery.csproj * Disabled "missing XML comment" warnings * Fixed most malformed XML comments (warnings about these are not disabled) --- src/SIPSorcery.csproj | 3 + src/app/Media/Codecs/AudioEncoder.cs | 3 +- src/app/Media/Codecs/G729Codec/CodLd8k.cs | 6 +- src/app/Media/Codecs/G729Codec/CorFunc.cs | 4 +- src/app/Media/Codecs/G729Codec/Gainpred.cs | 6 +- src/app/Media/Codecs/G729Codec/Ld8k.cs | 6 +- src/app/Media/Codecs/G729Codec/Pitch.cs | 5 +- src/app/Media/Codecs/G729Codec/Postfil.cs | 4 +- src/app/Media/IMediaSession.cs | 4 +- src/app/Media/Sources/AudioSignalGenerator.cs | 2 +- src/app/SIPUserAgents/SIPCallDescriptor.cs | 2 +- src/app/SIPUserAgents/SIPUserAgent.cs | 4 +- .../DtlsSrtp/Transform/SrtcpTransformer.cs | 150 +++++++++--------- src/net/DtlsSrtp/Transform/SrtpCipherCTR.cs | 78 ++++----- src/net/DtlsSrtp/Transform/SrtpCipherF8.cs | 100 ++++++------ src/net/ICE/RTCIceCandidate.cs | 4 +- src/net/ICE/RtpIceChannel.cs | 3 +- src/net/RTCP/RTCPSession.cs | 2 +- src/net/RTP/MediaStream.cs | 15 +- src/net/RTP/MediaStreamTrack.cs | 6 +- src/net/RTP/Packetisation/H264Depacketiser.cs | 14 +- src/net/RTP/RTPSession.cs | 3 +- src/net/RTP/VideoStream.cs | 9 +- src/net/RTSP/Mjpeg.cs | 2 +- src/net/SCTP/Chunks/SctpDataChunk.cs | 2 +- src/net/SCTP/SctpAssociation.cs | 2 +- src/net/SCTP/SctpDataReceiver.cs | 4 + src/net/SCTP/SctpDataSender.cs | 4 +- src/net/SCTP/SctpPacket.cs | 2 +- src/net/SCTP/SctpTransport.cs | 4 +- src/net/SDP/SDPAudioVideoMediaFormat.cs | 8 +- src/net/WebRTC/IRTCPeerConnection.cs | 1 + src/net/WebRTC/RTCPeerConnection.cs | 12 +- src/net/WebRTC/RTCPeerSctpAssociation.cs | 2 - src/net/WebRTC/RTCSctpTransport.cs | 2 - 35 files changed, 234 insertions(+), 244 deletions(-) diff --git a/src/SIPSorcery.csproj b/src/SIPSorcery.csproj index 6623c6356..ccb8b7241 100755 --- a/src/SIPSorcery.csproj +++ b/src/SIPSorcery.csproj @@ -28,6 +28,9 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;net461;net5.0;net6.0;net8.0 true $(NoWarn);SYSLIB0050 + true + + $(NoWarn);CS1591;CS1573;CS1587 Aaron Clauson, Christophe Irles, Rafael Soares & Contributors Copyright © 2010-2024 Aaron Clauson BSD-3-Clause diff --git a/src/app/Media/Codecs/AudioEncoder.cs b/src/app/Media/Codecs/AudioEncoder.cs index 78e1730f6..363e341d9 100644 --- a/src/app/Media/Codecs/AudioEncoder.cs +++ b/src/app/Media/Codecs/AudioEncoder.cs @@ -123,9 +123,8 @@ public byte[] EncodeAudio(short[] pcm, AudioFormat format) /// /// Event handler for receiving RTP packets from the remote party. /// - /// The remote end point the RTP was received from. + /// Data received from an RTP socket. /// The audio format of the encoded packets. - /// The RTP packet with the media sample. public short[] DecodeAudio(byte[] encodedSample, AudioFormat format) { if (format.Codec == AudioCodecsEnum.G722) diff --git a/src/app/Media/Codecs/G729Codec/CodLd8k.cs b/src/app/Media/Codecs/G729Codec/CodLd8k.cs index d9130cb67..f6be7031e 100644 --- a/src/app/Media/Codecs/G729Codec/CodLd8k.cs +++ b/src/app/Media/Codecs/G729Codec/CodLd8k.cs @@ -155,7 +155,7 @@ Sherbrooke. All rights reserved. /** * Initialization of variables for the encoder. * Initialize pointers to speech vector. - *
+ *
 
+ * ]]>
*/ public void init_coder_ld8k() @@ -543,4 +543,4 @@ int[] ana Util.copy(old_exc, L_FRAME, old_exc, PIT_MAX + L_INTERPOL); } } -} \ No newline at end of file +} diff --git a/src/app/Media/Codecs/G729Codec/CorFunc.cs b/src/app/Media/Codecs/G729Codec/CorFunc.cs index 41da1d466..2d5466af3 100644 --- a/src/app/Media/Codecs/G729Codec/CorFunc.cs +++ b/src/app/Media/Codecs/G729Codec/CorFunc.cs @@ -59,7 +59,7 @@ G.729 main body and G.729A * @param xn input : target vector x[0:l_subfr] * @param y1 input : filtered adaptive codebook vector * @param y2 input : filtered 1st codebook innovation - * @param g_coeff output: , -2 , and 2 + * @param g_coeff , -2 , and 2 ]]> */ public static void corr_xy2( @@ -115,4 +115,4 @@ float[] d } } } -} \ No newline at end of file +} diff --git a/src/app/Media/Codecs/G729Codec/Gainpred.cs b/src/app/Media/Codecs/G729Codec/Gainpred.cs index 82fc4aa67..871c06252 100644 --- a/src/app/Media/Codecs/G729Codec/Gainpred.cs +++ b/src/app/Media/Codecs/G729Codec/Gainpred.cs @@ -118,13 +118,13 @@ float g_code /** * Update table of past quantized energies (frame erasure). - *
+ * 
 
+ * ]]>
* * @param past_qua_en input/output:Past quantized energies */ @@ -147,4 +147,4 @@ float[] past_qua_en past_qua_en[0] = av_pred_en; } } -} \ No newline at end of file +} diff --git a/src/app/Media/Codecs/G729Codec/Ld8k.cs b/src/app/Media/Codecs/G729Codec/Ld8k.cs index 6a10faadd..34f6aa981 100644 --- a/src/app/Media/Codecs/G729Codec/Ld8k.cs +++ b/src/app/Media/Codecs/G729Codec/Ld8k.cs @@ -124,12 +124,12 @@ public class Ld8k public static float GAMMA2_PST = 0.55f; /** - * tilt weighting factor when k1<0 + * tilt weighting factor when k1 < 0 */ public static float GAMMA3_MINUS = 0.9f; /** - * tilt weighting factor when k1>0 + * tilt weighting factor when k1 > 0 */ public static float GAMMA3_PLUS = 0.2f; @@ -479,4 +479,4 @@ Sherbrooke. All rights reserved. * resolution of fractional delays */ } -} \ No newline at end of file +} diff --git a/src/app/Media/Codecs/G729Codec/Pitch.cs b/src/app/Media/Codecs/G729Codec/Pitch.cs index 576cc5c00..e077fa84d 100644 --- a/src/app/Media/Codecs/G729Codec/Pitch.cs +++ b/src/app/Media/Codecs/G729Codec/Pitch.cs @@ -351,7 +351,7 @@ int corr_norm_offset } } - /** + /** , -2 * * @param xn input : target vector @@ -359,6 +359,7 @@ int corr_norm_offset * @param g_coeff output: and -2 * @param l_subfr input : vector dimension * @return pitch gain + * ]]> */ public static float g_pitch( @@ -528,4 +529,4 @@ float x return 1.0f / (float)Math.Sqrt(x); } } -} \ No newline at end of file +} diff --git a/src/app/Media/Codecs/G729Codec/Postfil.cs b/src/app/Media/Codecs/G729Codec/Postfil.cs index 9a441997c..bd730c858 100644 --- a/src/app/Media/Codecs/G729Codec/Postfil.cs +++ b/src/app/Media/Codecs/G729Codec/Postfil.cs @@ -635,7 +635,7 @@ float gain_plt /** * Compute delayed signal, - * num & den of gain for fractional delay + * num & den of gain for fractional delay * with long interpolation filter * * @param s_in input signal with past @@ -906,4 +906,4 @@ float gain_prec return gain_prec; } } -} \ No newline at end of file +} diff --git a/src/app/Media/IMediaSession.cs b/src/app/Media/IMediaSession.cs index ba668646a..31012b358 100644 --- a/src/app/Media/IMediaSession.cs +++ b/src/app/Media/IMediaSession.cs @@ -102,7 +102,7 @@ public interface IMediaSession /// if they are. /// /// Whether the SDP being set is an offer or answer. - /// The SDP description from the remote party. + /// The SDP description from the remote party. /// If successful an OK enum result. If not an enum result indicating the /// failure cause. SetDescriptionResultEnum SetRemoteDescription(SdpType sdpType, SDP sessionDescription); @@ -150,4 +150,4 @@ public interface IMediaSession /// Optional. A descriptive reason for closing the session. void Close(string reason); } -} \ No newline at end of file +} diff --git a/src/app/Media/Sources/AudioSignalGenerator.cs b/src/app/Media/Sources/AudioSignalGenerator.cs index 90eaf8c15..a74614c14 100644 --- a/src/app/Media/Sources/AudioSignalGenerator.cs +++ b/src/app/Media/Sources/AudioSignalGenerator.cs @@ -67,7 +67,7 @@ public SignalGenerator() /// Initializes a new instance for the Generator (UserDef SampleRate & Channels) /// /// Desired sample rate - /// Number of channels + /// Number of channels public SignalGenerator(int sampleRate, int channels) { phi = 0; diff --git a/src/app/SIPUserAgents/SIPCallDescriptor.cs b/src/app/SIPUserAgents/SIPCallDescriptor.cs index e8387f82e..1288ca7b5 100644 --- a/src/app/SIPUserAgents/SIPCallDescriptor.cs +++ b/src/app/SIPUserAgents/SIPCallDescriptor.cs @@ -265,7 +265,7 @@ public SIPFromHeader GetFromHeader() /// /// /// - /// + /// public void SetGeneralFromHeaderFields(string fromDisplayName, string fromUsername, string fromHost) { if (!fromDisplayName.IsNullOrBlank() && FromDisplayName == null) diff --git a/src/app/SIPUserAgents/SIPUserAgent.cs b/src/app/SIPUserAgents/SIPUserAgent.cs index a2b6a987a..e47bbab1c 100644 --- a/src/app/SIPUserAgents/SIPUserAgent.cs +++ b/src/app/SIPUserAgents/SIPUserAgent.cs @@ -416,7 +416,7 @@ public SIPUserAgent(SIPTransport transport, SIPEndPoint outboundProxy, bool isTr /// /// Attempts to place a new outgoing call AND waits for the call to be answered or fail. - /// Use to start a call without + /// Use to start a call without /// waiting for it to complete and monitor and /// to detect an answer or failure. /// @@ -464,7 +464,7 @@ public Task Call(string dst, string username, string password, IMediaSessi /// /// Attempts to place a new outgoing call AND waits for the call to be answered or fail. - /// Use to start a call without + /// Use to start a call without /// waiting for it to complete and monitor and /// to detect an answer or failure. /// diff --git a/src/net/DtlsSrtp/Transform/SrtcpTransformer.cs b/src/net/DtlsSrtp/Transform/SrtcpTransformer.cs index 8efb73adf..734f9b120 100644 --- a/src/net/DtlsSrtp/Transform/SrtcpTransformer.cs +++ b/src/net/DtlsSrtp/Transform/SrtcpTransformer.cs @@ -15,58 +15,58 @@ // License: // BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. // Original Source: AGPL-3.0 License -//----------------------------------------------------------------------------- - +//----------------------------------------------------------------------------- + using System.Collections.Concurrent; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; -namespace SIPSorcery.Net +namespace SIPSorcery.Net { /// - /// SRTCPTransformer implements PacketTransformer. - /// It encapsulate the encryption / decryption logic for SRTCP packets - /// - /// @author Bing SU (nova.su @gmail.com) - /// @author Werner Dittmann - /// - public class SrtcpTransformer : IPacketTransformer - { - private int _isLocked = 0; - private RawPacket packet; - - private SrtpTransformEngine forwardEngine; - private SrtpTransformEngine reverseEngine; - - /** All the known SSRC's corresponding SRTCPCryptoContexts */ - private ConcurrentDictionary contexts; - - public SrtcpTransformer(SrtpTransformEngine engine) : this(engine, engine) - { - - } - - public SrtcpTransformer(SrtpTransformEngine forwardEngine, SrtpTransformEngine reverseEngine) - { - this.packet = new RawPacket(); - this.forwardEngine = forwardEngine; - this.reverseEngine = reverseEngine; - this.contexts = new ConcurrentDictionary(); - } - - /// - /// Encrypts a SRTCP packet + /// SRTCPTransformer implements PacketTransformer. + /// It encapsulate the encryption / decryption logic for SRTCP packets + /// + /// @author Bing SU (nova.su @gmail.com) + /// @author Werner Dittmann (Werner.Dittmann@t-online.de) + /// + public class SrtcpTransformer : IPacketTransformer + { + private int _isLocked = 0; + private RawPacket packet; + + private SrtpTransformEngine forwardEngine; + private SrtpTransformEngine reverseEngine; + + /** All the known SSRC's corresponding SRTCPCryptoContexts */ + private ConcurrentDictionary contexts; + + public SrtcpTransformer(SrtpTransformEngine engine) : this(engine, engine) + { + + } + + public SrtcpTransformer(SrtpTransformEngine forwardEngine, SrtpTransformEngine reverseEngine) + { + this.packet = new RawPacket(); + this.forwardEngine = forwardEngine; + this.reverseEngine = reverseEngine; + this.contexts = new ConcurrentDictionary(); + } + + /// + /// Encrypts a SRTCP packet /// /// plain SRTCP packet to be encrypted. /// encrypted SRTCP packet. - public byte[] Transform(byte[] pkt) - { - return Transform(pkt, 0, pkt.Length); - } - - public byte[] Transform(byte[] pkt, int offset, int length) - { - var isLocked = Interlocked.CompareExchange(ref _isLocked, 1, 0) != 0; + public byte[] Transform(byte[] pkt) + { + return Transform(pkt, 0, pkt.Length); + } + + public byte[] Transform(byte[] pkt, int offset, int length) + { + var isLocked = Interlocked.CompareExchange(ref _isLocked, 1, 0) != 0; try { // Wrap the data into raw packet for readable format @@ -90,23 +90,23 @@ public byte[] Transform(byte[] pkt, int offset, int length) byte[] result = packet.GetData(); return result; - } - finally + } + finally { //Unlock if (!isLocked) Interlocked.CompareExchange(ref _isLocked, 0, 1); - } - } - - public byte[] ReverseTransform(byte[] pkt) - { - return ReverseTransform(pkt, 0, pkt.Length); - } - - public byte[] ReverseTransform(byte[] pkt, int offset, int length) - { - var isLocked = Interlocked.CompareExchange(ref _isLocked, 1, 0) != 0; + } + } + + public byte[] ReverseTransform(byte[] pkt) + { + return ReverseTransform(pkt, 0, pkt.Length); + } + + public byte[] ReverseTransform(byte[] pkt, int offset, int length) + { + var isLocked = Interlocked.CompareExchange(ref _isLocked, 1, 0) != 0; try { // wrap data into raw packet for readable format @@ -133,36 +133,36 @@ public byte[] ReverseTransform(byte[] pkt, int offset, int length) result = packet.GetData(); } return result; - } - finally + } + finally { //Unlock if (!isLocked) Interlocked.CompareExchange(ref _isLocked, 0, 1); - } - } - + } + } + /// /// Close the transformer and underlying transform engine. /// The close functions closes all stored crypto contexts. This deletes key data /// and forces a cleanup of the crypto contexts. - /// - public void Close() - { - forwardEngine.Close(); + /// + public void Close() + { + forwardEngine.Close(); if (forwardEngine != reverseEngine) { reverseEngine.Close(); - } - - var keys = new List(contexts.Keys); - foreach (var ssrc in keys) + } + + var keys = new List(contexts.Keys); + foreach (var ssrc in keys) { if (contexts.TryRemove(ssrc, out var context)) { context.Close(); - } - } - } - } -} + } + } + } + } +} diff --git a/src/net/DtlsSrtp/Transform/SrtpCipherCTR.cs b/src/net/DtlsSrtp/Transform/SrtpCipherCTR.cs index 1629eb098..ba0566a3b 100644 --- a/src/net/DtlsSrtp/Transform/SrtpCipherCTR.cs +++ b/src/net/DtlsSrtp/Transform/SrtpCipherCTR.cs @@ -1,39 +1,39 @@ -//----------------------------------------------------------------------------- -// Filename: SrtpCipherCTR.cs -// -// Description: Implements SRTP Counter Mode Encryption. -// -// Derived From: -// https://github.com/jitsi/jitsi-srtp/blob/master/src/main/java/org/jitsi/srtp/crypto/SrtpCipherCtr.java -// -// Author(s): -// Rafael Soares (raf.csoares@kyubinteractive.com) -// -// History: -// 01 Jul 2020 Rafael Soares Created. -// -// License: -// Customisations: BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. -// Original Source: Apache License: see below +//----------------------------------------------------------------------------- +// Filename: SrtpCipherCTR.cs +// +// Description: Implements SRTP Counter Mode Encryption. +// +// Derived From: +// https://github.com/jitsi/jitsi-srtp/blob/master/src/main/java/org/jitsi/srtp/crypto/SrtpCipherCtr.java +// +// Author(s): +// Rafael Soares (raf.csoares@kyubinteractive.com) +// +// History: +// 01 Jul 2020 Rafael Soares Created. +// +// License: +// Customisations: BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. +// Original Source: Apache License: see below //----------------------------------------------------------------------------- - -/* - * Copyright @ 2016 - present 8x8, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** + +/* + * Copyright @ 2016 - present 8x8, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* * SRTPCipherF8 implements SRTP F8 Mode AES Encryption (AES-f8). * F8 Mode AES Encryption algorithm is defined in RFC3711, section 4.1.2. * @@ -59,10 +59,10 @@ * * @author Bing SU (nova.su@gmail.com) * @author Werner Dittmann - */ - -using System.IO; -using Org.BouncyCastle.Crypto; + */ + +using System.IO; +using Org.BouncyCastle.Crypto; namespace SIPSorcery.Net { diff --git a/src/net/DtlsSrtp/Transform/SrtpCipherF8.cs b/src/net/DtlsSrtp/Transform/SrtpCipherF8.cs index 06f1c0438..5952712e2 100644 --- a/src/net/DtlsSrtp/Transform/SrtpCipherF8.cs +++ b/src/net/DtlsSrtp/Transform/SrtpCipherF8.cs @@ -1,37 +1,37 @@ -//----------------------------------------------------------------------------- -// Filename: SrtpCipherF8.cs -// -// Description: Implements SRTP F8 Mode Encryption for 128 bits block cipher. -// -// Derived From: -// https://github.com/jitsi/jitsi-srtp/blob/master/src/main/java/org/jitsi/srtp/crypto/SrtpCipherF8.java -// -// Author(s): -// Rafael Soares (raf.csoares@kyubinteractive.com) -// -// History: -// 01 Jul 2020 Rafael Soares Created. -// -// License: -// Customisations: BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. -// Original Source: Apache License: see below -//----------------------------------------------------------------------------- - -/* - * Copyright @ 2015 - present 8x8, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +//----------------------------------------------------------------------------- +// Filename: SrtpCipherF8.cs +// +// Description: Implements SRTP F8 Mode Encryption for 128 bits block cipher. +// +// Derived From: +// https://github.com/jitsi/jitsi-srtp/blob/master/src/main/java/org/jitsi/srtp/crypto/SrtpCipherF8.java +// +// Author(s): +// Rafael Soares (raf.csoares@kyubinteractive.com) +// +// History: +// 01 Jul 2020 Rafael Soares Created. +// +// License: +// Customisations: BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. +// Original Source: Apache License: see below +//----------------------------------------------------------------------------- + +/* + * Copyright @ 2015 - present 8x8, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * SRTPCipherF8 implements SRTP F8 Mode AES Encryption (AES-f8). @@ -58,10 +58,10 @@ * We use AESCipher to handle basic AES encryption / decryption. * * @author Bing SU (nova.su@gmail.com) - * @author Werner Dittmann - */ - -using System.IO; + * @author Werner Dittmann (werner.dittmann@t-online.de) + */ + +using System.IO; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Utilities; @@ -100,19 +100,19 @@ public static void DeriveForIV(IBlockCipher f8Cipher, byte[] key, byte[] salt) * full key. */ System.Array.Copy(salt, 0, saltMask, 0, salt.Length); - for (int i = salt.Length; i < saltMask.Length; ++i) - { - saltMask[i] = 0x55; - } + for (int i = salt.Length; i < saltMask.Length; ++i) + { + saltMask[i] = 0x55; + } /* * XOR the original key with the above created mask to get the special * key. */ - for (int i = 0; i < key.Length; i++) - { - maskedKey[i] = (byte)(key[i] ^ saltMask[i]); - } + for (int i = 0; i < key.Length; i++) + { + maskedKey[i] = (byte)(key[i] ^ saltMask[i]); + } /* * Prepare the f8Cipher with the special key to compute IV' @@ -182,10 +182,10 @@ public static void ProcessBlock(IBlockCipher cipher, F8Context f8ctx, * XOR the previous key stream with IV' * ( S(-1) xor IV' ) */ - for (int i = 0; i < BLKLEN; i++) - { - f8ctx.S[i] ^= f8ctx.ivAccent[i]; - } + for (int i = 0; i < BLKLEN; i++) + { + f8ctx.S[i] ^= f8ctx.ivAccent[i]; + } /* * Now XOR (S(n-1) xor IV') with the current counter, then increment diff --git a/src/net/ICE/RTCIceCandidate.cs b/src/net/ICE/RTCIceCandidate.cs index d404bb7f3..7e2264f76 100644 --- a/src/net/ICE/RTCIceCandidate.cs +++ b/src/net/ICE/RTCIceCandidate.cs @@ -396,7 +396,7 @@ public string toJSON() /// protocol and IP end point. Primary use case is to check whether a candidate /// is a match for a remote end point that a message has been received from. /// - /// The protocol to check equivalence for. + /// The protocol to check equivalence for. /// The IP end point to check equivalence for. /// True if the candidate is deemed equivalent or false if not. public bool IsEquivalentEndPoint(RTCIceProtocol epPotocol, IPEndPoint ep) @@ -466,4 +466,4 @@ private uint UpdateCrc32(uint start, byte[] buf) } } -} \ No newline at end of file +} diff --git a/src/net/ICE/RtpIceChannel.cs b/src/net/ICE/RtpIceChannel.cs index 011e88500..9ce685ffc 100755 --- a/src/net/ICE/RtpIceChannel.cs +++ b/src/net/ICE/RtpIceChannel.cs @@ -2601,7 +2601,6 @@ protected override void OnRTPPacketReceived(UdpReceiver receiver, int localPort, /// /// Sends a packet via a TURN relay server. /// - /// The local socket to send the packet from. /// The peer destination end point. /// The data to send to the peer. /// The TURN server end point to send the relayed request to. @@ -2701,4 +2700,4 @@ public override SocketError Send(RTPChannelSocketsEnum sendOn, IPEndPoint dstEnd } } } -} \ No newline at end of file +} diff --git a/src/net/RTCP/RTCPSession.cs b/src/net/RTCP/RTCPSession.cs index 1bf465ce6..18af4171b 100644 --- a/src/net/RTCP/RTCPSession.cs +++ b/src/net/RTCP/RTCPSession.cs @@ -261,7 +261,7 @@ public void RecordRtpPacketSend(RTPPacket rtpPacket) /// Event handler for an RTCP packet being received from the remote party. /// /// The end point the packet was received from. - /// The data received. + /// The data received. public void ReportReceived(IPEndPoint remoteEndPoint, RTCPCompoundPacket rtcpCompoundPacket) { try diff --git a/src/net/RTP/MediaStream.cs b/src/net/RTP/MediaStream.cs index 9d9016eaf..2d1d97ec9 100644 --- a/src/net/RTP/MediaStream.cs +++ b/src/net/RTP/MediaStream.cs @@ -402,11 +402,10 @@ protected void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloa /// /// Allows additional control for sending raw RTP payloads. No framing or other processing is carried out. /// - /// The media type of the RTP packet being sent. Must be audio or video. - /// The RTP packet payload. + /// The RTP packet payload. /// The timestamp to set on the RTP header. /// The value to set on the RTP header marker bit, should be 0 or 1. - /// The payload ID to set in the RTP header. + /// The payload ID to set in the RTP header. /// The RTP sequence number public void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadType, ushort seqNum) { @@ -416,11 +415,10 @@ public void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadTy /// /// Allows additional control for sending raw RTP payloads. No framing or other processing is carried out. /// - /// The media type of the RTP packet being sent. Must be audio or video. - /// The RTP packet payload. + /// The RTP packet payload. /// The timestamp to set on the RTP header. /// The value to set on the RTP header marker bit, should be 0 or 1. - /// The payload ID to set in the RTP header. + /// The payload ID to set in the RTP header. public void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadType) { SendRtpRaw(data, timestamp, markerBit, payloadType, false); @@ -519,7 +517,6 @@ public void SendRtcpReport(RTCPCompoundPacket report) /// /// Allows sending of RTCP feedback reports. /// - /// The media type of the RTCP report being sent. Must be audio or video. /// The feedback report to send. public void SendRtcpFeedback(RTCPFeedback feedback) { @@ -718,7 +715,6 @@ protected void LogIfWrongSeqNumber(string trackType, RTPHeader header, MediaStre /// /// Adjusts the expected remote end point for a particular media type. /// - /// The media type of the RTP packet received. /// The SSRC from the RTP packet header. /// The actual remote end point that the RTP packet came from. /// True if remote end point for this media type was the expected one or it was adjusted. False if @@ -773,8 +769,6 @@ protected bool AdjustRemoteEndPoint(uint ssrc, IPEndPoint receivedOnEndPoint) /// /// Creates a new RTCP session for a media track belonging to this RTP session. /// - /// The media type to create the RTP session for. Must be - /// audio or video. /// A new RTCPSession object. The RTCPSession must have its Start method called /// in order to commence sending RTCP reports. public Boolean CreateRtcpSession() @@ -791,7 +785,6 @@ public Boolean CreateRtcpSession() /// /// Sets the remote end points for a media type supported by this RTP session. /// - /// The media type, must be audio or video, to set the remote end point for. /// The remote end point for RTP packets corresponding to the media type. /// The remote end point for RTCP packets corresponding to the media type. public void SetDestination(IPEndPoint rtpEndPoint, IPEndPoint rtcpEndPoint) diff --git a/src/net/RTP/MediaStreamTrack.cs b/src/net/RTP/MediaStreamTrack.cs index e14a45870..dad47da56 100644 --- a/src/net/RTP/MediaStreamTrack.cs +++ b/src/net/RTP/MediaStreamTrack.cs @@ -80,7 +80,7 @@ public class MediaStreamTrack /// public List Capabilities { get; internal set; } - // + /// /// a=extmap - Mapping for RTP header extensions /// public Dictionary HeaderExtensions { get; } @@ -205,7 +205,7 @@ public MediaStreamTrack( /// /// Add a local audio track. /// - /// The audio formats that the local application supports. + /// The audio formats that the local application supports. /// Optional. The stream status for the audio track, e.g. whether /// send and receive or only one of. public MediaStreamTrack( @@ -229,7 +229,7 @@ public MediaStreamTrack( /// /// Add a local video track. /// - /// The video formats that the local application supports. + /// The video formats that the local application supports. /// Optional. The stream status for the video track, e.g. whether /// send and receive or only one of. public MediaStreamTrack( diff --git a/src/net/RTP/Packetisation/H264Depacketiser.cs b/src/net/RTP/Packetisation/H264Depacketiser.cs index 86d2a5e73..b30e7f4e6 100644 --- a/src/net/RTP/Packetisation/H264Depacketiser.cs +++ b/src/net/RTP/Packetisation/H264Depacketiser.cs @@ -1,16 +1,16 @@ -/// -/// Based in https://github.com/BogdanovKirill/RtspClientSharp/blob/master/RtspClientSharp/MediaParsers/H264VideoPayloadParser.cs -/// Distributed under MIT License -/// -/// @author raf.csoares@kyubinteractive.com -/// - + using System; using System.Collections.Generic; using System.IO; namespace SIPSorcery.Net { + /// + /// Based in https://github.com/BogdanovKirill/RtspClientSharp/blob/master/RtspClientSharp/MediaParsers/H264VideoPayloadParser.cs + /// Distributed under MIT License + /// + /// @author raf.csoares@kyubinteractive.com + /// public class H264Depacketiser { const int SPS = 7; diff --git a/src/net/RTP/RTPSession.cs b/src/net/RTP/RTPSession.cs index 741035eb5..0362957ca 100644 --- a/src/net/RTP/RTPSession.cs +++ b/src/net/RTP/RTPSession.cs @@ -1585,7 +1585,7 @@ private void SetLocalTrackStreamStatus(MediaStreamTrack localTrack, MediaStreamS /// /// Generates a session description from the provided list of MediaStream. /// - /// The list of tracks to generate the session description for. + /// The list of tracks to generate the session description for. /// Optional. If set this address will be used as /// the SDP Connection address. If not specified the Internet facing address will /// be used. IPAddress.Any and IPAddress. Any and IPv6Any are special cases. If they are set the respective @@ -1799,7 +1799,6 @@ private SDP GetSessionDescription(List mediaStreamList, IPAddress c /// Creates a new RTP channel (which manages the UDP socket sending and receiving RTP /// packets) for use with this session. /// - /// The type of media the RTP channel is for. Must be audio or video. /// A new RTPChannel instance. protected virtual RTPChannel CreateRtpChannel() { diff --git a/src/net/RTP/VideoStream.cs b/src/net/RTP/VideoStream.cs index e64c23a58..54dd24161 100644 --- a/src/net/RTP/VideoStream.cs +++ b/src/net/RTP/VideoStream.cs @@ -83,11 +83,11 @@ public bool HasVideo /// It's intended as a quick convenient way to send something like a test pattern image over an RTSP connection. More than likely it won't be suitable when a high /// quality image is required since the header used in this method does not support quantization tables. /// + /// The duration in timestamp units of the payload (e.g. 3000 for 30fps). /// The raw encoded bytes of the JPEG image to transmit. /// The encoder quality of the JPEG image. /// The width of the JPEG image. /// The height of the JPEG image. - /// The rate at which the JPEG frames are being transmitted at. used to calculate the timestamp. public void SendJpegFrame(uint duration, int payloadTypeID, byte[] jpegBytes, int jpegQuality, int jpegWidth, int jpegHeight) { if (CheckIfCanSendRtpRaw()) @@ -129,8 +129,9 @@ public void SendJpegFrame(uint duration, int payloadTypeID, byte[] jpegBytes, in /// An Access Unit can contain one or more NAL's. The NAL's have to be parsed in order to be able to package /// in RTP packets. /// - /// See https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.264-201602-S!!PDF-E&type=items Annex B for byte stream specification. + /// See Annex B for byte stream specification. /// + // The same URL without XML escape sequences: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.264-201602-S!!PDF-E&type=items public void SendH264Frame(uint duration, int payloadTypeID, byte[] accessUnit) { if (CheckIfCanSendRtpRaw()) @@ -150,8 +151,6 @@ public void SendH264Frame(uint duration, int payloadTypeID, byte[] accessUnit) /// The buffer containing the NAL to send. /// Should be set for the last NAL in the H264 access unit. Determines when the markbit gets set /// and the timestamp incremented. - /// The destination end point to send to. - /// The video track to send on. private void SendH264Nal(uint duration, int payloadTypeID, byte[] nal, bool isLastNal) { //logger.LogDebug($"Send NAL {nal.Length}, is last {isLastNal}, timestamp {videoTrack.Timestamp}."); @@ -204,7 +203,7 @@ private void SendH264Nal(uint duration, int payloadTypeID, byte[] nal, bool isLa /// /// Sends a VP8 frame as one or more RTP packets. /// - /// The timestamp to place in the RTP header. Needs + /// The duration in timestamp units of the payload. Needs /// to be based on a 90Khz clock. /// The payload ID to place in the RTP header. /// The VP8 encoded payload. diff --git a/src/net/RTSP/Mjpeg.cs b/src/net/RTSP/Mjpeg.cs index 4c5de60e4..86c3992d7 100644 --- a/src/net/RTSP/Mjpeg.cs +++ b/src/net/RTSP/Mjpeg.cs @@ -321,7 +321,7 @@ static byte[] CreateQuantizationTables(uint type, uint Q, byte precision) /// Creates a Jpeg QuantizationTableMarker for each table given in the tables /// /// The tables verbatim, either 1 or 2 (Luminance and Chrominance) - /// The table with marker and prefix/returns> + /// The table with marker and prefix static byte[] CreateQuantizationTablesMarker(ArraySegment tables, byte precision) { //List result = new List(); diff --git a/src/net/SCTP/Chunks/SctpDataChunk.cs b/src/net/SCTP/Chunks/SctpDataChunk.cs index 2d32a07b5..2b2a15a48 100644 --- a/src/net/SCTP/Chunks/SctpDataChunk.cs +++ b/src/net/SCTP/Chunks/SctpDataChunk.cs @@ -98,7 +98,7 @@ private SctpDataChunk() /// without requiring it to be delivered to the remote part in order. /// Must be set to true for the first chunk in a user data payload. /// Must be set to true for the last chunk in a user data payload. Note that - /// and must both be set to true when the full payload + /// and must both be set to true when the full payload /// is being sent in a single data chunk. /// The Transmission Sequence Number for this chunk. /// Optional. The stream ID for this data chunk. diff --git a/src/net/SCTP/SctpAssociation.cs b/src/net/SCTP/SctpAssociation.cs index 4f43216fb..e823cc776 100644 --- a/src/net/SCTP/SctpAssociation.cs +++ b/src/net/SCTP/SctpAssociation.cs @@ -588,7 +588,7 @@ public void SendData(ushort streamID, uint ppid, string message) /// /// The stream ID to sent the data on. /// The payload protocol ID for the data. - /// The byte data to send. + /// The byte data to send. public void SendData(ushort streamID, uint ppid, byte[] data) { if (_wasAborted) diff --git a/src/net/SCTP/SctpDataReceiver.cs b/src/net/SCTP/SctpDataReceiver.cs index 6842ee6fb..8106e42b0 100644 --- a/src/net/SCTP/SctpDataReceiver.cs +++ b/src/net/SCTP/SctpDataReceiver.cs @@ -33,6 +33,10 @@ public struct SctpDataFrame public uint PPID; public byte[] UserData; + /// The stream ID of the chunk. + /// The stream sequence number of the chunk. Will be 0 for unordered streams. + /// The payload protocol ID for the chunk. + /// The chunk data. public SctpDataFrame(bool unordered, ushort streamID, ushort streamSeqNum, uint ppid, byte[] userData) { Unordered = unordered; diff --git a/src/net/SCTP/SctpDataSender.cs b/src/net/SCTP/SctpDataSender.cs index 37ce5e823..dd814bf84 100644 --- a/src/net/SCTP/SctpDataSender.cs +++ b/src/net/SCTP/SctpDataSender.cs @@ -305,7 +305,7 @@ public void GotSack(SctpSackChunk sack) /// /// The stream ID to sent the data on. /// The payload protocol ID for the data. - /// The byte data to send. + /// The byte data to send. public void SendData(ushort streamID, uint ppid, byte[] data) { lock (_sendQueue) @@ -665,7 +665,7 @@ private int GetSendWaitMilliseconds() /// Updates the round trip time. /// See https://datatracker.ietf.org/doc/html/rfc4960#section-6.3.1 /// - /// The last round trip time + /// The last sent and acknowledged chunk used to calculate the round trip time private void UpdateRoundTripTime(SctpDataChunk acknowledgedChunk) { // rfc 4960 6.3.1 C5: RTT measurements MUST NOT be made using packets that were retransmitted diff --git a/src/net/SCTP/SctpPacket.cs b/src/net/SCTP/SctpPacket.cs index 9f68bb5cf..de6e675cf 100644 --- a/src/net/SCTP/SctpPacket.cs +++ b/src/net/SCTP/SctpPacket.cs @@ -82,7 +82,7 @@ public class SctpPacket public SctpHeader Header; /// - /// The list of one or recognised chunks after parsing with + /// The list of one or recognised chunks after parsing with /// or chunks that have been manually added for an outgoing SCTP packet. /// public List Chunks; diff --git a/src/net/SCTP/SctpTransport.cs b/src/net/SCTP/SctpTransport.cs index 06f227761..dd166c11f 100644 --- a/src/net/SCTP/SctpTransport.cs +++ b/src/net/SCTP/SctpTransport.cs @@ -297,8 +297,8 @@ protected string GetCookieHMAC(byte[] buffer) /// /// Send an SCTP packet with one of the error type chunks (ABORT or ERROR) to the remote peer. /// - /// Set to true to use an ABORT chunk otherwise an ERROR chunk will be used. - /// The SCTP destination port. + /// Set to true to use an ABORT chunk otherwise an ERROR chunk will be used. + /// The SCTP destination port. /// The SCTP source port. /// If available the initial tag for the remote peer. /// The error to send. diff --git a/src/net/SDP/SDPAudioVideoMediaFormat.cs b/src/net/SDP/SDPAudioVideoMediaFormat.cs index f8b7dcdd8..c183c433f 100644 --- a/src/net/SDP/SDPAudioVideoMediaFormat.cs +++ b/src/net/SDP/SDPAudioVideoMediaFormat.cs @@ -54,7 +54,7 @@ public struct SDPAudioVideoMediaFormat /// Note (rj2): FormatID MUST be string (not int), in case ID is 't38' and type is 'image' /// Note to above: The FormatID is always numeric for profile "RTP/AVP" and "RTP/SAVP", see /// https://tools.ietf.org/html/rfc4566#section-5.14 and section on "fmt": - /// "If the sub-field is "RTP/AVP" or "RTP/SAVP" the + /// "If the [proto] sub-field is "RTP/AVP" or "RTP/SAVP" the [fmt] /// sub-fields contain RTP payload type numbers" /// In the case of T38 the format name is "t38" but the formatID must be set as a dynamic ID. /// @@ -79,7 +79,7 @@ public struct SDPAudioVideoMediaFormat /// /// // Example /// a=rtpmap:0 PCMU/8000 - /// a=rtpmap:101 telephone-event/8000 <-- "101 telephone-event/8000" is the rtpmap properties. + /// a=rtpmap:101 telephone-event/8000 ← "101 telephone-event/8000" is the rtpmap properties. /// a=fmtp:101 0-16 /// /// @@ -91,7 +91,7 @@ public struct SDPAudioVideoMediaFormat /// // Example /// a=rtpmap:0 PCMU/8000 /// a=rtpmap:101 telephone-event/8000 - /// a=fmtp:101 0-16 <-- "101 0-16" is the fmtp attribute. + /// a=fmtp:101 0-16 ← "101 0-16" is the fmtp attribute. /// /// public string Fmtp { get; } @@ -108,7 +108,7 @@ public IEnumerable SupportedRtcpFeedbackMessages /// The standard name of the media format. /// /// // Example - /// a=rtpmap:0 PCMU/8000 <-- "PCMU" is the media format name. + /// a=rtpmap:0 PCMU/8000 ← "PCMU" is the media format name. /// a=rtpmap:101 telephone-event/8000 /// a=fmtp:101 0-16 /// diff --git a/src/net/WebRTC/IRTCPeerConnection.cs b/src/net/WebRTC/IRTCPeerConnection.cs index 1919f67f9..e65c0a52c 100644 --- a/src/net/WebRTC/IRTCPeerConnection.cs +++ b/src/net/WebRTC/IRTCPeerConnection.cs @@ -54,6 +54,7 @@ public class RTCOfferOptions /// public class RTCAnswerOptions { + /// /// If set it indicates that any available ICE candidates should NOT be added /// to the offer SDP. By default "host" candidates should always be available /// and will be added to the offer SDP. diff --git a/src/net/WebRTC/RTCPeerConnection.cs b/src/net/WebRTC/RTCPeerConnection.cs index 3ed676cad..22181fb44 100644 --- a/src/net/WebRTC/RTCPeerConnection.cs +++ b/src/net/WebRTC/RTCPeerConnection.cs @@ -518,7 +518,7 @@ private bool InitializeCertificates2(RTCConfiguration configuration) /// /// Event handler for ICE connection state changes. /// - /// The new ICE connection state. + /// The new ICE connection state. private async void IceConnectionStateChange(RTCIceConnectionState iceState) { oniceconnectionstatechange?.Invoke(iceConnectionState); @@ -624,7 +624,6 @@ private async void IceConnectionStateChange(RTCIceConnectionState iceState) /// Creates a new RTP ICE channel (which manages the UDP socket sending and receiving RTP /// packets) for use with this session. /// - /// The type of media the RTP channel is for. Must be audio or video. /// A new RTPChannel instance. protected override RTPChannel CreateRtpChannel() { @@ -1258,7 +1257,7 @@ void AddIceCandidates(SDPMediaAnnouncement announcement) } /// - /// From RFC5764: + /// From RFC5764: forward to RTP /// | | @@ -1266,6 +1265,7 @@ void AddIceCandidates(SDPMediaAnnouncement announcement) /// | | /// | B< 2 -+--> forward to STUN /// +----------------+ + /// ]]> /// /// The local port on the RTP socket that received the packet. /// The remote end point the packet was received from. @@ -1314,7 +1314,7 @@ private void OnRTPDataReceived(int localPort, IPEndPoint remoteEP, byte[] buffer /// example is when a machine is behind a 1:1 NAT and the application wants a host /// candidate with the public IP address to be included. /// - /// The ICE candidate to add. + /// The ICE candidate to add. /// /// var natCandidate = new RTCIceCandidate(RTCIceProtocol.udp, natAddress, natPort, RTCIceCandidateType.host); /// pc.addLocalIceCandidate(natCandidate); @@ -1538,10 +1538,6 @@ private void OnSctpAssociationDataChannelOpened(ushort streamID) /// /// Event handler for an SCTP DATA chunk being received on the SCTP association. /// - /// The stream ID of the chunk. - /// The stream sequence number of the chunk. Will be 0 for unordered streams. - /// The payload protocol ID for the chunk. - /// The chunk data. private void OnSctpAssociationDataChunk(SctpDataFrame frame) { if (dataChannels.TryGetChannel(frame.StreamID, out var dc)) diff --git a/src/net/WebRTC/RTCPeerSctpAssociation.cs b/src/net/WebRTC/RTCPeerSctpAssociation.cs index 599cd2da1..d7f9c6480 100644 --- a/src/net/WebRTC/RTCPeerSctpAssociation.cs +++ b/src/net/WebRTC/RTCPeerSctpAssociation.cs @@ -69,8 +69,6 @@ public class RTCPeerSctpAssociation : SctpAssociation /// /// The DTLS transport that will be used to encapsulate the /// SCTP packets. - /// True if this peer will be the client within the association. This - /// dictates whether streams created use odd or even ID's. /// The source port to use when forming the association. /// The destination port to use when forming the association. /// Optional. The local UDP port being used for the DTLS connection. This diff --git a/src/net/WebRTC/RTCSctpTransport.cs b/src/net/WebRTC/RTCSctpTransport.cs index cc5f113c4..c918e3e00 100644 --- a/src/net/WebRTC/RTCSctpTransport.cs +++ b/src/net/WebRTC/RTCSctpTransport.cs @@ -179,8 +179,6 @@ public void Start(DatagramTransport dtlsTransport, bool isDtlsClient) /// /// Attempts to create and initialise a new SCTP association with the remote party. /// - /// The source port to use for the SCTP association. - /// The destination port to use for the SCTP association. public void Associate() { SetState(RTCSctpTransportState.Connecting);