mediasoup 3.19.19 → 3.19.21
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.
- package/README.md +4 -4
- package/node/lib/Worker.d.ts +1 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +8 -2
- package/node/lib/WorkerTypes.d.ts +8 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +2 -1
- package/node/lib/sctpParametersTypes.d.ts +3 -13
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/test/test-PlainTransport.js +8 -3
- package/node/lib/test/test-WebRtcTransport.js +9 -4
- package/package.json +10 -10
- package/worker/Makefile +0 -4
- package/worker/fuzzer/src/fuzzer.cpp +6 -5
- package/worker/include/RTC/DataConsumer.hpp +4 -14
- package/worker/include/RTC/SCTP/TODO_SCTP.md +18 -10
- package/worker/include/RTC/SCTP/association/Association.hpp +39 -31
- package/worker/include/RTC/SCTP/association/{AssociationDeferredListener.hpp → AssociationListenerDeferrer.hpp} +10 -8
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +77 -0
- package/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +2 -2
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +2 -2
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +2 -2
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +272 -0
- package/worker/include/RTC/SCTP/association/TCBContext.hpp +67 -0
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +81 -11
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +274 -0
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +0 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +1 -0
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +14 -10
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +14 -10
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +13 -2
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +7 -1
- package/worker/include/RTC/SCTP/public/AssociationListener.hpp +11 -0
- package/worker/include/RTC/SCTP/public/Message.hpp +1 -0
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +4 -4
- package/worker/include/RTC/SctpAssociation.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +9 -13
- package/worker/include/Settings.hpp +2 -1
- package/worker/include/Utils.hpp +130 -6
- package/worker/meson.build +10 -39
- package/worker/meson_options.txt +0 -1
- package/worker/scripts/package-lock.json +6 -6
- package/worker/src/DepLibUring.cpp +1 -1
- package/worker/src/RTC/DataConsumer.cpp +5 -29
- package/worker/src/RTC/PipeTransport.cpp +15 -12
- package/worker/src/RTC/PlainTransport.cpp +15 -12
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +5 -5
- package/worker/src/RTC/RTP/RtpStream.cpp +2 -2
- package/worker/src/RTC/RTP/RtxStream.cpp +1 -1
- package/worker/src/RTC/RateCalculator.cpp +5 -5
- package/worker/src/RTC/SCTP/association/Association.cpp +218 -148
- package/worker/src/RTC/SCTP/association/{AssociationDeferredListener.cpp → AssociationListenerDeferrer.cpp} +38 -30
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +244 -0
- package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +8 -6
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +7 -2
- package/worker/src/RTC/SCTP/association/StateCookie.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +512 -0
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +45 -39
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +22 -5
- package/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +22 -5
- package/worker/src/RTC/SCTP/tx/RetransmissionErrorCounter.cpp +1 -1
- package/worker/src/RTC/SctpAssociation.cpp +1 -2
- package/worker/src/RTC/SeqManager.cpp +4 -4
- package/worker/src/RTC/Transport.cpp +247 -134
- package/worker/src/RTC/WebRtcTransport.cpp +9 -5
- package/worker/src/Settings.cpp +21 -1
- package/worker/src/Worker.cpp +13 -10
- package/worker/src/lib.cpp +11 -8
- package/worker/tasks.py +2 -35
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +13 -12
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +20 -20
- package/worker/test/src/RTC/SCTP/common/TestUnwrappedSequenceNumber.cpp +210 -0
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +9 -4
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +5 -0
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +5 -5
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +19 -20
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +3 -0
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +3 -0
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +24 -27
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +25 -30
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +8 -6
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +12 -0
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +5 -8
- package/worker/test/src/Utils/TestNumber.cpp +119 -49
- package/worker/test/src/tests.cpp +11 -8
|
@@ -110,10 +110,10 @@ namespace RTC
|
|
|
110
110
|
indentation,
|
|
111
111
|
" re-configuration request sequence number: %" PRIu32,
|
|
112
112
|
GetReconfigurationRequestSequenceNumber());
|
|
113
|
-
MS_DUMP_CLEAN(indentation, "
|
|
114
|
-
for (
|
|
113
|
+
MS_DUMP_CLEAN(indentation, " stream ids:");
|
|
114
|
+
for (const uint16_t streamId : GetStreamIds())
|
|
115
115
|
{
|
|
116
|
-
MS_DUMP_CLEAN(indentation, " -
|
|
116
|
+
MS_DUMP_CLEAN(indentation, " - stream id: %" PRIu16, streamId);
|
|
117
117
|
}
|
|
118
118
|
MS_DUMP_CLEAN(indentation, "</SCTP::IncomingSsnResetRequestParameter>");
|
|
119
119
|
}
|
|
@@ -137,7 +137,24 @@ namespace RTC
|
|
|
137
137
|
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 4, value);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
std::vector<uint16_t> IncomingSsnResetRequestParameter::GetStreamIds() const
|
|
141
|
+
{
|
|
142
|
+
MS_TRACE();
|
|
143
|
+
|
|
144
|
+
const uint16_t numberOfStreams = GetNumberOfStreams();
|
|
145
|
+
std::vector<uint16_t> streamIds;
|
|
146
|
+
|
|
147
|
+
streamIds.reserve(numberOfStreams);
|
|
148
|
+
|
|
149
|
+
for (uint16_t idx{ 0 }; idx < numberOfStreams; ++idx)
|
|
150
|
+
{
|
|
151
|
+
streamIds.emplace_back(GetStreamAt(idx));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return streamIds;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
void IncomingSsnResetRequestParameter::AddStreamId(uint16_t streamId)
|
|
141
158
|
{
|
|
142
159
|
MS_TRACE();
|
|
143
160
|
|
|
@@ -148,7 +165,7 @@ namespace RTC
|
|
|
148
165
|
|
|
149
166
|
// Add the new stream.
|
|
150
167
|
Utils::Byte::Set2Bytes(
|
|
151
|
-
GetVariableLengthValuePointer(), previousVariableLengthValueLength,
|
|
168
|
+
GetVariableLengthValuePointer(), previousVariableLengthValueLength, streamId);
|
|
152
169
|
}
|
|
153
170
|
|
|
154
171
|
IncomingSsnResetRequestParameter* IncomingSsnResetRequestParameter::SoftClone(
|
|
@@ -117,10 +117,10 @@ namespace RTC
|
|
|
117
117
|
" re-configuration response sequence number: %" PRIu32,
|
|
118
118
|
GetReconfigurationResponseSequenceNumber());
|
|
119
119
|
MS_DUMP_CLEAN(indentation, " sender last assigned tsn: %" PRIu32, GetSenderLastAssignedTsn());
|
|
120
|
-
MS_DUMP_CLEAN(indentation, "
|
|
121
|
-
for (
|
|
120
|
+
MS_DUMP_CLEAN(indentation, " stream ids:");
|
|
121
|
+
for (const uint16_t streamId : GetStreamIds())
|
|
122
122
|
{
|
|
123
|
-
MS_DUMP_CLEAN(indentation, " -
|
|
123
|
+
MS_DUMP_CLEAN(indentation, " - stream id: %" PRIu16, streamId);
|
|
124
124
|
}
|
|
125
125
|
MS_DUMP_CLEAN(indentation, "</SCTP::OutgoingSsnResetRequestParameter>");
|
|
126
126
|
}
|
|
@@ -158,7 +158,24 @@ namespace RTC
|
|
|
158
158
|
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 12, value);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
std::vector<uint16_t> OutgoingSsnResetRequestParameter::GetStreamIds() const
|
|
162
|
+
{
|
|
163
|
+
MS_TRACE();
|
|
164
|
+
|
|
165
|
+
const uint16_t numberOfStreams = GetNumberOfStreams();
|
|
166
|
+
std::vector<uint16_t> streamIds;
|
|
167
|
+
|
|
168
|
+
streamIds.reserve(numberOfStreams);
|
|
169
|
+
|
|
170
|
+
for (uint16_t idx{ 0 }; idx < numberOfStreams; ++idx)
|
|
171
|
+
{
|
|
172
|
+
streamIds.emplace_back(GetStreamAt(idx));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return streamIds;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
void OutgoingSsnResetRequestParameter::AddStreamId(uint16_t streamId)
|
|
162
179
|
{
|
|
163
180
|
MS_TRACE();
|
|
164
181
|
|
|
@@ -169,7 +186,7 @@ namespace RTC
|
|
|
169
186
|
|
|
170
187
|
// Add the new stream.
|
|
171
188
|
Utils::Byte::Set2Bytes(
|
|
172
|
-
GetVariableLengthValuePointer(), previousVariableLengthValueLength,
|
|
189
|
+
GetVariableLengthValuePointer(), previousVariableLengthValueLength, streamId);
|
|
173
190
|
}
|
|
174
191
|
|
|
175
192
|
OutgoingSsnResetRequestParameter* OutgoingSsnResetRequestParameter::SoftClone(
|
|
@@ -513,8 +513,7 @@ namespace RTC
|
|
|
513
513
|
|
|
514
514
|
return;
|
|
515
515
|
}
|
|
516
|
-
// If the transport is not connected
|
|
517
|
-
// anything.
|
|
516
|
+
// If the transport is not connected, don't do anything.
|
|
518
517
|
else if (!this->transportConnected)
|
|
519
518
|
{
|
|
520
519
|
MS_DEBUG_DEV("transport is not connected, ignoring");
|
|
@@ -11,25 +11,25 @@ namespace RTC
|
|
|
11
11
|
template<typename T, uint8_t N>
|
|
12
12
|
bool SeqManager<T, N>::SeqLowerThan::operator()(T lhs, T rhs) const
|
|
13
13
|
{
|
|
14
|
-
return Utils::Number<T, N
|
|
14
|
+
return Utils::Number::IsLowerThan<T, N>(lhs, rhs);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
template<typename T, uint8_t N>
|
|
18
18
|
bool SeqManager<T, N>::SeqHigherThan::operator()(T lhs, T rhs) const
|
|
19
19
|
{
|
|
20
|
-
return Utils::Number<T, N
|
|
20
|
+
return Utils::Number::IsHigherThan<T, N>(lhs, rhs);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
template<typename T, uint8_t N>
|
|
24
24
|
bool SeqManager<T, N>::IsSeqHigherThan(T lhs, T rhs)
|
|
25
25
|
{
|
|
26
|
-
return Utils::Number<T, N
|
|
26
|
+
return Utils::Number::IsHigherThan<T, N>(lhs, rhs);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
template<typename T, uint8_t N>
|
|
30
30
|
bool SeqManager<T, N>::IsSeqLowerThan(T lhs, T rhs)
|
|
31
31
|
{
|
|
32
|
-
return Utils::Number<T, N
|
|
32
|
+
return Utils::Number::IsLowerThan<T, N>(lhs, rhs);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
template<typename T, uint8_t N>
|