mediasoup 3.19.21 → 3.19.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.d.ts +1 -0
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +14 -0
- package/package.json +4 -2
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +9 -3
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +9 -1
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +39 -0
- package/worker/include/Channel/ChannelMessageRegistratorInterface.hpp +32 -0
- package/worker/include/Channel/ChannelSocket.hpp +1 -1
- package/worker/include/DepUsrSCTP.hpp +8 -7
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +7 -7
- package/worker/include/RTC/AudioLevelObserver.hpp +7 -7
- package/worker/include/RTC/Consumer.hpp +3 -3
- package/worker/include/RTC/DataConsumer.hpp +3 -3
- package/worker/include/RTC/DataProducer.hpp +3 -3
- package/worker/include/RTC/DirectTransport.hpp +2 -2
- package/worker/include/RTC/DtlsTransport.hpp +8 -6
- package/worker/include/RTC/ICE/IceServer.hpp +8 -5
- package/worker/include/RTC/KeyFrameRequestManager.hpp +15 -12
- package/worker/include/RTC/NackGenerator.hpp +7 -6
- package/worker/include/RTC/PipeConsumer.hpp +1 -2
- package/worker/include/RTC/PipeTransport.hpp +2 -2
- package/worker/include/RTC/PlainTransport.hpp +2 -2
- package/worker/include/RTC/Producer.hpp +3 -3
- package/worker/include/RTC/RTP/RtpStream.hpp +7 -1
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +6 -5
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -1
- package/worker/include/RTC/Router.hpp +3 -3
- package/worker/include/RTC/RtpObserver.hpp +3 -3
- package/worker/include/RTC/SCTP/TODO_SCTP.md +18 -6
- package/worker/include/RTC/SCTP/association/Association.hpp +11 -8
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +9 -6
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +37 -23
- package/worker/include/RTC/SCTP/association/TCBContext.hpp +3 -2
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +81 -8
- package/worker/include/RTC/SCTP/packet/UserData.hpp +36 -0
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +2 -1
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +604 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +336 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +5 -4
- package/worker/include/RTC/Serializable.hpp +8 -0
- package/worker/include/RTC/SimpleConsumer.hpp +1 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +1 -2
- package/worker/include/RTC/SvcConsumer.hpp +1 -2
- package/worker/include/RTC/Transport.hpp +8 -8
- package/worker/include/RTC/TransportCongestionControlClient.hpp +8 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +8 -5
- package/worker/include/RTC/WebRtcServer.hpp +3 -3
- package/worker/include/RTC/WebRtcTransport.hpp +3 -3
- package/worker/include/Shared.hpp +40 -0
- package/worker/include/SharedInterface.hpp +44 -0
- package/worker/include/Utils.hpp +6 -0
- package/worker/include/Worker.hpp +3 -3
- package/worker/include/common.hpp +1 -1
- package/worker/include/handles/BackoffTimerHandle.hpp +27 -65
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +116 -0
- package/worker/include/handles/TimerHandle.hpp +36 -20
- package/worker/include/handles/TimerHandleInterface.hpp +43 -0
- package/worker/meson.build +21 -4
- package/worker/meson_options.txt +2 -1
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +45 -0
- package/worker/mocks/include/MockShared.hpp +43 -0
- package/worker/mocks/src/Channel/MockChannelMessageRegistrator.cpp +128 -0
- package/worker/mocks/src/MockShared.cpp +26 -0
- package/worker/scripts/clang-scripts.mjs +4 -1
- package/worker/src/Channel/ChannelMessageRegistrator.cpp +125 -0
- package/worker/src/Channel/ChannelSocket.cpp +1 -1
- package/worker/src/DepUsrSCTP.cpp +10 -4
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +7 -7
- package/worker/src/RTC/AudioLevelObserver.cpp +12 -10
- package/worker/src/RTC/Consumer.cpp +23 -20
- package/worker/src/RTC/DataConsumer.cpp +11 -11
- package/worker/src/RTC/DataProducer.cpp +3 -3
- package/worker/src/RTC/DirectTransport.cpp +16 -16
- package/worker/src/RTC/DtlsTransport.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +4 -3
- package/worker/src/RTC/KeyFrameRequestManager.cpp +15 -15
- package/worker/src/RTC/NackGenerator.cpp +3 -3
- package/worker/src/RTC/PipeConsumer.cpp +5 -4
- package/worker/src/RTC/PipeTransport.cpp +3 -3
- package/worker/src/RTC/PlainTransport.cpp +10 -9
- package/worker/src/RTC/Producer.cpp +30 -28
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +1 -2
- package/worker/src/RTC/RTP/RtpStream.cpp +9 -2
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +5 -4
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +5 -2
- package/worker/src/RTC/Router.cpp +3 -3
- package/worker/src/RTC/RtpObserver.cpp +2 -1
- package/worker/src/RTC/SCTP/association/Association.cpp +94 -114
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +27 -21
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +52 -55
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +144 -25
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +905 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +799 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +1 -1
- package/worker/src/RTC/SctpAssociation.cpp +1 -1
- package/worker/src/RTC/SimpleConsumer.cpp +8 -7
- package/worker/src/RTC/SimulcastConsumer.cpp +11 -10
- package/worker/src/RTC/SvcConsumer.cpp +11 -10
- package/worker/src/RTC/Transport.cpp +36 -26
- package/worker/src/RTC/TransportCongestionControlClient.cpp +4 -2
- package/worker/src/RTC/TransportCongestionControlServer.cpp +4 -3
- package/worker/src/RTC/WebRtcServer.cpp +5 -4
- package/worker/src/RTC/WebRtcTransport.cpp +39 -26
- package/worker/src/Shared.cpp +35 -0
- package/worker/src/Worker.cpp +10 -23
- package/worker/src/handles/BackoffTimerHandle.cpp +11 -16
- package/worker/src/handles/TimerHandle.cpp +5 -4
- package/worker/src/lib.cpp +14 -1
- package/worker/tasks.py +1 -1
- package/worker/test/include/RTC/ICE/iceCommon.hpp +1 -0
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +1 -0
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +6 -0
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +12 -5
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +34 -23
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +1196 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +33 -33
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +14 -6
- package/worker/test/src/RTC/TestNackGenerator.cpp +6 -2
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +6 -10
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +9 -2
- package/worker/test/src/Utils/TestByte.cpp +98 -0
- package/worker/include/ChannelMessageRegistrator.hpp +0 -30
- package/worker/include/RTC/Shared.hpp +0 -23
- package/worker/src/ChannelMessageRegistrator.cpp +0 -119
- package/worker/src/RTC/Shared.cpp +0 -23
|
@@ -11,7 +11,7 @@ namespace RTC
|
|
|
11
11
|
/* Instance methods. */
|
|
12
12
|
|
|
13
13
|
Consumer::Consumer(
|
|
14
|
-
|
|
14
|
+
SharedInterface* shared,
|
|
15
15
|
const std::string& id,
|
|
16
16
|
const std::string& producerId,
|
|
17
17
|
Listener* listener,
|
|
@@ -445,7 +445,8 @@ namespace RTC
|
|
|
445
445
|
UserOnPaused();
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
this->shared->
|
|
448
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
449
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_PAUSE);
|
|
449
450
|
}
|
|
450
451
|
|
|
451
452
|
void Consumer::ProducerResumed()
|
|
@@ -466,7 +467,8 @@ namespace RTC
|
|
|
466
467
|
UserOnResumed();
|
|
467
468
|
}
|
|
468
469
|
|
|
469
|
-
this->shared->
|
|
470
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
471
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_RESUME);
|
|
470
472
|
}
|
|
471
473
|
|
|
472
474
|
void Consumer::ProducerRtpStreamScores(const std::vector<uint8_t>* scores)
|
|
@@ -487,7 +489,8 @@ namespace RTC
|
|
|
487
489
|
|
|
488
490
|
MS_DEBUG_DEV("Producer closed [consumerId:%s]", this->id.c_str());
|
|
489
491
|
|
|
490
|
-
this->shared->
|
|
492
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
493
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_CLOSE);
|
|
491
494
|
|
|
492
495
|
this->listener->OnConsumerProducerClosed(this);
|
|
493
496
|
}
|
|
@@ -498,12 +501,12 @@ namespace RTC
|
|
|
498
501
|
|
|
499
502
|
if (this->traceEventTypes.keyframe && packet->IsKeyFrame())
|
|
500
503
|
{
|
|
501
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
502
|
-
auto traceInfo
|
|
503
|
-
this->shared->
|
|
504
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
505
|
+
auto traceInfo = FBS::Consumer::CreateKeyFrameTraceInfo(
|
|
506
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
504
507
|
|
|
505
508
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
506
|
-
this->shared->
|
|
509
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
507
510
|
FBS::Consumer::TraceEventType::KEYFRAME,
|
|
508
511
|
DepLibUV::GetTimeMs(),
|
|
509
512
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
@@ -514,12 +517,12 @@ namespace RTC
|
|
|
514
517
|
}
|
|
515
518
|
else if (this->traceEventTypes.rtp)
|
|
516
519
|
{
|
|
517
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
518
|
-
auto traceInfo
|
|
519
|
-
this->shared->
|
|
520
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
521
|
+
auto traceInfo = FBS::Consumer::CreateRtpTraceInfo(
|
|
522
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
520
523
|
|
|
521
524
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
522
|
-
this->shared->
|
|
525
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
523
526
|
FBS::Consumer::TraceEventType::RTP,
|
|
524
527
|
DepLibUV::GetTimeMs(),
|
|
525
528
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
@@ -539,11 +542,11 @@ namespace RTC
|
|
|
539
542
|
return;
|
|
540
543
|
}
|
|
541
544
|
|
|
542
|
-
auto traceInfo =
|
|
543
|
-
|
|
545
|
+
auto traceInfo = FBS::Consumer::CreatePliTraceInfo(
|
|
546
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
544
547
|
|
|
545
548
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
546
|
-
this->shared->
|
|
549
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
547
550
|
FBS::Consumer::TraceEventType::PLI,
|
|
548
551
|
DepLibUV::GetTimeMs(),
|
|
549
552
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
@@ -562,11 +565,11 @@ namespace RTC
|
|
|
562
565
|
return;
|
|
563
566
|
}
|
|
564
567
|
|
|
565
|
-
auto traceInfo =
|
|
566
|
-
|
|
568
|
+
auto traceInfo = FBS::Consumer::CreateFirTraceInfo(
|
|
569
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
567
570
|
|
|
568
571
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
569
|
-
this->shared->
|
|
572
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
570
573
|
FBS::Consumer::TraceEventType::FIR,
|
|
571
574
|
DepLibUV::GetTimeMs(),
|
|
572
575
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
@@ -586,7 +589,7 @@ namespace RTC
|
|
|
586
589
|
}
|
|
587
590
|
|
|
588
591
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
589
|
-
this->shared->
|
|
592
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
590
593
|
FBS::Consumer::TraceEventType::NACK,
|
|
591
594
|
DepLibUV::GetTimeMs(),
|
|
592
595
|
FBS::Common::TraceDirection::DIRECTION_IN);
|
|
@@ -598,7 +601,7 @@ namespace RTC
|
|
|
598
601
|
{
|
|
599
602
|
MS_TRACE();
|
|
600
603
|
|
|
601
|
-
this->shared->
|
|
604
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
602
605
|
this->id,
|
|
603
606
|
FBS::Notification::Event::CONSUMER_TRACE,
|
|
604
607
|
FBS::Notification::Body::Consumer_TraceNotification,
|
|
@@ -11,7 +11,7 @@ namespace RTC
|
|
|
11
11
|
/* Instance methods. */
|
|
12
12
|
|
|
13
13
|
DataConsumer::DataConsumer(
|
|
14
|
-
|
|
14
|
+
SharedInterface* shared,
|
|
15
15
|
const std::string& id,
|
|
16
16
|
const std::string& dataProducerId,
|
|
17
17
|
RTC::DataConsumer::Listener* listener,
|
|
@@ -75,7 +75,7 @@ namespace RTC
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// NOTE: This may throw.
|
|
78
|
-
this->shared->
|
|
78
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
79
79
|
this->id,
|
|
80
80
|
/*channelRequestHandler*/ this,
|
|
81
81
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -85,7 +85,7 @@ namespace RTC
|
|
|
85
85
|
{
|
|
86
86
|
MS_TRACE();
|
|
87
87
|
|
|
88
|
-
this->shared->
|
|
88
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
flatbuffers::Offset<FBS::DataConsumer::DumpResponse> DataConsumer::FillBuffer(
|
|
@@ -245,9 +245,9 @@ namespace RTC
|
|
|
245
245
|
{
|
|
246
246
|
// Notify the Node DataConsumer.
|
|
247
247
|
auto bufferedAmountLowOffset = FBS::DataConsumer::CreateBufferedAmountLowNotification(
|
|
248
|
-
this->shared->
|
|
248
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), this->bufferedAmount);
|
|
249
249
|
|
|
250
|
-
this->shared->
|
|
250
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
251
251
|
this->id,
|
|
252
252
|
FBS::Notification::Event::DATACONSUMER_BUFFERED_AMOUNT_LOW,
|
|
253
253
|
FBS::Notification::Body::DataConsumer_BufferedAmountLowNotification,
|
|
@@ -417,7 +417,7 @@ namespace RTC
|
|
|
417
417
|
|
|
418
418
|
MS_DEBUG_DEV("DataProducer paused [dataConsumerId:%s]", this->id.c_str());
|
|
419
419
|
|
|
420
|
-
this->shared->
|
|
420
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
421
421
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_PAUSE);
|
|
422
422
|
}
|
|
423
423
|
|
|
@@ -434,7 +434,7 @@ namespace RTC
|
|
|
434
434
|
|
|
435
435
|
MS_DEBUG_DEV("DataProducer resumed [dataConsumerId:%s]", this->id.c_str());
|
|
436
436
|
|
|
437
|
-
this->shared->
|
|
437
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
438
438
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_RESUME);
|
|
439
439
|
}
|
|
440
440
|
|
|
@@ -473,9 +473,9 @@ namespace RTC
|
|
|
473
473
|
|
|
474
474
|
// Notify the Node DataConsumer.
|
|
475
475
|
auto bufferedAmountLowOffset = FBS::DataConsumer::CreateBufferedAmountLowNotification(
|
|
476
|
-
this->shared->
|
|
476
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), this->bufferedAmount);
|
|
477
477
|
|
|
478
|
-
this->shared->
|
|
478
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
479
479
|
this->id,
|
|
480
480
|
FBS::Notification::Event::DATACONSUMER_BUFFERED_AMOUNT_LOW,
|
|
481
481
|
FBS::Notification::Body::DataConsumer_BufferedAmountLowNotification,
|
|
@@ -487,7 +487,7 @@ namespace RTC
|
|
|
487
487
|
{
|
|
488
488
|
MS_TRACE();
|
|
489
489
|
|
|
490
|
-
this->shared->
|
|
490
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
491
491
|
this->id, FBS::Notification::Event::DATACONSUMER_SCTP_SENDBUFFER_FULL);
|
|
492
492
|
}
|
|
493
493
|
|
|
@@ -501,7 +501,7 @@ namespace RTC
|
|
|
501
501
|
|
|
502
502
|
MS_DEBUG_DEV("DataProducer closed [dataConsumerId:%s]", this->id.c_str());
|
|
503
503
|
|
|
504
|
-
this->shared->
|
|
504
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
505
505
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_CLOSE);
|
|
506
506
|
|
|
507
507
|
this->listener->OnDataConsumerDataProducerClosed(this);
|
|
@@ -12,7 +12,7 @@ namespace RTC
|
|
|
12
12
|
/* Instance methods. */
|
|
13
13
|
|
|
14
14
|
DataProducer::DataProducer(
|
|
15
|
-
|
|
15
|
+
SharedInterface* shared,
|
|
16
16
|
const std::string& id,
|
|
17
17
|
size_t maxMessageSize,
|
|
18
18
|
RTC::DataProducer::Listener* listener,
|
|
@@ -63,7 +63,7 @@ namespace RTC
|
|
|
63
63
|
this->paused = data->paused();
|
|
64
64
|
|
|
65
65
|
// NOTE: This may throw.
|
|
66
|
-
this->shared->
|
|
66
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
67
67
|
this->id,
|
|
68
68
|
/*channelRequestHandler*/ this,
|
|
69
69
|
/*channelNotificationHandler*/ this);
|
|
@@ -73,7 +73,7 @@ namespace RTC
|
|
|
73
73
|
{
|
|
74
74
|
MS_TRACE();
|
|
75
75
|
|
|
76
|
-
this->shared->
|
|
76
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
flatbuffers::Offset<FBS::DataProducer::DumpResponse> DataProducer::FillBuffer(
|
|
@@ -11,7 +11,7 @@ namespace RTC
|
|
|
11
11
|
|
|
12
12
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
|
13
13
|
DirectTransport::DirectTransport(
|
|
14
|
-
|
|
14
|
+
SharedInterface* shared,
|
|
15
15
|
const std::string& id,
|
|
16
16
|
RTC::Transport::Listener* listener,
|
|
17
17
|
const FBS::DirectTransport::DirectTransportOptions* options)
|
|
@@ -20,7 +20,7 @@ namespace RTC
|
|
|
20
20
|
MS_TRACE();
|
|
21
21
|
|
|
22
22
|
// NOTE: This may throw.
|
|
23
|
-
this->shared->
|
|
23
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
24
24
|
this->id,
|
|
25
25
|
/*channelRequestHandler*/ this,
|
|
26
26
|
/*channelNotificationHandler*/ this);
|
|
@@ -34,7 +34,7 @@ namespace RTC
|
|
|
34
34
|
// the class instance.
|
|
35
35
|
Destroying();
|
|
36
36
|
|
|
37
|
-
this->shared->
|
|
37
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
flatbuffers::Offset<FBS::DirectTransport::DumpResponse> DirectTransport::FillBuffer(
|
|
@@ -156,13 +156,13 @@ namespace RTC
|
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
const auto data = this->shared->
|
|
159
|
+
const auto data = this->shared->GetChannelNotifier()->GetBufferBuilder().CreateVector(
|
|
160
160
|
packet->GetBuffer(), packet->GetLength());
|
|
161
161
|
|
|
162
|
-
auto notification =
|
|
163
|
-
|
|
162
|
+
auto notification = FBS::Consumer::CreateRtpNotification(
|
|
163
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), data);
|
|
164
164
|
|
|
165
|
-
this->shared->
|
|
165
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
166
166
|
consumer->id,
|
|
167
167
|
FBS::Notification::Event::CONSUMER_RTP,
|
|
168
168
|
FBS::Notification::Body::Consumer_RtpNotification,
|
|
@@ -183,13 +183,13 @@ namespace RTC
|
|
|
183
183
|
MS_TRACE();
|
|
184
184
|
|
|
185
185
|
// Notify the Node DirectTransport.
|
|
186
|
-
const auto data = this->shared->
|
|
186
|
+
const auto data = this->shared->GetChannelNotifier()->GetBufferBuilder().CreateVector(
|
|
187
187
|
packet->GetData(), packet->GetSize());
|
|
188
188
|
|
|
189
189
|
auto notification = FBS::DirectTransport::CreateRtcpNotification(
|
|
190
|
-
this->shared->
|
|
190
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), data);
|
|
191
191
|
|
|
192
|
-
this->shared->
|
|
192
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
193
193
|
this->id,
|
|
194
194
|
FBS::Notification::Event::DIRECTTRANSPORT_RTCP,
|
|
195
195
|
FBS::Notification::Body::DirectTransport_RtcpNotification,
|
|
@@ -205,13 +205,13 @@ namespace RTC
|
|
|
205
205
|
|
|
206
206
|
packet->Serialize(RTC::RTCP::SerializationBuffer);
|
|
207
207
|
|
|
208
|
-
const auto data = this->shared->
|
|
208
|
+
const auto data = this->shared->GetChannelNotifier()->GetBufferBuilder().CreateVector(
|
|
209
209
|
packet->GetData(), packet->GetSize());
|
|
210
210
|
|
|
211
211
|
auto notification = FBS::DirectTransport::CreateRtcpNotification(
|
|
212
|
-
this->shared->
|
|
212
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), data);
|
|
213
213
|
|
|
214
|
-
this->shared->
|
|
214
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
215
215
|
this->id,
|
|
216
216
|
FBS::Notification::Event::DIRECTTRANSPORT_RTCP,
|
|
217
217
|
FBS::Notification::Body::DirectTransport_RtcpNotification,
|
|
@@ -224,12 +224,12 @@ namespace RTC
|
|
|
224
224
|
MS_TRACE();
|
|
225
225
|
|
|
226
226
|
// Notify the Node DirectTransport.
|
|
227
|
-
auto data = this->shared->
|
|
227
|
+
auto data = this->shared->GetChannelNotifier()->GetBufferBuilder().CreateVector(msg, len);
|
|
228
228
|
|
|
229
229
|
auto notification = FBS::DataConsumer::CreateMessageNotification(
|
|
230
|
-
this->shared->
|
|
230
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ppid, data);
|
|
231
231
|
|
|
232
|
-
this->shared->
|
|
232
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
233
233
|
dataConsumer->id,
|
|
234
234
|
FBS::Notification::Event::DATACONSUMER_MESSAGE,
|
|
235
235
|
FBS::Notification::Body::DataConsumer_MessageNotification,
|
|
@@ -709,8 +709,8 @@ namespace RTC
|
|
|
709
709
|
|
|
710
710
|
/* Instance methods. */
|
|
711
711
|
|
|
712
|
-
DtlsTransport::DtlsTransport(Listener* listener)
|
|
713
|
-
: listener(listener), ssl(SSL_new(DtlsTransport::sslCtx))
|
|
712
|
+
DtlsTransport::DtlsTransport(Listener* listener, SharedInterface* shared)
|
|
713
|
+
: listener(listener), shared(shared), ssl(SSL_new(DtlsTransport::sslCtx))
|
|
714
714
|
{
|
|
715
715
|
MS_TRACE();
|
|
716
716
|
|
|
@@ -764,7 +764,7 @@ namespace RTC
|
|
|
764
764
|
DTLS_set_timer_cb(this->ssl, onSslDtlsTimer);
|
|
765
765
|
|
|
766
766
|
// Set the DTLS timer.
|
|
767
|
-
this->timer =
|
|
767
|
+
this->timer = this->shared->CreateTimer(this);
|
|
768
768
|
|
|
769
769
|
return;
|
|
770
770
|
|
|
@@ -1699,7 +1699,7 @@ namespace RTC
|
|
|
1699
1699
|
}
|
|
1700
1700
|
|
|
1701
1701
|
// NOLINTNEXTLINE(misc-no-recursion)
|
|
1702
|
-
void DtlsTransport::OnTimer(
|
|
1702
|
+
void DtlsTransport::OnTimer(TimerHandleInterface* /*timer*/)
|
|
1703
1703
|
{
|
|
1704
1704
|
MS_TRACE();
|
|
1705
1705
|
|
|
@@ -72,10 +72,11 @@ namespace RTC
|
|
|
72
72
|
|
|
73
73
|
IceServer::IceServer(
|
|
74
74
|
Listener* listener,
|
|
75
|
+
SharedInterface* shared,
|
|
75
76
|
const std::string& usernameFragment,
|
|
76
77
|
const std::string& password,
|
|
77
78
|
uint8_t consentTimeoutSec)
|
|
78
|
-
: listener(listener), usernameFragment(usernameFragment), password(password)
|
|
79
|
+
: listener(listener), shared(shared), usernameFragment(usernameFragment), password(password)
|
|
79
80
|
{
|
|
80
81
|
MS_TRACE();
|
|
81
82
|
|
|
@@ -935,7 +936,7 @@ namespace RTC
|
|
|
935
936
|
// Create the ICE consent check timer if it doesn't exist.
|
|
936
937
|
if (!this->consentCheckTimer)
|
|
937
938
|
{
|
|
938
|
-
this->consentCheckTimer =
|
|
939
|
+
this->consentCheckTimer = this->shared->CreateTimer(this);
|
|
939
940
|
}
|
|
940
941
|
|
|
941
942
|
this->consentCheckTimer->Start(this->consentTimeoutMs);
|
|
@@ -962,7 +963,7 @@ namespace RTC
|
|
|
962
963
|
this->consentCheckTimer->Stop();
|
|
963
964
|
}
|
|
964
965
|
|
|
965
|
-
inline void IceServer::OnTimer(
|
|
966
|
+
inline void IceServer::OnTimer(TimerHandleInterface* timer)
|
|
966
967
|
{
|
|
967
968
|
MS_TRACE();
|
|
968
969
|
|
|
@@ -8,8 +8,9 @@ static constexpr uint32_t KeyFrameRetransmissionWaitTime{ 1000u };
|
|
|
8
8
|
|
|
9
9
|
/* PendingKeyFrameInfo methods. */
|
|
10
10
|
|
|
11
|
-
RTC::PendingKeyFrameInfo::PendingKeyFrameInfo(
|
|
12
|
-
|
|
11
|
+
RTC::PendingKeyFrameInfo::PendingKeyFrameInfo(
|
|
12
|
+
PendingKeyFrameInfo::Listener* listener, SharedInterface* shared, uint32_t ssrc)
|
|
13
|
+
: listener(listener), ssrc(ssrc), timer(shared->CreateTimer(this))
|
|
13
14
|
{
|
|
14
15
|
MS_TRACE();
|
|
15
16
|
|
|
@@ -24,7 +25,7 @@ RTC::PendingKeyFrameInfo::~PendingKeyFrameInfo()
|
|
|
24
25
|
delete this->timer;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
void RTC::PendingKeyFrameInfo::OnTimer(TimerHandleInterface* timer)
|
|
28
29
|
{
|
|
29
30
|
MS_TRACE();
|
|
30
31
|
|
|
@@ -37,8 +38,8 @@ inline void RTC::PendingKeyFrameInfo::OnTimer(TimerHandle* timer)
|
|
|
37
38
|
/* KeyFrameRequestDelayer methods. */
|
|
38
39
|
|
|
39
40
|
RTC::KeyFrameRequestDelayer::KeyFrameRequestDelayer(
|
|
40
|
-
KeyFrameRequestDelayer::Listener* listener, uint32_t ssrc, uint32_t delay)
|
|
41
|
-
: listener(listener), ssrc(ssrc), timer(
|
|
41
|
+
KeyFrameRequestDelayer::Listener* listener, SharedInterface* shared, uint32_t ssrc, uint32_t delay)
|
|
42
|
+
: listener(listener), ssrc(ssrc), timer(shared->CreateTimer(this))
|
|
42
43
|
{
|
|
43
44
|
MS_TRACE();
|
|
44
45
|
|
|
@@ -53,7 +54,7 @@ RTC::KeyFrameRequestDelayer::~KeyFrameRequestDelayer()
|
|
|
53
54
|
delete this->timer;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
void RTC::KeyFrameRequestDelayer::OnTimer(TimerHandleInterface* timer)
|
|
57
58
|
{
|
|
58
59
|
MS_TRACE();
|
|
59
60
|
|
|
@@ -66,8 +67,8 @@ inline void RTC::KeyFrameRequestDelayer::OnTimer(TimerHandle* timer)
|
|
|
66
67
|
/* KeyFrameRequestManager methods. */
|
|
67
68
|
|
|
68
69
|
RTC::KeyFrameRequestManager::KeyFrameRequestManager(
|
|
69
|
-
KeyFrameRequestManager::Listener* listener, uint32_t keyFrameRequestDelay)
|
|
70
|
-
: listener(listener), keyFrameRequestDelay(keyFrameRequestDelay)
|
|
70
|
+
KeyFrameRequestManager::Listener* listener, SharedInterface* shared, uint32_t keyFrameRequestDelay)
|
|
71
|
+
: listener(listener), shared(shared), keyFrameRequestDelay(keyFrameRequestDelay)
|
|
71
72
|
{
|
|
72
73
|
MS_TRACE();
|
|
73
74
|
}
|
|
@@ -118,7 +119,7 @@ void RTC::KeyFrameRequestManager::KeyFrameNeeded(uint32_t ssrc)
|
|
|
118
119
|
MS_DEBUG_DEV("creating a delayer for the given ssrc");
|
|
119
120
|
|
|
120
121
|
this->mapSsrcKeyFrameRequestDelayer[ssrc] =
|
|
121
|
-
new KeyFrameRequestDelayer(this, ssrc, this->keyFrameRequestDelay);
|
|
122
|
+
new KeyFrameRequestDelayer(this, this->shared, ssrc, this->keyFrameRequestDelay);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -135,7 +136,7 @@ void RTC::KeyFrameRequestManager::KeyFrameNeeded(uint32_t ssrc)
|
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
this->mapSsrcPendingKeyFrameInfo[ssrc] = new PendingKeyFrameInfo(this, ssrc);
|
|
139
|
+
this->mapSsrcPendingKeyFrameInfo[ssrc] = new PendingKeyFrameInfo(this, this->shared, ssrc);
|
|
139
140
|
|
|
140
141
|
this->listener->OnKeyFrameNeeded(this, ssrc);
|
|
141
142
|
}
|
|
@@ -158,7 +159,7 @@ void RTC::KeyFrameRequestManager::ForceKeyFrameNeeded(uint32_t ssrc)
|
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
this->mapSsrcKeyFrameRequestDelayer[ssrc] =
|
|
161
|
-
new KeyFrameRequestDelayer(this, ssrc, this->keyFrameRequestDelay);
|
|
162
|
+
new KeyFrameRequestDelayer(this, this->shared, ssrc, this->keyFrameRequestDelay);
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
auto it = this->mapSsrcPendingKeyFrameInfo.find(ssrc);
|
|
@@ -173,7 +174,7 @@ void RTC::KeyFrameRequestManager::ForceKeyFrameNeeded(uint32_t ssrc)
|
|
|
173
174
|
}
|
|
174
175
|
else
|
|
175
176
|
{
|
|
176
|
-
this->mapSsrcPendingKeyFrameInfo[ssrc] = new PendingKeyFrameInfo(this, ssrc);
|
|
177
|
+
this->mapSsrcPendingKeyFrameInfo[ssrc] = new PendingKeyFrameInfo(this, this->shared, ssrc);
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
this->listener->OnKeyFrameNeeded(this, ssrc);
|
|
@@ -198,7 +199,7 @@ void RTC::KeyFrameRequestManager::KeyFrameReceived(uint32_t ssrc)
|
|
|
198
199
|
this->mapSsrcPendingKeyFrameInfo.erase(it);
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
|
|
202
|
+
void RTC::KeyFrameRequestManager::OnKeyFrameRequestTimeout(PendingKeyFrameInfo* pendingKeyFrameInfo)
|
|
202
203
|
{
|
|
203
204
|
MS_TRACE();
|
|
204
205
|
|
|
@@ -225,8 +226,7 @@ inline void RTC::KeyFrameRequestManager::OnKeyFrameRequestTimeout(PendingKeyFram
|
|
|
225
226
|
this->listener->OnKeyFrameNeeded(this, pendingKeyFrameInfo->GetSsrc());
|
|
226
227
|
}
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
KeyFrameRequestDelayer* keyFrameRequestDelayer)
|
|
229
|
+
void RTC::KeyFrameRequestManager::OnKeyFrameDelayTimeout(KeyFrameRequestDelayer* keyFrameRequestDelayer)
|
|
230
230
|
{
|
|
231
231
|
MS_TRACE();
|
|
232
232
|
|
|
@@ -17,10 +17,10 @@ namespace RTC
|
|
|
17
17
|
|
|
18
18
|
/* Instance methods. */
|
|
19
19
|
|
|
20
|
-
NackGenerator::NackGenerator(Listener* listener, unsigned int sendNackDelayMs)
|
|
20
|
+
NackGenerator::NackGenerator(Listener* listener, SharedInterface* shared, unsigned int sendNackDelayMs)
|
|
21
21
|
: listener(listener),
|
|
22
22
|
sendNackDelayMs(sendNackDelayMs),
|
|
23
|
-
timer(
|
|
23
|
+
timer(shared->CreateTimer(this)),
|
|
24
24
|
rtt(DefaultRtt)
|
|
25
25
|
{
|
|
26
26
|
MS_TRACE();
|
|
@@ -365,7 +365,7 @@ namespace RTC
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
inline void NackGenerator::OnTimer(
|
|
368
|
+
inline void NackGenerator::OnTimer(TimerHandleInterface* /*timer*/)
|
|
369
369
|
{
|
|
370
370
|
MS_TRACE();
|
|
371
371
|
|
|
@@ -58,7 +58,7 @@ namespace RTC
|
|
|
58
58
|
/* Instance methods. */
|
|
59
59
|
|
|
60
60
|
PipeConsumer::PipeConsumer(
|
|
61
|
-
|
|
61
|
+
SharedInterface* shared,
|
|
62
62
|
const std::string& id,
|
|
63
63
|
const std::string& producerId,
|
|
64
64
|
RTC::Consumer::Listener* listener,
|
|
@@ -82,7 +82,7 @@ namespace RTC
|
|
|
82
82
|
CreateRtpStreams();
|
|
83
83
|
|
|
84
84
|
// NOTE: This may throw.
|
|
85
|
-
this->shared->
|
|
85
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
86
86
|
this->id,
|
|
87
87
|
/*channelRequestHandler*/ this,
|
|
88
88
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -92,7 +92,7 @@ namespace RTC
|
|
|
92
92
|
{
|
|
93
93
|
MS_TRACE();
|
|
94
94
|
|
|
95
|
-
this->shared->
|
|
95
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
96
96
|
|
|
97
97
|
for (auto* rtpStream : this->rtpStreams)
|
|
98
98
|
{
|
|
@@ -803,7 +803,8 @@ namespace RTC
|
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
|
|
806
|
-
auto* rtpStream =
|
|
806
|
+
auto* rtpStream =
|
|
807
|
+
new RTC::RTP::RtpStreamSend(this, this->shared, params, this->rtpParameters.mid);
|
|
807
808
|
|
|
808
809
|
// If the Consumer is paused, tell the RtpStreamSend.
|
|
809
810
|
if (IsPaused() || IsProducerPaused())
|
|
@@ -24,7 +24,7 @@ namespace RTC
|
|
|
24
24
|
|
|
25
25
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
|
26
26
|
PipeTransport::PipeTransport(
|
|
27
|
-
|
|
27
|
+
SharedInterface* shared,
|
|
28
28
|
const std::string& id,
|
|
29
29
|
RTC::Transport::Listener* listener,
|
|
30
30
|
const FBS::PipeTransport::PipeTransportOptions* options)
|
|
@@ -122,7 +122,7 @@ namespace RTC
|
|
|
122
122
|
udpSocket->GetRecvBufferSize());
|
|
123
123
|
|
|
124
124
|
// NOTE: This may throw.
|
|
125
|
-
this->shared->
|
|
125
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
126
126
|
this->id,
|
|
127
127
|
/*channelRequestHandler*/ this,
|
|
128
128
|
/*channelNotificationHandler*/ this);
|
|
@@ -146,7 +146,7 @@ namespace RTC
|
|
|
146
146
|
// the class instance.
|
|
147
147
|
Destroying();
|
|
148
148
|
|
|
149
|
-
this->shared->
|
|
149
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
150
150
|
|
|
151
151
|
delete this->udpSocket;
|
|
152
152
|
this->udpSocket = nullptr;
|
|
@@ -32,7 +32,7 @@ namespace RTC
|
|
|
32
32
|
/* Instance methods. */
|
|
33
33
|
|
|
34
34
|
PlainTransport::PlainTransport(
|
|
35
|
-
|
|
35
|
+
SharedInterface* shared,
|
|
36
36
|
const std::string& id,
|
|
37
37
|
RTC::Transport::Listener* listener,
|
|
38
38
|
const FBS::PlainTransport::PlainTransportOptions* options)
|
|
@@ -243,7 +243,7 @@ namespace RTC
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
// NOTE: This may throw.
|
|
246
|
-
this->shared->
|
|
246
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
247
247
|
this->id,
|
|
248
248
|
/*channelRequestHandler*/ this,
|
|
249
249
|
/*channelNotificationHandler*/ this);
|
|
@@ -268,7 +268,7 @@ namespace RTC
|
|
|
268
268
|
// the class instance.
|
|
269
269
|
Destroying();
|
|
270
270
|
|
|
271
|
-
this->shared->
|
|
271
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
272
272
|
|
|
273
273
|
delete this->udpSocket;
|
|
274
274
|
this->udpSocket = nullptr;
|
|
@@ -1231,11 +1231,11 @@ namespace RTC
|
|
|
1231
1231
|
|
|
1232
1232
|
inline void PlainTransport::EmitTuple() const
|
|
1233
1233
|
{
|
|
1234
|
-
auto tuple
|
|
1234
|
+
auto tuple = this->tuple->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1235
1235
|
auto notification = FBS::PlainTransport::CreateTupleNotification(
|
|
1236
|
-
this->shared->
|
|
1236
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), tuple);
|
|
1237
1237
|
|
|
1238
|
-
this->shared->
|
|
1238
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1239
1239
|
this->id,
|
|
1240
1240
|
FBS::Notification::Event::PLAINTRANSPORT_TUPLE,
|
|
1241
1241
|
FBS::Notification::Body::PlainTransport_TupleNotification,
|
|
@@ -1244,11 +1244,12 @@ namespace RTC
|
|
|
1244
1244
|
|
|
1245
1245
|
inline void PlainTransport::EmitRtcpTuple() const
|
|
1246
1246
|
{
|
|
1247
|
-
auto rtcpTuple =
|
|
1247
|
+
auto rtcpTuple =
|
|
1248
|
+
this->rtcpTuple->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1248
1249
|
auto notification = FBS::PlainTransport::CreateRtcpTupleNotification(
|
|
1249
|
-
this->shared->
|
|
1250
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtcpTuple);
|
|
1250
1251
|
|
|
1251
|
-
this->shared->
|
|
1252
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1252
1253
|
this->id,
|
|
1253
1254
|
FBS::Notification::Event::PLAINTRANSPORT_RTCP_TUPLE,
|
|
1254
1255
|
FBS::Notification::Body::PlainTransport_RtcpTupleNotification,
|