mediasoup 3.19.18 → 3.19.19

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 (257) hide show
  1. package/package.json +7 -7
  2. package/worker/Makefile +9 -1
  3. package/worker/fuzzer/src/FuzzerUtils.cpp +26 -22
  4. package/worker/fuzzer/src/RTC/ICE/FuzzerStunPacket.cpp +3 -3
  5. package/worker/fuzzer/src/RTC/RTCP/FuzzerPacket.cpp +10 -6
  6. package/worker/fuzzer/src/RTC/SCTP/{FuzzerStateCookie.cpp → association/FuzzerStateCookie.cpp} +13 -13
  7. package/worker/fuzzer/src/fuzzer.cpp +4 -0
  8. package/worker/include/RTC/DataConsumer.hpp +7 -1
  9. package/worker/include/RTC/DirectTransport.hpp +1 -1
  10. package/worker/include/RTC/DtlsTransport.hpp +2 -1
  11. package/worker/include/RTC/ICE/IceCandidate.hpp +20 -8
  12. package/worker/include/RTC/ICE/StunPacket.hpp +6 -1
  13. package/worker/include/RTC/PipeTransport.hpp +1 -1
  14. package/worker/include/RTC/PlainTransport.hpp +1 -1
  15. package/worker/include/RTC/RTCP/Feedback.hpp +6 -1
  16. package/worker/include/RTC/RTCP/FeedbackPsFir.hpp +4 -0
  17. package/worker/include/RTC/RTCP/FeedbackPsLei.hpp +4 -0
  18. package/worker/include/RTC/RTCP/FeedbackPsRpsi.hpp +4 -0
  19. package/worker/include/RTC/RTCP/FeedbackPsSli.hpp +4 -0
  20. package/worker/include/RTC/RTCP/FeedbackPsTst.hpp +5 -0
  21. package/worker/include/RTC/RTCP/FeedbackPsVbcm.hpp +4 -0
  22. package/worker/include/RTC/RTCP/FeedbackRtpEcn.hpp +4 -0
  23. package/worker/include/RTC/RTCP/FeedbackRtpNack.hpp +4 -0
  24. package/worker/include/RTC/RTCP/FeedbackRtpTllei.hpp +4 -0
  25. package/worker/include/RTC/RTCP/FeedbackRtpTmmb.hpp +4 -0
  26. package/worker/include/RTC/RTCP/Packet.hpp +6 -1
  27. package/worker/include/RTC/RTCP/ReceiverReport.hpp +6 -1
  28. package/worker/include/RTC/RTCP/Sdes.hpp +8 -0
  29. package/worker/include/RTC/RTCP/SenderReport.hpp +6 -1
  30. package/worker/include/RTC/RTCP/XR.hpp +9 -4
  31. package/worker/include/RTC/RTCP/XrDelaySinceLastRr.hpp +4 -0
  32. package/worker/include/RTC/RTCP/XrReceiverReferenceTime.hpp +4 -0
  33. package/worker/include/RTC/RTP/Codecs/DependencyDescriptor.hpp +0 -2
  34. package/worker/include/RTC/RTP/Packet.hpp +31 -0
  35. package/worker/include/RTC/RateCalculator.hpp +0 -1
  36. package/worker/include/RTC/SCTP/TODO_SCTP.md +29 -8
  37. package/worker/include/RTC/SCTP/association/Association.hpp +491 -0
  38. package/worker/include/RTC/SCTP/association/AssociationDeferredListener.hpp +96 -0
  39. package/worker/include/RTC/SCTP/{NegotiatedCapabilities.hpp → association/NegotiatedCapabilities.hpp} +15 -11
  40. package/worker/include/RTC/SCTP/association/PacketSender.hpp +51 -0
  41. package/worker/include/RTC/SCTP/{StateCookie.hpp → association/StateCookie.hpp} +2 -2
  42. package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +178 -0
  43. package/worker/include/RTC/SCTP/packet/Chunk.hpp +74 -35
  44. package/worker/include/RTC/SCTP/packet/ErrorCause.hpp +4 -1
  45. package/worker/include/RTC/SCTP/packet/Packet.hpp +53 -6
  46. package/worker/include/RTC/SCTP/packet/Parameter.hpp +4 -1
  47. package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
  48. package/worker/include/RTC/SCTP/packet/UserData.hpp +140 -0
  49. package/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp +5 -0
  50. package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +85 -0
  51. package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +80 -0
  52. package/worker/include/RTC/SCTP/packet/chunks/AnyInitChunk.hpp +37 -0
  53. package/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp +10 -0
  54. package/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp +10 -0
  55. package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +65 -18
  56. package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +25 -12
  57. package/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp +5 -0
  58. package/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp +5 -0
  59. package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +58 -19
  60. package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +29 -16
  61. package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +13 -8
  62. package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +12 -7
  63. package/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp +5 -0
  64. package/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp +8 -3
  65. package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +67 -23
  66. package/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp +10 -0
  67. package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +10 -0
  68. package/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp +10 -0
  69. package/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp +10 -0
  70. package/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp +0 -1
  71. package/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp +10 -7
  72. package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +1 -1
  73. package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +172 -0
  74. package/worker/include/RTC/SCTP/{SocketListener.hpp → public/AssociationListener.hpp} +75 -73
  75. package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +136 -0
  76. package/worker/include/RTC/SCTP/{Message.hpp → public/Message.hpp} +11 -3
  77. package/worker/include/RTC/SCTP/{SocketOptions.hpp → public/SctpOptions.hpp} +21 -21
  78. package/worker/include/RTC/SCTP/public/SctpTypes.hpp +338 -0
  79. package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +63 -0
  80. package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +66 -0
  81. package/worker/include/RTC/Serializable.hpp +1 -1
  82. package/worker/include/RTC/SrtpSession.hpp +0 -1
  83. package/worker/include/RTC/Transport.hpp +36 -1
  84. package/worker/include/RTC/TransportTuple.hpp +7 -3
  85. package/worker/include/RTC/WebRtcServer.hpp +3 -1
  86. package/worker/include/RTC/WebRtcTransport.hpp +1 -1
  87. package/worker/include/Utils.hpp +0 -1
  88. package/worker/include/common.hpp +10 -10
  89. package/worker/include/handles/BackoffTimerHandle.hpp +21 -24
  90. package/worker/include/handles/TimerHandle.hpp +1 -0
  91. package/worker/meson.build +67 -46
  92. package/worker/meson_options.txt +1 -0
  93. package/worker/scripts/get-dep.sh +1 -25
  94. package/worker/src/Channel/ChannelSocket.cpp +5 -2
  95. package/worker/src/DepLibUring.cpp +3 -3
  96. package/worker/src/RTC/ActiveSpeakerObserver.cpp +10 -4
  97. package/worker/src/RTC/Consumer.cpp +6 -2
  98. package/worker/src/RTC/DataConsumer.cpp +27 -7
  99. package/worker/src/RTC/DirectTransport.cpp +3 -1
  100. package/worker/src/RTC/DtlsTransport.cpp +10 -8
  101. package/worker/src/RTC/ICE/StunPacket.cpp +8 -8
  102. package/worker/src/RTC/NackGenerator.cpp +3 -1
  103. package/worker/src/RTC/PipeTransport.cpp +16 -2
  104. package/worker/src/RTC/PlainTransport.cpp +13 -39
  105. package/worker/src/RTC/RTCP/FeedbackRtpNack.cpp +1 -0
  106. package/worker/src/RTC/RTCP/Packet.cpp +1 -1
  107. package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +3 -1
  108. package/worker/src/RTC/RTP/Packet.cpp +2 -4
  109. package/worker/src/RTC/RTP/ProbationGenerator.cpp +2 -1
  110. package/worker/src/RTC/RTP/RtpStreamRecv.cpp +2 -1
  111. package/worker/src/RTC/RTP/RtpStreamSend.cpp +2 -1
  112. package/worker/src/RTC/RTP/SharedPacket.cpp +8 -3
  113. package/worker/src/RTC/RateCalculator.cpp +3 -1
  114. package/worker/src/RTC/SCTP/association/Association.cpp +2758 -0
  115. package/worker/src/RTC/SCTP/association/AssociationDeferredListener.cpp +266 -0
  116. package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +88 -0
  117. package/worker/src/RTC/SCTP/association/PacketSender.cpp +46 -0
  118. package/worker/src/RTC/SCTP/{StateCookie.cpp → association/StateCookie.cpp} +10 -10
  119. package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +245 -0
  120. package/worker/src/RTC/SCTP/packet/Chunk.cpp +61 -22
  121. package/worker/src/RTC/SCTP/packet/Packet.cpp +41 -11
  122. package/worker/src/RTC/SCTP/packet/TLV.cpp +1 -1
  123. package/worker/src/RTC/SCTP/packet/UserData.cpp +56 -0
  124. package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +15 -15
  125. package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +25 -7
  126. package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +17 -18
  127. package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +26 -8
  128. package/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp +3 -1
  129. package/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp +2 -1
  130. package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +121 -10
  131. package/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp +1 -0
  132. package/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp +1 -0
  133. package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +1 -0
  134. package/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp +1 -0
  135. package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +19 -13
  136. package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +2 -2
  137. package/worker/src/RTC/SCTP/public/AssociationMetrics.cpp +45 -0
  138. package/worker/src/RTC/SCTP/{Message.cpp → public/Message.cpp} +2 -3
  139. package/worker/src/RTC/SCTP/tx/RetransmissionErrorCounter.cpp +82 -0
  140. package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +97 -0
  141. package/worker/src/RTC/SctpAssociation.cpp +6 -2
  142. package/worker/src/RTC/SenderBandwidthEstimator.cpp +5 -2
  143. package/worker/src/RTC/Serializable.cpp +1 -1
  144. package/worker/src/RTC/SrtpSession.cpp +2 -2
  145. package/worker/src/RTC/TcpConnection.cpp +5 -1
  146. package/worker/src/RTC/TcpServer.cpp +5 -2
  147. package/worker/src/RTC/Transport.cpp +347 -34
  148. package/worker/src/RTC/TransportCongestionControlClient.cpp +4 -2
  149. package/worker/src/RTC/UdpSocket.cpp +2 -1
  150. package/worker/src/RTC/WebRtcTransport.cpp +9 -44
  151. package/worker/src/Worker.cpp +6 -0
  152. package/worker/src/handles/BackoffTimerHandle.cpp +21 -27
  153. package/worker/src/handles/TimerHandle.cpp +33 -0
  154. package/worker/src/handles/UdpSocketHandle.cpp +5 -1
  155. package/worker/src/lib.cpp +6 -0
  156. package/worker/subprojects/catch2.wrap +6 -6
  157. package/worker/subprojects/liburing.wrap +10 -9
  158. package/worker/tasks.py +53 -9
  159. package/worker/test/include/RTC/SCTP/sctpCommon.hpp +1 -0
  160. package/worker/test/src/RTC/ICE/TestStunPacket.cpp +4 -4
  161. package/worker/test/src/RTC/ICE/iceCommon.cpp +8 -6
  162. package/worker/test/src/RTC/RTCP/TestBye.cpp +3 -3
  163. package/worker/test/src/RTC/RTCP/TestFeedbackPsAfb.cpp +2 -2
  164. package/worker/test/src/RTC/RTCP/TestFeedbackPsFir.cpp +7 -2
  165. package/worker/test/src/RTC/RTCP/TestFeedbackPsLei.cpp +7 -2
  166. package/worker/test/src/RTC/RTCP/TestFeedbackPsPli.cpp +2 -2
  167. package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +2 -2
  168. package/worker/test/src/RTC/RTCP/TestFeedbackPsRpsi.cpp +7 -2
  169. package/worker/test/src/RTC/RTCP/TestFeedbackPsSli.cpp +2 -2
  170. package/worker/test/src/RTC/RTCP/TestFeedbackPsTst.cpp +8 -2
  171. package/worker/test/src/RTC/RTCP/TestFeedbackPsVbcm.cpp +7 -2
  172. package/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +7 -2
  173. package/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +7 -2
  174. package/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +2 -2
  175. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +7 -2
  176. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +8 -2
  177. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp +17 -17
  178. package/worker/test/src/RTC/RTCP/TestPacket.cpp +10 -1
  179. package/worker/test/src/RTC/RTCP/TestReceiverReport.cpp +8 -3
  180. package/worker/test/src/RTC/RTCP/TestSdes.cpp +15 -10
  181. package/worker/test/src/RTC/RTCP/TestSenderReport.cpp +9 -4
  182. package/worker/test/src/RTC/RTCP/TestXr.cpp +17 -10
  183. package/worker/test/src/RTC/RTP/TestPacket.cpp +26 -34
  184. package/worker/test/src/RTC/RTP/rtpCommon.cpp +9 -5
  185. package/worker/test/src/RTC/SCTP/{TestNegotiatedCapabilities.cpp → association/TestNegotiatedCapabilities.cpp} +18 -18
  186. package/worker/test/src/RTC/SCTP/{TestStateCookie.cpp → association/TestStateCookie.cpp} +15 -15
  187. package/worker/test/src/RTC/SCTP/packet/TestChunk.cpp +117 -0
  188. package/worker/test/src/RTC/SCTP/packet/TestErrorCause.cpp +11 -0
  189. package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +81 -28
  190. package/worker/test/src/RTC/SCTP/packet/TestParameter.cpp +11 -0
  191. package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +1 -1
  192. package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
  193. package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
  194. package/worker/test/src/RTC/SCTP/packet/chunks/TestDataChunk.cpp +130 -63
  195. package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +32 -32
  196. package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +1 -1
  197. package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +2 -2
  198. package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +131 -63
  199. package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +33 -53
  200. package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
  201. package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
  202. package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +1 -1
  203. package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +1 -1
  204. package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +41 -58
  205. package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
  206. package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownChunk.cpp +1 -1
  207. package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
  208. package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +1 -1
  209. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
  210. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
  211. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +5 -5
  212. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +4 -4
  213. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +5 -5
  214. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +4 -4
  215. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +3 -3
  216. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +3 -3
  217. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +5 -5
  218. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +3 -3
  219. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +3 -3
  220. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
  221. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +3 -3
  222. package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +19 -64
  223. package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
  224. package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
  225. package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +5 -5
  226. package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
  227. package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +4 -4
  228. package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +5 -5
  229. package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +5 -5
  230. package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +1 -1
  231. package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +1 -1
  232. package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +4 -4
  233. package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
  234. package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +4 -4
  235. package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +2 -2
  236. package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +1 -1
  237. package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +3 -3
  238. package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
  239. package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
  240. package/worker/test/src/RTC/SCTP/sctpCommon.cpp +8 -5
  241. package/worker/test/src/RTC/SCTP/tx/TestRetransmissionErrorCounter.cpp +74 -0
  242. package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +233 -0
  243. package/worker/test/src/RTC/TestNackGenerator.cpp +7 -3
  244. package/worker/test/src/RTC/TestSimpleConsumer.cpp +3 -2
  245. package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +1 -1
  246. package/worker/test/src/Utils/TestByte.cpp +25 -29
  247. package/worker/test/src/tests.cpp +6 -0
  248. package/worker/include/RTC/SCTP/Socket.hpp +0 -194
  249. package/worker/include/RTC/SCTP/SocketDeferredListener.hpp +0 -100
  250. package/worker/include/RTC/SCTP/SocketMetrics.hpp +0 -78
  251. package/worker/include/RTC/SCTP/TransmissionControlBlock.hpp +0 -108
  252. package/worker/include/RTC/SCTP/Types.hpp +0 -149
  253. package/worker/src/RTC/SCTP/NegotiatedCapabilities.cpp +0 -96
  254. package/worker/src/RTC/SCTP/Socket.cpp +0 -1045
  255. package/worker/src/RTC/SCTP/SocketDeferredListener.cpp +0 -247
  256. package/worker/src/RTC/SCTP/SocketMetrics.cpp +0 -39
  257. package/worker/src/RTC/SCTP/TransmissionControlBlock.cpp +0 -52
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasoup",
3
- "version": "3.19.18",
3
+ "version": "3.19.19",
4
4
  "description": "Cutting Edge WebRTC Video Conferencing",
5
5
  "contributors": [
6
6
  "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
@@ -102,30 +102,30 @@
102
102
  "h264-profile-level-id": "^2.3.2",
103
103
  "node-fetch": "^3.3.2",
104
104
  "supports-color": "^10.2.2",
105
- "tar": "^7.5.11"
105
+ "tar": "^7.5.13"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@eslint/js": "^10.0.1",
109
109
  "@octokit/rest": "^22.0.1",
110
- "@types/debug": "^4.1.12",
110
+ "@types/debug": "^4.1.13",
111
111
  "@types/ini": "^4.1.1",
112
112
  "@types/jest": "^30.0.0",
113
113
  "@types/node": "^24.10.1",
114
- "eslint": "^10.0.3",
114
+ "eslint": "^10.1.0",
115
115
  "eslint-config-prettier": "^10.1.8",
116
116
  "eslint-plugin-jest": "^29.15.0",
117
117
  "eslint-plugin-prettier": "^5.5.5",
118
118
  "globals": "^17.4.0",
119
119
  "ini": "^6.0.0",
120
120
  "jest": "^30.3.0",
121
- "knip": "^5.86.0",
122
- "marked": "^17.0.4",
121
+ "knip": "^6.0.4",
122
+ "marked": "^17.0.5",
123
123
  "open-cli": "^8.0.0",
124
124
  "pick-port": "^2.2.0",
125
125
  "prettier": "^3.8.1",
126
126
  "ts-jest": "^29.4.6",
127
127
  "typescript": "^5.9.3",
128
- "typescript-eslint": "^8.57.0",
128
+ "typescript-eslint": "^8.57.2",
129
129
  "werift-sctp": "^0.0.11"
130
130
  }
131
131
  }
package/worker/Makefile CHANGED
@@ -42,7 +42,9 @@ endif
42
42
  docker \
43
43
  docker-run \
44
44
  docker-alpine \
45
- docker-alpine-run
45
+ docker-alpine-run \
46
+ docker-386 \
47
+ docker-386-run
46
48
 
47
49
  default: mediasoup-worker
48
50
 
@@ -131,3 +133,9 @@ docker-alpine: invoke
131
133
 
132
134
  docker-alpine-run: invoke
133
135
  "$(PYTHON)" -m invoke docker-alpine-run
136
+
137
+ docker-386: invoke
138
+ "$(PYTHON)" -m invoke docker-386
139
+
140
+ docker-386-run: invoke
141
+ "$(PYTHON)" -m invoke docker-386-run
@@ -1,33 +1,37 @@
1
1
  #include "FuzzerUtils.hpp"
2
2
  #include "MediaSoupErrors.hpp"
3
3
  #include "Utils.hpp"
4
- #include <cstring> // std::memory()
4
+ #include <cstring> // std::memcpy()
5
5
  #include <string>
6
6
 
7
- void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
7
+ namespace
8
8
  {
9
- // For some fuzzers below.
10
- const std::unique_ptr<uint8_t[]> data2(new uint8_t[len + (INET6_ADDRSTRLEN * 3)]);
9
+ alignas(4) thread_local uint8_t DataBuffer[65536];
10
+ }
11
11
 
12
- std::memcpy(data2.get(), data, len);
12
+ void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
13
+ {
14
+ // NOTE: We need to copy given data into another buffer because we are gonna
15
+ // write into it.
16
+ std::memcpy(DataBuffer, data, len);
13
17
 
14
18
  /* IP class. */
15
19
 
16
20
  std::string ip;
17
21
 
18
- ip = std::string(reinterpret_cast<const char*>(data2.get()), INET6_ADDRSTRLEN / 2);
22
+ ip = std::string(reinterpret_cast<const char*>(DataBuffer), INET6_ADDRSTRLEN / 2);
19
23
  Utils::IP::GetFamily(ip);
20
24
 
21
- ip = std::string(reinterpret_cast<const char*>(data2.get()), INET6_ADDRSTRLEN);
25
+ ip = std::string(reinterpret_cast<const char*>(DataBuffer), INET6_ADDRSTRLEN);
22
26
  Utils::IP::GetFamily(ip);
23
27
 
24
- ip = std::string(reinterpret_cast<const char*>(data2.get()), INET6_ADDRSTRLEN * 2);
28
+ ip = std::string(reinterpret_cast<const char*>(DataBuffer), INET6_ADDRSTRLEN * 2);
25
29
  Utils::IP::GetFamily(ip);
26
30
 
27
31
  // Protect with try/catch since throws are legit.
28
32
  try
29
33
  {
30
- auto ip = std::string(reinterpret_cast<const char*>(data2.get()), len);
34
+ auto ip = std::string(reinterpret_cast<const char*>(DataBuffer), len);
31
35
 
32
36
  Utils::IP::NormalizeIp(ip);
33
37
  }
@@ -37,16 +41,16 @@ void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
37
41
 
38
42
  /* Byte class. */
39
43
 
40
- Utils::Byte::Get1Byte(data2.get(), len);
41
- Utils::Byte::Get2Bytes(data2.get(), len);
42
- Utils::Byte::Get3Bytes(data2.get(), len);
43
- Utils::Byte::Get4Bytes(data2.get(), len);
44
- Utils::Byte::Get8Bytes(data2.get(), len);
45
- Utils::Byte::Set1Byte(data2.get(), len, uint8_t{ 6u });
46
- Utils::Byte::Set2Bytes(data2.get(), len, uint16_t{ 66u });
47
- Utils::Byte::Set3Bytes(data2.get(), len, uint32_t{ 666u });
48
- Utils::Byte::Set4Bytes(data2.get(), len, uint32_t{ 666u });
49
- Utils::Byte::Set8Bytes(data2.get(), len, uint64_t{ 6666u });
44
+ Utils::Byte::Get1Byte(DataBuffer, len);
45
+ Utils::Byte::Get2Bytes(DataBuffer, len);
46
+ Utils::Byte::Get3Bytes(DataBuffer, len);
47
+ Utils::Byte::Get4Bytes(DataBuffer, len);
48
+ Utils::Byte::Get8Bytes(DataBuffer, len);
49
+ Utils::Byte::Set1Byte(DataBuffer, len, uint8_t{ 6u });
50
+ Utils::Byte::Set2Bytes(DataBuffer, len, uint16_t{ 66u });
51
+ Utils::Byte::Set3Bytes(DataBuffer, len, uint32_t{ 666u });
52
+ Utils::Byte::Set4Bytes(DataBuffer, len, uint32_t{ 666u });
53
+ Utils::Byte::Set8Bytes(DataBuffer, len, uint64_t{ 6666u });
50
54
  Utils::Byte::PadTo4Bytes(static_cast<uint8_t>(len));
51
55
  Utils::Byte::PadTo4Bytes(static_cast<uint16_t>(len));
52
56
  Utils::Byte::PadTo4Bytes(static_cast<uint32_t>(len));
@@ -70,7 +74,7 @@ void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
70
74
  static_cast<uint64_t>(len), static_cast<uint64_t>(len + 1000000));
71
75
  Utils::Crypto::GetRandomUInt<size_t>(len, len + 1000000);
72
76
  Utils::Crypto::GetRandomString(len);
73
- Utils::Crypto::GetCRC32(data2.get(), len);
77
+ Utils::Crypto::GetCRC32(DataBuffer, len);
74
78
 
75
79
  /* String class. */
76
80
 
@@ -79,8 +83,8 @@ void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
79
83
  {
80
84
  size_t outLen;
81
85
 
82
- Utils::String::Base64Encode(data2.get(), len);
83
- Utils::String::Base64Decode(data2.get(), len, outLen);
86
+ Utils::String::Base64Encode(DataBuffer, len);
87
+ Utils::String::Base64Decode(DataBuffer, len, outLen);
84
88
  }
85
89
  catch (const MediaSoupError& error) // NOLINT(bugprone-empty-catch)
86
90
  {
@@ -3,11 +3,11 @@
3
3
  #include <string_view>
4
4
 
5
5
  static constexpr size_t ResponseFactoryBufferLength{ 65536 };
6
- thread_local uint8_t ResponseFactoryBuffer[ResponseFactoryBufferLength];
6
+ alignas(4) thread_local uint8_t ResponseFactoryBuffer[ResponseFactoryBufferLength];
7
7
  static constexpr size_t SerializeBufferLength{ 65536 };
8
- thread_local uint8_t SerializeBuffer[SerializeBufferLength];
8
+ alignas(4) thread_local uint8_t SerializeBuffer[SerializeBufferLength];
9
9
  static constexpr size_t CloneBufferLength{ 65536 };
10
- thread_local uint8_t CloneBuffer[CloneBufferLength];
10
+ alignas(4) thread_local uint8_t CloneBuffer[CloneBufferLength];
11
11
 
12
12
  void FuzzerRtcIceStunPacket::Fuzz(const uint8_t* data, size_t len)
13
13
  {
@@ -7,6 +7,12 @@
7
7
  #include "RTC/RTCP/FuzzerSenderReport.hpp"
8
8
  #include "RTC/RTCP/FuzzerXr.hpp"
9
9
  #include "RTC/RTCP/Packet.hpp"
10
+ #include <cstring> // std::memcpy()
11
+
12
+ namespace
13
+ {
14
+ alignas(4) thread_local uint8_t DataBuffer[65536];
15
+ } // namespace
10
16
 
11
17
  void FuzzerRtcRtcpPacket::Fuzz(const uint8_t* data, size_t len)
12
18
  {
@@ -15,13 +21,11 @@ void FuzzerRtcRtcpPacket::Fuzz(const uint8_t* data, size_t len)
15
21
  return;
16
22
  }
17
23
 
18
- // We need to clone the given data into a separate buffer because setters
19
- // below will try to write into packet memory.
20
- const std::unique_ptr<uint8_t[]> data2(new uint8_t[len]);
21
-
22
- std::memcpy(data2.get(), data, len);
24
+ // NOTE: We need to copy given data into another buffer because we are gonna
25
+ // write into it.
26
+ std::memcpy(DataBuffer, data, len);
23
27
 
24
- RTC::RTCP::Packet* packet = RTC::RTCP::Packet::Parse(data2.get(), len);
28
+ RTC::RTCP::Packet* packet = RTC::RTCP::Packet::Parse(DataBuffer, len);
25
29
 
26
30
  if (!packet)
27
31
  {
@@ -1,17 +1,20 @@
1
1
  #include "RTC/SCTP/FuzzerStateCookie.hpp"
2
2
  #include "Utils.hpp"
3
- #include "RTC/SCTP/StateCookie.hpp"
4
- #include <cstdlib> // std::malloc(), std::free()
3
+ #include "RTC/SCTP/association/StateCookie.hpp"
5
4
  #include <cstring> // std::memcpy()
6
5
 
7
- thread_local uint8_t StateCookieSerializeBuffer[65536];
8
- thread_local uint8_t StateCookieCloneBuffer[65536];
6
+ namespace
7
+ {
8
+ alignas(4) thread_local uint8_t DataBuffer[65536];
9
+ alignas(4) thread_local uint8_t StateCookieSerializeBuffer[65536];
10
+ alignas(4) thread_local uint8_t StateCookieCloneBuffer[65536];
11
+ } // namespace
9
12
 
10
13
  void FuzzerRtcSctpStateCookie::Fuzz(const uint8_t* data, size_t len)
11
14
  {
12
- auto* clonedData = static_cast<uint8_t*>(std::malloc(len));
13
-
14
- std::memcpy(clonedData, data, len);
15
+ // NOTE: We need to copy given data into another buffer because we are gonna
16
+ // write into it.
17
+ std::memcpy(DataBuffer, data, len);
15
18
 
16
19
  // We need to force `data` to be a StateCookie since it's too hard that
17
20
  // random data matches it.
@@ -22,20 +25,18 @@ void FuzzerRtcSctpStateCookie::Fuzz(const uint8_t* data, size_t len)
22
25
 
23
26
  if (len < RTC::SCTP::StateCookie::StateCookieLength + 5)
24
27
  {
25
- Utils::Byte::Set8Bytes(clonedData, 0, RTC::SCTP::StateCookie::Magic1);
28
+ Utils::Byte::Set8Bytes(DataBuffer, 0, RTC::SCTP::StateCookie::Magic1);
26
29
  Utils::Byte::Set2Bytes(
27
- clonedData,
30
+ DataBuffer,
28
31
  RTC::SCTP::StateCookie::NegotiatedCapabilitiesOffset,
29
32
  RTC::SCTP::StateCookie::Magic2);
30
33
  }
31
34
  }
32
35
 
33
- RTC::SCTP::StateCookie* stateCookie = RTC::SCTP::StateCookie::Parse(clonedData, len);
36
+ RTC::SCTP::StateCookie* stateCookie = RTC::SCTP::StateCookie::Parse(DataBuffer, len);
34
37
 
35
38
  if (!stateCookie)
36
39
  {
37
- std::free(clonedData);
38
-
39
40
  return;
40
41
  }
41
42
 
@@ -71,6 +72,5 @@ void FuzzerRtcSctpStateCookie::Fuzz(const uint8_t* data, size_t len)
71
72
 
72
73
  clonedStateCookie->Serialize(StateCookieSerializeBuffer, len);
73
74
 
74
- std::free(clonedData);
75
75
  delete clonedStateCookie;
76
76
  }
@@ -5,7 +5,9 @@
5
5
  #include "DepLibUV.hpp"
6
6
  #include "DepLibWebRTC.hpp"
7
7
  #include "DepOpenSSL.hpp"
8
+ #ifndef MS_SCTP_STACK
8
9
  #include "DepUsrSCTP.hpp"
10
+ #endif
9
11
  #include "FuzzerUtils.hpp"
10
12
  #include "Settings.hpp"
11
13
  #include "Utils.hpp"
@@ -145,7 +147,9 @@ namespace
145
147
  DepLibUV::ClassInit();
146
148
  DepOpenSSL::ClassInit();
147
149
  DepLibSRTP::ClassInit();
150
+ #ifndef MS_SCTP_STACK
148
151
  DepUsrSCTP::ClassInit();
152
+ #endif
149
153
  DepLibWebRTC::ClassInit();
150
154
  Utils::Crypto::ClassInit();
151
155
  RTC::DtlsTransport::ClassInit();
@@ -11,9 +11,11 @@
11
11
 
12
12
  namespace RTC
13
13
  {
14
+ #ifndef MS_SCTP_STACK
14
15
  // Define class here such that we can use it even though we don't know what it looks like yet
15
16
  // (this is to avoid circular dependencies).
16
17
  class SctpAssociation;
18
+ #endif
17
19
 
18
20
  class DataConsumer : public Channel::ChannelSocket::RequestHandler
19
21
  {
@@ -48,7 +50,9 @@ namespace RTC
48
50
  RTC::Shared* shared,
49
51
  const std::string& id,
50
52
  const std::string& dataProducerId,
53
+ #ifndef MS_SCTP_STACK
51
54
  RTC::SctpAssociation* sctpAssociation,
55
+ #endif
52
56
  RTC::DataConsumer::Listener* listener,
53
57
  const FBS::Transport::ConsumeDataRequest* data,
54
58
  size_t maxMessageSize);
@@ -98,7 +102,7 @@ namespace RTC
98
102
  void SctpAssociationBufferedAmount(uint32_t bufferedAmount);
99
103
  void SctpAssociationSendBufferFull();
100
104
  void DataProducerClosed();
101
- void SendMessage(
105
+ bool SendMessage(
102
106
  const uint8_t* msg,
103
107
  size_t len,
104
108
  uint32_t ppid,
@@ -118,7 +122,9 @@ namespace RTC
118
122
  private:
119
123
  // Passed by argument.
120
124
  RTC::Shared* shared{ nullptr };
125
+ #ifndef MS_SCTP_STACK
121
126
  RTC::SctpAssociation* sctpAssociation{ nullptr };
127
+ #endif
122
128
  RTC::DataConsumer::Listener* listener{ nullptr };
123
129
  size_t maxMessageSize{ 0u };
124
130
  // Others.
@@ -36,7 +36,7 @@ namespace RTC
36
36
  size_t len,
37
37
  uint32_t ppid,
38
38
  onQueuedCallback* cb = nullptr) override;
39
- void SendSctpData(const uint8_t* data, size_t len) override;
39
+ bool SendSctpData(const uint8_t* data, size_t len) override;
40
40
  void RecvStreamClosed(uint32_t ssrc) override;
41
41
  void SendStreamClosed(uint32_t ssrc) override;
42
42
 
@@ -151,7 +151,8 @@ namespace RTC
151
151
  {
152
152
  return this->localRole;
153
153
  }
154
- void SendApplicationData(const uint8_t* data, size_t len);
154
+ // Returns a boolean indicating whether the data could be sent.
155
+ bool SendApplicationData(const uint8_t* data, size_t len);
155
156
  // This method must be public since it's called within an OpenSSL callback.
156
157
  void SendDtlsData(const uint8_t* data, size_t len);
157
158
 
@@ -37,27 +37,39 @@ namespace RTC
37
37
 
38
38
  public:
39
39
  IceCandidate(RTC::UdpSocket* udpSocket, uint32_t priority)
40
- : foundation("udpcandidate"), priority(priority), address(udpSocket->GetLocalIp()),
41
- protocol(Protocol::UDP), port(udpSocket->GetLocalPort())
40
+ : foundation("udpcandidate"),
41
+ priority(priority),
42
+ address(udpSocket->GetLocalIp()),
43
+ protocol(Protocol::UDP),
44
+ port(udpSocket->GetLocalPort())
42
45
  {
43
46
  }
44
47
 
45
48
  IceCandidate(RTC::UdpSocket* udpSocket, uint32_t priority, std::string& announcedAddress)
46
- : foundation("udpcandidate"), priority(priority), address(announcedAddress),
47
- protocol(Protocol::UDP), port(udpSocket->GetLocalPort())
49
+ : foundation("udpcandidate"),
50
+ priority(priority),
51
+ address(announcedAddress),
52
+ protocol(Protocol::UDP),
53
+ port(udpSocket->GetLocalPort())
48
54
  {
49
55
  }
50
56
 
51
57
  IceCandidate(RTC::TcpServer* tcpServer, uint32_t priority)
52
- : foundation("tcpcandidate"), priority(priority), address(tcpServer->GetLocalIp()),
53
- protocol(Protocol::TCP), port(tcpServer->GetLocalPort())
58
+ : foundation("tcpcandidate"),
59
+ priority(priority),
60
+ address(tcpServer->GetLocalIp()),
61
+ protocol(Protocol::TCP),
62
+ port(tcpServer->GetLocalPort())
54
63
 
55
64
  {
56
65
  }
57
66
 
58
67
  IceCandidate(RTC::TcpServer* tcpServer, uint32_t priority, std::string& announcedAddress)
59
- : foundation("tcpcandidate"), priority(priority), address(announcedAddress),
60
- protocol(Protocol::TCP), port(tcpServer->GetLocalPort())
68
+ : foundation("tcpcandidate"),
69
+ priority(priority),
70
+ address(announcedAddress),
71
+ protocol(Protocol::TCP),
72
+ port(tcpServer->GetLocalPort())
61
73
 
62
74
  {
63
75
  }
@@ -4,7 +4,6 @@
4
4
  #include "common.hpp"
5
5
  #include "Utils.hpp"
6
6
  #include "RTC/Serializable.hpp"
7
- #include <cstdint>
8
7
  #include <string_view>
9
8
  #include <unordered_map>
10
9
 
@@ -126,6 +125,12 @@ namespace RTC
126
125
  };
127
126
 
128
127
  private:
128
+ /**
129
+ * @remarks
130
+ * - This struct is NOT guaranteed to be aligned to any fixed number of
131
+ * bytes because it contains a `size_t`, which is 4 or 8 bytes depending
132
+ * on the architecture. Anyway we never cast any buffer to this struct.
133
+ */
129
134
  struct Attribute
130
135
  {
131
136
  Attribute(AttributeType type, uint16_t len, size_t offset)
@@ -54,7 +54,7 @@ namespace RTC
54
54
  size_t len,
55
55
  uint32_t ppid,
56
56
  onQueuedCallback* cb = nullptr) override;
57
- void SendSctpData(const uint8_t* data, size_t len) override;
57
+ bool SendSctpData(const uint8_t* data, size_t len) override;
58
58
  void RecvStreamClosed(uint32_t ssrc) override;
59
59
  void SendStreamClosed(uint32_t ssrc) override;
60
60
  void OnPacketReceived(RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen);
@@ -48,7 +48,7 @@ namespace RTC
48
48
  size_t len,
49
49
  uint32_t ppid,
50
50
  onQueuedCallback* cb = nullptr) override;
51
- void SendSctpData(const uint8_t* data, size_t len) override;
51
+ bool SendSctpData(const uint8_t* data, size_t len) override;
52
52
  void RecvStreamClosed(uint32_t ssrc) override;
53
53
  void SendStreamClosed(uint32_t ssrc) override;
54
54
  void OnPacketReceived(RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen);
@@ -13,7 +13,12 @@ namespace RTC
13
13
  class FeedbackPacket : public Packet
14
14
  {
15
15
  public:
16
- /* Struct for RTP Feedback message. */
16
+ /**
17
+ * Struct for RTP Feedback message.
18
+ *
19
+ * @remarks
20
+ * - This struct is guaranteed to be aligned to 4 bytes.
21
+ */
17
22
  struct Header
18
23
  {
19
24
  uint32_t senderSsrc;
@@ -23,6 +23,10 @@ namespace RTC
23
23
  class FeedbackPsFirItem : public FeedbackItem
24
24
  {
25
25
  public:
26
+ /**
27
+ * @remarks
28
+ * - This struct is guaranteed to be aligned to 4 bytes.
29
+ */
26
30
  struct Header
27
31
  {
28
32
  uint32_t ssrc;
@@ -20,6 +20,10 @@ namespace RTC
20
20
  class FeedbackPsLeiItem : public FeedbackItem
21
21
  {
22
22
  public:
23
+ /**
24
+ * @remarks
25
+ * - This struct is guaranteed to be aligned to 4 bytes.
26
+ */
23
27
  struct Header
24
28
  {
25
29
  uint32_t ssrc;
@@ -25,6 +25,10 @@ namespace RTC
25
25
  static const size_t MaxBitStringSize{ 6 };
26
26
 
27
27
  public:
28
+ /**
29
+ * @remarks
30
+ * - This struct is guaranteed to be aligned to 1 byte.
31
+ */
28
32
  struct Header
29
33
  {
30
34
  uint8_t paddingBits;
@@ -20,6 +20,10 @@ namespace RTC
20
20
  class FeedbackPsSliItem : public FeedbackItem
21
21
  {
22
22
  public:
23
+ /**
24
+ * @remarks
25
+ * - This struct is guaranteed to be aligned to 4 bytes.
26
+ */
23
27
  struct Header
24
28
  {
25
29
  uint32_t compact;
@@ -30,6 +30,11 @@ namespace RTC
30
30
  #else
31
31
  #define MEDIASOUP_PACKED __attribute__((packed))
32
32
  #endif
33
+ /**
34
+ * @remarks
35
+ * - This struct is guaranteed to be aligned to 1 byte due to the usage
36
+ * of `pack()` and `packed` macros.
37
+ */
33
38
  struct Header
34
39
  {
35
40
  uint32_t ssrc;
@@ -26,6 +26,10 @@ namespace RTC
26
26
  class FeedbackPsVbcmItem : public FeedbackItem
27
27
  {
28
28
  public:
29
+ /**
30
+ * @remarks
31
+ * - This struct is guaranteed to be aligned to 4 bytes.
32
+ */
29
33
  struct Header
30
34
  {
31
35
  uint32_t ssrc;
@@ -30,6 +30,10 @@ namespace RTC
30
30
  class FeedbackRtpEcnItem : public FeedbackItem
31
31
  {
32
32
  public:
33
+ /**
34
+ * @remarks
35
+ * - This struct is guaranteed to be aligned to 4 bytes.
36
+ */
33
37
  struct Header
34
38
  {
35
39
  uint32_t sequenceNumber;
@@ -21,6 +21,10 @@ namespace RTC
21
21
  class FeedbackRtpNackItem : public FeedbackItem
22
22
  {
23
23
  public:
24
+ /**
25
+ * @remarks
26
+ * - This struct is guaranteed to be aligned to 2 bytes.
27
+ */
24
28
  struct Header
25
29
  {
26
30
  uint16_t packetId;
@@ -20,6 +20,10 @@ namespace RTC
20
20
  class FeedbackRtpTlleiItem : public FeedbackItem
21
21
  {
22
22
  public:
23
+ /**
24
+ * @remarks
25
+ * - This struct is guaranteed to be aligned to 2 bytes.
26
+ */
23
27
  struct Header
24
28
  {
25
29
  uint16_t packetId;
@@ -24,6 +24,10 @@ namespace RTC
24
24
  class FeedbackRtpTmmbItem : public FeedbackItem
25
25
  {
26
26
  public:
27
+ /**
28
+ * @remarks
29
+ * - This struct is guaranteed to be aligned to 4 bytes.
30
+ */
27
31
  struct Header
28
32
  {
29
33
  uint32_t ssrc;
@@ -32,7 +32,12 @@ namespace RTC
32
32
  class Packet
33
33
  {
34
34
  public:
35
- /* Struct for RTCP common header. */
35
+ /**
36
+ * Struct for RTCP common header.
37
+ *
38
+ * @remarks
39
+ * - This struct is guaranteed to be aligned to 2 bytes.
40
+ */
36
41
  struct CommonHeader
37
42
  {
38
43
  #if defined(MS_LITTLE_ENDIAN)
@@ -13,7 +13,12 @@ namespace RTC
13
13
  class ReceiverReport
14
14
  {
15
15
  public:
16
- /* Struct for RTCP receiver report. */
16
+ /**
17
+ * Struct for RTCP receiver report.
18
+ *
19
+ * @remarks
20
+ * - This struct is guaranteed to be aligned to 4 bytes.
21
+ */
17
22
  struct Header
18
23
  {
19
24
  uint32_t ssrc;
@@ -27,7 +27,15 @@ namespace RTC
27
27
  PRIV
28
28
  };
29
29
 
30
+ #ifdef MS_TEST
31
+ public:
32
+ #else
30
33
  private:
34
+ #endif
35
+ /**
36
+ * @remarks
37
+ * - This struct is guaranteed to be aligned to 1 byte.
38
+ */
31
39
  struct Header
32
40
  {
33
41
  SdesItem::Type type;
@@ -12,7 +12,12 @@ namespace RTC
12
12
  class SenderReport
13
13
  {
14
14
  public:
15
- /* Struct for RTCP sender report. */
15
+ /**
16
+ * Struct for RTCP sender report.
17
+ *
18
+ * @remarks
19
+ * - This struct is guaranteed to be aligned to 4 bytes.
20
+ */
16
21
  struct Header
17
22
  {
18
23
  uint32_t ssrc;
@@ -37,12 +37,17 @@ namespace RTC
37
37
  };
38
38
 
39
39
  public:
40
- /* Struct for Extended Report Block common header. */
40
+ /**
41
+ * Struct for Extended Report Block common header.
42
+ *
43
+ * @remarks
44
+ * - This struct is guaranteed to be aligned to 2 bytes.
45
+ */
41
46
  struct CommonHeader
42
47
  {
43
- uint8_t blockType : 8;
44
- uint8_t reserved : 8;
45
- uint16_t length : 16;
48
+ uint8_t blockType;
49
+ uint8_t reserved;
50
+ uint16_t length;
46
51
  };
47
52
 
48
53
  public: