mediasoup 3.11.21 → 3.11.22
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 +1 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.js +1 -1
- package/package.json +1 -1
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/alr_detector.cc +20 -1
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/alr_detector.h +3 -0
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe.cc +2 -2
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/goog_cc_network_control.cc +1 -1
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/trendline_estimator.cc +113 -106
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/trendline_estimator.h +47 -26
- package/worker/deps/libwebrtc/libwebrtc/rtc_base/experiments/alr_experiment.cc +8 -5
- package/worker/deps/libwebrtc/libwebrtc/rtc_base/experiments/alr_experiment.h +1 -0
- package/worker/include/RTC/RtcLogger.hpp +58 -0
- package/worker/include/RTC/RtpPacket.hpp +4 -0
- package/worker/include/RTC/RtpStreamRecv.hpp +3 -1
- package/worker/include/RTC/SeqManager.hpp +0 -1
- package/worker/meson.build +7 -0
- package/worker/meson_options.txt +1 -0
- package/worker/src/RTC/PipeConsumer.cpp +15 -0
- package/worker/src/RTC/Producer.cpp +14 -1
- package/worker/src/RTC/Router.cpp +2 -0
- package/worker/src/RTC/RtcLogger.cpp +101 -0
- package/worker/src/RTC/RtpPacket.cpp +9 -0
- package/worker/src/RTC/RtpStreamRecv.cpp +14 -11
- package/worker/src/RTC/SeqManager.cpp +48 -65
- package/worker/src/RTC/SimpleConsumer.cpp +17 -0
- package/worker/src/RTC/SimulcastConsumer.cpp +34 -0
- package/worker/src/RTC/SvcConsumer.cpp +19 -0
- package/worker/src/RTC/Transport.cpp +7 -0
- package/worker/test/src/RTC/TestRtpStreamRecv.cpp +4 -3
- package/worker/test/src/RTC/TestSeqManager.cpp +80 -83
|
@@ -593,8 +593,14 @@ namespace RTC
|
|
|
593
593
|
{
|
|
594
594
|
MS_TRACE();
|
|
595
595
|
|
|
596
|
+
packet->logger.consumerId = this->id;
|
|
597
|
+
|
|
596
598
|
if (!IsActive())
|
|
599
|
+
{
|
|
600
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::CONSUMER_INACTIVE);
|
|
601
|
+
|
|
597
602
|
return;
|
|
603
|
+
}
|
|
598
604
|
|
|
599
605
|
// clang-format off
|
|
600
606
|
if (
|
|
@@ -603,6 +609,8 @@ namespace RTC
|
|
|
603
609
|
)
|
|
604
610
|
// clang-format on
|
|
605
611
|
{
|
|
612
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::INVALID_TARGET_LAYER);
|
|
613
|
+
|
|
606
614
|
return;
|
|
607
615
|
}
|
|
608
616
|
|
|
@@ -614,12 +622,18 @@ namespace RTC
|
|
|
614
622
|
{
|
|
615
623
|
MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType);
|
|
616
624
|
|
|
625
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE);
|
|
626
|
+
|
|
617
627
|
return;
|
|
618
628
|
}
|
|
619
629
|
|
|
620
630
|
// If we need to sync and this is not a key frame, ignore the packet.
|
|
621
631
|
if (this->syncRequired && !packet->IsKeyFrame())
|
|
632
|
+
{
|
|
633
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
|
|
634
|
+
|
|
622
635
|
return;
|
|
636
|
+
}
|
|
623
637
|
|
|
624
638
|
// Whether this is the first packet after re-sync.
|
|
625
639
|
const bool isSyncPacket = this->syncRequired;
|
|
@@ -646,6 +660,8 @@ namespace RTC
|
|
|
646
660
|
{
|
|
647
661
|
this->rtpSeqManager.Drop(packet->GetSequenceNumber());
|
|
648
662
|
|
|
663
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::DROPPED_BY_CODEC);
|
|
664
|
+
|
|
649
665
|
return;
|
|
650
666
|
}
|
|
651
667
|
|
|
@@ -673,6 +689,9 @@ namespace RTC
|
|
|
673
689
|
packet->SetSsrc(this->rtpParameters.encodings[0].ssrc);
|
|
674
690
|
packet->SetSequenceNumber(seq);
|
|
675
691
|
|
|
692
|
+
packet->logger.sendRtpTimestamp = packet->GetTimestamp();
|
|
693
|
+
packet->logger.sendSeqNumber = seq;
|
|
694
|
+
|
|
676
695
|
if (marker)
|
|
677
696
|
{
|
|
678
697
|
packet->SetMarker(true);
|
|
@@ -1692,6 +1692,8 @@ namespace RTC
|
|
|
1692
1692
|
{
|
|
1693
1693
|
MS_TRACE();
|
|
1694
1694
|
|
|
1695
|
+
packet->logger.recvTransportId = this->id;
|
|
1696
|
+
|
|
1695
1697
|
// Apply the Transport RTP header extension ids so the RTP listener can use them.
|
|
1696
1698
|
packet->SetMidExtensionId(this->recvRtpHeaderExtensionIds.mid);
|
|
1697
1699
|
packet->SetRidExtensionId(this->recvRtpHeaderExtensionIds.rid);
|
|
@@ -1712,6 +1714,8 @@ namespace RTC
|
|
|
1712
1714
|
|
|
1713
1715
|
if (!producer)
|
|
1714
1716
|
{
|
|
1717
|
+
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::PRODUCER_NOT_FOUND);
|
|
1718
|
+
|
|
1715
1719
|
MS_WARN_TAG(
|
|
1716
1720
|
rtp,
|
|
1717
1721
|
"no suitable Producer for received RTP packet [ssrc:%" PRIu32 ", payloadType:%" PRIu8 "]",
|
|
@@ -2663,6 +2667,9 @@ namespace RTC
|
|
|
2663
2667
|
{
|
|
2664
2668
|
MS_TRACE();
|
|
2665
2669
|
|
|
2670
|
+
packet->logger.sendTransportId = this->id;
|
|
2671
|
+
packet->logger.Sent();
|
|
2672
|
+
|
|
2666
2673
|
// Update abs-send-time if present.
|
|
2667
2674
|
packet->UpdateAbsSendTime(DepLibUV::GetTimeMs());
|
|
2668
2675
|
|
|
@@ -11,6 +11,7 @@ using namespace RTC;
|
|
|
11
11
|
// 17: 16 bit mask + the initial sequence number.
|
|
12
12
|
static constexpr size_t MaxRequestedPackets{ 17 };
|
|
13
13
|
static constexpr unsigned int SendNackDelay{ 0u }; // In ms.
|
|
14
|
+
static const bool UseRtpInactivityCheck{ false };
|
|
14
15
|
|
|
15
16
|
SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
|
|
16
17
|
{
|
|
@@ -141,7 +142,7 @@ SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
|
|
|
141
142
|
SECTION("NACK one packet")
|
|
142
143
|
{
|
|
143
144
|
RtpStreamRecvListener listener;
|
|
144
|
-
RtpStreamRecv rtpStream(&listener, params, SendNackDelay);
|
|
145
|
+
RtpStreamRecv rtpStream(&listener, params, SendNackDelay, UseRtpInactivityCheck);
|
|
145
146
|
|
|
146
147
|
packet->SetSequenceNumber(1);
|
|
147
148
|
rtpStream.ReceivePacket(packet);
|
|
@@ -170,7 +171,7 @@ SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
|
|
|
170
171
|
SECTION("wrapping sequence numbers")
|
|
171
172
|
{
|
|
172
173
|
RtpStreamRecvListener listener;
|
|
173
|
-
RtpStreamRecv rtpStream(&listener, params, SendNackDelay);
|
|
174
|
+
RtpStreamRecv rtpStream(&listener, params, SendNackDelay, UseRtpInactivityCheck);
|
|
174
175
|
|
|
175
176
|
packet->SetSequenceNumber(0xfffe);
|
|
176
177
|
rtpStream.ReceivePacket(packet);
|
|
@@ -190,7 +191,7 @@ SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
|
|
|
190
191
|
SECTION("require key frame")
|
|
191
192
|
{
|
|
192
193
|
RtpStreamRecvListener listener;
|
|
193
|
-
RtpStreamRecv rtpStream(&listener, params, SendNackDelay);
|
|
194
|
+
RtpStreamRecv rtpStream(&listener, params, SendNackDelay, UseRtpInactivityCheck);
|
|
194
195
|
|
|
195
196
|
packet->SetSequenceNumber(1);
|
|
196
197
|
rtpStream.ReceivePacket(packet);
|
|
@@ -11,9 +11,8 @@ constexpr uint16_t kMaxNumberFor15Bits = (1 << 15) - 1;
|
|
|
11
11
|
template<typename T>
|
|
12
12
|
struct TestSeqManagerInput
|
|
13
13
|
{
|
|
14
|
-
TestSeqManagerInput(
|
|
15
|
-
|
|
16
|
-
: input(input), output(output), sync(sync), drop(drop), offset(offset), maxInput(maxInput)
|
|
14
|
+
TestSeqManagerInput(T input, T output, bool sync = false, bool drop = false, int64_t maxInput = -1)
|
|
15
|
+
: input(input), output(output), sync(sync), drop(drop), maxInput(maxInput)
|
|
17
16
|
{
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -21,7 +20,6 @@ struct TestSeqManagerInput
|
|
|
21
20
|
T output{ 0 };
|
|
22
21
|
bool sync{ false };
|
|
23
22
|
bool drop{ false };
|
|
24
|
-
T offset{ 0 };
|
|
25
23
|
int64_t maxInput{ -1 };
|
|
26
24
|
};
|
|
27
25
|
|
|
@@ -31,10 +29,9 @@ void validate(SeqManager<T, N>& seqManager, std::vector<TestSeqManagerInput<T>>&
|
|
|
31
29
|
for (auto& element : inputs)
|
|
32
30
|
{
|
|
33
31
|
if (element.sync)
|
|
32
|
+
{
|
|
34
33
|
seqManager.Sync(element.input - 1);
|
|
35
|
-
|
|
36
|
-
if (element.offset)
|
|
37
|
-
seqManager.Offset(element.offset);
|
|
34
|
+
}
|
|
38
35
|
|
|
39
36
|
if (element.drop)
|
|
40
37
|
{
|
|
@@ -299,14 +296,14 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
299
296
|
// clang-format off
|
|
300
297
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
301
298
|
{
|
|
302
|
-
{ 0, 0, false, false
|
|
303
|
-
{ 1, 1, false, false
|
|
304
|
-
{ 2, 2, false, false
|
|
305
|
-
{ 80,
|
|
306
|
-
{ 81,
|
|
307
|
-
{ 82,
|
|
308
|
-
{ 83,
|
|
309
|
-
{ 84,
|
|
299
|
+
{ 0, 0, false, false },
|
|
300
|
+
{ 1, 1, false, false },
|
|
301
|
+
{ 2, 2, false, false },
|
|
302
|
+
{ 80, 3, true, false },
|
|
303
|
+
{ 81, 4, false, false },
|
|
304
|
+
{ 82, 5, false, false },
|
|
305
|
+
{ 83, 6, false, false },
|
|
306
|
+
{ 84, 7, false, false }
|
|
310
307
|
};
|
|
311
308
|
// clang-format on
|
|
312
309
|
|
|
@@ -553,16 +550,16 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
553
550
|
// clang-format off
|
|
554
551
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
555
552
|
{
|
|
556
|
-
{ 32762, 1, true, false,
|
|
557
|
-
{ 32763, 2, false, false,
|
|
558
|
-
{ 32764, 3, false, false,
|
|
559
|
-
{ 32765, 0, false, true,
|
|
560
|
-
{ 32766, 0, false, true,
|
|
561
|
-
{ 32767, 4, false, false,
|
|
562
|
-
{ 0, 5, false, false,
|
|
563
|
-
{ 1, 6, false, false,
|
|
564
|
-
{ 2, 7, false, false,
|
|
565
|
-
{ 3, 8, false, false,
|
|
553
|
+
{ 32762, 1, true, false, 32762 },
|
|
554
|
+
{ 32763, 2, false, false, 32763 },
|
|
555
|
+
{ 32764, 3, false, false, 32764 },
|
|
556
|
+
{ 32765, 0, false, true, 32765 },
|
|
557
|
+
{ 32766, 0, false, true, 32766 },
|
|
558
|
+
{ 32767, 4, false, false, 32767 },
|
|
559
|
+
{ 0, 5, false, false, 0 },
|
|
560
|
+
{ 1, 6, false, false, 1 },
|
|
561
|
+
{ 2, 7, false, false, 2 },
|
|
562
|
+
{ 3, 8, false, false, 3 }
|
|
566
563
|
};
|
|
567
564
|
// clang-format on
|
|
568
565
|
|
|
@@ -575,12 +572,12 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
575
572
|
// clang-format off
|
|
576
573
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
577
574
|
{
|
|
578
|
-
{ 0, 1, true, false, 0
|
|
575
|
+
{ 0, 1, true, false, 0 },
|
|
579
576
|
};
|
|
580
577
|
for (uint16_t j = 0; j < 3; ++j) {
|
|
581
578
|
for (uint16_t i = 1; i < std::numeric_limits<uint16_t>::max(); ++i) {
|
|
582
579
|
const uint16_t output = i + 1;
|
|
583
|
-
inputs.emplace_back( i, output, false, false,
|
|
580
|
+
inputs.emplace_back( i, output, false, false, i );
|
|
584
581
|
}
|
|
585
582
|
}
|
|
586
583
|
// clang-format on
|
|
@@ -594,12 +591,12 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
594
591
|
// clang-format off
|
|
595
592
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
596
593
|
{
|
|
597
|
-
{ 0, 1, true, false, 0,
|
|
594
|
+
{ 0, 1, true, false, 0, },
|
|
598
595
|
};
|
|
599
596
|
for (uint16_t j = 0; j < 3; ++j) {
|
|
600
597
|
for (uint16_t i = 1; i < kMaxNumberFor15Bits; ++i) {
|
|
601
598
|
const uint16_t output = i + 1;
|
|
602
|
-
inputs.emplace_back( i, output, false, false,
|
|
599
|
+
inputs.emplace_back( i, output, false, false, i );
|
|
603
600
|
}
|
|
604
601
|
}
|
|
605
602
|
// clang-format on
|
|
@@ -632,17 +629,17 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
632
629
|
// clang-format off
|
|
633
630
|
std::vector<TestSeqManagerInput<uint8_t>> inputs =
|
|
634
631
|
{
|
|
635
|
-
{ 1, 1, false, false
|
|
636
|
-
{ 2, 0, false, true
|
|
637
|
-
{ 3, 2, false, false
|
|
638
|
-
{ 4, 3, false, false
|
|
639
|
-
{ 5, 4, false, false
|
|
640
|
-
{ 6, 5, false, false
|
|
641
|
-
{ 7, 6, false, false
|
|
642
|
-
{ 0, 7, false, false
|
|
643
|
-
{ 1, 0, false, false
|
|
644
|
-
{ 2, 1, false, false
|
|
645
|
-
{ 3, 2, false, false
|
|
632
|
+
{ 1, 1, false, false },
|
|
633
|
+
{ 2, 0, false, true }, // Drop.
|
|
634
|
+
{ 3, 2, false, false },
|
|
635
|
+
{ 4, 3, false, false },
|
|
636
|
+
{ 5, 4, false, false },
|
|
637
|
+
{ 6, 5, false, false },
|
|
638
|
+
{ 7, 6, false, false },
|
|
639
|
+
{ 0, 7, false, false },
|
|
640
|
+
{ 1, 0, false, false },
|
|
641
|
+
{ 2, 1, false, false },
|
|
642
|
+
{ 3, 2, false, false }
|
|
646
643
|
};
|
|
647
644
|
// clang-format on
|
|
648
645
|
|
|
@@ -655,33 +652,33 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
655
652
|
// clang-format off
|
|
656
653
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
657
654
|
{
|
|
658
|
-
{ 36964, 36964, false, false
|
|
659
|
-
{ 25923, 0, false, true
|
|
660
|
-
{ 25701, 25701, false, false
|
|
661
|
-
{ 17170, 0, false, true
|
|
662
|
-
{ 25923, 25923, false, false
|
|
663
|
-
{ 4728, 0, false, true
|
|
664
|
-
{ 17170, 17170, false, false
|
|
665
|
-
{ 30738, 0, false, true
|
|
666
|
-
{ 4728, 4728, false, false
|
|
667
|
-
{ 4806, 0, false, true
|
|
668
|
-
{ 30738, 30738, false, false
|
|
669
|
-
{ 50886, 0, false, true
|
|
670
|
-
{ 4806, 4805, false, false
|
|
671
|
-
{ 50774, 0, false, true
|
|
672
|
-
{ 50886,
|
|
673
|
-
{ 22136, 0, false, true
|
|
674
|
-
{ 50774,
|
|
675
|
-
{ 30910, 0, false, true
|
|
676
|
-
{ 22136,
|
|
677
|
-
{ 48862, 0, false, true
|
|
678
|
-
{ 30910, 30909, false, false
|
|
679
|
-
{ 56832, 0, false, true
|
|
680
|
-
{ 48862, 48861, false, false
|
|
681
|
-
{ 2, 0, false, true
|
|
682
|
-
{ 56832,
|
|
683
|
-
{ 530, 0, false, true
|
|
684
|
-
{ 2,
|
|
655
|
+
{ 36964, 36964, false, false },
|
|
656
|
+
{ 25923, 0, false, true }, // Drop.
|
|
657
|
+
{ 25701, 25701, false, false },
|
|
658
|
+
{ 17170, 0, false, true }, // Drop.
|
|
659
|
+
{ 25923, 25923, false, false },
|
|
660
|
+
{ 4728, 0, false, true }, // Drop.
|
|
661
|
+
{ 17170, 17170, false, false },
|
|
662
|
+
{ 30738, 0, false, true }, // Drop.
|
|
663
|
+
{ 4728, 4728, false, false },
|
|
664
|
+
{ 4806, 0, false, true }, // Drop.
|
|
665
|
+
{ 30738, 30738, false, false },
|
|
666
|
+
{ 50886, 0, false, true }, // Drop.
|
|
667
|
+
{ 4806, 4805, false, false }, // Previously dropped.
|
|
668
|
+
{ 50774, 0, false, true }, // Drop.
|
|
669
|
+
{ 50886, 4805, false, false }, // Previously dropped.
|
|
670
|
+
{ 22136, 0, false, true }, // Drop.
|
|
671
|
+
{ 50774, 50773, false, false },
|
|
672
|
+
{ 30910, 0, false, true }, // Drop.
|
|
673
|
+
{ 22136, 50773, false, false }, // Previously dropped.
|
|
674
|
+
{ 48862, 0, false, true }, // Drop.
|
|
675
|
+
{ 30910, 30909, false, false },
|
|
676
|
+
{ 56832, 0, false, true }, // Drop.
|
|
677
|
+
{ 48862, 48861, false, false },
|
|
678
|
+
{ 2, 0, false, true }, // Drop.
|
|
679
|
+
{ 56832, 48861, false, false }, // Previously dropped.
|
|
680
|
+
{ 530, 0, false, true }, // Drop.
|
|
681
|
+
{ 2, 48861, false, false }, // Previously dropped.
|
|
685
682
|
};
|
|
686
683
|
// clang-format on
|
|
687
684
|
|
|
@@ -694,13 +691,13 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
694
691
|
// clang-format off
|
|
695
692
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
696
693
|
{
|
|
697
|
-
{ 36960, 36960, false, false
|
|
698
|
-
{ 3328, 0, false, true
|
|
699
|
-
{ 24589, 24588, false, false
|
|
700
|
-
{ 120, 0, false, true
|
|
701
|
-
{ 3328,
|
|
702
|
-
{ 30848, 0, false, true
|
|
703
|
-
{ 120,
|
|
694
|
+
{ 36960, 36960, false, false },
|
|
695
|
+
{ 3328, 0, false, true }, // Drop.
|
|
696
|
+
{ 24589, 24588, false, false },
|
|
697
|
+
{ 120, 0, false, true }, // Drop.
|
|
698
|
+
{ 3328, 24588, false, false }, // Previously dropped.
|
|
699
|
+
{ 30848, 0, false, true }, // Drop.
|
|
700
|
+
{ 120, 120, false, false },
|
|
704
701
|
};
|
|
705
702
|
// clang-format on
|
|
706
703
|
|
|
@@ -713,15 +710,15 @@ SCENARIO("SeqManager", "[rtc][SeqMananger]")
|
|
|
713
710
|
// clang-format off
|
|
714
711
|
std::vector<TestSeqManagerInput<uint16_t>> inputs =
|
|
715
712
|
{
|
|
716
|
-
{ 36964, 36964, false, false
|
|
717
|
-
{ 65396 , 0, false, true
|
|
718
|
-
{ 25855, 25854, false, false
|
|
719
|
-
{ 29793 , 0, false, true
|
|
720
|
-
{ 65396,
|
|
721
|
-
{ 25087, 0, false, true
|
|
722
|
-
{ 29793,
|
|
723
|
-
{ 65535 , 0, false, true
|
|
724
|
-
{ 25087,
|
|
713
|
+
{ 36964, 36964, false, false },
|
|
714
|
+
{ 65396 , 0, false, true }, // Drop.
|
|
715
|
+
{ 25855, 25854, false, false },
|
|
716
|
+
{ 29793 , 0, false, true }, // Drop.
|
|
717
|
+
{ 65396, 25854, false, false }, // Previously dropped.
|
|
718
|
+
{ 25087, 0, false, true }, // Drop.
|
|
719
|
+
{ 29793, 25854, false, false }, // Previously dropped.
|
|
720
|
+
{ 65535 , 0, false, true }, // Drop.
|
|
721
|
+
{ 25087, 25086, false, false },
|
|
725
722
|
};
|
|
726
723
|
// clang-format on
|
|
727
724
|
|