mediasoup 3.27.0 → 3.28.0

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 (213) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/node/lib/Consumer.d.ts.map +1 -1
  3. package/node/lib/Consumer.js +4 -51
  4. package/node/lib/Producer.d.ts.map +1 -1
  5. package/node/lib/Producer.js +4 -8
  6. package/node/lib/ProducerTypes.d.ts +4 -2
  7. package/node/lib/ProducerTypes.d.ts.map +1 -1
  8. package/node/lib/Router.d.ts.map +1 -1
  9. package/node/lib/Router.js +4 -0
  10. package/node/lib/Transport.d.ts.map +1 -1
  11. package/node/lib/Transport.js +7 -10
  12. package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.d.ts +3 -4
  13. package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.d.ts.map +1 -1
  14. package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.js +3 -4
  15. package/node/lib/ortc.d.ts +0 -2
  16. package/node/lib/ortc.d.ts.map +1 -1
  17. package/node/lib/ortc.js +11 -21
  18. package/node/lib/rtpMappingFbsUtils.d.ts +6 -0
  19. package/node/lib/rtpMappingFbsUtils.d.ts.map +1 -0
  20. package/node/lib/rtpMappingFbsUtils.js +65 -0
  21. package/node/lib/rtpParametersFbsUtils.d.ts.map +1 -1
  22. package/node/lib/rtpParametersFbsUtils.js +0 -6
  23. package/node/lib/rtpParametersTypes.d.ts +1 -1
  24. package/node/lib/rtpParametersTypes.d.ts.map +1 -1
  25. package/node/lib/rtpStreamFbsUtils.d.ts +4 -0
  26. package/node/lib/rtpStreamFbsUtils.d.ts.map +1 -0
  27. package/node/lib/rtpStreamFbsUtils.js +51 -0
  28. package/node/lib/supportedRtpCapabilities.d.ts.map +1 -1
  29. package/node/lib/supportedRtpCapabilities.js +6 -13
  30. package/node/lib/test/test-Consumer.js +1 -13
  31. package/node/lib/test/test-DataConsumer.js +9 -0
  32. package/node/lib/test/test-DataProducer.js +38 -0
  33. package/node/lib/test/test-PipeTransport.js +27 -29
  34. package/node/lib/test/test-Producer.js +97 -0
  35. package/node/lib/test/test-ortc.js +34 -14
  36. package/package.json +10 -10
  37. package/worker/fbs/FBS/meson.build +25 -0
  38. package/worker/fbs/meson.build +15 -18
  39. package/worker/fbs/rtpParameters.fbs +0 -1
  40. package/worker/fuzzer/src/FuzzerUtils.cpp +5 -3
  41. package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +16 -2
  42. package/worker/include/DepLibUV.hpp +13 -0
  43. package/worker/include/RTC/BWE/AlrDetector.hpp +97 -0
  44. package/worker/include/RTC/BWE/BitrateProber.hpp +217 -0
  45. package/worker/include/RTC/BWE/BitrateUtils.hpp +39 -0
  46. package/worker/include/RTC/BWE/BweTypes.hpp +171 -3
  47. package/worker/include/RTC/BWE/FeedbackAdapter.hpp +0 -14
  48. package/worker/include/RTC/BWE/InterArrival.hpp +117 -0
  49. package/worker/include/RTC/BWE/IntervalBudget.hpp +81 -0
  50. package/worker/include/RTC/BWE/LossBasedController.hpp +625 -0
  51. package/worker/include/RTC/BWE/OveruseDetector.hpp +71 -0
  52. package/worker/include/RTC/BWE/OveruseEstimator.hpp +115 -0
  53. package/worker/include/RTC/BWE/ProbeBitrateEstimator.hpp +84 -0
  54. package/worker/include/RTC/BWE/ProbeController.hpp +379 -0
  55. package/worker/include/RTC/BWE/ProbePacketGenerator.hpp +130 -0
  56. package/worker/include/RTC/BWE/ProbingScheduler.hpp +187 -0
  57. package/worker/include/RTC/BWE/RembGenerator.hpp +96 -0
  58. package/worker/include/RTC/BWE/RemoteBitrateEstimatorAbsSendTime.hpp +237 -0
  59. package/worker/include/RTC/BWE/RobustThroughputEstimator.hpp +26 -0
  60. package/worker/include/RTC/BWE/SendPacketHistory.hpp +161 -25
  61. package/worker/include/RTC/BWE/TargetRateController.hpp +306 -0
  62. package/worker/include/RTC/BWE/TransportWideCcFeedbackGenerator.hpp +146 -0
  63. package/worker/include/RTC/BWE/TrendlineEstimator.hpp +73 -16
  64. package/worker/include/RTC/Consts.hpp +70 -0
  65. package/worker/include/RTC/DataConsumer.hpp +3 -5
  66. package/worker/include/RTC/DirectTransport.hpp +4 -5
  67. package/worker/include/RTC/PipeTransport.hpp +4 -5
  68. package/worker/include/RTC/PlainTransport.hpp +4 -5
  69. package/worker/include/RTC/RTCP/FeedbackPsRemb.hpp +6 -7
  70. package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +3 -1
  71. package/worker/include/RTC/RTP/Codecs/Tools.hpp +1 -1
  72. package/worker/include/RTC/RTP/HeaderExtensionIds.hpp +0 -1
  73. package/worker/include/RTC/RTP/Packet.hpp +16 -4
  74. package/worker/include/RTC/RTP/ProbationGenerator.hpp +0 -8
  75. package/worker/include/RTC/RTP/RtpStream.hpp +12 -9
  76. package/worker/include/RTC/RTP/RtpStreamRecv.hpp +22 -4
  77. package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -2
  78. package/worker/include/RTC/RTP/RtxStream.hpp +10 -4
  79. package/worker/include/RTC/RateCalculator.hpp +103 -24
  80. package/worker/include/RTC/RemoteCaptureTimeEstimator.hpp +33 -3
  81. package/worker/include/RTC/{RtcLogger.hpp → RtcLogger/RtpPacket.hpp} +5 -3
  82. package/worker/include/RTC/RtcLogger/SendBurst.hpp +88 -0
  83. package/worker/include/RTC/RtpDictionaries.hpp +3 -4
  84. package/worker/include/RTC/SCTP/association/Association.hpp +1 -1
  85. package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +36 -0
  86. package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +0 -1
  87. package/worker/include/RTC/SCTP/public/SctpTypes.hpp +9 -9
  88. package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
  89. package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +11 -1
  90. package/worker/include/RTC/SctpDictionaries.hpp +2 -2
  91. package/worker/include/RTC/TcpConnection.hpp +2 -1
  92. package/worker/include/RTC/Transport.hpp +23 -8
  93. package/worker/include/RTC/TransportTuple.hpp +61 -6
  94. package/worker/include/RTC/WebRtcTransport.hpp +4 -5
  95. package/worker/include/Shared.hpp +5 -0
  96. package/worker/include/SharedInterface.hpp +10 -0
  97. package/worker/include/Utils.hpp +72 -3
  98. package/worker/include/common.hpp +12 -4
  99. package/worker/include/handles/SendCallbacks.hpp +34 -0
  100. package/worker/include/handles/TcpConnectionHandle.hpp +4 -12
  101. package/worker/include/handles/UdpSocketHandle.hpp +4 -8
  102. package/worker/meson.build +45 -1
  103. package/worker/meson_options.txt +1 -0
  104. package/worker/mocks/include/MockShared.hpp +16 -2
  105. package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +1 -1
  106. package/worker/scripts/package-lock.json +6 -6
  107. package/worker/src/RTC/BWE/AimdRateControl.cpp +4 -5
  108. package/worker/src/RTC/BWE/AlrDetector.cpp +80 -0
  109. package/worker/src/RTC/BWE/BitrateProber.cpp +256 -0
  110. package/worker/src/RTC/BWE/BitrateUtils.cpp +54 -0
  111. package/worker/src/RTC/BWE/DelayBasedBwe.cpp +2 -2
  112. package/worker/src/RTC/BWE/FeedbackAdapter.cpp +20 -37
  113. package/worker/src/RTC/BWE/InterArrival.cpp +216 -0
  114. package/worker/src/RTC/BWE/IntervalBudget.cpp +93 -0
  115. package/worker/src/RTC/BWE/LossBasedController.cpp +1194 -0
  116. package/worker/src/RTC/BWE/OveruseDetector.cpp +128 -0
  117. package/worker/src/RTC/BWE/OveruseEstimator.cpp +166 -0
  118. package/worker/src/RTC/BWE/ProbeBitrateEstimator.cpp +222 -0
  119. package/worker/src/RTC/BWE/ProbeController.cpp +645 -0
  120. package/worker/src/RTC/BWE/ProbePacketGenerator.cpp +140 -0
  121. package/worker/src/RTC/BWE/ProbingScheduler.cpp +196 -0
  122. package/worker/src/RTC/BWE/RembGenerator.cpp +169 -0
  123. package/worker/src/RTC/BWE/RemoteBitrateEstimatorAbsSendTime.cpp +497 -0
  124. package/worker/src/RTC/BWE/RobustThroughputEstimator.cpp +47 -0
  125. package/worker/src/RTC/BWE/SendPacketHistory.cpp +173 -50
  126. package/worker/src/RTC/BWE/TargetRateController.cpp +433 -0
  127. package/worker/src/RTC/BWE/TransportWideCcFeedbackGenerator.cpp +377 -0
  128. package/worker/src/RTC/BWE/TrendlineEstimator.cpp +102 -5
  129. package/worker/src/RTC/Consumer.cpp +7 -5
  130. package/worker/src/RTC/DataConsumer.cpp +8 -10
  131. package/worker/src/RTC/DirectTransport.cpp +14 -8
  132. package/worker/src/RTC/DtlsTransport.cpp +8 -8
  133. package/worker/src/RTC/ICE/IceCandidate.cpp +4 -4
  134. package/worker/src/RTC/ICE/IceServer.cpp +1 -1
  135. package/worker/src/RTC/PipeTransport.cpp +13 -8
  136. package/worker/src/RTC/PlainTransport.cpp +13 -8
  137. package/worker/src/RTC/Producer.cpp +14 -31
  138. package/worker/src/RTC/RTCP/Bye.cpp +1 -1
  139. package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +18 -0
  140. package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +2 -2
  141. package/worker/src/RTC/RTCP/FeedbackPsVbcm.cpp +2 -1
  142. package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +2 -2
  143. package/worker/src/RTC/RTCP/Sdes.cpp +1 -1
  144. package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +2 -1
  145. package/worker/src/RTC/RTP/Packet.cpp +26 -11
  146. package/worker/src/RTC/RTP/ProbationGenerator.cpp +5 -6
  147. package/worker/src/RTC/RTP/RtpStream.cpp +1 -1
  148. package/worker/src/RTC/RTP/RtpStreamRecv.cpp +69 -48
  149. package/worker/src/RTC/RTP/RtpStreamSend.cpp +31 -31
  150. package/worker/src/RTC/RTP/RtxStream.cpp +22 -7
  151. package/worker/src/RTC/RateCalculator.cpp +133 -28
  152. package/worker/src/RTC/RemoteCaptureTimeEstimator.cpp +56 -1
  153. package/worker/src/RTC/{RtcLogger.cpp → RtcLogger/RtpPacket.cpp} +2 -2
  154. package/worker/src/RTC/RtcLogger/SendBurst.cpp +124 -0
  155. package/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp +2 -12
  156. package/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +1 -1
  157. package/worker/src/RTC/SCTP/association/Association.cpp +16 -2
  158. package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +106 -1
  159. package/worker/src/RTC/SCTP/public/AssociationMetrics.cpp +1 -1
  160. package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +3 -3
  161. package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +2 -1
  162. package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +4 -4
  163. package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +4 -4
  164. package/worker/src/RTC/SctpDictionaries/SctpStreamParameters.cpp +6 -10
  165. package/worker/src/RTC/SimulcastProducerStreamManager.cpp +2 -2
  166. package/worker/src/RTC/SrtpSession.cpp +2 -2
  167. package/worker/src/RTC/SvcProducerStreamManager.cpp +2 -2
  168. package/worker/src/RTC/TcpConnection.cpp +2 -2
  169. package/worker/src/RTC/Transport.cpp +112 -75
  170. package/worker/src/RTC/TransportTuple.cpp +4 -4
  171. package/worker/src/RTC/WebRtcServer.cpp +4 -3
  172. package/worker/src/RTC/WebRtcTransport.cpp +20 -13
  173. package/worker/src/Utils/BitStream.cpp +24 -0
  174. package/worker/src/handles/BackoffTimerHandle.cpp +1 -1
  175. package/worker/src/handles/TcpConnectionHandle.cpp +13 -23
  176. package/worker/src/handles/UdpSocketHandle.cpp +14 -21
  177. package/worker/tasks.py +43 -18
  178. package/worker/test/include/RTC/BWE/helpers/LinkSimulator.hpp +68 -14
  179. package/worker/test/include/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.hpp +125 -0
  180. package/worker/test/src/RTC/BWE/TestAlrDetector.cpp +110 -0
  181. package/worker/test/src/RTC/BWE/TestBitrateProber.cpp +418 -0
  182. package/worker/test/src/RTC/BWE/TestBitrateUtils.cpp +61 -0
  183. package/worker/test/src/RTC/BWE/TestDelayBasedBwe.cpp +4 -4
  184. package/worker/test/src/RTC/BWE/TestFeedbackAdapter.cpp +53 -37
  185. package/worker/test/src/RTC/BWE/TestInterArrival.cpp +643 -0
  186. package/worker/test/src/RTC/BWE/TestIntervalBudget.cpp +130 -0
  187. package/worker/test/src/RTC/BWE/TestLossBasedController.cpp +1199 -0
  188. package/worker/test/src/RTC/BWE/TestOveruseDetector.cpp +519 -0
  189. package/worker/test/src/RTC/BWE/TestProbeBitrateEstimator.cpp +266 -0
  190. package/worker/test/src/RTC/BWE/TestProbeController.cpp +1682 -0
  191. package/worker/test/src/RTC/BWE/TestProbePacketGenerator.cpp +265 -0
  192. package/worker/test/src/RTC/BWE/TestProbingScheduler.cpp +260 -0
  193. package/worker/test/src/RTC/BWE/TestRembGenerator.cpp +285 -0
  194. package/worker/test/src/RTC/BWE/TestRemoteBitrateEstimatorAbsSendTime.cpp +414 -0
  195. package/worker/test/src/RTC/BWE/TestSendPacketHistory.cpp +296 -77
  196. package/worker/test/src/RTC/BWE/TestTargetRateController.cpp +337 -0
  197. package/worker/test/src/RTC/BWE/TestTransportWideCcFeedbackGenerator.cpp +578 -0
  198. package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +45 -0
  199. package/worker/test/src/RTC/BWE/helpers/LinkSimulator.cpp +133 -29
  200. package/worker/test/src/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.cpp +625 -0
  201. package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +19 -0
  202. package/worker/test/src/RTC/RTP/TestPacket.cpp +58 -4
  203. package/worker/test/src/RTC/RTP/TestProbationGenerator.cpp +3 -2
  204. package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +50 -0
  205. package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +59 -0
  206. package/worker/test/src/RTC/SCTP/association/TestStreamResetHandler.cpp +111 -0
  207. package/worker/test/src/RTC/TestRateCalculator.cpp +322 -60
  208. package/worker/test/src/RTC/TestRemoteCaptureTimeEstimator.cpp +95 -7
  209. package/worker/test/src/RTC/TestSimpleProducerStreamManager.cpp +34 -16
  210. package/worker/test/src/RTC/TestSimulcastProducerStreamManager.cpp +31 -13
  211. package/worker/test/src/RTC/TestSvcProducerStreamManager.cpp +37 -19
  212. package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +10 -10
  213. package/worker/test/src/Utils/TestTime.cpp +120 -21
@@ -14,7 +14,7 @@ namespace RTC
14
14
  {
15
15
  MS_TRACE();
16
16
 
17
- auto peerImplementationStringView = Types::SctpImplementationToString(this->peerImplementation);
17
+ auto peerImplementationStringView = Types::sctpImplementationToString(this->peerImplementation);
18
18
 
19
19
  MS_DUMP_CLEAN(indentation, "<SCTP::AssociationMetrics>");
20
20
  MS_DUMP_CLEAN(indentation, " tx packets count: %" PRIu64, this->txPacketsCount);
@@ -118,7 +118,7 @@ namespace RTC
118
118
  this->nextMid.Increment();
119
119
 
120
120
  // This might unblock assembling more messages.
121
- return -TryToAssembleMessages();
121
+ return -static_cast<int32_t>(TryToAssembleMessages());
122
122
  }
123
123
 
124
124
  // Slow path.
@@ -159,7 +159,7 @@ namespace RTC
159
159
  removedBytes += std::accumulate(
160
160
  it->second.begin(),
161
161
  it->second.end(),
162
- 0,
162
+ size_t{ 0 },
163
163
  [](size_t acc, const auto& i)
164
164
  {
165
165
  const auto& data = i.second.second;
@@ -295,7 +295,7 @@ namespace RTC
295
295
  const size_t payloadLength = std::accumulate(
296
296
  tsnChunks.begin(),
297
297
  tsnChunks.end(),
298
- 0,
298
+ size_t{ 0 },
299
299
  [](size_t acc, const auto& i)
300
300
  {
301
301
  const auto& data = i.second.second;
@@ -13,7 +13,8 @@ namespace RTC
13
13
  {
14
14
  ReassemblyQueue::ReassemblyQueue(size_t maxLengthBytes, bool useMessageInterleaving)
15
15
  : maxLengthBytes(maxLengthBytes),
16
- watermarkBytes(this->maxLengthBytes * ReassemblyQueue::HighWatermarkLimit),
16
+ watermarkBytes(
17
+ static_cast<size_t>(this->maxLengthBytes * ReassemblyQueue::HighWatermarkLimit)),
17
18
  reassemblyStreams(CreateReassemblyStreams(
18
19
  [this](std::span<const Types::UnwrappedTsn> tsns, Message message)
19
20
  {
@@ -114,7 +114,7 @@ namespace RTC
114
114
  const size_t payloadLength = std::accumulate(
115
115
  start,
116
116
  end,
117
- 0,
117
+ size_t{ 0 },
118
118
  [](size_t acc, const auto& i)
119
119
  {
120
120
  const auto& data = i.second;
@@ -200,13 +200,13 @@ namespace RTC
200
200
  size_t removedBytes = std::accumulate(
201
201
  this->chunksBySsn.begin(),
202
202
  endIt,
203
- 0,
203
+ size_t{ 0 },
204
204
  [](size_t acc1, const auto& i1)
205
205
  {
206
206
  return acc1 + std::accumulate(
207
207
  i1.second.begin(),
208
208
  i1.second.end(),
209
- 0,
209
+ size_t{ 0 },
210
210
  [](size_t acc2, const auto& i2)
211
211
  {
212
212
  const auto& data = i2.second;
@@ -349,7 +349,7 @@ namespace RTC
349
349
  const size_t removedBytes = std::accumulate(
350
350
  this->chunks.begin(),
351
351
  endIt,
352
- 0,
352
+ size_t{ 0 },
353
353
  [](size_t acc, const auto& i)
354
354
  {
355
355
  const auto& data = i.second;
@@ -3,7 +3,7 @@
3
3
 
4
4
  #include "RTC/SCTP/tx/RetransmissionTimeout.hpp"
5
5
  #include "Logger.hpp"
6
- #include <cmath> // std::abs(), std::max(), std::round()
6
+ #include <cmath> // std::abs(), std::round()
7
7
 
8
8
  namespace RTC
9
9
  {
@@ -33,8 +33,8 @@ namespace RTC
33
33
  maxRttUs(sctpOptions.maxRttMs * 1000),
34
34
  minRttVarianceUs(
35
35
  static_cast<int64_t>((sctpOptions.minRttVarianceMs * 1000) / HeuristicVarianceAdjustment)),
36
- srttUs(sctpOptions.initialRtoMs * 1000),
37
- rtoUs(sctpOptions.initialRtoMs * 1000),
36
+ srttUs(static_cast<double>(sctpOptions.initialRtoMs * 1000)),
37
+ rtoUs(static_cast<double>(sctpOptions.initialRtoMs * 1000)),
38
38
  firstMeasurement(true)
39
39
  {
40
40
  MS_TRACE();
@@ -76,7 +76,7 @@ namespace RTC
76
76
  // https://datatracker.ietf.org/doc/html/rfc9260#section-6.3.1
77
77
  if (this->firstMeasurement)
78
78
  {
79
- this->srttUs = rttUs;
79
+ this->srttUs = static_cast<double>(rttUs);
80
80
  this->rttVarUs = rttUs / 2.0;
81
81
  this->firstMeasurement = false;
82
82
  }
@@ -41,16 +41,18 @@ namespace RTC
41
41
  this->maxRetransmits = maxRetransmits.value();
42
42
  }
43
43
 
44
- if (this->maxPacketLifeTime && this->maxRetransmits)
44
+ if (this->maxPacketLifeTime.has_value() && this->maxRetransmits.has_value())
45
45
  {
46
46
  MS_THROW_TYPE_ERROR("cannot provide both maxPacketLifeTime and maxRetransmits");
47
47
  }
48
48
 
49
- if (orderedGiven && this->ordered && (this->maxPacketLifeTime || this->maxRetransmits))
49
+ if (
50
+ orderedGiven && this->ordered &&
51
+ (this->maxPacketLifeTime.has_value() || this->maxRetransmits.has_value()))
50
52
  {
51
53
  MS_THROW_TYPE_ERROR("cannot be ordered with maxPacketLifeTime or maxRetransmits");
52
54
  }
53
- else if (!orderedGiven && (this->maxPacketLifeTime || this->maxRetransmits))
55
+ else if (!orderedGiven && (this->maxPacketLifeTime.has_value() || this->maxRetransmits.has_value()))
54
56
  {
55
57
  this->ordered = false;
56
58
  }
@@ -62,12 +64,6 @@ namespace RTC
62
64
  MS_TRACE();
63
65
 
64
66
  return FBS::SctpParameters::CreateSctpStreamParameters(
65
- builder,
66
- this->streamId,
67
- this->ordered,
68
- this->maxPacketLifeTime ? flatbuffers::Optional<uint16_t>(this->maxPacketLifeTime)
69
- : flatbuffers::nullopt,
70
- this->maxRetransmits ? flatbuffers::Optional<uint16_t>(this->maxRetransmits)
71
- : flatbuffers::nullopt);
67
+ builder, this->streamId, this->ordered, this->maxPacketLifeTime, this->maxRetransmits);
72
68
  }
73
69
  } // namespace RTC
@@ -219,11 +219,11 @@ namespace RTC
219
219
  // packet lost.
220
220
  if (lossPercentage < 2)
221
221
  {
222
- virtualBitrate = 1.08 * bitrate;
222
+ virtualBitrate = static_cast<int64_t>(1.08 * bitrate);
223
223
  }
224
224
  else if (lossPercentage > 10)
225
225
  {
226
- virtualBitrate = (1 - 0.5 * (lossPercentage / 100)) * bitrate;
226
+ virtualBitrate = static_cast<int64_t>((1 - 0.5 * (lossPercentage / 100)) * bitrate);
227
227
  }
228
228
  else
229
229
  {
@@ -56,7 +56,7 @@ namespace RTC
56
56
  return FBS::SrtpParameters::SrtpCryptoSuite::AES_CM_128_HMAC_SHA1_32;
57
57
  }
58
58
 
59
- NO_DEFAULT_GCC();
59
+ NO_DEFAULT();
60
60
  }
61
61
  }
62
62
 
@@ -86,7 +86,7 @@ namespace RTC
86
86
  return SrtpSession::CryptoSuite::AES_CM_128_HMAC_SHA1_32;
87
87
  }
88
88
 
89
- NO_DEFAULT_GCC();
89
+ NO_DEFAULT();
90
90
  }
91
91
  }
92
92
 
@@ -160,11 +160,11 @@ namespace RTC
160
160
  // packet lost.
161
161
  if (lossPercentage < 2)
162
162
  {
163
- virtualBitrate = 1.08 * bitrate;
163
+ virtualBitrate = static_cast<int64_t>(1.08 * bitrate);
164
164
  }
165
165
  else if (lossPercentage > 10)
166
166
  {
167
- virtualBitrate = (1 - 0.5 * (lossPercentage / 100)) * bitrate;
167
+ virtualBitrate = static_cast<int64_t>((1 - 0.5 * (lossPercentage / 100)) * bitrate);
168
168
  }
169
169
  else
170
170
  {
@@ -168,7 +168,7 @@ namespace RTC
168
168
  }
169
169
  }
170
170
 
171
- void TcpConnection::Send(const uint8_t* data, size_t len, ::TcpConnectionHandle::onSendCallback* cb)
171
+ void TcpConnection::Send(const uint8_t* data, size_t len, onSendCallback cb)
172
172
  {
173
173
  MS_TRACE();
174
174
 
@@ -177,6 +177,6 @@ namespace RTC
177
177
  uint8_t frameLen[2];
178
178
 
179
179
  Utils::Byte::Set2Bytes(frameLen, 0, len);
180
- ::TcpConnectionHandle::Write(frameLen, 2, data, len, cb);
180
+ ::TcpConnectionHandle::Write(frameLen, 2, data, len, std::move(cb));
181
181
  }
182
182
  } // namespace RTC