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
package/node/lib/Worker.d.ts
CHANGED
|
@@ -30,5 +30,6 @@ export declare class WorkerImpl<WorkerAppData extends AppData = AppData> extends
|
|
|
30
30
|
createRouter<RouterAppData extends AppData = AppData>({ mediaCodecs, appData, }?: RouterOptions<RouterAppData>): Promise<Router<RouterAppData>>;
|
|
31
31
|
private workerDied;
|
|
32
32
|
private handleListenerError;
|
|
33
|
+
private onSignal;
|
|
33
34
|
}
|
|
34
35
|
//# sourceMappingURL=Worker.d.ts.map
|
package/node/lib/Worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EACX,MAAM,EACN,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,cAAc,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvC,eAAO,MAAM,gBAAgB,EAAE,MAA8B,CAAC;AAE9D,qBAAa,UAAU,CAAC,aAAa,SAAS,OAAO,GAAG,OAAO,CAC9D,SAAQ,oBAAoB,CAAC,YAAY,CACzC,YAAW,MAAM;;gBAiCL,EACX,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,OAAO,GACP,EAAE,cAAc,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EACX,MAAM,EACN,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,cAAc,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvC,eAAO,MAAM,gBAAgB,EAAE,MAA8B,CAAC;AAE9D,qBAAa,UAAU,CAAC,aAAa,SAAS,OAAO,GAAG,OAAO,CAC9D,SAAQ,oBAAoB,CAAC,YAAY,CACzC,YAAW,MAAM;;gBAiCL,EACX,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,OAAO,GACP,EAAE,cAAc,CAAC,aAAa,CAAC;IA6NhC,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED,IAAI,OAAO,IAAI,aAAa,CAE3B;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,aAAa,EAEjC;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED;;OAEG;IACH,IAAI,uBAAuB,IAAI,GAAG,CAAC,YAAY,CAAC,CAE/C;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,GAAG,CAAC,MAAM,CAAC,CAEnC;IAED,KAAK,IAAI,IAAI;IAkCP,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAc3B,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAkChD,cAAc,CAAC,EACpB,QAAQ,EACR,OAAO,GACP,GAAE,wBAAwB,CAAC,aAAa,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzD,kBAAkB,CAAC,mBAAmB,SAAS,OAAO,GAAG,OAAO,EAAE,EACvE,WAAW,EACX,OAAO,GACP,EAAE,mBAAmB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CACpD,YAAY,CAAC,mBAAmB,CAAC,CACjC;IA0DK,YAAY,CAAC,aAAa,SAAS,OAAO,GAAG,OAAO,EAAE,EAC3D,WAAW,EACX,OAAO,GACP,GAAE,aAAa,CAAC,aAAa,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAgDrE,OAAO,CAAC,UAAU;IAmClB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,QAAQ,CAMd;CACF"}
|
package/node/lib/Worker.js
CHANGED
|
@@ -192,6 +192,13 @@ class WorkerImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
+
// NOTE: Avoid "Possible EventEmitter memory leak detected" Node warning.
|
|
196
|
+
const processListenerCount = process.getMaxListeners();
|
|
197
|
+
if (processListenerCount >= 10) {
|
|
198
|
+
process.setMaxListeners(processListenerCount + 2);
|
|
199
|
+
}
|
|
200
|
+
process.once('SIGINT', this.onSignal);
|
|
201
|
+
process.once('SIGTERM', this.onSignal);
|
|
195
202
|
this.handleListenerError();
|
|
196
203
|
}
|
|
197
204
|
get pid() {
|
|
@@ -233,6 +240,8 @@ class WorkerImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
233
240
|
}
|
|
234
241
|
logger.debug('close()');
|
|
235
242
|
this.#closed = true;
|
|
243
|
+
process.removeListener('SIGINT', this.onSignal);
|
|
244
|
+
process.removeListener('SIGTERM', this.onSignal);
|
|
236
245
|
// Close every Router.
|
|
237
246
|
for (const router of this.#routers) {
|
|
238
247
|
router.workerClosed();
|
|
@@ -376,6 +385,11 @@ class WorkerImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
376
385
|
logger.error(`event listener threw an error [eventName:${eventName}]:`, error);
|
|
377
386
|
});
|
|
378
387
|
}
|
|
388
|
+
// NOTE: Arrow method on purpose.
|
|
389
|
+
onSignal = (signal) => {
|
|
390
|
+
logger.debug(`signal received, closing the worker process [pid:${this.#pid}, signal:${signal}]`);
|
|
391
|
+
this.close();
|
|
392
|
+
};
|
|
379
393
|
}
|
|
380
394
|
exports.WorkerImpl = WorkerImpl;
|
|
381
395
|
function parseWorkerDumpResponse(binary) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mediasoup",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.22",
|
|
4
4
|
"description": "Cutting Edge WebRTC Video Conferencing",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"worker/fuzzer/include",
|
|
49
49
|
"worker/fuzzer/src",
|
|
50
50
|
"worker/include",
|
|
51
|
+
"worker/mocks/include",
|
|
52
|
+
"worker/mocks/src",
|
|
51
53
|
"worker/src",
|
|
52
54
|
"worker/scripts/*.json",
|
|
53
55
|
"worker/scripts/*.mjs",
|
|
@@ -125,7 +127,7 @@
|
|
|
125
127
|
"prettier": "^3.8.3",
|
|
126
128
|
"ts-jest": "^29.4.9",
|
|
127
129
|
"typescript": "^5.9.3",
|
|
128
|
-
"typescript-eslint": "^8.59.
|
|
130
|
+
"typescript-eslint": "^8.59.1",
|
|
129
131
|
"werift-sctp": "^0.0.11"
|
|
130
132
|
}
|
|
131
133
|
}
|
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
#include "RTC/FuzzerDtlsTransport.hpp"
|
|
5
5
|
#include "Logger.hpp"
|
|
6
6
|
#include "Utils.hpp"
|
|
7
|
+
#include "mocks/include/MockShared.hpp"
|
|
7
8
|
|
|
8
9
|
namespace
|
|
9
10
|
{
|
|
10
|
-
//
|
|
11
|
+
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
12
|
+
thread_local mocks::MockShared shared;
|
|
13
|
+
|
|
11
14
|
// DtlsTransport instance. It's reset every time DTLS handshake fails or DTLS
|
|
12
15
|
// is closed.
|
|
16
|
+
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
13
17
|
thread_local RTC::DtlsTransport* dtlsTransportSingleton{ nullptr };
|
|
18
|
+
|
|
14
19
|
// DtlsTransport Listener instance. It's reset every time the DtlsTransport
|
|
15
20
|
// singletonDTLS is reset.
|
|
21
|
+
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
16
22
|
thread_local FuzzerRtcDtlsTransport::DtlsTransportListener* dtlsTransportListenerSingleton{ nullptr };
|
|
17
|
-
// NOLINTEND(readability-identifier-naming)
|
|
18
23
|
} // namespace
|
|
19
24
|
|
|
20
25
|
void FuzzerRtcDtlsTransport::Fuzz(const uint8_t* data, size_t len)
|
|
@@ -31,7 +36,8 @@ void FuzzerRtcDtlsTransport::Fuzz(const uint8_t* data, size_t len)
|
|
|
31
36
|
delete dtlsTransportListenerSingleton;
|
|
32
37
|
dtlsTransportListenerSingleton = new DtlsTransportListener();
|
|
33
38
|
|
|
34
|
-
dtlsTransportSingleton =
|
|
39
|
+
dtlsTransportSingleton =
|
|
40
|
+
new RTC::DtlsTransport(dtlsTransportListenerSingleton, std::addressof(shared));
|
|
35
41
|
|
|
36
42
|
RTC::DtlsTransport::Role localRole;
|
|
37
43
|
RTC::DtlsTransport::Fingerprint dtlsRemoteFingerprint;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
#include "RTC/RTP/FuzzerRtpStreamSend.hpp"
|
|
2
2
|
#include "Utils.hpp"
|
|
3
|
+
#include "mocks/include/MockShared.hpp"
|
|
3
4
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
4
5
|
|
|
6
|
+
namespace
|
|
7
|
+
{
|
|
8
|
+
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
9
|
+
thread_local mocks::MockShared shared;
|
|
10
|
+
} // namespace
|
|
11
|
+
|
|
5
12
|
void FuzzerRtcRtpStreamSend::Fuzz(const uint8_t* data, size_t len)
|
|
6
13
|
{
|
|
7
14
|
// clang-format off
|
|
@@ -30,7 +37,8 @@ void FuzzerRtcRtpStreamSend::Fuzz(const uint8_t* data, size_t len)
|
|
|
30
37
|
packet->SetSsrc(params.ssrc);
|
|
31
38
|
|
|
32
39
|
std::string mid;
|
|
33
|
-
auto* stream = new RTC::RTP::RtpStreamSend(
|
|
40
|
+
auto* stream = new RTC::RTP::RtpStreamSend(
|
|
41
|
+
std::addressof(testRtpStreamListener), std::addressof(shared), params, mid);
|
|
34
42
|
size_t offset{ 0u };
|
|
35
43
|
|
|
36
44
|
while (len >= 4u)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#ifndef MS_CHANNEL_MESSAGE_REGISTRATOR_HPP
|
|
2
|
+
#define MS_CHANNEL_MESSAGE_REGISTRATOR_HPP
|
|
3
|
+
|
|
4
|
+
#include "Channel/ChannelMessageRegistratorInterface.hpp"
|
|
5
|
+
#include "Channel/ChannelSocket.hpp"
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <unordered_map>
|
|
8
|
+
|
|
9
|
+
namespace Channel
|
|
10
|
+
{
|
|
11
|
+
class ChannelMessageRegistrator : public Channel::ChannelMessageRegistratorInterface
|
|
12
|
+
{
|
|
13
|
+
public:
|
|
14
|
+
explicit ChannelMessageRegistrator();
|
|
15
|
+
|
|
16
|
+
~ChannelMessageRegistrator() override;
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
flatbuffers::Offset<FBS::Worker::ChannelMessageHandlers> FillBuffer(
|
|
20
|
+
flatbuffers::FlatBufferBuilder& builder) override;
|
|
21
|
+
|
|
22
|
+
void RegisterHandler(
|
|
23
|
+
const std::string& id,
|
|
24
|
+
ChannelSocket::RequestHandler* channelRequestHandler,
|
|
25
|
+
ChannelSocket::NotificationHandler* channelNotificationHandler) override;
|
|
26
|
+
|
|
27
|
+
void UnregisterHandler(const std::string& id) override;
|
|
28
|
+
|
|
29
|
+
ChannelSocket::RequestHandler* GetChannelRequestHandler(const std::string& id) override;
|
|
30
|
+
|
|
31
|
+
ChannelSocket::NotificationHandler* GetChannelNotificationHandler(const std::string& id) override;
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
std::unordered_map<std::string, ChannelSocket::RequestHandler*> mapChannelRequestHandlers;
|
|
35
|
+
std::unordered_map<std::string, ChannelSocket::NotificationHandler*> mapChannelNotificationHandlers;
|
|
36
|
+
};
|
|
37
|
+
} // namespace Channel
|
|
38
|
+
|
|
39
|
+
#endif
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#ifndef MS_CHANNEL_MESSAGE_REGISTRATOR_INTERFACE_HPP
|
|
2
|
+
#define MS_CHANNEL_MESSAGE_REGISTRATOR_INTERFACE_HPP
|
|
3
|
+
|
|
4
|
+
// TODO: We should have a ChannelSocketInterface class instead.
|
|
5
|
+
#include "Channel/ChannelSocket.hpp"
|
|
6
|
+
#include <string>
|
|
7
|
+
|
|
8
|
+
namespace Channel
|
|
9
|
+
{
|
|
10
|
+
class ChannelMessageRegistratorInterface
|
|
11
|
+
{
|
|
12
|
+
public:
|
|
13
|
+
virtual ~ChannelMessageRegistratorInterface() = default;
|
|
14
|
+
|
|
15
|
+
public:
|
|
16
|
+
virtual flatbuffers::Offset<FBS::Worker::ChannelMessageHandlers> FillBuffer(
|
|
17
|
+
flatbuffers::FlatBufferBuilder& builder) = 0;
|
|
18
|
+
|
|
19
|
+
virtual void RegisterHandler(
|
|
20
|
+
const std::string& id,
|
|
21
|
+
ChannelSocket::RequestHandler* channelRequestHandler,
|
|
22
|
+
ChannelSocket::NotificationHandler* channelNotificationHandler) = 0;
|
|
23
|
+
|
|
24
|
+
virtual void UnregisterHandler(const std::string& id) = 0;
|
|
25
|
+
|
|
26
|
+
virtual ChannelSocket::RequestHandler* GetChannelRequestHandler(const std::string& id) = 0;
|
|
27
|
+
|
|
28
|
+
virtual ChannelSocket::NotificationHandler* GetChannelNotificationHandler(const std::string& id) = 0;
|
|
29
|
+
};
|
|
30
|
+
} // namespace Channel
|
|
31
|
+
|
|
32
|
+
#endif
|
|
@@ -2,36 +2,37 @@
|
|
|
2
2
|
#define MS_DEP_USRSCTP_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "RTC/SctpAssociation.hpp"
|
|
6
|
-
#include "handles/
|
|
7
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
7
8
|
#include <absl/container/flat_hash_map.h>
|
|
8
9
|
|
|
9
10
|
class DepUsrSCTP
|
|
10
11
|
{
|
|
11
12
|
private:
|
|
12
|
-
class Checker : public
|
|
13
|
+
class Checker : public TimerHandleInterface::Listener
|
|
13
14
|
{
|
|
14
15
|
public:
|
|
15
|
-
Checker();
|
|
16
|
+
Checker(SharedInterface* shared);
|
|
16
17
|
~Checker() override;
|
|
17
18
|
|
|
18
19
|
public:
|
|
19
20
|
void Start();
|
|
20
21
|
void Stop();
|
|
21
22
|
|
|
22
|
-
/* Pure virtual methods inherited from
|
|
23
|
+
/* Pure virtual methods inherited from TimerHandleInterface::Listener. */
|
|
23
24
|
public:
|
|
24
|
-
void OnTimer(
|
|
25
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
25
26
|
|
|
26
27
|
private:
|
|
27
|
-
|
|
28
|
+
TimerHandleInterface* timer{ nullptr };
|
|
28
29
|
uint64_t lastCalledAtMs{ 0u };
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
public:
|
|
32
33
|
static void ClassInit();
|
|
33
34
|
static void ClassDestroy();
|
|
34
|
-
static void CreateChecker();
|
|
35
|
+
static void CreateChecker(SharedInterface* shared);
|
|
35
36
|
static void CloseChecker();
|
|
36
37
|
static uintptr_t GetNextSctpAssociationId();
|
|
37
38
|
static void RegisterSctpAssociation(RTC::SctpAssociation* sctpAssociation);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#ifndef MS_RTC_ACTIVE_SPEAKER_OBSERVER_HPP
|
|
2
2
|
#define MS_RTC_ACTIVE_SPEAKER_OBSERVER_HPP
|
|
3
3
|
|
|
4
|
+
#include "SharedInterface.hpp"
|
|
4
5
|
#include "RTC/RtpObserver.hpp"
|
|
5
|
-
#include "
|
|
6
|
-
#include "handles/TimerHandle.hpp"
|
|
6
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
7
7
|
#include <absl/container/flat_hash_map.h>
|
|
8
8
|
#include <vector>
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// https://github.com/jitsi/jitsi-utils/blob/master/src/main/java/org/jitsi/utils/dsi/DominantSpeakerIdentification.java
|
|
15
15
|
namespace RTC
|
|
16
16
|
{
|
|
17
|
-
class ActiveSpeakerObserver : public RTC::RtpObserver, public
|
|
17
|
+
class ActiveSpeakerObserver : public RTC::RtpObserver, public TimerHandleInterface::Listener
|
|
18
18
|
{
|
|
19
19
|
private:
|
|
20
20
|
class Speaker
|
|
@@ -69,7 +69,7 @@ namespace RTC
|
|
|
69
69
|
|
|
70
70
|
public:
|
|
71
71
|
ActiveSpeakerObserver(
|
|
72
|
-
|
|
72
|
+
SharedInterface* shared,
|
|
73
73
|
const std::string& id,
|
|
74
74
|
RTC::RtpObserver::Listener* listener,
|
|
75
75
|
const FBS::ActiveSpeakerObserver::ActiveSpeakerObserverOptions* options);
|
|
@@ -89,14 +89,14 @@ namespace RTC
|
|
|
89
89
|
bool CalculateActiveSpeaker();
|
|
90
90
|
void TimeoutIdleLevels(uint64_t now);
|
|
91
91
|
|
|
92
|
-
/* Pure virtual methods inherited from
|
|
92
|
+
/* Pure virtual methods inherited from TimerHandleInterface. */
|
|
93
93
|
protected:
|
|
94
|
-
void OnTimer(
|
|
94
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
95
95
|
|
|
96
96
|
private:
|
|
97
97
|
double relativeSpeachActivities[RelativeSpeachActivitiesLen]{};
|
|
98
98
|
std::string dominantId;
|
|
99
|
-
|
|
99
|
+
TimerHandleInterface* periodicTimer{ nullptr };
|
|
100
100
|
uint16_t interval{ 300u };
|
|
101
101
|
// Map of ProducerSpeakers indexed by Producer id.
|
|
102
102
|
absl::flat_hash_map<std::string, ProducerSpeaker*> mapProducerSpeakers;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#ifndef MS_RTC_AUDIO_LEVEL_OBSERVER_HPP
|
|
2
2
|
#define MS_RTC_AUDIO_LEVEL_OBSERVER_HPP
|
|
3
3
|
|
|
4
|
+
#include "SharedInterface.hpp"
|
|
4
5
|
#include "RTC/RtpObserver.hpp"
|
|
5
|
-
#include "
|
|
6
|
-
#include "handles/TimerHandle.hpp"
|
|
6
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
7
7
|
#include <absl/container/flat_hash_map.h>
|
|
8
8
|
|
|
9
9
|
namespace RTC
|
|
10
10
|
{
|
|
11
|
-
class AudioLevelObserver : public RTC::RtpObserver, public
|
|
11
|
+
class AudioLevelObserver : public RTC::RtpObserver, public TimerHandleInterface::Listener
|
|
12
12
|
{
|
|
13
13
|
private:
|
|
14
14
|
struct DBovs
|
|
@@ -19,7 +19,7 @@ namespace RTC
|
|
|
19
19
|
|
|
20
20
|
public:
|
|
21
21
|
AudioLevelObserver(
|
|
22
|
-
|
|
22
|
+
SharedInterface* shared,
|
|
23
23
|
const std::string& id,
|
|
24
24
|
RTC::RtpObserver::Listener* listener,
|
|
25
25
|
const FBS::AudioLevelObserver::AudioLevelObserverOptions* options);
|
|
@@ -38,9 +38,9 @@ namespace RTC
|
|
|
38
38
|
void Update();
|
|
39
39
|
void ResetMapProducerDBovs();
|
|
40
40
|
|
|
41
|
-
/* Pure virtual methods inherited from
|
|
41
|
+
/* Pure virtual methods inherited from TimerHandleInterface. */
|
|
42
42
|
protected:
|
|
43
|
-
void OnTimer(
|
|
43
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
44
44
|
|
|
45
45
|
private:
|
|
46
46
|
// Passed by argument.
|
|
@@ -48,7 +48,7 @@ namespace RTC
|
|
|
48
48
|
int8_t threshold{ -80 };
|
|
49
49
|
uint16_t interval{ 1000u };
|
|
50
50
|
// Allocated by this.
|
|
51
|
-
|
|
51
|
+
TimerHandleInterface* periodicTimer{ nullptr };
|
|
52
52
|
// Others.
|
|
53
53
|
absl::flat_hash_map<RTC::Producer*, DBovs> mapProducerDBovs;
|
|
54
54
|
bool silence{ true };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#define MS_RTC_CONSUMER_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "Channel/ChannelRequest.hpp"
|
|
6
7
|
#include "Channel/ChannelSocket.hpp"
|
|
7
8
|
#include "FBS/consumer.h"
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
#include "RTC/RTP/RtpStreamSend.hpp"
|
|
17
18
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
18
19
|
#include "RTC/RtpDictionaries.hpp"
|
|
19
|
-
#include "RTC/Shared.hpp"
|
|
20
20
|
#include <absl/container/flat_hash_set.h>
|
|
21
21
|
#include <string>
|
|
22
22
|
#include <vector>
|
|
@@ -52,7 +52,7 @@ namespace RTC
|
|
|
52
52
|
|
|
53
53
|
public:
|
|
54
54
|
Consumer(
|
|
55
|
-
|
|
55
|
+
SharedInterface* shared,
|
|
56
56
|
const std::string& id,
|
|
57
57
|
const std::string& producerId,
|
|
58
58
|
RTC::Consumer::Listener* listener,
|
|
@@ -177,7 +177,7 @@ namespace RTC
|
|
|
177
177
|
|
|
178
178
|
protected:
|
|
179
179
|
// Passed by argument.
|
|
180
|
-
|
|
180
|
+
SharedInterface* shared{ nullptr };
|
|
181
181
|
RTC::Consumer::Listener* listener{ nullptr };
|
|
182
182
|
RTC::Media::Kind kind;
|
|
183
183
|
RTC::RtpParameters rtpParameters;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
#define MS_RTC_DATA_CONSUMER_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "Channel/ChannelRequest.hpp"
|
|
6
7
|
#include "Channel/ChannelSocket.hpp"
|
|
7
8
|
#include "RTC/SctpDictionaries.hpp"
|
|
8
|
-
#include "RTC/Shared.hpp"
|
|
9
9
|
#include <absl/container/flat_hash_set.h>
|
|
10
10
|
#include <string>
|
|
11
11
|
|
|
@@ -43,7 +43,7 @@ namespace RTC
|
|
|
43
43
|
|
|
44
44
|
public:
|
|
45
45
|
DataConsumer(
|
|
46
|
-
|
|
46
|
+
SharedInterface* shared,
|
|
47
47
|
const std::string& id,
|
|
48
48
|
const std::string& dataProducerId,
|
|
49
49
|
RTC::DataConsumer::Listener* listener,
|
|
@@ -114,7 +114,7 @@ namespace RTC
|
|
|
114
114
|
|
|
115
115
|
private:
|
|
116
116
|
// Passed by argument.
|
|
117
|
-
|
|
117
|
+
SharedInterface* shared{ nullptr };
|
|
118
118
|
RTC::DataConsumer::Listener* listener{ nullptr };
|
|
119
119
|
size_t maxMessageSize{ 0u };
|
|
120
120
|
// Others.
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
#define MS_RTC_DATA_PRODUCER_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "Channel/ChannelRequest.hpp"
|
|
6
7
|
#include "Channel/ChannelSocket.hpp"
|
|
7
8
|
#include "RTC/SctpDictionaries.hpp"
|
|
8
|
-
#include "RTC/Shared.hpp"
|
|
9
9
|
#include <string>
|
|
10
10
|
#include <vector>
|
|
11
11
|
|
|
@@ -42,7 +42,7 @@ namespace RTC
|
|
|
42
42
|
|
|
43
43
|
public:
|
|
44
44
|
DataProducer(
|
|
45
|
-
|
|
45
|
+
SharedInterface* shared,
|
|
46
46
|
const std::string& id,
|
|
47
47
|
size_t maxMessageSize,
|
|
48
48
|
RTC::DataProducer::Listener* listener,
|
|
@@ -87,7 +87,7 @@ namespace RTC
|
|
|
87
87
|
|
|
88
88
|
private:
|
|
89
89
|
// Passed by argument.
|
|
90
|
-
|
|
90
|
+
SharedInterface* shared{ nullptr };
|
|
91
91
|
size_t maxMessageSize{ 0u };
|
|
92
92
|
RTC::DataProducer::Listener* listener{ nullptr };
|
|
93
93
|
// Others.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#ifndef MS_RTC_DIRECT_TRANSPORT_HPP
|
|
2
2
|
#define MS_RTC_DIRECT_TRANSPORT_HPP
|
|
3
3
|
|
|
4
|
-
#include "
|
|
4
|
+
#include "SharedInterface.hpp"
|
|
5
5
|
#include "RTC/Transport.hpp"
|
|
6
6
|
|
|
7
7
|
namespace RTC
|
|
@@ -10,7 +10,7 @@ namespace RTC
|
|
|
10
10
|
{
|
|
11
11
|
public:
|
|
12
12
|
DirectTransport(
|
|
13
|
-
|
|
13
|
+
SharedInterface* shared,
|
|
14
14
|
const std::string& id,
|
|
15
15
|
RTC::Transport::Listener* listener,
|
|
16
16
|
const FBS::DirectTransport::DirectTransportOptions* options);
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
#define MS_RTC_DTLS_TRANSPORT_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "FBS/webRtcTransport.h"
|
|
6
7
|
#include "RTC/SrtpSession.hpp"
|
|
7
|
-
#include "handles/
|
|
8
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
8
9
|
#include <openssl/bio.h>
|
|
9
10
|
#include <openssl/ssl.h>
|
|
10
11
|
#include <openssl/x509.h>
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
|
|
15
16
|
namespace RTC
|
|
16
17
|
{
|
|
17
|
-
class DtlsTransport : public
|
|
18
|
+
class DtlsTransport : public TimerHandleInterface::Listener
|
|
18
19
|
{
|
|
19
20
|
public:
|
|
20
21
|
enum class DtlsState : uint8_t
|
|
@@ -135,7 +136,7 @@ namespace RTC
|
|
|
135
136
|
static const std::vector<SrtpCryptoSuiteMapEntry> SrtpCryptoSuites;
|
|
136
137
|
|
|
137
138
|
public:
|
|
138
|
-
explicit DtlsTransport(Listener* listener);
|
|
139
|
+
explicit DtlsTransport(Listener* listener, SharedInterface* shared);
|
|
139
140
|
~DtlsTransport() override;
|
|
140
141
|
|
|
141
142
|
public:
|
|
@@ -195,18 +196,19 @@ namespace RTC
|
|
|
195
196
|
public:
|
|
196
197
|
void OnSslInfo(int where, int ret);
|
|
197
198
|
|
|
198
|
-
/* Pure virtual methods inherited from
|
|
199
|
+
/* Pure virtual methods inherited from TimerHandleInterface::Listener. */
|
|
199
200
|
public:
|
|
200
|
-
void OnTimer(
|
|
201
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
201
202
|
|
|
202
203
|
private:
|
|
203
204
|
// Passed by argument.
|
|
204
205
|
Listener* listener{ nullptr };
|
|
206
|
+
SharedInterface* shared{ nullptr };
|
|
205
207
|
// Allocated by this.
|
|
206
208
|
SSL* ssl{ nullptr };
|
|
207
209
|
BIO* sslBioFromNetwork{ nullptr }; // The BIO from which ssl reads.
|
|
208
210
|
BIO* sslBioToNetwork{ nullptr }; // The BIO in which ssl writes.
|
|
209
|
-
|
|
211
|
+
TimerHandleInterface* timer{ nullptr };
|
|
210
212
|
// Others.
|
|
211
213
|
DtlsState state{ DtlsState::NEW };
|
|
212
214
|
std::optional<Role> localRole;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
#define MS_RTC_ICE_ICE_SERVER_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "SharedInterface.hpp"
|
|
5
6
|
#include "FBS/webRtcTransport.h"
|
|
6
7
|
#include "RTC/ICE/StunPacket.hpp"
|
|
7
8
|
#include "RTC/TransportTuple.hpp"
|
|
8
|
-
#include "handles/
|
|
9
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
9
10
|
#include <list>
|
|
10
11
|
#include <string>
|
|
11
12
|
#include <unordered_map>
|
|
@@ -14,7 +15,7 @@ namespace RTC
|
|
|
14
15
|
{
|
|
15
16
|
namespace ICE
|
|
16
17
|
{
|
|
17
|
-
class IceServer : public
|
|
18
|
+
class IceServer : public TimerHandleInterface::Listener
|
|
18
19
|
{
|
|
19
20
|
public:
|
|
20
21
|
enum class IceState : uint8_t
|
|
@@ -65,6 +66,7 @@ namespace RTC
|
|
|
65
66
|
public:
|
|
66
67
|
IceServer(
|
|
67
68
|
Listener* listener,
|
|
69
|
+
SharedInterface* shared,
|
|
68
70
|
const std::string& usernameFragment,
|
|
69
71
|
const std::string& password,
|
|
70
72
|
uint8_t consentTimeoutSec);
|
|
@@ -129,13 +131,14 @@ namespace RTC
|
|
|
129
131
|
void RestartConsentCheck();
|
|
130
132
|
void StopConsentCheck();
|
|
131
133
|
|
|
132
|
-
/* Pure virtual methods inherited from
|
|
134
|
+
/* Pure virtual methods inherited from TimerHandleInterface::Listener. */
|
|
133
135
|
public:
|
|
134
|
-
void OnTimer(
|
|
136
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
135
137
|
|
|
136
138
|
private:
|
|
137
139
|
// Passed by argument.
|
|
138
140
|
Listener* listener{ nullptr };
|
|
141
|
+
SharedInterface* shared{ nullptr };
|
|
139
142
|
std::string usernameFragment;
|
|
140
143
|
std::string password;
|
|
141
144
|
uint16_t consentTimeoutMs{ 30000u };
|
|
@@ -146,7 +149,7 @@ namespace RTC
|
|
|
146
149
|
uint32_t remoteNomination{ 0u };
|
|
147
150
|
std::list<RTC::TransportTuple> tuples;
|
|
148
151
|
RTC::TransportTuple* selectedTuple{ nullptr };
|
|
149
|
-
|
|
152
|
+
TimerHandleInterface* consentCheckTimer{ nullptr };
|
|
150
153
|
bool isRemovingTuples{ false };
|
|
151
154
|
};
|
|
152
155
|
} // namespace ICE
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#ifndef MS_KEY_FRAME_REQUEST_MANAGER_HPP
|
|
2
2
|
#define MS_KEY_FRAME_REQUEST_MANAGER_HPP
|
|
3
3
|
|
|
4
|
-
#include "
|
|
4
|
+
#include "SharedInterface.hpp"
|
|
5
|
+
#include "handles/TimerHandleInterface.hpp"
|
|
5
6
|
#include <absl/container/flat_hash_map.h>
|
|
6
7
|
|
|
7
8
|
namespace RTC
|
|
8
9
|
{
|
|
9
|
-
class PendingKeyFrameInfo : public
|
|
10
|
+
class PendingKeyFrameInfo : public TimerHandleInterface::Listener
|
|
10
11
|
{
|
|
11
12
|
public:
|
|
12
13
|
class Listener
|
|
@@ -19,7 +20,7 @@ namespace RTC
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
public:
|
|
22
|
-
PendingKeyFrameInfo(Listener* listener, uint32_t ssrc);
|
|
23
|
+
PendingKeyFrameInfo(Listener* listener, SharedInterface* shared, uint32_t ssrc);
|
|
23
24
|
~PendingKeyFrameInfo() override;
|
|
24
25
|
|
|
25
26
|
uint32_t GetSsrc() const
|
|
@@ -39,18 +40,18 @@ namespace RTC
|
|
|
39
40
|
this->timer->Restart();
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
/* Pure virtual methods inherited from
|
|
43
|
+
/* Pure virtual methods inherited from TimerHandleInterface::Listener. */
|
|
43
44
|
public:
|
|
44
|
-
void OnTimer(
|
|
45
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
45
46
|
|
|
46
47
|
private:
|
|
47
48
|
Listener* listener{ nullptr };
|
|
48
49
|
uint32_t ssrc;
|
|
49
|
-
|
|
50
|
+
TimerHandleInterface* timer{ nullptr };
|
|
50
51
|
bool retryOnTimeout{ true };
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
class KeyFrameRequestDelayer : public
|
|
54
|
+
class KeyFrameRequestDelayer : public TimerHandleInterface::Listener
|
|
54
55
|
{
|
|
55
56
|
public:
|
|
56
57
|
class Listener
|
|
@@ -63,7 +64,7 @@ namespace RTC
|
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
public:
|
|
66
|
-
KeyFrameRequestDelayer(Listener* listener, uint32_t ssrc, uint32_t delay);
|
|
67
|
+
KeyFrameRequestDelayer(Listener* listener, SharedInterface* shared, uint32_t ssrc, uint32_t delay);
|
|
67
68
|
~KeyFrameRequestDelayer() override;
|
|
68
69
|
|
|
69
70
|
uint32_t GetSsrc() const
|
|
@@ -79,14 +80,14 @@ namespace RTC
|
|
|
79
80
|
this->keyFrameRequested = flag;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
/* Pure virtual methods inherited from
|
|
83
|
+
/* Pure virtual methods inherited from TimerHandleInterface::Listener. */
|
|
83
84
|
public:
|
|
84
|
-
void OnTimer(
|
|
85
|
+
void OnTimer(TimerHandleInterface* timer) override;
|
|
85
86
|
|
|
86
87
|
private:
|
|
87
88
|
Listener* listener{ nullptr };
|
|
88
89
|
uint32_t ssrc;
|
|
89
|
-
|
|
90
|
+
TimerHandleInterface* timer{ nullptr };
|
|
90
91
|
bool keyFrameRequested{ false };
|
|
91
92
|
};
|
|
92
93
|
|
|
@@ -104,7 +105,8 @@ namespace RTC
|
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
public:
|
|
107
|
-
explicit KeyFrameRequestManager(
|
|
108
|
+
explicit KeyFrameRequestManager(
|
|
109
|
+
Listener* listener, SharedInterface* shared, uint32_t keyFrameRequestDelay);
|
|
108
110
|
~KeyFrameRequestManager() override;
|
|
109
111
|
|
|
110
112
|
void KeyFrameNeeded(uint32_t ssrc);
|
|
@@ -121,6 +123,7 @@ namespace RTC
|
|
|
121
123
|
|
|
122
124
|
private:
|
|
123
125
|
Listener* listener{ nullptr };
|
|
126
|
+
SharedInterface* shared{ nullptr };
|
|
124
127
|
uint32_t keyFrameRequestDelay{ 0u }; // 0 means disabled.
|
|
125
128
|
absl::flat_hash_map<uint32_t, PendingKeyFrameInfo*> mapSsrcPendingKeyFrameInfo;
|
|
126
129
|
absl::flat_hash_map<uint32_t, KeyFrameRequestDelayer*> mapSsrcKeyFrameRequestDelayer;
|