mediasoup 3.9.12 → 3.9.13
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/node/lib/Worker.js
CHANGED
|
@@ -81,7 +81,7 @@ class Worker extends EnhancedEventEmitter_1.EnhancedEventEmitter {
|
|
|
81
81
|
// options
|
|
82
82
|
{
|
|
83
83
|
env: {
|
|
84
|
-
MEDIASOUP_VERSION: '3.9.
|
|
84
|
+
MEDIASOUP_VERSION: '3.9.13',
|
|
85
85
|
// Let the worker process inherit all environment variables, useful
|
|
86
86
|
// if a custom and not in the path GCC is used so the user can set
|
|
87
87
|
// LD_LIBRARY_PATH environment variable for runtime.
|
package/node/lib/index.d.ts
CHANGED
package/node/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mediasoup",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.13",
|
|
4
4
|
"description": "Cutting Edge WebRTC Video Conferencing",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/debug": "^4.1.7",
|
|
79
79
|
"@types/uuid": "^8.3.4",
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
81
|
-
"@typescript-eslint/parser": "^5.
|
|
82
|
-
"eslint": "^8.
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
81
|
+
"@typescript-eslint/parser": "^5.23.0",
|
|
82
|
+
"eslint": "^8.15.0",
|
|
83
83
|
"eslint-plugin-jest": "^26.1.5",
|
|
84
84
|
"jest": "^27.5.1",
|
|
85
85
|
"jest-tobetype": "^1.2.3",
|
|
@@ -267,7 +267,11 @@ namespace RTC
|
|
|
267
267
|
if (this->payloadDescriptor->tlIndex > context->GetTargetTemporalLayer())
|
|
268
268
|
{
|
|
269
269
|
context->pictureIdManager.Drop(this->payloadDescriptor->pictureId);
|
|
270
|
-
|
|
270
|
+
|
|
271
|
+
if (this->payloadDescriptor->tlIndex == 0)
|
|
272
|
+
{
|
|
273
|
+
context->tl0PictureIndexManager.Drop(this->payloadDescriptor->tl0PictureIndex);
|
|
274
|
+
}
|
|
271
275
|
|
|
272
276
|
return false;
|
|
273
277
|
}
|
|
@@ -280,7 +284,11 @@ namespace RTC
|
|
|
280
284
|
// clang-format on
|
|
281
285
|
{
|
|
282
286
|
context->pictureIdManager.Drop(this->payloadDescriptor->pictureId);
|
|
283
|
-
|
|
287
|
+
|
|
288
|
+
if (this->payloadDescriptor->tlIndex == 0)
|
|
289
|
+
{
|
|
290
|
+
context->tl0PictureIndexManager.Drop(this->payloadDescriptor->tl0PictureIndex);
|
|
291
|
+
}
|
|
284
292
|
|
|
285
293
|
return false;
|
|
286
294
|
}
|
|
@@ -1256,7 +1256,6 @@ namespace RTC
|
|
|
1256
1256
|
newTargetSpatialLayer = -1;
|
|
1257
1257
|
newTargetTemporalLayer = -1;
|
|
1258
1258
|
|
|
1259
|
-
uint8_t maxProducerScore{ 0u };
|
|
1260
1259
|
auto nowMs = DepLibUV::GetTimeMs();
|
|
1261
1260
|
|
|
1262
1261
|
for (size_t sIdx{ 0u }; sIdx < this->producerRtpStreams.size(); ++sIdx)
|
|
@@ -1297,7 +1296,6 @@ namespace RTC
|
|
|
1297
1296
|
continue;
|
|
1298
1297
|
|
|
1299
1298
|
newTargetSpatialLayer = spatialLayer;
|
|
1300
|
-
maxProducerScore = producerScore;
|
|
1301
1299
|
|
|
1302
1300
|
// If this is the preferred or higher spatial layer take it and exit.
|
|
1303
1301
|
if (spatialLayer >= this->preferredSpatialLayer)
|
|
@@ -210,3 +210,86 @@ SCENARIO("parse VP8 payload descriptor", "[codecs][vp8]")
|
|
|
210
210
|
REQUIRE_FALSE(payloadDescriptor);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
|
|
214
|
+
Codecs::VP8::PayloadDescriptor* CreatePacket(
|
|
215
|
+
uint8_t* buffer,
|
|
216
|
+
size_t bufferLen,
|
|
217
|
+
uint16_t pictureId,
|
|
218
|
+
uint8_t tl0PictureIndex,
|
|
219
|
+
uint8_t tlIndex,
|
|
220
|
+
bool layerSync = true)
|
|
221
|
+
{
|
|
222
|
+
uint16_t netPictureId = htons(pictureId);
|
|
223
|
+
std::memcpy(buffer + 2, &netPictureId, 2);
|
|
224
|
+
buffer[2] |= 0x80;
|
|
225
|
+
buffer[4] = tl0PictureIndex;
|
|
226
|
+
buffer[5] = tlIndex << 6;
|
|
227
|
+
|
|
228
|
+
if (layerSync)
|
|
229
|
+
buffer[5] |= 0x20; // y bit
|
|
230
|
+
|
|
231
|
+
auto* payloadDescriptor = Codecs::VP8::Parse(buffer, bufferLen);
|
|
232
|
+
|
|
233
|
+
REQUIRE(payloadDescriptor);
|
|
234
|
+
|
|
235
|
+
return payloadDescriptor;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
std::unique_ptr<Codecs::VP8::PayloadDescriptor> ProcessPacket(
|
|
239
|
+
Codecs::VP8::EncodingContext& context,
|
|
240
|
+
uint16_t pictureId,
|
|
241
|
+
uint8_t tl0PictureIndex,
|
|
242
|
+
uint8_t tlIndex,
|
|
243
|
+
bool layerSync = true)
|
|
244
|
+
{
|
|
245
|
+
// clang-format off
|
|
246
|
+
uint8_t buffer[] =
|
|
247
|
+
{
|
|
248
|
+
0x90, 0xe0, 0x80, 0x00, 0x00, 0x00
|
|
249
|
+
};
|
|
250
|
+
// clang-format on
|
|
251
|
+
bool marker;
|
|
252
|
+
auto* payloadDescriptor =
|
|
253
|
+
CreatePacket(buffer, sizeof(buffer), pictureId, tl0PictureIndex, tlIndex, layerSync);
|
|
254
|
+
std::unique_ptr<Codecs::VP8::PayloadDescriptorHandler> payloadDescriptorHandler(
|
|
255
|
+
new Codecs::VP8::PayloadDescriptorHandler(payloadDescriptor));
|
|
256
|
+
|
|
257
|
+
if (payloadDescriptorHandler->Process(&context, buffer, marker))
|
|
258
|
+
{
|
|
259
|
+
return std::unique_ptr<Codecs::VP8::PayloadDescriptor>(Codecs::VP8::Parse(buffer, sizeof(buffer)));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return nullptr;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
SCENARIO("process VP8 payload descriptor", "[codecs][vp8]")
|
|
266
|
+
{
|
|
267
|
+
SECTION("do not drop TL0PICIDX from temporal layers higher than 0")
|
|
268
|
+
{
|
|
269
|
+
RTC::Codecs::EncodingContext::Params params;
|
|
270
|
+
params.spatialLayers = 0;
|
|
271
|
+
params.temporalLayers = 2;
|
|
272
|
+
Codecs::VP8::EncodingContext context(params);
|
|
273
|
+
|
|
274
|
+
context.SetCurrentTemporalLayer(0);
|
|
275
|
+
context.SetTargetTemporalLayer(0);
|
|
276
|
+
|
|
277
|
+
// Frame 1
|
|
278
|
+
auto forwarded = ProcessPacket(context, 0, 0, 0);
|
|
279
|
+
REQUIRE(forwarded);
|
|
280
|
+
REQUIRE(forwarded->pictureId == 0);
|
|
281
|
+
REQUIRE(forwarded->tl0PictureIndex == 0);
|
|
282
|
+
|
|
283
|
+
// Frame 2 gets lost
|
|
284
|
+
|
|
285
|
+
// Frame 3
|
|
286
|
+
forwarded = ProcessPacket(context, 2, 1, 1);
|
|
287
|
+
REQUIRE_FALSE(forwarded);
|
|
288
|
+
|
|
289
|
+
// Frame 2 retransmitted
|
|
290
|
+
forwarded = ProcessPacket(context, 1, 1, 0);
|
|
291
|
+
REQUIRE(forwarded);
|
|
292
|
+
REQUIRE(forwarded->pictureId == 1);
|
|
293
|
+
REQUIRE(forwarded->tl0PictureIndex == 1);
|
|
294
|
+
}
|
|
295
|
+
}
|