mediasoup 3.20.0 → 3.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/node/lib/Consumer.d.ts.map +1 -1
  2. package/node/lib/Consumer.js +5 -4
  3. package/node/lib/DataConsumer.d.ts +2 -3
  4. package/node/lib/DataConsumer.d.ts.map +1 -1
  5. package/node/lib/DataConsumer.js +10 -7
  6. package/node/lib/DataConsumerTypes.d.ts +5 -4
  7. package/node/lib/DataConsumerTypes.d.ts.map +1 -1
  8. package/node/lib/DataProducer.d.ts.map +1 -1
  9. package/node/lib/DataProducer.js +2 -1
  10. package/node/lib/PipeTransport.d.ts.map +1 -1
  11. package/node/lib/PipeTransport.js +5 -4
  12. package/node/lib/PlainTransport.d.ts.map +1 -1
  13. package/node/lib/PlainTransport.js +6 -5
  14. package/node/lib/Producer.d.ts.map +1 -1
  15. package/node/lib/Producer.js +4 -3
  16. package/node/lib/Router.js +1 -1
  17. package/node/lib/WebRtcTransport.d.ts.map +1 -1
  18. package/node/lib/WebRtcTransport.js +6 -5
  19. package/node/lib/fbs/consumer/degrade-request.d.ts +30 -0
  20. package/node/lib/fbs/consumer/degrade-request.d.ts.map +1 -0
  21. package/node/lib/fbs/consumer/degrade-request.js +124 -0
  22. package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +24 -0
  23. package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +1 -0
  24. package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +102 -0
  25. package/node/lib/fbs/data-consumer/send-response.d.ts +21 -0
  26. package/node/lib/fbs/data-consumer/send-response.d.ts.map +1 -0
  27. package/node/lib/fbs/data-consumer/send-response.js +91 -0
  28. package/node/lib/fbs/data-consumer.d.ts +1 -0
  29. package/node/lib/fbs/data-consumer.d.ts.map +1 -1
  30. package/node/lib/fbs/data-consumer.js +4 -1
  31. package/node/lib/fbs/producer/degrade-request.d.ts +30 -0
  32. package/node/lib/fbs/producer/degrade-request.d.ts.map +1 -0
  33. package/node/lib/fbs/producer/degrade-request.js +124 -0
  34. package/node/lib/fbs/response/body.d.ts +7 -5
  35. package/node/lib/fbs/response/body.d.ts.map +1 -1
  36. package/node/lib/fbs/response/body.js +7 -3
  37. package/node/lib/fbs/response/response.d.ts +3 -2
  38. package/node/lib/fbs/response/response.d.ts.map +1 -1
  39. package/node/lib/fbs/sctp-parameters/num-sctp-streams.d.ts.map +1 -1
  40. package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +5 -5
  41. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts +24 -0
  42. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts.map +1 -0
  43. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.js +102 -0
  44. package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts +24 -0
  45. package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts.map +1 -0
  46. package/node/lib/fbs/transport/sctp-negotiated-options-notification.js +102 -0
  47. package/node/lib/fbs/worker/close-notification.d.ts +18 -0
  48. package/node/lib/fbs/worker/close-notification.d.ts.map +1 -0
  49. package/node/lib/fbs/worker/close-notification.js +78 -0
  50. package/node/lib/fbs/worker/close-request.d.ts +18 -0
  51. package/node/lib/fbs/worker/close-request.d.ts.map +1 -0
  52. package/node/lib/fbs/worker/close-request.js +78 -0
  53. package/node/lib/fbs/worker/close-worker-notification.d.ts +18 -0
  54. package/node/lib/fbs/worker/close-worker-notification.d.ts.map +1 -0
  55. package/node/lib/fbs/worker/close-worker-notification.js +78 -0
  56. package/node/lib/sctpParametersTypes.d.ts +23 -0
  57. package/node/lib/sctpParametersTypes.d.ts.map +1 -1
  58. package/node/lib/test/test-Consumer.js +194 -0
  59. package/node/lib/test/test-DataConsumer.js +6 -0
  60. package/node/lib/test/test-Router.js +11 -0
  61. package/node/lib/test/test-werift-sctp.js +7 -0
  62. package/npm-scripts.mjs +2 -2
  63. package/package.json +7 -6
  64. package/worker/Makefile +5 -1
  65. package/worker/deps/libwebrtc/meson.build +5 -1
  66. package/worker/fbs/dataConsumer.fbs +4 -0
  67. package/worker/fbs/response.fbs +1 -0
  68. package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +2 -2
  69. package/worker/include/Channel/ChannelMessageRegistrator.hpp +4 -3
  70. package/worker/include/Channel/ChannelNotification.hpp +0 -4
  71. package/worker/include/Channel/ChannelRequest.hpp +3 -4
  72. package/worker/include/DepLibSRTP.hpp +2 -2
  73. package/worker/include/RTC/ActiveSpeakerObserver.hpp +2 -2
  74. package/worker/include/RTC/AudioLevelObserver.hpp +2 -2
  75. package/worker/include/RTC/Consumer.hpp +1 -1
  76. package/worker/include/RTC/DataConsumer.hpp +2 -2
  77. package/worker/include/RTC/DtlsTransport.hpp +4 -4
  78. package/worker/include/RTC/ICE/IceServer.hpp +2 -2
  79. package/worker/include/RTC/ICE/StunPacket.hpp +34 -34
  80. package/worker/include/RTC/KeyFrameRequestManager.hpp +3 -3
  81. package/worker/include/RTC/Parameters.hpp +2 -2
  82. package/worker/include/RTC/PipeConsumer.hpp +6 -5
  83. package/worker/include/RTC/PlainTransport.hpp +0 -1
  84. package/worker/include/RTC/PortManager.hpp +92 -12
  85. package/worker/include/RTC/Producer.hpp +7 -6
  86. package/worker/include/RTC/RTCP/Feedback.hpp +1 -2
  87. package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +2 -2
  88. package/worker/include/RTC/RTCP/Packet.hpp +2 -2
  89. package/worker/include/RTC/RTCP/Sdes.hpp +1 -1
  90. package/worker/include/RTC/RTP/Codecs/DependencyDescriptor.hpp +2 -1
  91. package/worker/include/RTC/RTP/Packet.hpp +57 -57
  92. package/worker/include/RTC/RTP/ProbationGenerator.hpp +2 -2
  93. package/worker/include/RTC/RTP/SharedPacket.hpp +4 -4
  94. package/worker/include/RTC/Router.hpp +12 -11
  95. package/worker/include/RTC/RtcLogger.hpp +2 -2
  96. package/worker/include/RTC/RtpDictionaries.hpp +6 -6
  97. package/worker/include/RTC/RtpListener.hpp +4 -4
  98. package/worker/include/RTC/SCTP/association/Association.hpp +13 -13
  99. package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +2 -2
  100. package/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +2 -2
  101. package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
  102. package/worker/include/RTC/SCTP/association/StateCookie.hpp +9 -9
  103. package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +4 -4
  104. package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +24 -24
  105. package/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +4 -4
  106. package/worker/include/RTC/SCTP/packet/Chunk.hpp +86 -86
  107. package/worker/include/RTC/SCTP/packet/ErrorCause.hpp +18 -18
  108. package/worker/include/RTC/SCTP/packet/Packet.hpp +33 -33
  109. package/worker/include/RTC/SCTP/packet/Parameter.hpp +24 -24
  110. package/worker/include/RTC/SCTP/packet/TLV.hpp +13 -13
  111. package/worker/include/RTC/SCTP/packet/UserData.hpp +4 -4
  112. package/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp +5 -5
  113. package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +9 -9
  114. package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +3 -3
  115. package/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp +5 -5
  116. package/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp +5 -5
  117. package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +11 -11
  118. package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +6 -6
  119. package/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp +6 -6
  120. package/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp +6 -6
  121. package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +6 -6
  122. package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +7 -7
  123. package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +10 -10
  124. package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +8 -8
  125. package/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp +6 -6
  126. package/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp +10 -10
  127. package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +5 -5
  128. package/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp +5 -5
  129. package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +5 -5
  130. package/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp +5 -5
  131. package/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp +2 -2
  132. package/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp +4 -4
  133. package/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp +4 -4
  134. package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +5 -5
  135. package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +5 -5
  136. package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +5 -5
  137. package/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp +4 -4
  138. package/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp +4 -4
  139. package/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp +4 -4
  140. package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +5 -5
  141. package/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp +2 -2
  142. package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp +4 -4
  143. package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp +4 -4
  144. package/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp +4 -4
  145. package/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp +4 -4
  146. package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +5 -5
  147. package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +5 -5
  148. package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +5 -5
  149. package/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp +4 -4
  150. package/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp +3 -3
  151. package/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp +4 -4
  152. package/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp +5 -5
  153. package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +5 -5
  154. package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +5 -5
  155. package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +7 -7
  156. package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +5 -5
  157. package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +5 -5
  158. package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +4 -4
  159. package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +4 -4
  160. package/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp +2 -2
  161. package/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp +4 -4
  162. package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +7 -7
  163. package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +7 -7
  164. package/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp +26 -26
  165. package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +7 -7
  166. package/worker/include/RTC/SCTP/public/Message.hpp +1 -1
  167. package/worker/include/RTC/SCTP/public/SctpOptions.hpp +4 -4
  168. package/worker/include/RTC/SCTP/public/SctpTypes.hpp +10 -10
  169. package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
  170. package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +1 -1
  171. package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +39 -39
  172. package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +1 -1
  173. package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +14 -14
  174. package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +1 -1
  175. package/worker/include/RTC/SctpListener.hpp +2 -2
  176. package/worker/include/RTC/SimulcastConsumer.hpp +2 -1
  177. package/worker/include/RTC/TcpServer.hpp +3 -2
  178. package/worker/include/RTC/Transport.hpp +8 -8
  179. package/worker/include/RTC/UdpSocket.hpp +3 -2
  180. package/worker/include/RTC/WebRtcServer.hpp +4 -5
  181. package/worker/include/RTC/WebRtcTransport.hpp +2 -2
  182. package/worker/include/Settings.hpp +3 -3
  183. package/worker/include/Worker.hpp +3 -3
  184. package/worker/include/handles/TcpServerHandle.hpp +2 -2
  185. package/worker/meson.build +9 -4
  186. package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +4 -3
  187. package/worker/src/Channel/ChannelNotification.cpp +5 -4
  188. package/worker/src/Channel/ChannelRequest.cpp +9 -6
  189. package/worker/src/DepLibSRTP.cpp +1 -1
  190. package/worker/src/RTC/AudioLevelObserver.cpp +2 -2
  191. package/worker/src/RTC/DataConsumer.cpp +13 -3
  192. package/worker/src/RTC/DataProducer.cpp +1 -1
  193. package/worker/src/RTC/DtlsTransport.cpp +3 -3
  194. package/worker/src/RTC/ICE/IceServer.cpp +1 -1
  195. package/worker/src/RTC/ICE/StunPacket.cpp +77 -77
  196. package/worker/src/RTC/PipeTransport.cpp +5 -4
  197. package/worker/src/RTC/PlainTransport.cpp +9 -8
  198. package/worker/src/RTC/PortManager.cpp +174 -114
  199. package/worker/src/RTC/Producer.cpp +0 -1
  200. package/worker/src/RTC/RTCP/Feedback.cpp +6 -6
  201. package/worker/src/RTC/RTCP/FeedbackPs.cpp +1 -1
  202. package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
  203. package/worker/src/RTC/RTCP/FeedbackPsPli.cpp +1 -1
  204. package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +2 -2
  205. package/worker/src/RTC/RTCP/FeedbackRtp.cpp +1 -1
  206. package/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp +1 -1
  207. package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +2 -2
  208. package/worker/src/RTC/RTCP/Packet.cpp +2 -2
  209. package/worker/src/RTC/RTCP/Sdes.cpp +1 -1
  210. package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +2 -1
  211. package/worker/src/RTC/RTP/Packet.cpp +68 -68
  212. package/worker/src/RTC/RTP/ProbationGenerator.cpp +3 -3
  213. package/worker/src/RTC/RTP/RtpStreamRecv.cpp +3 -3
  214. package/worker/src/RTC/RTP/RtxStream.cpp +2 -2
  215. package/worker/src/RTC/RTP/SharedPacket.cpp +4 -4
  216. package/worker/src/RTC/Router.cpp +5 -5
  217. package/worker/src/RTC/RtcLogger.cpp +1 -1
  218. package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +4 -4
  219. package/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +2 -3
  220. package/worker/src/RTC/SCTP/association/Association.cpp +100 -97
  221. package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +6 -6
  222. package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +3 -3
  223. package/worker/src/RTC/SCTP/association/PacketSender.cpp +1 -1
  224. package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +2 -2
  225. package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +5 -5
  226. package/worker/src/RTC/SCTP/packet/Chunk.cpp +52 -52
  227. package/worker/src/RTC/SCTP/packet/ErrorCause.cpp +14 -14
  228. package/worker/src/RTC/SCTP/packet/Packet.cpp +17 -17
  229. package/worker/src/RTC/SCTP/packet/Parameter.cpp +17 -17
  230. package/worker/src/RTC/SCTP/packet/TLV.cpp +8 -8
  231. package/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp +3 -3
  232. package/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp +2 -2
  233. package/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp +1 -1
  234. package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +2 -2
  235. package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +2 -2
  236. package/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp +3 -3
  237. package/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp +3 -3
  238. package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +2 -2
  239. package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +2 -2
  240. package/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp +4 -4
  241. package/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp +4 -4
  242. package/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp +3 -3
  243. package/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp +3 -3
  244. package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +3 -3
  245. package/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp +2 -2
  246. package/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp +2 -2
  247. package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +2 -2
  248. package/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp +2 -2
  249. package/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp +2 -2
  250. package/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp +2 -2
  251. package/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp +4 -4
  252. package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +2 -2
  253. package/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp +2 -2
  254. package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +1 -1
  255. package/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
  256. package/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp +2 -2
  257. package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp +1 -1
  258. package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp +1 -1
  259. package/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp +1 -1
  260. package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
  261. package/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp +2 -2
  262. package/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp +2 -2
  263. package/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp +2 -2
  264. package/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp +2 -2
  265. package/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp +1 -1
  266. package/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp +2 -2
  267. package/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp +2 -2
  268. package/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +2 -2
  269. package/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +2 -2
  270. package/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp +3 -3
  271. package/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp +2 -2
  272. package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +3 -3
  273. package/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp +3 -3
  274. package/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp +1 -1
  275. package/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp +1 -1
  276. package/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp +3 -3
  277. package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +1 -0
  278. package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +1 -0
  279. package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +8 -8
  280. package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +1 -1
  281. package/worker/src/RTC/SvcConsumer.cpp +6 -2
  282. package/worker/src/RTC/TcpServer.cpp +4 -4
  283. package/worker/src/RTC/Transport.cpp +42 -19
  284. package/worker/src/RTC/UdpSocket.cpp +4 -4
  285. package/worker/src/RTC/WebRtcServer.cpp +8 -8
  286. package/worker/src/RTC/WebRtcTransport.cpp +9 -8
  287. package/worker/src/Settings.cpp +2 -2
  288. package/worker/src/lib.cpp +1 -2
  289. package/worker/subprojects/packagefiles/ankerl-unordered-dense/meson.build +5 -0
  290. package/worker/subprojects/unordered-dense.wrap +9 -0
  291. package/worker/tasks.py +293 -196
  292. package/worker/test/src/RTC/ICE/TestStunPacket.cpp +22 -22
  293. package/worker/test/src/RTC/ICE/iceCommon.cpp +1 -1
  294. package/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +8 -8
  295. package/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +1 -1
  296. package/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +1 -1
  297. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +1 -1
  298. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
  299. package/worker/test/src/RTC/RTCP/TestSenderReport.cpp +1 -1
  300. package/worker/test/src/RTC/RTP/TestPacket.cpp +26 -26
  301. package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
  302. package/worker/test/src/RTC/RTP/rtpCommon.cpp +1 -1
  303. package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +4 -4
  304. package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +14 -14
  305. package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +4 -4
  306. package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
  307. package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
  308. package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +3 -3
  309. package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +3 -3
  310. package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +9 -9
  311. package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +2 -2
  312. package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +3 -3
  313. package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +3 -3
  314. package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +8 -8
  315. package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +7 -7
  316. package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +6 -6
  317. package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +2 -2
  318. package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
  319. package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
  320. package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +2 -2
  321. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
  322. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
  323. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +6 -6
  324. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +11 -11
  325. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +6 -6
  326. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +5 -5
  327. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +2 -2
  328. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +2 -2
  329. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +6 -6
  330. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
  331. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +2 -2
  332. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
  333. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +2 -2
  334. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +2 -2
  335. package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
  336. package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
  337. package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +7 -7
  338. package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
  339. package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +2 -2
  340. package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +7 -7
  341. package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +7 -7
  342. package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +2 -2
  343. package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +2 -2
  344. package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +5 -5
  345. package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
  346. package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +1 -1
  347. package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +6 -6
  348. package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +3 -3
  349. package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +1 -1
  350. package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
  351. package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
  352. package/worker/test/src/RTC/SCTP/sctpCommon.cpp +1 -1
  353. package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +3 -3
  354. package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +1 -1
  355. package/worker/test/src/RTC/TestNackGenerator.cpp +1 -1
  356. package/worker/test/src/RTC/TestPortManager.cpp +126 -0
  357. package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +2 -2
  358. package/worker/test/src/RTC/TestTransportTuple.cpp +3 -2
  359. package/worker/test/src/Utils/TestCrypto.cpp +3 -3
  360. package/worker/test/src/Utils/TestString.cpp +1 -1
@@ -5,8 +5,8 @@
5
5
  #include "RTC/SCTP/packet/ErrorCause.hpp"
6
6
  #include "RTC/SCTP/packet/Parameter.hpp"
7
7
  #include "RTC/SCTP/packet/TLV.hpp"
8
+ #include <ankerl/unordered_dense.h>
8
9
  #include <string>
9
- #include <unordered_map>
10
10
  #include <vector>
11
11
 
12
12
  namespace RTC
@@ -28,13 +28,13 @@ namespace RTC
28
28
  * \ \
29
29
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
30
30
  *
31
- * - Chunk Type (8 bits).
32
- * - Chunk Flags (8 bits).
33
- * - Chunk Length (16 bits): Total length of the Chunk
34
- * excluding padding bytes. Minimum value is 4 (if Chunk Value is 0
31
+ * - Chunk type (8 bits).
32
+ * - Chunk flags (8 bits).
33
+ * - Chunk length (16 bits): Total length of the chunk
34
+ * excluding padding bytes. Minimum value is 4 (if chunk value is 0
35
35
  * bytes). Maximum value is 65535, which means 1 byte of padding.
36
- * - Chunk Value (variable length).
37
- * - Padding: Bytes of padding to make the Chunk total length be
36
+ * - Chunk value (variable length).
37
+ * - Padding: Bytes of padding to make the chunk total length be
38
38
  * multiple of 4 bytes.
39
39
  */
40
40
 
@@ -43,7 +43,7 @@ namespace RTC
43
43
 
44
44
  class Chunk : public TLV
45
45
  {
46
- // We need that Packet calls protected and private methods in this class.
46
+ // We need that packet calls protected and private methods in this class.
47
47
  friend class Packet;
48
48
 
49
49
  public:
@@ -79,7 +79,7 @@ namespace RTC
79
79
 
80
80
  /**
81
81
  * Action that is taken if the processing endpoint does not recognize the
82
- * Chunk Type.
82
+ * chunk type.
83
83
  */
84
84
  enum class ActionForUnknownChunkType : uint8_t
85
85
  {
@@ -100,10 +100,10 @@ namespace RTC
100
100
  ChunkType type;
101
101
  uint8_t flags;
102
102
  /**
103
- * The value of the Chunk Length field, which represents the total
104
- * length of the Chunk in bytes, including the Chunk Type, Chunk Flags,
105
- * Chunk Length and Chunk Value fields. So if the Chunk Value field is
106
- * zero-length, the Length field must be 4. The Chunk Length field does
103
+ * The value of the chunk length field, which represents the total
104
+ * length of the chunk in bytes, including the chunk type, chunk flags,
105
+ * chunk length and chunk value fields. So if the chunk value field is
106
+ * zero-length, the length field must be 4. The chunk length field does
107
107
  * not count any padding.
108
108
  */
109
109
  uint16_t length;
@@ -149,16 +149,16 @@ namespace RTC
149
149
 
150
150
  public:
151
151
  /**
152
- * Whether given buffer could be a a valid Chunk.
152
+ * Whether given buffer could be a a valid chunk.
153
153
  *
154
154
  * @param buffer
155
- * @param bufferLength - Can be greater than real Chunk length.
156
- * @param chunkType - If given buffer is a valid Chunk then `chunkType`
155
+ * @param bufferLength - Can be greater than real chunk length.
156
+ * @param chunkType - If given buffer is a valid chunk then `chunkType`
157
157
  * is rewritten to parsed ChunkType.
158
- * @param chunkLength - If given buffer is a valid Chunk then
159
- * `chunkLength` is rewritten to the value of the Chunk Length field.
160
- * @param padding - If given buffer is a valid Chunk then `padding` is
161
- * rewritten to the number of padding bytes in the Chunk (only the
158
+ * @param chunkLength - If given buffer is a valid chunk then
159
+ * `chunkLength` is rewritten to the value of the chunk length field.
160
+ * @param padding - If given buffer is a valid chunk then `padding` is
161
+ * rewritten to the number of padding bytes in the chunk (only the
162
162
  * necessary ones to make total length multiple of 4).
163
163
  */
164
164
  static bool IsChunk(
@@ -171,11 +171,11 @@ namespace RTC
171
171
  static const std::string& ChunkTypeToString(ChunkType chunkType);
172
172
 
173
173
  private:
174
- static const std::unordered_map<ChunkType, std::string> ChunkType2String;
174
+ static const ankerl::unordered_dense::map<ChunkType, std::string> ChunkType2String;
175
175
 
176
176
  protected:
177
177
  /**
178
- * Constructor is protected because we only want to create Chunk
178
+ * Constructor is protected because we only want to create chunk
179
179
  * instances via Parse() and Factory() in subclasses.
180
180
  */
181
181
  Chunk(uint8_t* buffer, size_t bufferLength);
@@ -217,7 +217,7 @@ namespace RTC
217
217
  }
218
218
 
219
219
  /**
220
- * Whether this type of Chunk can have Parameters. Subclasses must
220
+ * Whether this type of chunk can have parameters. Subclasses must
221
221
  * override this method.
222
222
  */
223
223
  virtual bool CanHaveParameters() const = 0;
@@ -267,42 +267,42 @@ namespace RTC
267
267
  }
268
268
 
269
269
  /**
270
- * Clone given Parameter into Chunk's buffer.
270
+ * Clone given parameter into chunk's buffer.
271
271
  *
272
272
  * @remarks
273
273
  * - Once this method is called, the caller may want to free the original
274
- * given Parameter (otherwise it will leak since the Chunk manages a clone
274
+ * given parameter (otherwise it will leak since the chunk manages a clone
275
275
  * of it).
276
276
  *
277
277
  * @throw
278
- * - MediaSoupError - If the Chunk subclass cannot have Parameters.
278
+ * - MediaSoupError - If the chunk subclass cannot have parameters.
279
279
  * - MediaSoupError - If `BuildParameterInPlace()` or
280
280
  * `BuildErrorCauseInPlace()` was called before and the caller didn't
281
- * invoke `Consolidate()` on the returned Parameter or Error Cause yet.
281
+ * invoke `Consolidate()` on the returned parameter or error cause yet.
282
282
  */
283
283
  virtual void AddParameter(const Parameter* parameter) final;
284
284
 
285
285
  /**
286
- * Build a Parameter within the Chunk's buffer and append it to the list
287
- * of Parameters. The caller can perform modifications in that Parameter
288
- * and those will affect the Chunk body where the Parameter is serialized.
289
- * The desired Parameter class type is given via template argument.
286
+ * Build a parameter within the chunk's buffer and append it to the list
287
+ * of parameters. The caller can perform modifications in that parameter
288
+ * and those will affect the chunk body where the parameter is serialized.
289
+ * The desired parameter class type is given via template argument.
290
290
  *
291
- * @returns Pointer of the created Parameter specific class.
291
+ * @returns Pointer of the created parameter specific class.
292
292
  *
293
293
  * @throw
294
- * - MediaSoupError - If the Chunk subclass cannot have Parameters.
294
+ * - MediaSoupError - If the chunk subclass cannot have parameters.
295
295
  * - MediaSoupError - If `BuildParameterInPlace()` or
296
296
  * `BuildErrorCauseInPlace()` was called before and the caller didn't
297
- * invoke `Consolidate()` on the returned Parameter or Error Cause yet.
297
+ * invoke `Consolidate()` on the returned parameter or error cause yet.
298
298
  *
299
299
  * @remarks
300
- * - The caller MUST invoke `Consolidate()` once the Parameter is
300
+ * - The caller MUST invoke `Consolidate()` once the parameter is
301
301
  * completed.
302
- * - The caller MUST NOT free the obtained Parameter pointer since it's
303
- * now part of the Chunk.
304
- * - The caller MUST free the obtained Parameter only in case the
305
- * `Consolidate()` method on the Parameter throws.
302
+ * - The caller MUST NOT free the obtained parameter pointer since it's
303
+ * now part of the chunk.
304
+ * - The caller MUST free the obtained parameter only in case the
305
+ * `Consolidate()` method on the parameter throws.
306
306
  * - Method implemented in header file due to C++ template usage.
307
307
  *
308
308
  * @example
@@ -317,18 +317,18 @@ namespace RTC
317
317
  AssertCanHaveParameters();
318
318
  AssertDoesNotNeedConsolidation();
319
319
 
320
- // The new Parameter will be added after other Parameters in the Chunk,
321
- // this is, at the end of the Chunk, whose length we know it's padded to
322
- // 4 bytes, and each Parameter total length is also multiple of 4 bytes.
320
+ // The new parameter will be added after other parameters in the chunk,
321
+ // this is, at the end of the chunk, whose length we know it's padded to
322
+ // 4 bytes, and each parameter total length is also multiple of 4 bytes.
323
323
  auto* ptr = const_cast<uint8_t*>(GetBuffer()) + GetLength();
324
324
  // The remaining length in the buffer is the potential buffer length
325
- // of the Parameter.
325
+ // of the parameter.
326
326
  size_t parameterMaxBufferLength = GetBufferLength() - (ptr - GetBuffer());
327
327
 
328
328
  auto* parameter = T::Factory(ptr, parameterMaxBufferLength);
329
329
 
330
- // NOTE: Do not fix/update the Parameter buffer length since the caller
331
- // probably wants to modify the Parameter.
330
+ // NOTE: Do not fix/update the parameter buffer length since the caller
331
+ // probably wants to modify the parameter.
332
332
 
333
333
  HandleInPlaceParameter(parameter);
334
334
 
@@ -336,7 +336,7 @@ namespace RTC
336
336
  }
337
337
 
338
338
  /**
339
- * Whether this type of Chunk can have Error Causes. Subclasses must
339
+ * Whether this type of chunk can have error causes. Subclasses must
340
340
  * override this method.
341
341
  */
342
342
  virtual bool CanHaveErrorCauses() const = 0;
@@ -386,43 +386,43 @@ namespace RTC
386
386
  }
387
387
 
388
388
  /**
389
- * Clone given Error Cause into Chunk's buffer.
389
+ * Clone given error cause into chunk's buffer.
390
390
  *
391
391
  * @remarks
392
392
  * - Once this method is called, the caller may want to free the original
393
- * given Error Cause (otherwise it will leak since the Chunk manages a
393
+ * given error cause (otherwise it will leak since the chunk manages a
394
394
  * clone of it).
395
395
  *
396
396
  * @throw
397
- * - MediaSoupError - If the Chunk subclass cannot have Error Causes.
397
+ * - MediaSoupError - If the chunk subclass cannot have error causes.
398
398
  * - MediaSoupError - If `BuildParameterInPlace()` or
399
399
  * `BuildErrorCauseInPlace()` was called before and the caller didn't
400
- * invoke `Consolidate()` on the returned Parameter or Error Cause yet.
400
+ * invoke `Consolidate()` on the returned parameter or error cause yet.
401
401
  */
402
402
  virtual void AddErrorCause(const ErrorCause* errorCause) final;
403
403
 
404
404
  /**
405
- * Build a Error Cause within the Chunk's buffer and append it to the
406
- * list of Error Causes. The caller can perform modifications in that
407
- * Error Cause and those will affect the Chunk body where the Error Cause
408
- * is serialzed. The desired Error Cause class type is given via template
405
+ * Build a error cause within the chunk's buffer and append it to the
406
+ * list of error causes. The caller can perform modifications in that
407
+ * error cause and those will affect the chunk body where the error cause
408
+ * is serialzed. The desired error cause class type is given via template
409
409
  * argument.
410
410
  *
411
- * @returns Pointer of the created Error Cause specific class.
411
+ * @returns Pointer of the created error cause specific class.
412
412
  *
413
413
  * @throw
414
- * - MediaSoupError - If the Chunk subclass cannot have Error Causes.
414
+ * - MediaSoupError - If the chunk subclass cannot have error causes.
415
415
  * - MediaSoupError - If `BuildParameterInPlace()` or
416
416
  * `BuildErrorCauseInPlace()` was called before and the caller didn't
417
- * invoke `Consolidate()` on the returned Parameter or Error Cause yet.
417
+ * invoke `Consolidate()` on the returned parameter or error cause yet.
418
418
  *
419
419
  * @remarks
420
- * - The caller MUST invoke `Consolidate()` once the Error Cause is
420
+ * - The caller MUST invoke `Consolidate()` once the error cause is
421
421
  * completed.
422
- * - The caller MUST NOT free the obtained Error Cause pointer since it's
423
- * now part of the Chunk.
424
- * - The caller MUST free the obtained Error Cause only in case the
425
- * `Consolidate()` method on the Error Cause throws.
422
+ * - The caller MUST NOT free the obtained error cause pointer since it's
423
+ * now part of the chunk.
424
+ * - The caller MUST free the obtained error cause only in case the
425
+ * `Consolidate()` method on the error cause throws.
426
426
  * - Method implemented in header file due to C++ template usage.
427
427
  *
428
428
  * @example
@@ -437,19 +437,19 @@ namespace RTC
437
437
  AssertCanHaveErrorCauses();
438
438
  AssertDoesNotNeedConsolidation();
439
439
 
440
- // The new Error Cause will be added after other Error Causes in the
441
- // Chunk, this is, at the end of the Chunk, whose length we know it's
442
- // padded to 4 bytes, and each Error Cause total length is also
440
+ // The new error cause will be added after other error causes in the
441
+ // chunk, this is, at the end of the chunk, whose length we know it's
442
+ // padded to 4 bytes, and each error cause total length is also
443
443
  // multiple of 4 bytes.
444
444
  auto* ptr = const_cast<uint8_t*>(GetBuffer()) + GetLength();
445
445
  // The remaining length in the buffer is the potential buffer length
446
- // of the Error Cause.
446
+ // of the error cause.
447
447
  size_t errorCauseMaxBufferLength = GetBufferLength() - (ptr - GetBuffer());
448
448
 
449
449
  auto* errorCause = T::Factory(ptr, errorCauseMaxBufferLength);
450
450
 
451
- // NOTE: Do not fix/update the Error Cause buffer length since the
452
- // caller probably wants to modify the Error Cause.
451
+ // NOTE: Do not fix/update the error cause buffer length since the
452
+ // caller probably wants to modify the error cause.
453
453
 
454
454
  HandleInPlaceErrorCause(errorCause);
455
455
 
@@ -459,7 +459,7 @@ namespace RTC
459
459
  /**
460
460
  * Whether `BuildParameterInPlace()` or `BuildErrorCauseInPlace()` was
461
461
  * called before and the caller didn't invoke `Consolidate()` on the
462
- * returned Parameter or Error Cause yet.
462
+ * returned parameter or error cause yet.
463
463
  */
464
464
  virtual bool NeedsConsolidation() const final
465
465
  {
@@ -576,8 +576,8 @@ namespace RTC
576
576
  /**
577
577
  * Chunk subclasses with header bigger than default one (4 bytes) must
578
578
  * override this method and return their header length (excluding
579
- * variable-length field considered "value", Optional/Variable-Length
580
- * Parameters and Error Causes).
579
+ * variable-length field considered "value", Optional/variable-length
580
+ * parameters and error causes).
581
581
  */
582
582
  size_t GetHeaderLength() const override
583
583
  {
@@ -585,34 +585,34 @@ namespace RTC
585
585
  }
586
586
 
587
587
  /**
588
- * To be called by each subclass of Chunk if Parameters parsing is
589
- * needed. It creates Parameter subclasses and adds them to the Chunk.
588
+ * To be called by each subclass of chunk if parameters parsing is
589
+ * needed. It creates parameter subclasses and adds them to the chunk.
590
590
  *
591
591
  * @remarks
592
- * - This method assumes that the Chunk basic parsing has been made
593
- * already so current length of the Chunk is the fixed length of the
594
- * specific Chunk class.
592
+ * - This method assumes that the chunk basic parsing has been made
593
+ * already so current length of the chunk is the fixed length of the
594
+ * specific chunk class.
595
595
  *
596
- * @return True if no error happened while parsing Parameters.
596
+ * @return True if no error happened while parsing parameters.
597
597
  *
598
598
  * @throw
599
- * - MediaSoupError - If the Chunk subclass cannot have Chunk Parameters.
599
+ * - MediaSoupError - If the chunk subclass cannot have chunk parameters.
600
600
  */
601
601
  virtual bool ParseParameters() final;
602
602
 
603
603
  /**
604
- * To be called by each subclass of Chunk if Error Causes parsing is
605
- * needed. It creates ErrorCause subclasses and adds them to the Chunk.
604
+ * To be called by each subclass of chunk if error causes parsing is
605
+ * needed. It creates ErrorCause subclasses and adds them to the chunk.
606
606
  *
607
607
  * @remarks
608
- * - This method assumes that the Chunk basic parsing has been made
609
- * already so current length of the Chunk is the fixed length of the
610
- * specific Chunk class.
608
+ * - This method assumes that the chunk basic parsing has been made
609
+ * already so current length of the chunk is the fixed length of the
610
+ * specific chunk class.
611
611
  *
612
- * @return True if no error happened while parsing Error Causes.
612
+ * @return True if no error happened while parsing error causes.
613
613
  *
614
614
  * @throw
615
- * - MediaSoupError - If the Chunk subclass cannot have Chunk Parameters.
615
+ * - MediaSoupError - If the chunk subclass cannot have chunk parameters.
616
616
  */
617
617
  virtual bool ParseErrorCauses() final;
618
618
 
@@ -658,7 +658,7 @@ namespace RTC
658
658
  std::vector<ErrorCause*> errorCauses;
659
659
  // Whether `BuildParameterInPlace()` or `BuildErrorCauseInPlace()` was
660
660
  // called and the caller didn't invoke `Consolidate()` on the returned
661
- // Parameter or Error Cause yet.
661
+ // parameter or error cause yet.
662
662
  bool needsConsolidation{ false };
663
663
  };
664
664
  } // namespace SCTP
@@ -3,8 +3,8 @@
3
3
 
4
4
  #include "common.hpp"
5
5
  #include "RTC/SCTP/packet/TLV.hpp"
6
+ #include <ankerl/unordered_dense.h>
6
7
  #include <string>
7
- #include <unordered_map>
8
8
 
9
9
  namespace RTC
10
10
  {
@@ -25,12 +25,12 @@ namespace RTC
25
25
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
26
26
  *
27
27
  * - Cause Code (16 bits).
28
- * - Cause Length (16 bits): Set to the size of the Error Cause in bytes,
29
- * including the Cause Code, Cause Length, and Cause-Specific Information
28
+ * - Cause length (16 bits): Set to the size of the error cause in bytes,
29
+ * including the Cause Code, Cause length, and Cause-Specific Information
30
30
  * fields (padding excluded).
31
31
  * - Cause-Specific Information (variable length): This field carries the
32
32
  * details of the error condition.
33
- * - Padding: Bytes of padding to make the Error Cause total length be
33
+ * - Padding: Bytes of padding to make the error cause total length be
34
34
  * multiple of 4 bytes.
35
35
  */
36
36
 
@@ -39,7 +39,7 @@ namespace RTC
39
39
 
40
40
  class ErrorCause : public TLV
41
41
  {
42
- // We need that Chunk calls protected and private methods in this class.
42
+ // We need that chunk calls protected and private methods in this class.
43
43
  friend class Chunk;
44
44
 
45
45
  public:
@@ -75,11 +75,11 @@ namespace RTC
75
75
  {
76
76
  ErrorCauseCode code;
77
77
  /**
78
- * The value of the Error Cause Length field, which represents the
79
- * total length of the Error Cause in bytes, including the Cause Code,
80
- * Cause Length and Cause-Specific Information fields. So if the
81
- * Cause-Specific Information field is zero-length, the Length field
82
- * must be 4. The Cause Length field does not count any padding.
78
+ * The value of the error cause length field, which represents the
79
+ * total length of the error cause in bytes, including the Cause Code,
80
+ * Cause length and Cause-Specific Information fields. So if the
81
+ * Cause-Specific Information field is zero-length, the length field
82
+ * must be 4. The Cause length field does not count any padding.
83
83
  */
84
84
  uint16_t length;
85
85
  };
@@ -89,16 +89,16 @@ namespace RTC
89
89
 
90
90
  public:
91
91
  /**
92
- * Whether given buffer could be a a valid Error Cause.
92
+ * Whether given buffer could be a a valid error cause.
93
93
  *
94
94
  * @param buffer
95
- * @param bufferLength - Can be greater than real Error Cause length.
96
- * @param causeCode - If given buffer is a valid Error Cause then
95
+ * @param bufferLength - Can be greater than real error cause length.
96
+ * @param causeCode - If given buffer is a valid error cause then
97
97
  * `causeCode` is rewritten to parsed ErrorCauseCode.
98
- * @param causeLength - If given buffer is a valid Error Cause then
99
- * `causeLength` is rewritten to the value of the Cause Length field.
100
- * @param padding - If given buffer is a valid Error Cause then `padding`
101
- * is rewritten to the number of padding bytes in the Error Cause (only
98
+ * @param causeLength - If given buffer is a valid error cause then
99
+ * `causeLength` is rewritten to the value of the Cause length field.
100
+ * @param padding - If given buffer is a valid error cause then `padding`
101
+ * is rewritten to the number of padding bytes in the error cause (only
102
102
  * the necessary ones to make total length multiple of 4).
103
103
  */
104
104
  static bool IsErrorCause(
@@ -111,7 +111,7 @@ namespace RTC
111
111
  static const std::string& ErrorCauseCodeToString(ErrorCauseCode causeCode);
112
112
 
113
113
  private:
114
- static const std::unordered_map<ErrorCauseCode, std::string> ErrorCauseCode2String;
114
+ static const ankerl::unordered_dense::map<ErrorCauseCode, std::string> ErrorCauseCode2String;
115
115
 
116
116
  protected:
117
117
  /**
@@ -27,7 +27,7 @@ namespace RTC
27
27
  * | Chunk #n |
28
28
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
29
29
  *
30
- * It's mandatory that the Packet total length is multiple of 4 bytes.
30
+ * It's mandatory that the packet total length is multiple of 4 bytes.
31
31
  */
32
32
 
33
33
  /**
@@ -73,28 +73,28 @@ namespace RTC
73
73
  static const size_t CommonHeaderLength{ 12 };
74
74
 
75
75
  /**
76
- * Whether given buffer could be a valid SCTP Packet.
76
+ * Whether given buffer could be a valid SCTP packet.
77
77
  *
78
78
  * @remarks
79
- * - `bufferLength` must be the exact length of the Packet.
79
+ * - `bufferLength` must be the exact length of the packet.
80
80
  * - This check is very lazy. It should NEVER be done before checking if
81
81
  * given buffer is an RTP or RTCP packet.
82
82
  */
83
83
  static bool IsSctp(const uint8_t* buffer, size_t bufferLength);
84
84
 
85
85
  /**
86
- * Parse an SCTP Packet.
86
+ * Parse an SCTP packet.
87
87
  *
88
88
  * @remarks
89
- * - `bufferLength` must be the exact length of the Packet.
89
+ * - `bufferLength` must be the exact length of the packet.
90
90
  */
91
91
  static Packet* Parse(const uint8_t* buffer, size_t bufferLength);
92
92
 
93
93
  /**
94
- * Create an SCTP Packet.
94
+ * Create an SCTP packet.
95
95
  *
96
96
  * @remarks
97
- * - `bufferLength` must be the exact length of the STUN Packet.
97
+ * - `bufferLength` must be the exact length of the STUN packet.
98
98
  * - If `transactionId` is not given then a random Transaction ID is
99
99
  * generated.
100
100
  */
@@ -102,8 +102,8 @@ namespace RTC
102
102
 
103
103
  private:
104
104
  /**
105
- * Constructor is private because we only want to create Packet instances
106
- * via Parse() and Factory().
105
+ * Constructor is private because we only want to create packet instances
106
+ * via `Parse()` and `Factory()`.
107
107
  */
108
108
  Packet(uint8_t* buffer, size_t bufferLength);
109
109
 
@@ -189,39 +189,39 @@ namespace RTC
189
189
  }
190
190
 
191
191
  /**
192
- * Clone given Chunk into Packet's buffer.
192
+ * Clone given chunk into packet's buffer.
193
193
  *
194
194
  * @remarks
195
195
  * - Once this method is called, the caller may want to free the original
196
- * given Chunk (otherwise it will leak since the Packet manages a clone
196
+ * given chunk (otherwise it will leak since the packet manages a clone
197
197
  * of it).
198
198
  *
199
199
  * @throw
200
200
  * - MediaSoupError - If `BuildChunkInPlace()` was called before and the
201
- * caller didn't invoke `Consolidate()` on the returned Chunk yet.
201
+ * caller didn't invoke `Consolidate()` on the returned chunk yet.
202
202
  */
203
203
  void AddChunk(const Chunk* chunk);
204
204
 
205
205
  /**
206
- * Build a Chunk within the Packet's buffer and append it to the list of
207
- * Chunks. The caller can perform modifications in that Chunk and those
208
- * will affect the Packet body where the Chunk is serialzed. The desired
209
- * Chunk class type is given via template argument.
206
+ * Build a chunk within the packet's buffer and append it to the list of
207
+ * chunks. The caller can perform modifications in that chunk and those
208
+ * will affect the packet body where the chunk is serialzed. The desired
209
+ * chunk class type is given via template argument.
210
210
  *
211
- * @returns Pointer of the created Chunk specific class.
211
+ * @returns Pointer of the created chunk specific class.
212
212
  *
213
213
  * @throw
214
214
  * - MediaSoupError - If `BuildChunkInPlace()` was called before and the
215
- * caller didn't invoke `Consolidate()` on the returned Chunk yet.
215
+ * caller didn't invoke `Consolidate()` on the returned chunk yet.
216
216
  *
217
217
  * @remarks
218
- * - The caller MUST invoke `Consolidate()` once the Chunk is completed.
219
- * - The caller MUST NOT call `BuildChunkInPlace()` while other Chunk is
218
+ * - The caller MUST invoke `Consolidate()` once the chunk is completed.
219
+ * - The caller MUST NOT call `BuildChunkInPlace()` while other chunk is
220
220
  * in progress.
221
- * - The caller MUST NOT free the obtained Chunk pointer since it's now
222
- * part of the Packet.
223
- * - The caller MUST free the obtained Chunk only in case the
224
- * `Consolidate()` method on the Chunk throws.
221
+ * - The caller MUST NOT free the obtained chunk pointer since it's now
222
+ * part of the packet.
223
+ * - The caller MUST free the obtained chunk only in case the
224
+ * `Consolidate()` method on the chunk throws.
225
225
  * - Method implemented in header file due to C++ template usage.
226
226
  *
227
227
  * @example
@@ -234,18 +234,18 @@ namespace RTC
234
234
  {
235
235
  AssertDoesNotNeedConsolidation();
236
236
 
237
- // The new Chunk will be added after other Chunks in the Packet, this is,
238
- // at the end of the Packet, whose length we know it's padded to 4
239
- // bytes, and each Parameter total length is also multiple of 4 bytes.
237
+ // The new chunk will be added after other chunks in the packet, this is,
238
+ // at the end of the packet, whose length we know it's padded to 4 bytes,
239
+ // and each parameter total length is also multiple of 4 bytes.
240
240
  auto* ptr = const_cast<uint8_t*>(GetBuffer()) + GetLength();
241
241
  // The remaining length in the buffer is the potential buffer length
242
- // of the Chunk.
242
+ // of the chunk.
243
243
  size_t chunkMaxBufferLength = GetBufferLength() - (ptr - GetBuffer());
244
244
 
245
245
  auto* chunk = T::Factory(ptr, chunkMaxBufferLength);
246
246
 
247
- // NOTE: Do not fix/update the Chunk buffer length since the caller
248
- // probably wants to modify the Chunk.
247
+ // NOTE: Do not fix/update the chunk buffer length since the caller
248
+ // probably wants to modify the chunk.
249
249
 
250
250
  HandleInPlaceChunk(chunk);
251
251
 
@@ -254,7 +254,7 @@ namespace RTC
254
254
 
255
255
  /**
256
256
  * Whether `BuildChunkInPlace()` was called and the caller didn't invoke
257
- * `Consolidate()` on the returned Chunk yet.
257
+ * `Consolidate()` on the returned chunk yet.
258
258
  */
259
259
  bool NeedsConsolidation() const
260
260
  {
@@ -262,7 +262,7 @@ namespace RTC
262
262
  }
263
263
 
264
264
  /**
265
- * Calculate CRC32C value of the whole Packet and insert it into the
265
+ * Calculate CRC32C value of the whole packet and insert it into the
266
266
  * Checksum field.
267
267
  */
268
268
  void WriteCRC32cChecksum();
@@ -295,7 +295,7 @@ namespace RTC
295
295
  // Chunks.
296
296
  std::vector<Chunk*> chunks;
297
297
  // Whether `BuildChunkInPlace()` was called and the caller didn't invoke
298
- // `Consolidate()` on the returned Chunk yet.
298
+ // `Consolidate()` on the returned chunk yet.
299
299
  bool needsConsolidation{ false };
300
300
  };
301
301
  } // namespace SCTP