From fe5b3ab3c3cf84bfaecbf4d692db10002fce5d54 Mon Sep 17 00:00:00 2001 From: Artur Grzesiak Date: Tue, 22 Feb 2022 11:15:47 +0100 Subject: [PATCH 01/11] Typing event emitters (#764) --- node/lib/ActiveSpeakerObserver.d.ts | 16 ++++++- node/lib/ActiveSpeakerObserver.d.ts.map | 2 +- node/lib/ActiveSpeakerObserver.js | 4 +- node/lib/AudioLevelObserver.d.ts | 14 +++++- node/lib/AudioLevelObserver.d.ts.map | 2 +- node/lib/AudioLevelObserver.js | 4 +- node/lib/Consumer.d.ts | 23 +++++++++- node/lib/Consumer.d.ts.map | 2 +- node/lib/DataConsumer.d.ts | 14 +++++- node/lib/DataConsumer.d.ts.map | 2 +- node/lib/DataProducer.d.ts | 10 ++++- node/lib/DataProducer.d.ts.map | 2 +- node/lib/DirectTransport.d.ts | 10 ++++- node/lib/DirectTransport.d.ts.map | 2 +- node/lib/EnhancedEventEmitter.d.ts | 16 +++++-- node/lib/EnhancedEventEmitter.d.ts.map | 2 +- node/lib/EnhancedEventEmitter.js | 28 ++++++++++++ node/lib/PipeTransport.d.ts | 10 ++++- node/lib/PipeTransport.d.ts.map | 2 +- node/lib/PlainTransport.d.ts | 14 +++++- node/lib/PlainTransport.d.ts.map | 2 +- node/lib/Producer.d.ts | 18 +++++++- node/lib/Producer.d.ts.map | 2 +- node/lib/Router.d.ts | 15 +++++-- node/lib/Router.d.ts.map | 2 +- node/lib/RtpObserver.d.ts | 14 +++++- node/lib/RtpObserver.d.ts.map | 2 +- node/lib/Transport.d.ts | 16 ++++++- node/lib/Transport.d.ts.map | 2 +- node/lib/WebRtcTransport.d.ts | 16 ++++++- node/lib/WebRtcTransport.d.ts.map | 2 +- node/lib/Worker.d.ts | 11 ++++- node/lib/Worker.d.ts.map | 2 +- node/lib/index.d.ts | 8 +++- node/lib/index.d.ts.map | 2 +- node/src/ActiveSpeakerObserver.ts | 26 ++++++++--- node/src/AudioLevelObserver.ts | 22 +++++++-- node/src/Consumer.ts | 28 ++++++++++-- node/src/DataConsumer.ts | 20 +++++++-- node/src/DataProducer.ts | 16 +++++-- node/src/DirectTransport.ts | 15 ++++++- node/src/EnhancedEventEmitter.ts | 59 +++++++++++++++++++++++-- node/src/PipeTransport.ts | 15 ++++++- node/src/PlainTransport.ts | 19 +++++++- node/src/Producer.ts | 24 ++++++++-- node/src/Router.ts | 18 ++++++-- node/src/RtpObserver.ts | 21 +++++++-- node/src/Transport.ts | 24 ++++++++-- node/src/WebRtcTransport.ts | 21 ++++++++- node/src/Worker.ts | 17 +++++-- 50 files changed, 547 insertions(+), 91 deletions(-) diff --git a/node/lib/ActiveSpeakerObserver.d.ts b/node/lib/ActiveSpeakerObserver.d.ts index e791fdb42c..b589c1e3e1 100644 --- a/node/lib/ActiveSpeakerObserver.d.ts +++ b/node/lib/ActiveSpeakerObserver.d.ts @@ -1,5 +1,6 @@ -import { RtpObserver } from './RtpObserver'; +import { RtpObserver, RtpObserverEvents, RtpObserverObserverEvents } from './RtpObserver'; import { Producer } from './Producer'; +import { EnhancedEventEmitter } from './EnhancedEventEmitter'; export interface ActiveSpeakerObserverOptions { interval?: number; /** @@ -13,7 +14,17 @@ export interface ActiveSpeakerObserverActivity { */ producer: Producer; } -export declare class ActiveSpeakerObserver extends RtpObserver { +export declare type ActiveSpeakerObserverEvents = RtpObserverEvents & { + dominantspeaker: [{ + producer: Producer; + }]; +}; +export declare type ActiveSpeakerObserverObserverEvents = RtpObserverObserverEvents & { + dominantspeaker: [{ + producer: Producer; + }]; +}; +export declare class ActiveSpeakerObserver extends RtpObserver { /** * @private */ @@ -21,6 +32,7 @@ export declare class ActiveSpeakerObserver extends RtpObserver { /** * Observer. */ + get observer(): EnhancedEventEmitter; private handleWorkerNotifications; } //# sourceMappingURL=ActiveSpeakerObserver.d.ts.map \ No newline at end of file diff --git a/node/lib/ActiveSpeakerObserver.d.ts.map b/node/lib/ActiveSpeakerObserver.d.ts.map index 9deda966e7..159888395b 100644 --- a/node/lib/ActiveSpeakerObserver.d.ts.map +++ b/node/lib/ActiveSpeakerObserver.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ActiveSpeakerObserver.d.ts","sourceRoot":"","sources":["../src/ActiveSpeakerObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAID,qBAAa,qBAAsB,SAAQ,WAAW;IAErD;;OAEG;gBACS,MAAM,EAAE,GAAG;IAOvB;;OAEG;IAGH,OAAO,CAAC,yBAAyB;CAyBjC"} \ No newline at end of file +{"version":3,"file":"ActiveSpeakerObserver.d.ts","sourceRoot":"","sources":["../src/ActiveSpeakerObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAE5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,6BAA6B;IAE7C;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAED,oBAAY,2BAA2B,GAAG,iBAAiB,GAC3D;IACC,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;CAC1C,CAAA;AAED,oBAAY,mCAAmC,GAAG,yBAAyB,GAC3E;IACC,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;CAC1C,CAAA;AAID,qBAAa,qBAAsB,SAAQ,WAAW,CAAC,2BAA2B,CAAC;IAElF;;OAEG;gBACS,MAAM,EAAE,GAAG;IAOvB;;OAEG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,mCAAmC,CAAC,CAGxE;IAED,OAAO,CAAC,yBAAyB;CAyBjC"} \ No newline at end of file diff --git a/node/lib/ActiveSpeakerObserver.js b/node/lib/ActiveSpeakerObserver.js index f762821a4c..ff9c9e5361 100644 --- a/node/lib/ActiveSpeakerObserver.js +++ b/node/lib/ActiveSpeakerObserver.js @@ -15,7 +15,9 @@ class ActiveSpeakerObserver extends RtpObserver_1.RtpObserver { /** * Observer. */ - // get observer(): EnhancedEventEmitter + get observer() { + return super.observer; + } handleWorkerNotifications() { this.channel.on(this.internal.rtpObserverId, (event, data) => { switch (event) { diff --git a/node/lib/AudioLevelObserver.d.ts b/node/lib/AudioLevelObserver.d.ts index 76f8eab87b..6fc83f53ab 100644 --- a/node/lib/AudioLevelObserver.d.ts +++ b/node/lib/AudioLevelObserver.d.ts @@ -1,5 +1,6 @@ -import { RtpObserver } from './RtpObserver'; +import { RtpObserver, RtpObserverEvents, RtpObserverObserverEvents } from './RtpObserver'; import { Producer } from './Producer'; +import { EnhancedEventEmitter } from './EnhancedEventEmitter'; export interface AudioLevelObserverOptions { /** * Maximum number of entries in the 'volumes”' event. Default 1. @@ -30,7 +31,15 @@ export interface AudioLevelObserverVolume { */ volume: number; } -export declare class AudioLevelObserver extends RtpObserver { +export declare type AudioLevelObserverEvents = RtpObserverEvents & { + volumes: [AudioLevelObserverVolume[]]; + silence: []; +}; +export declare type AudioLevelObserverObserverEvents = RtpObserverObserverEvents & { + volumes: [AudioLevelObserverVolume[]]; + silence: []; +}; +export declare class AudioLevelObserver extends RtpObserver { /** * @private * @emits volumes - (volumes: AudioLevelObserverVolume[]) @@ -48,6 +57,7 @@ export declare class AudioLevelObserver extends RtpObserver { * @emits volumes - (volumes: AudioLevelObserverVolume[]) * @emits silence */ + get observer(): EnhancedEventEmitter; private handleWorkerNotifications; } //# sourceMappingURL=AudioLevelObserver.d.ts.map \ No newline at end of file diff --git a/node/lib/AudioLevelObserver.d.ts.map b/node/lib/AudioLevelObserver.d.ts.map index 6085450390..cc6040f794 100644 --- a/node/lib/AudioLevelObserver.d.ts.map +++ b/node/lib/AudioLevelObserver.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"AudioLevelObserver.d.ts","sourceRoot":"","sources":["../src/AudioLevelObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,yBAAyB;IAEzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IAExC;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAID,qBAAa,kBAAmB,SAAQ,WAAW;IAElD;;;;OAIG;gBACS,MAAM,EAAE,GAAG;IAOvB;;;;;;;;;;OAUG;IAGH,OAAO,CAAC,yBAAyB;CA+CjC"} \ No newline at end of file +{"version":3,"file":"AudioLevelObserver.d.ts","sourceRoot":"","sources":["../src/AudioLevelObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,yBAAyB;IAEzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IAExC;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,wBAAwB,GAAG,iBAAiB,GACxD;IACC,OAAO,EAAE,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,EAAE,CAAC;CACZ,CAAA;AAED,oBAAY,gCAAgC,GAAG,yBAAyB,GACxE;IACC,OAAO,EAAE,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,EAAE,CAAC;CACZ,CAAA;AAID,qBAAa,kBAAmB,SAAQ,WAAW,CAAC,wBAAwB,CAAC;IAE5E;;;;OAIG;gBACS,MAAM,EAAE,GAAG;IAOvB;;;;;;;;;;OAUG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,gCAAgC,CAAC,CAGrE;IAED,OAAO,CAAC,yBAAyB;CA+CjC"} \ No newline at end of file diff --git a/node/lib/AudioLevelObserver.js b/node/lib/AudioLevelObserver.js index 9eec01e2fd..ac8b1d6dc1 100644 --- a/node/lib/AudioLevelObserver.js +++ b/node/lib/AudioLevelObserver.js @@ -25,7 +25,9 @@ class AudioLevelObserver extends RtpObserver_1.RtpObserver { * @emits volumes - (volumes: AudioLevelObserverVolume[]) * @emits silence */ - // get observer(): EnhancedEventEmitter + get observer() { + return super.observer; + } handleWorkerNotifications() { this.channel.on(this.internal.rtpObserverId, (event, data) => { switch (event) { diff --git a/node/lib/Consumer.d.ts b/node/lib/Consumer.d.ts index 208fbb47e2..d0a74db5f9 100644 --- a/node/lib/Consumer.d.ts +++ b/node/lib/Consumer.d.ts @@ -1,3 +1,4 @@ +/// import { EnhancedEventEmitter } from './EnhancedEventEmitter'; import { Channel } from './Channel'; import { PayloadChannel } from './PayloadChannel'; @@ -123,7 +124,25 @@ export declare type ConsumerStat = { * Consumer type. */ export declare type ConsumerType = 'simple' | 'simulcast' | 'svc' | 'pipe'; -export declare class Consumer extends EnhancedEventEmitter { +export declare type ConsumerEvents = { + transportclose: []; + producerclose: []; + producerpause: []; + producerresume: []; + score: [ConsumerScore]; + layerschange: [ConsumerLayers?]; + trace: [ConsumerTraceEventData]; + rtp: [Buffer]; +}; +export declare type ConsumerObserverEvents = { + close: []; + pause: []; + resume: []; + score: [ConsumerScore]; + layerschange: [ConsumerLayers?]; + trace: [ConsumerTraceEventData]; +}; +export declare class Consumer extends EnhancedEventEmitter { #private; /** * @private @@ -215,7 +234,7 @@ export declare class Consumer extends EnhancedEventEmitter { * @emits layerschange - (layers: ConsumerLayers | undefined) * @emits trace - (trace: ConsumerTraceEventData) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * @private * Just for testing purposes. diff --git a/node/lib/Consumer.d.ts.map b/node/lib/Consumer.d.ts.map index 417515e5d9..8789f39d8a 100644 --- a/node/lib/Consumer.d.ts.map +++ b/node/lib/Consumer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Consumer.d.ts","sourceRoot":"","sources":["../src/Consumer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACN,SAAS,EACT,eAAe,EACf,aAAa,EACb,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,eAAe,GAC3B;IACC;;OAEG;IACH,UAAU,EAAE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,IAAI,CAAC;IAU3E,OAAO,CAAC,yBAAyB;CAsIjC"} \ No newline at end of file +{"version":3,"file":"Consumer.d.ts","sourceRoot":"","sources":["../src/Consumer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACN,SAAS,EACT,eAAe,EACf,aAAa,EACb,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,eAAe,GAC3B;IACC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,eAAe,CAAC,EAAE,cAAc,CAAC;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED;;GAEG;AACH,oBAAY,sBAAsB,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAEjF;;GAEG;AACH,oBAAY,sBAAsB,GAClC;IACC;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAE7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC;CACV,CAAA;AAED,oBAAY,aAAa,GACzB;IACC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;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DataConsumer.d.ts +++ b/node/lib/DataConsumer.d.ts @@ -47,7 +47,17 @@ export declare type DataConsumerStat = { * DataConsumer type. */ export declare type DataConsumerType = 'sctp' | 'direct'; -export declare class DataConsumer extends EnhancedEventEmitter { +export declare type DataConsumerEvents = { + transportclose: []; + dataproducerclose: []; + message: [Buffer, number]; + sctpsendbufferfull: []; + bufferedamountlow: [number]; +}; +export declare type DataConsumerObserverEvents = { + close: []; +}; +export declare class DataConsumer extends EnhancedEventEmitter { #private; /** * @private @@ -107,7 +117,7 @@ export declare class DataConsumer extends EnhancedEventEmitter { * * @emits close */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Close the DataConsumer. */ diff --git a/node/lib/DataConsumer.d.ts.map b/node/lib/DataConsumer.d.ts.map index 38fbaff73b..5bbcd86ec4 100644 --- a/node/lib/DataConsumer.d.ts.map +++ b/node/lib/DataConsumer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DataConsumer.d.ts","sourceRoot":"","sources":["../src/DataConsumer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED,oBAAY,gBAAgB,GAC5B;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAA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;IAO7C;;OAEG;IACG,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrE;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0ClE;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAU1C,OAAO,CAAC,yBAAyB;CA2EjC"} \ No newline at end of file +{"version":3,"file":"DataConsumer.d.ts","sourceRoot":"","sources":["../src/DataConsumer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED,oBAAY,gBAAgB,GAC5B;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACvB,CAAA;AAED;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEjD,oBAAY,kBAAkB,GAC9B;IACC,cAAc,E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,CAAC;IAO1B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO7C;;OAEG;IACG,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrE;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0ClE;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAU1C,OAAO,CAAC,yBAAyB;CA2EjC"} \ No newline at end of file diff --git a/node/lib/DataProducer.d.ts b/node/lib/DataProducer.d.ts index c919fde78c..4a93aa0882 100644 --- a/node/lib/DataProducer.d.ts +++ b/node/lib/DataProducer.d.ts @@ -38,7 +38,13 @@ export declare type DataProducerStat = { * DataProducer type. */ export declare type DataProducerType = 'sctp' | 'direct'; -export declare class DataProducer extends EnhancedEventEmitter { +export declare type DataProducerEvents = { + transportclose: []; +}; +export declare type DataProducerObserverEvents = { + close: []; +}; +export declare class DataProducer extends EnhancedEventEmitter { #private; /** * @private @@ -89,7 +95,7 @@ export declare class DataProducer extends EnhancedEventEmitter { * * @emits close */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Close the DataProducer. */ diff --git a/node/lib/DataProducer.d.ts.map b/node/lib/DataProducer.d.ts.map index f2ec5ef94f..391a007e6d 100644 --- a/node/lib/DataProducer.d.ts.map +++ b/node/lib/DataProducer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DataProducer.d.ts","sourceRoot":"","sources":["../src/DataProducer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,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IACH,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,EAGvB;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAsBb;;;;OAIG;IACH,eAAe,IAAI,IAAI;IAmBvB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAO1B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO7C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IA0CnD,OAAO,CAAC,yBAAyB;CAIjC"} \ No newline at end of file +{"version":3,"file":"DataProducer.d.ts","sourceRoot":"","sources":["../src/DataProducer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,oBAAY,mBAAmB,GAC/B;IACC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED,oBAAY,gBAAgB,GAC5B;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACtB,CAA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AAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IA0CnD,OAAO,CAAC,yBAAyB;CAIjC"} \ No newline at end of file diff --git a/node/lib/DirectTransport.d.ts b/node/lib/DirectTransport.d.ts index b90cf618f8..388abecdf0 100644 --- a/node/lib/DirectTransport.d.ts +++ b/node/lib/DirectTransport.d.ts @@ -1,5 +1,5 @@ /// -import { Transport } from './Transport'; +import { Transport, TransportEvents, TransportObserverEvents } from './Transport'; export declare type DirectTransportOptions = { /** * Maximum allowed size for direct messages sent from DataProducers. @@ -33,7 +33,13 @@ export declare type DirectTransportStat = { availableIncomingBitrate?: number; maxIncomingBitrate?: number; }; -export declare class DirectTransport extends Transport { +export declare type DirectTransportEvents = TransportEvents & { + rtcp: [Buffer]; +}; +export declare type DirectTransportObserverEvents = TransportObserverEvents & { + rtcp: [Buffer]; +}; +export declare class DirectTransport extends Transport { #private; /** * @private diff --git a/node/lib/DirectTransport.d.ts.map b/node/lib/DirectTransport.d.ts.map index 81273d32cc..9895d812fd 100644 --- a/node/lib/DirectTransport.d.ts.map +++ b/node/lib/DirectTransport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DirectTransport.d.ts","sourceRoot":"","sources":["../src/DirectTransport.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAA2B,MAAM,aAAa,CAAC;AAEjE,oBAAY,sBAAsB,GAClC;IACC;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED,oBAAY,mBAAmB,GAC/B;IAEC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,E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AAC;IAK9B;;OAEG;IAEG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D;;OAEG;IAEG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM;IAW3B,OAAO,CAAC,yBAAyB;CAkDjC"} \ No newline at end of file diff --git a/node/lib/EnhancedEventEmitter.d.ts b/node/lib/EnhancedEventEmitter.d.ts index bee9ff77c2..e8bd7643de 100644 --- a/node/lib/EnhancedEventEmitter.d.ts +++ b/node/lib/EnhancedEventEmitter.d.ts @@ -1,8 +1,18 @@ /// import { EventEmitter } from 'events'; -export declare class EnhancedEventEmitter extends EventEmitter { +declare type Events = Record; +declare type InternalEvents = Record<`@${string}`, any[]>; +export declare class EnhancedEventEmitter extends EventEmitter { constructor(); - safeEmit(event: string, ...args: any[]): boolean; - safeEmitAsPromise(event: string, ...args: any[]): Promise; + safeEmit(event: K, ...args: E[K]): boolean; + safeEmitAsPromise(event: K, ...args: E[K]): Promise; + on(event: K, listener: (...args: E[K]) => void): this; + off(event: K, listener: (...args: E[K]) => void): this; + addListener(event: K, listener: (...args: E[K]) => void): this; + prependListener(event: K, listener: (...args: E[K]) => void): this; + once(event: K, listener: (...args: E[K]) => void): this; + prependOnceListener(event: K, listener: (...args: E[K]) => void): this; + removeListener(event: K, listener: (...args: E[K]) => void): this; } +export {}; //# sourceMappingURL=EnhancedEventEmitter.d.ts.map \ No newline at end of file diff --git a/node/lib/EnhancedEventEmitter.d.ts.map b/node/lib/EnhancedEventEmitter.d.ts.map index 0def633ad0..2918f3170e 100644 --- a/node/lib/EnhancedEventEmitter.d.ts.map +++ b/node/lib/EnhancedEventEmitter.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"EnhancedEventEmitter.d.ts","sourceRoot":"","sources":["../src/EnhancedEventEmitter.ts"],"names":[],"mappings":";AAAA,OAAO,EAA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AAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAO3E,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAMnF,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAOvF,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAM5E,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EACvD,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;IAOlC,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CAMtF"} \ No newline at end of file diff --git a/node/lib/EnhancedEventEmitter.js b/node/lib/EnhancedEventEmitter.js index 9c0a0f5381..07df165037 100644 --- a/node/lib/EnhancedEventEmitter.js +++ b/node/lib/EnhancedEventEmitter.js @@ -30,5 +30,33 @@ class EnhancedEventEmitter extends events_1.EventEmitter { } }); } + on(event, listener) { + super.on(event, listener); + return this; + } + off(event, listener) { + super.off(event, listener); + return this; + } + addListener(event, listener) { + super.on(event, listener); + return this; + } + prependListener(event, listener) { + super.prependListener(event, listener); + return this; + } + once(event, listener) { + super.once(event, listener); + return this; + } + prependOnceListener(event, listener) { + super.prependOnceListener(event, listener); + return this; + } + removeListener(event, listener) { + super.off(event, listener); + return this; + } } exports.EnhancedEventEmitter = EnhancedEventEmitter; diff --git a/node/lib/PipeTransport.d.ts b/node/lib/PipeTransport.d.ts index 9ed42034d0..2b255382dc 100644 --- a/node/lib/PipeTransport.d.ts +++ b/node/lib/PipeTransport.d.ts @@ -1,4 +1,4 @@ -import { Transport, TransportListenIp, TransportTuple, SctpState } from './Transport'; +import { Transport, TransportListenIp, TransportTuple, TransportEvents, TransportObserverEvents, SctpState } from './Transport'; import { Consumer } from './Consumer'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; import { SrtpParameters } from './SrtpParameters'; @@ -81,7 +81,13 @@ export declare type PipeConsumerOptions = { */ appData?: any; }; -export declare class PipeTransport extends Transport { +export declare type PipeTransportEvents = TransportEvents & { + sctpstatechange: [SctpState]; +}; +export declare type PipeTransportObserverEvents = TransportObserverEvents & { + sctpstatechange: [SctpState]; +}; +export declare class PipeTransport extends Transport { #private; /** * @private diff --git a/node/lib/PipeTransport.d.ts.map b/node/lib/PipeTransport.d.ts.map index 78f5726f87..5e42812a96 100644 --- a/node/lib/PipeTransport.d.ts.map +++ b/node/lib/PipeTransport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"PipeTransport.d.ts","sourceRoot":"","sources":["../src/PipeTransport.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,SAAS,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,oBAAY,oBAAoB,GAChC;IACC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAErC;;;OAGG;IACH,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,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAID,qBAAa,aAAc,SAAQ,SAAS;;IAY3C;;;;OAIG;gBACS,MAAM,EAAE,GAAG;IAoBvB;;OAEG;IACH,IAAI,KAAK,IAAI,cAAc,CAG1B;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,CAGrC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;;;;;;;;;;OAWG;IAGH;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAWb;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAWpB;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO9C;;;;OAIG;IACG,OAAO,CACZ,EACC,EAAE,EACF,IAAI,EACJ,cAAc,EACd,EACD;QACC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,CAAC,EAAE,cAAc,CAAC;KAChC,GACC,OAAO,CAAC,IAAI,CAAC;IAahB;;;;OAIG;IACG,OAAO,CAAC,EAAE,UAAU,EAAE,OAAY,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqDnF,OAAO,CAAC,yBAAyB;CAuCjC"} \ No newline at end of file +{"version":3,"file":"PipeTransport.d.ts","sourceRoot":"","sources":["../src/PipeTransport.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,oBAAY,oB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 2ed379ec19..38c6d27776 100644 --- a/node/lib/PlainTransport.d.ts +++ b/node/lib/PlainTransport.d.ts @@ -1,4 +1,4 @@ -import { Transport, TransportListenIp, TransportTuple, SctpState } from './Transport'; +import { Transport, TransportListenIp, TransportTuple, TransportEvents, TransportObserverEvents, SctpState } from './Transport'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; import { SrtpParameters, SrtpCryptoSuite } from './SrtpParameters'; export declare type PlainTransportOptions = { @@ -90,7 +90,17 @@ export declare type PlainTransportStat = { * DEPRECATED: Use PlainTransportStat. */ export declare type PlainRtpTransportStat = PlainTransportStat; -export declare class PlainTransport extends Transport { +export declare type PlainTransportEvents = TransportEvents & { + tuple: [TransportTuple]; + rtcptuple: [TransportTuple]; + sctpstatechange: [SctpState]; +}; +export declare type PlainTransportObserverEvents = TransportObserverEvents & { + tuple: [TransportTuple]; + rtcptuple: [TransportTuple]; + sctpstatechange: [SctpState]; +}; +export declare class PlainTransport extends Transport { #private; /** * @private diff --git a/node/lib/PlainTransport.d.ts.map b/node/lib/PlainTransport.d.ts.map index f584878623..620a780234 100644 --- a/node/lib/PlainTransport.d.ts.map +++ b/node/lib/PlainTransport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"PlainTransport.d.ts","sourceRoot":"","sources":["../src/PlainTransport.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,SAAS,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnE,oBAAY,qBAAqB,GACjC;IACC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAErC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IAC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Ac,CAAC;IACtB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAA;AAED;;GAEG;AACH,oBAAY,qBAAqB,GAAG,kBAAkB,CAAC;AAIvD,qBAAa,cAAe,SAAQ,SAAS;;IAc5C;;;;;;OAMG;gBACS,MAAM,EAAE,GAAG;IAsBvB;;OAEG;IACH,IAAI,KAAK,IAAI,cAAc,CAG1B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,cAAc,GAAG,SAAS,CAG1C;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,CAGrC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;;;;;;;;;;;;OAaG;IAGH;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAWb;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAWpB;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAO/C;;;;OAIG;IACG,OAAO,CACZ,EACC,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,EACD;QACC,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,cAAc,CAAC;KAChC,GACC,OAAO,CAAC,IAAI,CAAC;IAmBhB,OAAO,CAAC,yBAAyB;CAmEjC;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;gBAExC,MAAM,EAAE,GAAG;CAIvB"} \ No newline at end of file +{"version":3,"file":"PlainTransport.d.ts","sourceRoot":"","sources":["../src/PlainTransport.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,MAAM,aAAa,CAAC;AACr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;;OAIG;IACH,KAAK,IAAI,IAAI;IAWb;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAWpB;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAO/C;;;;OAIG;IACG,OAAO,CACZ,EACC,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,EACD;QACC,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,cAAc,CAAC;KAChC,GACC,OAAO,CAAC,IAAI,CAAC;IAmBhB,OAAO,CAAC,yBAAyB;CAmEjC;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;gBAExC,MAAM,EAAE,GAAG;CAIvB"} \ No newline at end of file diff --git a/node/lib/Producer.d.ts b/node/lib/Producer.d.ts index 1e369f5a3a..b3b11c71c6 100644 --- a/node/lib/Producer.d.ts +++ b/node/lib/Producer.d.ts @@ -113,7 +113,21 @@ export declare type ProducerStat = { * Producer type. */ export declare type ProducerType = 'simple' | 'simulcast' | 'svc'; -export declare class Producer extends EnhancedEventEmitter { +export declare type ProducerEvents = { + transportclose: []; + score: [ProducerScore[]]; + videoorientationchange: [ProducerVideoOrientation]; + trace: [ProducerTraceEventData]; +}; +export declare type ProducerObserverEvents = { + close: []; + pause: []; + resume: []; + score: [ProducerScore[]]; + videoorientationchange: [ProducerVideoOrientation]; + trace: [ProducerTraceEventData]; +}; +export declare class Producer extends EnhancedEventEmitter { #private; /** * @private @@ -183,7 +197,7 @@ export declare class Producer extends EnhancedEventEmitter { * @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation) * @emits trace - (trace: ProducerTraceEventData) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * @private * Just for testing purposes. diff --git a/node/lib/Producer.d.ts.map b/node/lib/Producer.d.ts.map index bda1cc2317..6cdd3e958a 100644 --- a/node/lib/Producer.d.ts.map +++ b/node/lib/Producer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../src/Producer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3D,oBAAY,eAAe,GAC3B;IACC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACd,CAAA;AAED;;GAEG;AACH,oBAAY,sBAAsB,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAEjF;;GAEG;AACH,oBAAY,sBAAsB,GAClC;IACC;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAE7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC;CACV,CAAA;AAED,oBAAY,aAAa,GACzB;IACC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd,CAAA;AAED,oBAAY,wBAAwB,GACpC;IACC;;OAEG;IACH,MAAM,EAAE,OAAO,CAA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,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAOzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAe7B;;OAEG;IACG,gBAAgB,CAAC,KAAK,GAAE,sBAAsB,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3E;;OAEG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM;IAWtB,OAAO,CAAC,yBAAyB;CAmDjC"} \ No newline at end of file diff --git a/node/lib/Router.d.ts b/node/lib/Router.d.ts index e3b23a240f..bce6005a40 100644 --- a/node/lib/Router.d.ts +++ b/node/lib/Router.d.ts @@ -1,7 +1,7 @@ import { EnhancedEventEmitter } from './EnhancedEventEmitter'; import { Channel } from './Channel'; import { PayloadChannel } from './PayloadChannel'; -import { TransportListenIp } from './Transport'; +import { Transport, TransportListenIp } from './Transport'; import { WebRtcTransport, WebRtcTransportOptions } from './WebRtcTransport'; import { PlainTransport, PlainTransportOptions } from './PlainTransport'; import { PipeTransport, PipeTransportOptions } from './PipeTransport'; @@ -10,6 +10,7 @@ import { Producer } from './Producer'; import { Consumer } from './Consumer'; import { DataProducer } from './DataProducer'; import { DataConsumer } from './DataConsumer'; +import { RtpObserver } from './RtpObserver'; import { ActiveSpeakerObserver, ActiveSpeakerObserverOptions } from './ActiveSpeakerObserver'; import { AudioLevelObserver, AudioLevelObserverOptions } from './AudioLevelObserver'; import { RtpCapabilities, RtpCodecCapability } from './RtpParameters'; @@ -79,7 +80,15 @@ export declare type PipeToRouterResult = { declare type PipeTransportPair = { [key: string]: PipeTransport; }; -export declare class Router extends EnhancedEventEmitter { +export declare type RouterEvents = { + workerclose: []; +}; +export declare type RouterObserverEvents = { + close: []; + newtransport: [Transport]; + newrtpobserver: [RtpObserver]; +}; +export declare class Router extends EnhancedEventEmitter { #private; /** * @private @@ -120,7 +129,7 @@ export declare class Router extends EnhancedEventEmitter { * @emits newtransport - (transport: Transport) * @emits newrtpobserver - (rtpObserver: RtpObserver) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Close the Router. */ diff --git a/node/lib/Router.d.ts.map b/node/lib/Router.d.ts.map index 94df004497..b5b9cd8030 100644 --- a/node/lib/Router.d.ts.map +++ b/node/lib/Router.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAa,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,oBAAY,aAAa,GACz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AAC,eAAe,CAAC;IA2C3B;;OAEG;IACG,YAAY,CACjB,EACC,UAAU,EACV,cAAc,EACd,MAAM,EACN,QAAsB,EACtB,UAAiB,EACjB,cAAwC,EACxC,SAAiB,EACjB,UAAkB,EAClB,EAAE,mBAAmB,GACpB,OAAO,CAAC,kBAAkB,CAAC;IA8O9B;;OAEG;IACH,oBAAoB,CACnB,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClD,IAAI;IA+BP;;OAEG;IACG,2BAA2B,CAChC,EACC,QAAc,EACd,OAAY,EACZ,GAAE,4BAAiC,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAmCjC;;OAEG;IACG,wBAAwB,CAC7B,EACC,UAAc,EACd,SAAe,EACf,QAAe,EACf,OAAY,EACZ,GAAE,yBAA8B,GAC/B,OAAO,CAAC,kBAAkB,CAAC;IAmC9B;;OAEG;IACH,UAAU,CACT,EACC,UAAU,EACV,eAAe,EACf,EACD;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GACC,OAAO;CAuBV"} \ No newline at end of file +{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EA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AmCjC;;OAEG;IACG,wBAAwB,CAC7B,EACC,UAAc,EACd,SAAe,EACf,QAAe,EACf,OAAY,EACZ,GAAE,yBAA8B,GAC/B,OAAO,CAAC,kBAAkB,CAAC;IAmC9B;;OAEG;IACH,UAAU,CACT,EACC,UAAU,EACV,eAAe,EACf,EACD;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GACC,OAAO;CAuBV"} \ No newline at end of file diff --git a/node/lib/RtpObserver.d.ts b/node/lib/RtpObserver.d.ts index f94bb8cf3b..731e5d65ee 100644 --- a/node/lib/RtpObserver.d.ts +++ b/node/lib/RtpObserver.d.ts @@ -2,13 +2,23 @@ import { EnhancedEventEmitter } from './EnhancedEventEmitter'; import { Channel } from './Channel'; import { PayloadChannel } from './PayloadChannel'; import { Producer } from './Producer'; +export declare type RtpObserverEvents = { + routerclose: []; +}; +export declare type RtpObserverObserverEvents = { + close: []; + pause: []; + resume: []; + addproducer: [Producer]; + removeproducer: [Producer]; +}; export declare type RtpObserverAddRemoveProducerOptions = { /** * The id of the Producer to be added or removed. */ producerId: string; }; -export declare class RtpObserver extends EnhancedEventEmitter { +export declare class RtpObserver extends EnhancedEventEmitter { #private; protected readonly internal: { routerId: string; @@ -59,7 +69,7 @@ export declare class RtpObserver extends EnhancedEventEmitter { * @emits addproducer - (producer: Producer) * @emits removeproducer - (producer: Producer) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * Close the RtpObserver. */ diff --git a/node/lib/RtpObserver.d.ts.map b/node/lib/RtpObserver.d.ts.map index 9e048437ca..6c1fd95619 100644 --- a/node/lib/RtpObserver.d.ts.map +++ b/node/lib/RtpObserver.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"RtpObserver.d.ts","sourceRoot":"","sources":["../src/RtpObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE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C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAYlD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,QAAQ,CAAC;IAKrE;;;;;OAKG;gBAEF,EACC,QAAQ,EACR,OAAO,EACP,cAAc,EACd,OAAO,EACP,eAAe,EACf,EACD;QACC,QAAQ,EAAE,GAAG,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,cAAc,CAAC;QAC/B,OAAO,EAAE,GAAG,CAAC;QACb,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,QAAQ,CAAC;KAClD;IAcF;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,CAGf;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,GAAG,CAGjB;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,EAGvB;IAED;;;;;;;;OAQG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAAC,yBAAyB,CAAC,CAG9D;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAsBb;;;;OAIG;IACH,YAAY,IAAI,IAAI;IAmBpB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAe7B;;OAEG;IACG,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,mCAAmC,GAAG,OAAO,CAAC,IAAI,CAAC;IAarF;;OAEG;IACG,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE,mCAAmC,GAAG,OAAO,CAAC,IAAI,CAAC;CAYxF"} \ No newline at end of file diff --git a/node/lib/Transport.d.ts b/node/lib/Transport.d.ts index edfb3132d9..e6d9f3f83f 100644 --- a/node/lib/Transport.d.ts +++ b/node/lib/Transport.d.ts @@ -54,7 +54,19 @@ export interface TransportTraceEventData { info: any; } export declare type SctpState = 'new' | 'connecting' | 'connected' | 'failed' | 'closed'; -export declare class Transport extends EnhancedEventEmitter { +export declare type TransportEvents = { + routerclose: []; + trace: [TransportTraceEventData]; +}; +export declare type TransportObserverEvents = { + close: []; + newproducer: [Producer]; + newconsumer: [Consumer]; + newdataproducer: [DataProducer]; + newdataconsumer: [DataConsumer]; + trace: [TransportTraceEventData]; +}; +export declare class Transport extends EnhancedEventEmitter { #private; protected readonly internal: { routerId: string; @@ -112,7 +124,7 @@ export declare class Transport extends EnhancedEventEmitter { * @emits newdataproducer - (dataProducer: DataProducer) * @emits newdataconsumer - (dataProducer: DataProducer) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * @private * Just for testing purposes. diff --git a/node/lib/Transport.d.ts.map b/node/lib/Transport.d.ts.map index 23aa3a73df..66760df59a 100644 --- a/node/lib/Transport.d.ts.map +++ b/node/lib/Transport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../src/Transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACN,YAAY,EACZ,mBAAmB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,YAAY,EACZ,mBAAmB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,iBAAiB;IAEjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX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IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D;;OAEG;IACG,OAAO,CACZ,EACC,EAAc,EACd,IAAI,EACJ,aAAa,EACb,MAAc,EACd,oBAAoB,EACpB,OAAY,EACZ,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IA+FpB;;;;OAIG;IACG,OAAO,CACZ,EACC,UAAU,EACV,eAAe,EACf,MAAc,EACd,GAAG,EACH,eAAe,EACf,IAAY,EACZ,OAAY,EACZ,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IAyFpB;;OAEG;IACG,WAAW,CAChB,EACC,EAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAY,EACZ,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IAmExB;;OAEG;IACG,WAAW,CAChB,EACC,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,OAAY,EACZ,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IAuGxB;;OAEG;IACG,gBAAgB,CAAC,KAAK,GAAE,uBAAuB,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAU5E,OAAO,CAAC,mBAAmB;CA+B3B"} \ No newline at end of file +{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../src/Transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAA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G;IACG,WAAW,CAChB,EACC,EAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAY,EACZ,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IAmExB;;OAEG;IACG,WAAW,CAChB,EACC,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,OAAY,EACZ,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IAuGxB;;OAEG;IACG,gBAAgB,CAAC,KAAK,GAAE,uBAAuB,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAU5E,OAAO,CAAC,mBAAmB;CA+B3B"} \ No newline at end of file diff --git a/node/lib/WebRtcTransport.d.ts b/node/lib/WebRtcTransport.d.ts index d5dad06a3b..f983d5523f 100644 --- a/node/lib/WebRtcTransport.d.ts +++ b/node/lib/WebRtcTransport.d.ts @@ -1,4 +1,4 @@ -import { Transport, TransportListenIp, TransportProtocol, TransportTuple, SctpState } from './Transport'; +import { Transport, TransportListenIp, TransportProtocol, TransportTuple, TransportEvents, TransportObserverEvents, SctpState } from './Transport'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; export declare type WebRtcTransportOptions = { /** @@ -112,7 +112,19 @@ export declare type WebRtcTransportStat = { iceSelectedTuple?: TransportTuple; dtlsState: DtlsState; }; -export declare class WebRtcTransport extends Transport { +export declare type WebRtcTransportEvents = TransportEvents & { + icestatechange: [IceState]; + iceselectedtuplechange: [TransportTuple]; + dtlsstatechange: [DtlsState]; + sctpstatechange: [SctpState]; +}; +export declare type WebRtcTransportObserverEvents = TransportObserverEvents & { + icestatechange: [IceState]; + iceselectedtuplechange: [TransportTuple]; + dtlsstatechange: [DtlsState]; + sctpstatechange: [SctpState]; +}; +export declare class WebRtcTransport extends Transport { #private; /** * @private diff --git a/node/lib/WebRtcTransport.d.ts.map b/node/lib/WebRtcTransport.d.ts.map index cdbb45f3d5..e2a307279d 100644 --- a/node/lib/WebRtcTransport.d.ts.map +++ b/node/lib/Web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AGrC;IAED;;;;;;;;;;;;;;OAcG;IAGH;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAeb;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAepB;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAOhD;;;;OAIG;IACG,OAAO,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAapF;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAc1C,OAAO,CAAC,yBAAyB;CAqFjC"} \ No newline at end of file diff --git a/node/lib/Worker.d.ts b/node/lib/Worker.d.ts index 7122c6cbdf..d95113002a 100644 --- a/node/lib/Worker.d.ts +++ b/node/lib/Worker.d.ts @@ -110,7 +110,14 @@ export declare type WorkerResourceUsage = { */ ru_nivcsw: number; }; -export declare class Worker extends EnhancedEventEmitter { +export declare type WorkerEvents = { + died: [Error]; +}; +export declare type WorkerObserverEvents = { + close: []; + newrouter: [Router]; +}; +export declare class Worker extends EnhancedEventEmitter { #private; /** * @private @@ -145,7 +152,7 @@ export declare class Worker extends EnhancedEventEmitter { * @emits close * @emits newrouter - (router: Router) */ - get observer(): EnhancedEventEmitter; + get observer(): EnhancedEventEmitter; /** * @private * Just for testing purposes. diff --git a/node/lib/Worker.d.ts.map b/node/lib/Worker.d.ts.map index 01fe7caddc..7515bad9b6 100644 --- a/node/lib/Worker.d.ts.map +++ b/node/lib/Worker.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEjD,oBAAY,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,oB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AE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CAGlB,CAAA;AAcD,qBAAa,MAAO,SAAQ,oBAAoB;;IA6B/C;;;;;OAKG;gBAEF,EACC,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,EAAE,cAAc;IAgMlB;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAGhB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAGlB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,GAAG,CAGjB;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,EAGvB;IAED;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;;OAGG;IACH,IAAI,iBAAiB,IAAI,GAAG,CAAC,MAAM,CAAC,CAGnC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAsCb;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAO1B;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOtD;;OAEG;IACG,cAAc,CACnB,EACC,QAAQ,EACR,OAAO,EACP,GAAE,wBAA6B,GAC9B,OAAO,CAAC,IAAI,CAAC;IAShB;;OAEG;IACG,YAAY,CACjB,EACC,WAAW,EACX,OAAY,EACZ,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiCxC,OAAO,CAAC,UAAU;CA4BlB"} \ No newline at end of file +{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D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ACG,cAAc,CACnB,EACC,QAAQ,EACR,OAAO,EACP,GAAE,wBAA6B,GAC9B,OAAO,CAAC,IAAI,CAAC;IAShB;;OAEG;IACG,YAAY,CACjB,EACC,WAAW,EACX,OAAY,EACZ,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiCxC,OAAO,CAAC,UAAU;CA4BlB"} \ No newline at end of file diff --git a/node/lib/index.d.ts b/node/lib/index.d.ts index 0822296219..3d79758026 100644 --- a/node/lib/index.d.ts +++ b/node/lib/index.d.ts @@ -14,7 +14,13 @@ export declare const version = "3.9.6"; * Expose parseScalabilityMode() function. */ export { parse as parseScalabilityMode } from './scalabilityModes'; -declare const observer: EnhancedEventEmitter; +declare const observer: EnhancedEventEmitter<{ + [x: string]: any[]; +}, { + [x: string]: any[]; +} & { + [x: `@${string}`]: any[]; +}>; /** * Observer. * diff --git a/node/lib/index.d.ts.map b/node/lib/index.d.ts.map index 67544e4ecc..b94f0647c7 100644 --- a/node/lib/index.d.ts.map +++ b/node/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAE/C;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGnE,QAAA,MAAM,QAAQ,sBAA6B,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB;;GAEG;AACH,wBAAsB,YAAY,CACjC,EACC,QAAkB,EAClB,OAAO,EACP,UAAkB,EAClB,UAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,OAAY,EACZ,GAAE,cAAmB,GACpB,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,eAAe,CAG7D"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAE/C;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGnE,QAAA,MAAM,QAAQ;;;;;;EAA6B,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB;;GAEG;AACH,wBAAsB,YAAY,CACjC,EACC,QAAkB,EAClB,OAAO,EACP,UAAkB,EAClB,UAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,OAAY,EACZ,GAAE,cAAmB,GACpB,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,eAAe,CAG7D"} \ No newline at end of file diff --git a/node/src/ActiveSpeakerObserver.ts b/node/src/ActiveSpeakerObserver.ts index 3a7465afd5..78c87ba146 100644 --- a/node/src/ActiveSpeakerObserver.ts +++ b/node/src/ActiveSpeakerObserver.ts @@ -1,8 +1,10 @@ import { Logger } from './Logger'; -import { RtpObserver } from './RtpObserver'; +import { RtpObserver, RtpObserverEvents, RtpObserverObserverEvents } from './RtpObserver'; import { Producer } from './Producer'; +import { EnhancedEventEmitter } from './EnhancedEventEmitter'; -export interface ActiveSpeakerObserverOptions { +export interface ActiveSpeakerObserverOptions +{ interval?: number; /** @@ -11,16 +13,27 @@ export interface ActiveSpeakerObserverOptions { appData?: any; } -export interface ActiveSpeakerObserverActivity { +export interface ActiveSpeakerObserverActivity +{ /** * The producer instance. */ producer: Producer; } +export type ActiveSpeakerObserverEvents = RtpObserverEvents & +{ + dominantspeaker: [{ producer: Producer }]; +} + +export type ActiveSpeakerObserverObserverEvents = RtpObserverObserverEvents & +{ + dominantspeaker: [{ producer: Producer }]; +} + const logger = new Logger('ActiveSpeakerObserver'); -export class ActiveSpeakerObserver extends RtpObserver +export class ActiveSpeakerObserver extends RtpObserver { /** * @private @@ -35,7 +48,10 @@ export class ActiveSpeakerObserver extends RtpObserver /** * Observer. */ - // get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter + { + return super.observer; + } private handleWorkerNotifications(): void { diff --git a/node/src/AudioLevelObserver.ts b/node/src/AudioLevelObserver.ts index f5d4b89870..1d037c2cc9 100644 --- a/node/src/AudioLevelObserver.ts +++ b/node/src/AudioLevelObserver.ts @@ -1,6 +1,7 @@ import { Logger } from './Logger'; -import { RtpObserver } from './RtpObserver'; +import { RtpObserver, RtpObserverEvents, RtpObserverObserverEvents } from './RtpObserver'; import { Producer } from './Producer'; +import { EnhancedEventEmitter } from './EnhancedEventEmitter'; export interface AudioLevelObserverOptions { @@ -40,9 +41,21 @@ export interface AudioLevelObserverVolume volume: number; } +export type AudioLevelObserverEvents = RtpObserverEvents & +{ + volumes: [AudioLevelObserverVolume[]]; + silence: []; +} + +export type AudioLevelObserverObserverEvents = RtpObserverObserverEvents & +{ + volumes: [AudioLevelObserverVolume[]]; + silence: []; +} + const logger = new Logger('AudioLevelObserver'); -export class AudioLevelObserver extends RtpObserver +export class AudioLevelObserver extends RtpObserver { /** * @private @@ -67,7 +80,10 @@ export class AudioLevelObserver extends RtpObserver * @emits volumes - (volumes: AudioLevelObserverVolume[]) * @emits silence */ - // get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter + { + return super.observer; + } private handleWorkerNotifications(): void { diff --git a/node/src/Consumer.ts b/node/src/Consumer.ts index bae9001b90..9008bc1450 100644 --- a/node/src/Consumer.ts +++ b/node/src/Consumer.ts @@ -154,9 +154,31 @@ export type ConsumerStat = */ export type ConsumerType = 'simple' | 'simulcast' | 'svc' | 'pipe'; +export type ConsumerEvents = +{ + transportclose: []; + producerclose: []; + producerpause: []; + producerresume: []; + score: [ConsumerScore]; + layerschange: [ConsumerLayers?]; + trace: [ConsumerTraceEventData]; + rtp: [Buffer]; +} + +export type ConsumerObserverEvents = +{ + close: []; + pause: []; + resume: []; + score: [ConsumerScore]; + layerschange: [ConsumerLayers?]; + trace: [ConsumerTraceEventData]; +} + const logger = new Logger('Consumer'); -export class Consumer extends EnhancedEventEmitter +export class Consumer extends EnhancedEventEmitter { // Internal data. readonly #internal: @@ -206,7 +228,7 @@ export class Consumer extends EnhancedEventEmitter #currentLayers?: ConsumerLayers; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -384,7 +406,7 @@ export class Consumer extends EnhancedEventEmitter * @emits layerschange - (layers: ConsumerLayers | undefined) * @emits trace - (trace: ConsumerTraceEventData) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/DataConsumer.ts b/node/src/DataConsumer.ts index 2cb80710cc..06ecb781a2 100644 --- a/node/src/DataConsumer.ts +++ b/node/src/DataConsumer.ts @@ -57,9 +57,23 @@ export type DataConsumerStat = */ export type DataConsumerType = 'sctp' | 'direct'; +export type DataConsumerEvents = +{ + transportclose: []; + dataproducerclose: []; + message: [Buffer, number]; + sctpsendbufferfull: []; + bufferedamountlow: [number]; +} + +export type DataConsumerObserverEvents = +{ + close: []; +} + const logger = new Logger('DataConsumer'); -export class DataConsumer extends EnhancedEventEmitter +export class DataConsumer extends EnhancedEventEmitter { // Internal data. readonly #internal: @@ -92,7 +106,7 @@ export class DataConsumer extends EnhancedEventEmitter readonly #appData?: any; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -211,7 +225,7 @@ export class DataConsumer extends EnhancedEventEmitter * * @emits close */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/DataProducer.ts b/node/src/DataProducer.ts index afbaf1a0b1..83045991f1 100644 --- a/node/src/DataProducer.ts +++ b/node/src/DataProducer.ts @@ -48,9 +48,19 @@ export type DataProducerStat = */ export type DataProducerType = 'sctp' | 'direct'; +export type DataProducerEvents = +{ + transportclose: []; +} + +export type DataProducerObserverEvents = +{ + close: []; +} + const logger = new Logger('DataProducer'); -export class DataProducer extends EnhancedEventEmitter +export class DataProducer extends EnhancedEventEmitter { // Internal data. readonly #internal: @@ -82,7 +92,7 @@ export class DataProducer extends EnhancedEventEmitter readonly #appData?: any; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -188,7 +198,7 @@ export class DataProducer extends EnhancedEventEmitter * * @emits close */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/DirectTransport.ts b/node/src/DirectTransport.ts index 32260e7db5..f6f2fda7ef 100644 --- a/node/src/DirectTransport.ts +++ b/node/src/DirectTransport.ts @@ -1,6 +1,6 @@ import { Logger } from './Logger'; import { UnsupportedError } from './errors'; -import { Transport, TransportTraceEventData } from './Transport'; +import { Transport, TransportTraceEventData, TransportEvents, TransportObserverEvents } from './Transport'; export type DirectTransportOptions = { @@ -41,9 +41,20 @@ export type DirectTransportStat = maxIncomingBitrate?: number; } +export type DirectTransportEvents = TransportEvents & +{ + rtcp: [Buffer]; +} + +export type DirectTransportObserverEvents = TransportObserverEvents & +{ + rtcp: [Buffer]; +} + const logger = new Logger('DirectTransport'); -export class DirectTransport extends Transport +export class DirectTransport extends + Transport { // DirectTransport data. readonly #data: diff --git a/node/src/EnhancedEventEmitter.ts b/node/src/EnhancedEventEmitter.ts index 471105f200..f8f95de3d1 100644 --- a/node/src/EnhancedEventEmitter.ts +++ b/node/src/EnhancedEventEmitter.ts @@ -3,7 +3,11 @@ import { Logger } from './Logger'; const logger = new Logger('EnhancedEventEmitter'); -export class EnhancedEventEmitter extends EventEmitter +type Events = Record +type InternalEvents = Record<`@${string}`, any[]> + +export class EnhancedEventEmitter extends EventEmitter { constructor() { @@ -11,7 +15,7 @@ export class EnhancedEventEmitter extends EventEmitter this.setMaxListeners(Infinity); } - safeEmit(event: string, ...args: any[]): boolean + safeEmit(event: K, ...args: E[K]): boolean { const numListeners = this.listenerCount(event); @@ -29,7 +33,8 @@ export class EnhancedEventEmitter extends EventEmitter } } - async safeEmitAsPromise(event: string, ...args: any[]): Promise + async safeEmitAsPromise(event: K, ...args: E[K]): + Promise { return new Promise((resolve, reject) => { @@ -47,4 +52,52 @@ export class EnhancedEventEmitter extends EventEmitter } }); } + + on(event: K, listener: (...args: E[K]) => void) + { + super.on(event, listener as (...args: any[]) => void); + + return this; + } + + off(event: K, listener: (...args: E[K]) => void) + { + super.off(event, listener as (...args: any[]) => void); + + return this; + } + + addListener(event: K, listener: (...args: E[K]) => void) + { + super.on(event, listener as (...args: any[]) => void); + + return this; + } + prependListener(event: K, listener: (...args: E[K]) => void) + { + super.prependListener(event, listener as (...args: any[]) => void); + + return this; + } + + once(event: K, listener: (...args: E[K]) => void) + { + super.once(event, listener as (...args: any[]) => void); + + return this; + } + prependOnceListener(event: K, + listener: (...args: E[K]) => void) + { + super.prependOnceListener(event, listener as (...args: any[]) => void); + + return this; + } + + removeListener(event: K, listener: (...args: E[K]) => void) + { + super.off(event, listener as (...args: any[]) => void); + + return this; + } } diff --git a/node/src/PipeTransport.ts b/node/src/PipeTransport.ts index 608767678d..7fffcb2aa3 100644 --- a/node/src/PipeTransport.ts +++ b/node/src/PipeTransport.ts @@ -6,6 +6,8 @@ import { TransportListenIp, TransportTuple, TransportTraceEventData, + TransportEvents, + TransportObserverEvents, SctpState } from './Transport'; import { Consumer } from './Consumer'; @@ -108,9 +110,20 @@ export type PipeConsumerOptions = appData?: any; } +export type PipeTransportEvents = TransportEvents & +{ + sctpstatechange: [SctpState]; +} + +export type PipeTransportObserverEvents = TransportObserverEvents & +{ + sctpstatechange: [SctpState]; +} + const logger = new Logger('PipeTransport'); -export class PipeTransport extends Transport +export class PipeTransport + extends Transport { // PipeTransport data. readonly #data: diff --git a/node/src/PlainTransport.ts b/node/src/PlainTransport.ts index 8cab59275d..7294d5be6c 100644 --- a/node/src/PlainTransport.ts +++ b/node/src/PlainTransport.ts @@ -4,6 +4,8 @@ import { TransportListenIp, TransportTuple, TransportTraceEventData, + TransportEvents, + TransportObserverEvents, SctpState } from './Transport'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; @@ -116,9 +118,24 @@ export type PlainTransportStat = */ export type PlainRtpTransportStat = PlainTransportStat; +export type PlainTransportEvents = TransportEvents & +{ + tuple: [TransportTuple]; + rtcptuple: [TransportTuple]; + sctpstatechange: [SctpState]; +} + +export type PlainTransportObserverEvents = TransportObserverEvents & +{ + tuple: [TransportTuple]; + rtcptuple: [TransportTuple]; + sctpstatechange: [SctpState]; +} + const logger = new Logger('PlainTransport'); -export class PlainTransport extends Transport +export class PlainTransport extends + Transport { // PlainTransport data. readonly #data: diff --git a/node/src/Producer.ts b/node/src/Producer.ts index 2e530cb469..8eb142fe86 100644 --- a/node/src/Producer.ts +++ b/node/src/Producer.ts @@ -140,9 +140,27 @@ export type ProducerStat = */ export type ProducerType = 'simple' | 'simulcast' | 'svc'; +export type ProducerEvents = +{ + transportclose: []; + score: [ProducerScore[]]; + videoorientationchange: [ProducerVideoOrientation]; + trace: [ProducerTraceEventData]; +} + +export type ProducerObserverEvents = +{ + close: []; + pause: []; + resume: []; + score: [ProducerScore[]]; + videoorientationchange: [ProducerVideoOrientation]; + trace: [ProducerTraceEventData]; +} + const logger = new Logger('Producer'); -export class Producer extends EnhancedEventEmitter +export class Producer extends EnhancedEventEmitter { // Internal data. readonly #internal: @@ -180,7 +198,7 @@ export class Producer extends EnhancedEventEmitter #score: ProducerScore[] = []; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -315,7 +333,7 @@ export class Producer extends EnhancedEventEmitter * @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation) * @emits trace - (trace: ProducerTraceEventData) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/Router.ts b/node/src/Router.ts index 2f87474d6a..6dd5742420 100644 --- a/node/src/Router.ts +++ b/node/src/Router.ts @@ -104,9 +104,21 @@ type PipeTransportPair = [key: string]: PipeTransport; }; +export type RouterEvents = +{ + workerclose: []; +} + +export type RouterObserverEvents = +{ + close: []; + newtransport: [Transport]; + newrtpobserver: [RtpObserver]; +} + const logger = new Logger('Router'); -export class Router extends EnhancedEventEmitter +export class Router extends EnhancedEventEmitter { // Internal data. readonly #internal: @@ -150,7 +162,7 @@ export class Router extends EnhancedEventEmitter Map> = new Map(); // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -232,7 +244,7 @@ export class Router extends EnhancedEventEmitter * @emits newtransport - (transport: Transport) * @emits newrtpobserver - (rtpObserver: RtpObserver) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/RtpObserver.ts b/node/src/RtpObserver.ts index 9e267c4b01..d32f4e99fd 100644 --- a/node/src/RtpObserver.ts +++ b/node/src/RtpObserver.ts @@ -4,6 +4,20 @@ import { Channel } from './Channel'; import { PayloadChannel } from './PayloadChannel'; import { Producer } from './Producer'; +export type RtpObserverEvents = +{ + routerclose: []; +} + +export type RtpObserverObserverEvents = +{ + close: []; + pause: []; + resume: []; + addproducer: [Producer]; + removeproducer: [Producer]; +} + const logger = new Logger('RtpObserver'); export type RtpObserverAddRemoveProducerOptions = @@ -14,7 +28,8 @@ export type RtpObserverAddRemoveProducerOptions = producerId: string; } -export class RtpObserver extends EnhancedEventEmitter +export class RtpObserver + extends EnhancedEventEmitter { // Internal data. protected readonly internal: @@ -42,7 +57,7 @@ export class RtpObserver extends EnhancedEventEmitter protected readonly getProducerById: (producerId: string) => Producer; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -127,7 +142,7 @@ export class RtpObserver extends EnhancedEventEmitter * @emits addproducer - (producer: Producer) * @emits removeproducer - (producer: Producer) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/Transport.ts b/node/src/Transport.ts index 423db58150..e935bbbfb4 100644 --- a/node/src/Transport.ts +++ b/node/src/Transport.ts @@ -81,9 +81,27 @@ export interface TransportTraceEventData export type SctpState = 'new' | 'connecting' | 'connected' | 'failed' | 'closed'; +export type TransportEvents = +{ + routerclose: []; + trace: [TransportTraceEventData]; +} + +export type TransportObserverEvents = +{ + close: []; + newproducer: [Producer]; + newconsumer: [Consumer]; + newdataproducer: [DataProducer]; + newdataconsumer: [DataConsumer]; + trace: [TransportTraceEventData]; +} + const logger = new Logger('Transport'); -export class Transport extends EnhancedEventEmitter +export class Transport + extends EnhancedEventEmitter { // Internal data. protected readonly internal: @@ -145,7 +163,7 @@ export class Transport extends EnhancedEventEmitter #nextSctpStreamId = 0; // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -235,7 +253,7 @@ export class Transport extends EnhancedEventEmitter * @emits newdataproducer - (dataProducer: DataProducer) * @emits newdataconsumer - (dataProducer: DataProducer) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } diff --git a/node/src/WebRtcTransport.ts b/node/src/WebRtcTransport.ts index 03e20e3806..add6c89fc7 100644 --- a/node/src/WebRtcTransport.ts +++ b/node/src/WebRtcTransport.ts @@ -5,6 +5,8 @@ import { TransportProtocol, TransportTuple, TransportTraceEventData, + TransportEvents, + TransportObserverEvents, SctpState } from './Transport'; import { SctpParameters, NumSctpStreams } from './SctpParameters'; @@ -149,9 +151,26 @@ export type WebRtcTransportStat = dtlsState: DtlsState; } +export type WebRtcTransportEvents = TransportEvents & +{ + icestatechange: [IceState]; + iceselectedtuplechange: [TransportTuple]; + dtlsstatechange: [DtlsState]; + sctpstatechange: [SctpState]; +} + +export type WebRtcTransportObserverEvents = TransportObserverEvents & +{ + icestatechange: [IceState]; + iceselectedtuplechange: [TransportTuple]; + dtlsstatechange: [DtlsState]; + sctpstatechange: [SctpState]; +} + const logger = new Logger('WebRtcTransport'); -export class WebRtcTransport extends Transport +export class WebRtcTransport extends + Transport { // WebRtcTransport data. readonly #data: diff --git a/node/src/Worker.ts b/node/src/Worker.ts index 68c0b526a4..09a7c29655 100644 --- a/node/src/Worker.ts +++ b/node/src/Worker.ts @@ -164,6 +164,17 @@ export type WorkerResourceUsage = /* eslint-enable camelcase */ } +export type WorkerEvents = +{ + died: [Error]; +} + +export type WorkerObserverEvents = +{ + close: []; + newrouter: [Router]; +} + // If env MEDIASOUP_WORKER_BIN is given, use it as worker binary. // Otherwise if env MEDIASOUP_BUILDTYPE is 'Debug' use the Debug binary. // Otherwise use the Release binary. @@ -176,7 +187,7 @@ const workerBin = process.env.MEDIASOUP_WORKER_BIN const logger = new Logger('Worker'); const workerLogger = new Logger('Worker'); -export class Worker extends EnhancedEventEmitter +export class Worker extends EnhancedEventEmitter { // mediasoup-worker child process. #child?: ChildProcess; @@ -203,7 +214,7 @@ export class Worker extends EnhancedEventEmitter readonly #routers: Set = new Set(); // Observer instance. - readonly #observer = new EnhancedEventEmitter(); + readonly #observer = new EnhancedEventEmitter(); /** * @private @@ -458,7 +469,7 @@ export class Worker extends EnhancedEventEmitter * @emits close * @emits newrouter - (router: Router) */ - get observer(): EnhancedEventEmitter + get observer(): EnhancedEventEmitter { return this.#observer; } From 0c596bad79cd4fd5dd20d930956822d19300273f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 22 Feb 2022 11:18:51 +0100 Subject: [PATCH 02/11] 3.9.7 --- CHANGELOG.md | 6 ++++++ node/lib/Worker.js | 2 +- node/lib/index.d.ts | 2 +- node/lib/index.js | 2 +- package.json | 12 ++++++------ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b61bd3320c..1953829401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog +### 3.9.7 + +* Typing event emitters in mediasoup Node (PR #764 by @unao). +* Update NPM deps. + + ### 3.9.6 * TCC client optimizations for faster and more stable BWE (PR #712 by @ggarber). diff --git a/node/lib/Worker.js b/node/lib/Worker.js index 411810803b..1d87192f0b 100644 --- a/node/lib/Worker.js +++ b/node/lib/Worker.js @@ -81,7 +81,7 @@ class Worker extends EnhancedEventEmitter_1.EnhancedEventEmitter { // options { env: { - MEDIASOUP_VERSION: '3.9.6', + MEDIASOUP_VERSION: '3.9.7', // Let the worker process inherit all environment variables, useful // if a custom and not in the path GCC is used so the user can set // LD_LIBRARY_PATH environment variable for runtime. diff --git a/node/lib/index.d.ts b/node/lib/index.d.ts index 3d79758026..c4e29e2bb8 100644 --- a/node/lib/index.d.ts +++ b/node/lib/index.d.ts @@ -9,7 +9,7 @@ export { types }; /** * Expose mediasoup version. */ -export declare const version = "3.9.6"; +export declare const version = "3.9.7"; /** * Expose parseScalabilityMode() function. */ diff --git a/node/lib/index.js b/node/lib/index.js index 3dcf87c225..4aa39bb79f 100644 --- a/node/lib/index.js +++ b/node/lib/index.js @@ -11,7 +11,7 @@ exports.types = types; /** * Expose mediasoup version. */ -exports.version = '3.9.6'; +exports.version = '3.9.7'; /** * Expose parseScalabilityMode() function. */ diff --git a/package.json b/package.json index 1bc0827ff6..7ee7171daa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mediasoup", - "version": "3.9.6", + "version": "3.9.7", "description": "Cutting Edge WebRTC Video Conferencing", "contributors": [ "Iñaki Baz Castillo (https://inakibaz.me)", @@ -80,11 +80,11 @@ "@types/debug": "^4.1.7", "@types/random-number": "^0.0.1", "@types/uuid": "^8.3.4", - "@typescript-eslint/eslint-plugin": "^5.10.1", - "@typescript-eslint/parser": "^5.10.1", - "eslint": "^8.7.0", - "eslint-plugin-jest": "^26.0.0", - "jest": "^27.4.7", + "@typescript-eslint/eslint-plugin": "^5.12.1", + "@typescript-eslint/parser": "^5.12.1", + "eslint": "^8.9.0", + "eslint-plugin-jest": "^26.1.1", + "jest": "^27.5.1", "jest-tobetype": "^1.2.3", "open-cli": "^7.0.1", "pick-port": "^1.0.0", From 6da13b2826ad0477bc6bcc38b28ea845f5023b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro?= Date: Fri, 25 Feb 2022 13:56:23 +0100 Subject: [PATCH 03/11] Replace outdated `random-numbers` package by native `crypto.randomInt()` (#776) --- node/lib/utils.d.ts | 3 +-- node/lib/utils.d.ts.map | 2 +- node/lib/utils.js | 15 ++++++++------- node/src/utils.ts | 14 +++++--------- package.json | 2 -- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/node/lib/utils.d.ts b/node/lib/utils.d.ts index 1a3624d36f..2f66d0626d 100644 --- a/node/lib/utils.d.ts +++ b/node/lib/utils.d.ts @@ -1,4 +1,3 @@ -declare const randomNumberGenerator: (min?: number | null | undefined, max?: number | null | undefined, integer?: boolean | null | undefined) => number; /** * Clones the given object/array. */ @@ -6,5 +5,5 @@ export declare function clone(data: any): any; /** * Generates a random positive integer. */ -export { randomNumberGenerator as generateRandomNumber }; +export declare function generateRandomNumber(): number; //# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node/lib/utils.d.ts.map b/node/lib/utils.d.ts.map index d01b6561d1..cf1b6d44eb 100644 --- a/node/lib/utils.d.ts.map +++ b/node/lib/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,qBAAqB,oHAKxB,CAAC;AAEJ;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAMpC;AAED;;GAEG;AACH,OAAO,EAAE,qBAAqB,IAAI,oBAAoB,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAMpC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,WAGnC"} \ No newline at end of file diff --git a/node/lib/utils.js b/node/lib/utils.js index c809bb5abc..31383c1da0 100644 --- a/node/lib/utils.js +++ b/node/lib/utils.js @@ -1,13 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateRandomNumber = exports.clone = void 0; -const randomNumber = require("random-number"); -const randomNumberGenerator = randomNumber.generator({ - min: 100000000, - max: 999999999, - integer: true -}); -exports.generateRandomNumber = randomNumberGenerator; +const crypto_1 = require("crypto"); /** * Clones the given object/array. */ @@ -17,3 +11,10 @@ function clone(data) { return JSON.parse(JSON.stringify(data)); } exports.clone = clone; +/** + * Generates a random positive integer. + */ +function generateRandomNumber() { + return (0, crypto_1.randomInt)(100_000_000, 999_999_999); +} +exports.generateRandomNumber = generateRandomNumber; diff --git a/node/src/utils.ts b/node/src/utils.ts index 7a558f5191..ad12fcbec7 100644 --- a/node/src/utils.ts +++ b/node/src/utils.ts @@ -1,11 +1,4 @@ -import * as randomNumber from 'random-number'; - -const randomNumberGenerator = randomNumber.generator( - { - min : 100000000, - max : 999999999, - integer : true - }); +import { randomInt } from 'crypto'; /** * Clones the given object/array. @@ -21,4 +14,7 @@ export function clone(data: any): any /** * Generates a random positive integer. */ -export { randomNumberGenerator as generateRandomNumber }; +export function generateRandomNumber() +{ + return randomInt(100_000_000, 999_999_999); +} diff --git a/package.json b/package.json index 7ee7171daa..51b4b6d402 100644 --- a/package.json +++ b/package.json @@ -72,13 +72,11 @@ "@types/node": "^16.11.10", "debug": "^4.3.3", "h264-profile-level-id": "^1.0.1", - "random-number": "^0.0.9", "supports-color": "^9.2.1", "uuid": "^8.3.2" }, "devDependencies": { "@types/debug": "^4.1.7", - "@types/random-number": "^0.0.1", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", From 26943dc3f4a59fb8c1090fde143aac0abf7494a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Fri, 25 Feb 2022 13:57:49 +0100 Subject: [PATCH 04/11] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1953829401..a348b2a212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +### WIP + +* Replace outdated `random-numbers` package by native `crypto.randomInt()` (PR #776 by @piranna). + + ### 3.9.7 * Typing event emitters in mediasoup Node (PR #764 by @unao). From 91c636fc549edd0387c96ca3483dd0a017e6b854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Kalbe?= Date: Sat, 26 Feb 2022 12:26:49 +0100 Subject: [PATCH 05/11] Add Send to async trait --- rust/src/router/active_speaker_observer.rs | 2 +- rust/src/router/audio_level_observer.rs | 2 +- rust/src/router/rtp_observer.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/src/router/active_speaker_observer.rs b/rust/src/router/active_speaker_observer.rs index 8190c70872..f079ca43d1 100644 --- a/rust/src/router/active_speaker_observer.rs +++ b/rust/src/router/active_speaker_observer.rs @@ -164,7 +164,7 @@ impl fmt::Debug for ActiveSpeakerObserver { } } -#[async_trait(?Send)] +#[async_trait] impl RtpObserver for ActiveSpeakerObserver { fn id(&self) -> RtpObserverId { self.inner.id diff --git a/rust/src/router/audio_level_observer.rs b/rust/src/router/audio_level_observer.rs index 51490d92ef..b6542616de 100644 --- a/rust/src/router/audio_level_observer.rs +++ b/rust/src/router/audio_level_observer.rs @@ -175,7 +175,7 @@ impl fmt::Debug for AudioLevelObserver { } } -#[async_trait(?Send)] +#[async_trait] impl RtpObserver for AudioLevelObserver { fn id(&self) -> RtpObserverId { self.inner.id diff --git a/rust/src/router/rtp_observer.rs b/rust/src/router/rtp_observer.rs index 26599b00d7..aae6dfdbe8 100644 --- a/rust/src/router/rtp_observer.rs +++ b/rust/src/router/rtp_observer.rs @@ -31,7 +31,7 @@ impl RtpObserverAddProducerOptions { /// mediasoup implements the following RTP observers: /// * [`AudioLevelObserver`](crate::audio_level_observer::AudioLevelObserver) /// * [`ActiveSpeakerObserver`](crate::active_speaker_observer::ActiveSpeakerObserver) -#[async_trait(?Send)] +#[async_trait] pub trait RtpObserver { /// RtpObserver id. #[must_use] From 1a751476ea6a75fee7b0f2b4ef653aa6f1673269 Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Tue, 1 Mar 2022 12:41:04 +0100 Subject: [PATCH 06/11] Fix VP9 kSVC forwarding logic to not forward lower unneded layers (#778) --- worker/src/RTC/Codecs/VP9.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/worker/src/RTC/Codecs/VP9.cpp b/worker/src/RTC/Codecs/VP9.cpp index b594a153d4..d63df49a49 100644 --- a/worker/src/RTC/Codecs/VP9.cpp +++ b/worker/src/RTC/Codecs/VP9.cpp @@ -281,9 +281,17 @@ namespace RTC } } - // Filter spatial layers higher than current one (unless old packet). - if (packetSpatialLayer > tmpSpatialLayer && !isOldPacket) + // Unless old packet filter spatial layers that are either + // * higher than current one + // * different than the current one when KSVC is enabled and this is not a keyframe + // (interframe p bit = 1) + if ( + !isOldPacket && + (packetSpatialLayer > tmpSpatialLayer || + (context->IsKSvc() && this->payloadDescriptor->p && packetSpatialLayer != tmpSpatialLayer))) + { return false; + } // Check and handle temporal layer (unless old packet). if (!isOldPacket) From 9a19b3fe45ec2b98607b3950407d4a50767accd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 1 Mar 2022 12:44:41 +0100 Subject: [PATCH 07/11] Update NPM deps and TypeScript version --- CHANGELOG.md | 2 ++ node/lib/types.js | 6 +++++- package.json | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a348b2a212..f8f35e46fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ### WIP +* Fix VP9 kSVC forwarding logic to not forward lower unneded layers (PR #778 by @ggarber). * Replace outdated `random-numbers` package by native `crypto.randomInt()` (PR #776 by @piranna). +* Update NPM deps and TypeScript version. ### 3.9.7 diff --git a/node/lib/types.js b/node/lib/types.js index a09279dd6b..00c6b24b1d 100644 --- a/node/lib/types.js +++ b/node/lib/types.js @@ -1,7 +1,11 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/package.json b/package.json index 51b4b6d402..8a76bdeb18 100644 --- a/package.json +++ b/package.json @@ -78,9 +78,9 @@ "devDependencies": { "@types/debug": "^4.1.7", "@types/uuid": "^8.3.4", - "@typescript-eslint/eslint-plugin": "^5.12.1", - "@typescript-eslint/parser": "^5.12.1", - "eslint": "^8.9.0", + "@typescript-eslint/eslint-plugin": "^5.13.0", + "@typescript-eslint/parser": "^5.13.0", + "eslint": "^8.10.0", "eslint-plugin-jest": "^26.1.1", "jest": "^27.5.1", "jest-tobetype": "^1.2.3", @@ -88,6 +88,6 @@ "pick-port": "^1.0.0", "sctp": "^1.0.0", "tsc-watch": "^4.6.0", - "typescript": "^4.5.5" + "typescript": "^4.6.2" } } From 7417beb0bbfd0f4900a3829a17e01e9dcd16abda Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Tue, 1 Mar 2022 12:52:30 +0100 Subject: [PATCH 08/11] Fix update bandwidth estimation configuration and available bitrate when updating max outgoing bitrate (#779) --- .../RTC/TransportCongestionControlClient.hpp | 1 + worker/src/RTC/TransportCongestionControlClient.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/worker/include/RTC/TransportCongestionControlClient.hpp b/worker/include/RTC/TransportCongestionControlClient.hpp index b59745ad5c..98cec771b2 100644 --- a/worker/include/RTC/TransportCongestionControlClient.hpp +++ b/worker/include/RTC/TransportCongestionControlClient.hpp @@ -83,6 +83,7 @@ namespace RTC private: void MayEmitAvailableBitrateEvent(uint32_t previousAvailableBitrate); void UpdatePacketLoss(double packetLoss); + void ApplyBitrateUpdates(); void InitializeController(); void DestroyController(); diff --git a/worker/src/RTC/TransportCongestionControlClient.cpp b/worker/src/RTC/TransportCongestionControlClient.cpp index ff81461fd4..02a3bf35b8 100644 --- a/worker/src/RTC/TransportCongestionControlClient.cpp +++ b/worker/src/RTC/TransportCongestionControlClient.cpp @@ -269,6 +269,14 @@ namespace RTC MS_THROW_ERROR("maxOutgoingBitrate must be >= 30000bps"); this->maxOutgoingBitrate = maxBitrate; + + ApplyBitrateUpdates(); + + if (this->maxOutgoingBitrate > 0u) + { + this->bitrates.availableBitrate = + std::min(this->maxOutgoingBitrate, this->bitrates.availableBitrate); + } } void TransportCongestionControlClient::SetDesiredBitrate(uint32_t desiredBitrate, bool force) @@ -290,6 +298,11 @@ namespace RTC // more stable values. this->bitrates.startBitrate = std::max(MinBitrate, this->bitrates.availableBitrate); + ApplyBitrateUpdates(); + } + + void TransportCongestionControlClient::ApplyBitrateUpdates() + { auto currentMaxBitrate = this->bitrates.maxBitrate; uint32_t newMaxBitrate = 0; From 224a53082c3c6db8a8d3e6a42ca304b2b03f8078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 1 Mar 2022 12:54:50 +0100 Subject: [PATCH 09/11] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f35e46fc..0e3e3c23fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### WIP * Fix VP9 kSVC forwarding logic to not forward lower unneded layers (PR #778 by @ggarber). +* Fix update bandwidth estimation configuration and available bitrate when updating max outgoing bitrate (PR #779 by @ggarber). * Replace outdated `random-numbers` package by native `crypto.randomInt()` (PR #776 by @piranna). * Update NPM deps and TypeScript version. From e6198dda88cab461baa4aab798aa26359574abdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 1 Mar 2022 12:56:27 +0100 Subject: [PATCH 10/11] 3.9.8 --- CHANGELOG.md | 2 +- node/lib/Worker.js | 2 +- node/lib/index.d.ts | 2 +- node/lib/index.js | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3e3c23fd..9e9ba2eaef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -### WIP +### 3.9.8 * Fix VP9 kSVC forwarding logic to not forward lower unneded layers (PR #778 by @ggarber). * Fix update bandwidth estimation configuration and available bitrate when updating max outgoing bitrate (PR #779 by @ggarber). diff --git a/node/lib/Worker.js b/node/lib/Worker.js index 1d87192f0b..52e7e06dea 100644 --- a/node/lib/Worker.js +++ b/node/lib/Worker.js @@ -81,7 +81,7 @@ class Worker extends EnhancedEventEmitter_1.EnhancedEventEmitter { // options { env: { - MEDIASOUP_VERSION: '3.9.7', + MEDIASOUP_VERSION: '3.9.8', // Let the worker process inherit all environment variables, useful // if a custom and not in the path GCC is used so the user can set // LD_LIBRARY_PATH environment variable for runtime. diff --git a/node/lib/index.d.ts b/node/lib/index.d.ts index c4e29e2bb8..8f57bb30f0 100644 --- a/node/lib/index.d.ts +++ b/node/lib/index.d.ts @@ -9,7 +9,7 @@ export { types }; /** * Expose mediasoup version. */ -export declare const version = "3.9.7"; +export declare const version = "3.9.8"; /** * Expose parseScalabilityMode() function. */ diff --git a/node/lib/index.js b/node/lib/index.js index 4aa39bb79f..a97bf6988d 100644 --- a/node/lib/index.js +++ b/node/lib/index.js @@ -11,7 +11,7 @@ exports.types = types; /** * Expose mediasoup version. */ -exports.version = '3.9.7'; +exports.version = '3.9.8'; /** * Expose parseScalabilityMode() function. */ diff --git a/package.json b/package.json index 8a76bdeb18..d5771c99a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mediasoup", - "version": "3.9.7", + "version": "3.9.8", "description": "Cutting Edge WebRTC Video Conferencing", "contributors": [ "Iñaki Baz Castillo (https://inakibaz.me)", From ff17d135957513aff86d45d99e82ffce45187318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Wed, 2 Mar 2022 10:41:30 +0100 Subject: [PATCH 11/11] Use more efficient collections (#782) * Replace `std::map` with `std::unordered_map` in all places where applicable * Replace most of `std::map/set/unordered_map/unordered_set` with more efficient collections from abseil-cpp Taken from 'memory optimizations' branch to make it more readable and concise. Co-authored-by: Nazar Mokrynskyi --- worker/include/Channel/ChannelRequest.hpp | 4 ++-- worker/include/DepUsrSCTP.hpp | 4 ++-- .../include/PayloadChannel/Notification.hpp | 4 ++-- .../PayloadChannel/PayloadChannelRequest.hpp | 4 ++-- worker/include/RTC/ActiveSpeakerObserver.hpp | 4 ++-- worker/include/RTC/AudioLevelObserver.hpp | 4 ++-- worker/include/RTC/Consumer.hpp | 4 ++-- worker/include/RTC/DtlsTransport.hpp | 8 +++---- worker/include/RTC/KeyFrameRequestManager.hpp | 6 +++--- worker/include/RTC/NackGenerator.hpp | 8 ++++--- worker/include/RTC/Parameters.hpp | 4 ++-- worker/include/RTC/PipeConsumer.hpp | 8 +++---- worker/include/RTC/PlainTransport.hpp | 6 +++--- worker/include/RTC/PortManager.hpp | 6 +++--- worker/include/RTC/Producer.hpp | 13 ++++++------ worker/include/RTC/RTCP/Feedback.hpp | 3 ++- .../include/RTC/RTCP/FeedbackRtpTransport.hpp | 2 +- worker/include/RTC/RTCP/Packet.hpp | 4 ++-- worker/include/RTC/RTCP/Sdes.hpp | 3 +-- worker/include/RTC/Router.hpp | 21 ++++++++++--------- worker/include/RTC/RtpDictionaries.hpp | 21 +++++++++---------- worker/include/RTC/RtpPacket.hpp | 6 +++--- .../include/RTC/SenderBandwidthEstimator.hpp | 2 +- worker/include/RTC/SimulcastConsumer.hpp | 2 +- worker/include/RTC/Transport.hpp | 14 ++++++------- worker/include/RTC/WebRtcTransport.hpp | 4 ++-- worker/include/Settings.hpp | 6 +++--- worker/include/Worker.hpp | 4 ++-- worker/include/handles/TcpServerHandler.hpp | 4 ++-- worker/meson.build | 2 ++ worker/src/Channel/ChannelRequest.cpp | 2 +- worker/src/DepUsrSCTP.cpp | 2 +- worker/src/PayloadChannel/Notification.cpp | 2 +- .../PayloadChannel/PayloadChannelRequest.cpp | 2 +- worker/src/RTC/AudioLevelObserver.cpp | 2 +- worker/src/RTC/DtlsTransport.cpp | 6 +++--- worker/src/RTC/NackGenerator.cpp | 6 +++--- worker/src/RTC/PlainTransport.cpp | 4 ++-- worker/src/RTC/PortManager.cpp | 4 ++-- worker/src/RTC/Producer.cpp | 1 + worker/src/RTC/RTCP/Feedback.cpp | 4 ++-- worker/src/RTC/RTCP/FeedbackRtpTransport.cpp | 2 +- worker/src/RTC/RTCP/Packet.cpp | 2 +- worker/src/RTC/RTCP/Sdes.cpp | 2 +- worker/src/RTC/RtpDictionaries/Media.cpp | 4 ++-- .../RTC/RtpDictionaries/RtpCodecMimeType.cpp | 8 +++---- .../RtpDictionaries/RtpHeaderExtensionUri.cpp | 2 +- .../src/RTC/RtpDictionaries/RtpParameters.cpp | 8 +++---- worker/src/Settings.cpp | 7 +++---- worker/src/lib.cpp | 4 ++-- 50 files changed, 131 insertions(+), 128 deletions(-) diff --git a/worker/include/Channel/ChannelRequest.hpp b/worker/include/Channel/ChannelRequest.hpp index 6e421418e6..cca5dda3fc 100644 --- a/worker/include/Channel/ChannelRequest.hpp +++ b/worker/include/Channel/ChannelRequest.hpp @@ -2,9 +2,9 @@ #define MS_CHANNEL_REQUEST_HPP #include "common.hpp" +#include #include #include -#include using json = nlohmann::json; @@ -75,7 +75,7 @@ namespace Channel }; private: - static std::unordered_map string2MethodId; + static absl::flat_hash_map string2MethodId; public: ChannelRequest(Channel::ChannelSocket* channel, json& jsonRequest); diff --git a/worker/include/DepUsrSCTP.hpp b/worker/include/DepUsrSCTP.hpp index 2ab0688793..b7df08620b 100644 --- a/worker/include/DepUsrSCTP.hpp +++ b/worker/include/DepUsrSCTP.hpp @@ -4,7 +4,7 @@ #include "common.hpp" #include "RTC/SctpAssociation.hpp" #include "handles/Timer.hpp" -#include +#include class DepUsrSCTP { @@ -42,7 +42,7 @@ class DepUsrSCTP thread_local static Checker* checker; static uint64_t numSctpAssociations; static uintptr_t nextSctpAssociationId; - static std::unordered_map mapIdSctpAssociation; + static absl::flat_hash_map mapIdSctpAssociation; }; #endif diff --git a/worker/include/PayloadChannel/Notification.hpp b/worker/include/PayloadChannel/Notification.hpp index 79cbac7023..585a6704e9 100644 --- a/worker/include/PayloadChannel/Notification.hpp +++ b/worker/include/PayloadChannel/Notification.hpp @@ -2,9 +2,9 @@ #define MS_PAYLOAD_CHANNEL_NOTIFICATION_HPP #include "common.hpp" +#include #include #include -#include using json = nlohmann::json; @@ -24,7 +24,7 @@ namespace PayloadChannel static bool IsNotification(json& jsonNotification); private: - static std::unordered_map string2EventId; + static absl::flat_hash_map string2EventId; public: explicit Notification(json& jsonNotification); diff --git a/worker/include/PayloadChannel/PayloadChannelRequest.hpp b/worker/include/PayloadChannel/PayloadChannelRequest.hpp index e1fceedcca..c4e44ee0d6 100644 --- a/worker/include/PayloadChannel/PayloadChannelRequest.hpp +++ b/worker/include/PayloadChannel/PayloadChannelRequest.hpp @@ -2,9 +2,9 @@ #define MS_PAYLOAD_CHANNEL_REQUEST_HPP #include "common.hpp" +#include #include #include -#include using json = nlohmann::json; @@ -26,7 +26,7 @@ namespace PayloadChannel static bool IsRequest(json& jsonRequest); private: - static std::unordered_map string2MethodId; + static absl::flat_hash_map string2MethodId; public: PayloadChannelRequest(PayloadChannel::PayloadChannelSocket* channel, json& jsonRequest); diff --git a/worker/include/RTC/ActiveSpeakerObserver.hpp b/worker/include/RTC/ActiveSpeakerObserver.hpp index 81d2e4cfdb..23709ab595 100644 --- a/worker/include/RTC/ActiveSpeakerObserver.hpp +++ b/worker/include/RTC/ActiveSpeakerObserver.hpp @@ -3,8 +3,8 @@ #include "RTC/RtpObserver.hpp" #include "handles/Timer.hpp" +#include #include -#include #include #include @@ -89,7 +89,7 @@ namespace RTC std::string dominantId{ "" }; Timer* periodicTimer{ nullptr }; uint16_t interval{ 300u }; - std::unordered_map mapProducerSpeaker; + absl::flat_hash_map mapProducerSpeaker; uint64_t lastLevelIdleTime{ 0 }; }; } // namespace RTC diff --git a/worker/include/RTC/AudioLevelObserver.hpp b/worker/include/RTC/AudioLevelObserver.hpp index f6dfb8a4fa..6500ecaae6 100644 --- a/worker/include/RTC/AudioLevelObserver.hpp +++ b/worker/include/RTC/AudioLevelObserver.hpp @@ -3,8 +3,8 @@ #include "RTC/RtpObserver.hpp" #include "handles/Timer.hpp" +#include #include -#include using json = nlohmann::json; @@ -48,7 +48,7 @@ namespace RTC // Allocated by this. Timer* periodicTimer{ nullptr }; // Others. - std::unordered_map mapProducerDBovs; + absl::flat_hash_map mapProducerDBovs; bool silence{ true }; }; } // namespace RTC diff --git a/worker/include/RTC/Consumer.hpp b/worker/include/RTC/Consumer.hpp index 5ebc0daadc..425c655baa 100644 --- a/worker/include/RTC/Consumer.hpp +++ b/worker/include/RTC/Consumer.hpp @@ -14,9 +14,9 @@ #include "RTC/RtpPacket.hpp" #include "RTC/RtpStream.hpp" #include "RTC/RtpStreamSend.hpp" +#include #include #include -#include #include using json = nlohmann::json; @@ -182,7 +182,7 @@ namespace RTC struct RTC::RtpHeaderExtensionIds rtpHeaderExtensionIds; const std::vector* producerRtpStreamScores{ nullptr }; // Others. - std::unordered_set supportedCodecPayloadTypes; + absl::flat_hash_set supportedCodecPayloadTypes; uint64_t lastRtcpSentTime{ 0u }; uint16_t maxRtcpInterval{ 0u }; bool externallyManagedBitrate{ false }; diff --git a/worker/include/RTC/DtlsTransport.hpp b/worker/include/RTC/DtlsTransport.hpp index 53d9ab9b2e..9cf922351e 100644 --- a/worker/include/RTC/DtlsTransport.hpp +++ b/worker/include/RTC/DtlsTransport.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -144,9 +144,9 @@ namespace RTC thread_local static EVP_PKEY* privateKey; thread_local static SSL_CTX* sslCtx; thread_local static uint8_t sslReadBuffer[]; - static std::map string2Role; - static std::map string2FingerprintAlgorithm; - static std::map fingerprintAlgorithm2String; + static absl::flat_hash_map string2Role; + static absl::flat_hash_map string2FingerprintAlgorithm; + static absl::flat_hash_map fingerprintAlgorithm2String; thread_local static std::vector localFingerprints; static std::vector srtpCryptoSuites; diff --git a/worker/include/RTC/KeyFrameRequestManager.hpp b/worker/include/RTC/KeyFrameRequestManager.hpp index c1eb65a4ea..d3d52c6b34 100644 --- a/worker/include/RTC/KeyFrameRequestManager.hpp +++ b/worker/include/RTC/KeyFrameRequestManager.hpp @@ -2,7 +2,7 @@ #define MS_KEY_FRAME_REQUEST_MANAGER_HPP #include "handles/Timer.hpp" -#include +#include namespace RTC { @@ -122,8 +122,8 @@ namespace RTC private: Listener* listener{ nullptr }; uint32_t keyFrameRequestDelay{ 0u }; // 0 means disabled. - std::map mapSsrcPendingKeyFrameInfo; - std::map mapSsrcKeyFrameRequestDelayer; + absl::flat_hash_map mapSsrcPendingKeyFrameInfo; + absl::flat_hash_map mapSsrcKeyFrameRequestDelayer; }; } // namespace RTC diff --git a/worker/include/RTC/NackGenerator.hpp b/worker/include/RTC/NackGenerator.hpp index 845d8df9d5..34d3c1c419 100644 --- a/worker/include/RTC/NackGenerator.hpp +++ b/worker/include/RTC/NackGenerator.hpp @@ -5,6 +5,8 @@ #include "RTC/RtpPacket.hpp" #include "RTC/SeqManager.hpp" #include "handles/Timer.hpp" +#include +#include #include #include #include @@ -75,9 +77,9 @@ namespace RTC // Allocated by this. Timer* timer{ nullptr }; // Others. - std::map::SeqLowerThan> nackList; - std::set::SeqLowerThan> keyFrameList; - std::set::SeqLowerThan> recoveredList; + absl::btree_map::SeqLowerThan> nackList; + absl::btree_set::SeqLowerThan> keyFrameList; + absl::btree_set::SeqLowerThan> recoveredList; bool started{ false }; uint16_t lastSeq{ 0u }; // Seq number of last valid packet. uint32_t rtt{ 0u }; // Round trip time (ms). diff --git a/worker/include/RTC/Parameters.hpp b/worker/include/RTC/Parameters.hpp index d096a284bf..eb7cd8f188 100644 --- a/worker/include/RTC/Parameters.hpp +++ b/worker/include/RTC/Parameters.hpp @@ -2,9 +2,9 @@ #define MS_RTC_PARAMETERS_HPP #include "common.hpp" +#include #include #include -#include #include using json = nlohmann::json; @@ -78,7 +78,7 @@ namespace RTC const std::vector& GetArrayOfIntegers(const std::string& key) const; private: - std::unordered_map mapKeyValues; + absl::flat_hash_map mapKeyValues; }; } // namespace RTC diff --git a/worker/include/RTC/PipeConsumer.hpp b/worker/include/RTC/PipeConsumer.hpp index 1918c0640f..56f6fa0d62 100644 --- a/worker/include/RTC/PipeConsumer.hpp +++ b/worker/include/RTC/PipeConsumer.hpp @@ -60,11 +60,11 @@ namespace RTC // Allocated by this. std::vector rtpStreams; // Others. - std::unordered_map mapMappedSsrcSsrc; - std::unordered_map mapSsrcRtpStream; + absl::flat_hash_map mapMappedSsrcSsrc; + absl::flat_hash_map mapSsrcRtpStream; bool keyFrameSupported{ false }; - std::unordered_map mapRtpStreamSyncRequired; - std::unordered_map> mapRtpStreamRtpSeqManager; + absl::flat_hash_map mapRtpStreamSyncRequired; + absl::flat_hash_map> mapRtpStreamRtpSeqManager; }; } // namespace RTC diff --git a/worker/include/RTC/PlainTransport.hpp b/worker/include/RTC/PlainTransport.hpp index 9f63bac171..0522be51aa 100644 --- a/worker/include/RTC/PlainTransport.hpp +++ b/worker/include/RTC/PlainTransport.hpp @@ -5,7 +5,7 @@ #include "RTC/Transport.hpp" #include "RTC/TransportTuple.hpp" #include "RTC/UdpSocket.hpp" -#include +#include namespace RTC { @@ -19,8 +19,8 @@ namespace RTC }; private: - static std::map string2SrtpCryptoSuite; - static std::map srtpCryptoSuite2String; + static absl::flat_hash_map string2SrtpCryptoSuite; + static absl::flat_hash_map srtpCryptoSuite2String; static size_t srtpMasterLength; public: diff --git a/worker/include/RTC/PortManager.hpp b/worker/include/RTC/PortManager.hpp index 04f350b01e..ca925ef46f 100644 --- a/worker/include/RTC/PortManager.hpp +++ b/worker/include/RTC/PortManager.hpp @@ -4,9 +4,9 @@ #include "common.hpp" #include "Settings.hpp" #include +#include #include #include -#include #include namespace RTC @@ -54,8 +54,8 @@ namespace RTC static std::vector& GetPorts(Transport transport, const std::string& ip); private: - thread_local static std::unordered_map> mapUdpIpPorts; - thread_local static std::unordered_map> mapTcpIpPorts; + thread_local static absl::flat_hash_map> mapUdpIpPorts; + thread_local static absl::flat_hash_map> mapTcpIpPorts; }; } // namespace RTC diff --git a/worker/include/RTC/Producer.hpp b/worker/include/RTC/Producer.hpp index 64f74a343d..f52d132ea5 100644 --- a/worker/include/RTC/Producer.hpp +++ b/worker/include/RTC/Producer.hpp @@ -12,7 +12,6 @@ #include "RTC/RtpHeaderExtensionIds.hpp" #include "RTC/RtpPacket.hpp" #include "RTC/RtpStreamRecv.hpp" -#include #include #include #include @@ -55,7 +54,7 @@ namespace RTC private: struct RtpMapping { - std::map codecs; + absl::flat_hash_map codecs; std::vector encodings; }; @@ -113,7 +112,7 @@ namespace RTC { return this->paused; } - const std::map& GetRtpStreams() + const absl::flat_hash_map& GetRtpStreams() { return this->mapRtpStreamMappedSsrc; } @@ -161,7 +160,7 @@ namespace RTC // Passed by argument. RTC::Producer::Listener* listener{ nullptr }; // Allocated by this. - std::map mapSsrcRtpStream; + absl::flat_hash_map mapSsrcRtpStream; RTC::KeyFrameRequestManager* keyFrameRequestManager{ nullptr }; // Others. RTC::Media::Kind kind; @@ -170,9 +169,9 @@ namespace RTC struct RtpMapping rtpMapping; std::vector rtpStreamByEncodingIdx; std::vector rtpStreamScores; - std::map mapRtxSsrcRtpStream; - std::map mapRtpStreamMappedSsrc; - std::map mapMappedSsrcSsrc; + absl::flat_hash_map mapRtxSsrcRtpStream; + absl::flat_hash_map mapRtpStreamMappedSsrc; + absl::flat_hash_map mapMappedSsrcSsrc; struct RTC::RtpHeaderExtensionIds rtpHeaderExtensionIds; bool paused{ false }; RTC::RtpPacket* currentRtpPacket{ nullptr }; diff --git a/worker/include/RTC/RTCP/Feedback.hpp b/worker/include/RTC/RTCP/Feedback.hpp index a51ba17b70..2fab054645 100644 --- a/worker/include/RTC/RTCP/Feedback.hpp +++ b/worker/include/RTC/RTCP/Feedback.hpp @@ -4,6 +4,7 @@ #include "common.hpp" #include "RTC/RTCP/FeedbackItem.hpp" #include "RTC/RTCP/Packet.hpp" +#include namespace RTC { @@ -27,7 +28,7 @@ namespace RTC static const std::string& MessageType2String(typename T::MessageType type); private: - static std::map type2String; + static absl::flat_hash_map type2String; public: typename T::MessageType GetMessageType() const diff --git a/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp b/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp index 763f565fb7..d23ea69dec 100644 --- a/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +++ b/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp @@ -197,7 +197,7 @@ namespace RTC static FeedbackRtpTransportPacket* Parse(const uint8_t* data, size_t len); private: - static std::map status2String; + static absl::flat_hash_map status2String; public: FeedbackRtpTransportPacket(uint32_t senderSsrc, uint32_t mediaSsrc) diff --git a/worker/include/RTC/RTCP/Packet.hpp b/worker/include/RTC/RTCP/Packet.hpp index 53c0b7dd97..bf771fad22 100644 --- a/worker/include/RTC/RTCP/Packet.hpp +++ b/worker/include/RTC/RTCP/Packet.hpp @@ -2,7 +2,7 @@ #define MS_RTC_RTCP_PACKET_HPP #include "common.hpp" -#include +#include #include namespace RTC @@ -72,7 +72,7 @@ namespace RTC static const std::string& Type2String(Type type); private: - static std::map type2String; + static absl::flat_hash_map type2String; public: explicit Packet(Type type) : type(type) diff --git a/worker/include/RTC/RTCP/Sdes.hpp b/worker/include/RTC/RTCP/Sdes.hpp index 2b195aa78a..79a021a41f 100644 --- a/worker/include/RTC/RTCP/Sdes.hpp +++ b/worker/include/RTC/RTCP/Sdes.hpp @@ -3,7 +3,6 @@ #include "common.hpp" #include "RTC/RTCP/Packet.hpp" -#include #include #include @@ -77,7 +76,7 @@ namespace RTC std::unique_ptr raw; private: - static std::map type2String; + static absl::flat_hash_map type2String; }; class SdesChunk diff --git a/worker/include/RTC/Router.hpp b/worker/include/RTC/Router.hpp index abaebeaf32..02b331b42d 100644 --- a/worker/include/RTC/Router.hpp +++ b/worker/include/RTC/Router.hpp @@ -13,9 +13,9 @@ #include "RTC/RtpPacket.hpp" #include "RTC/RtpStream.hpp" #include "RTC/Transport.hpp" +#include #include #include -#include #include using json = nlohmann::json; @@ -93,16 +93,17 @@ namespace RTC private: // Allocated by this. - std::unordered_map mapTransports; - std::unordered_map mapRtpObservers; + absl::flat_hash_map mapTransports; + absl::flat_hash_map mapRtpObservers; // Others. - std::unordered_map> mapProducerConsumers; - std::unordered_map mapConsumerProducer; - std::unordered_map> mapProducerRtpObservers; - std::unordered_map mapProducers; - std::unordered_map> mapDataProducerDataConsumers; - std::unordered_map mapDataConsumerDataProducer; - std::unordered_map mapDataProducers; + absl::flat_hash_map> mapProducerConsumers; + absl::flat_hash_map mapConsumerProducer; + absl::flat_hash_map> mapProducerRtpObservers; + absl::flat_hash_map mapProducers; + absl::flat_hash_map> + mapDataProducerDataConsumers; + absl::flat_hash_map mapDataConsumerDataProducer; + absl::flat_hash_map mapDataProducers; }; } // namespace RTC diff --git a/worker/include/RTC/RtpDictionaries.hpp b/worker/include/RTC/RtpDictionaries.hpp index 00185c6dee..3204165128 100644 --- a/worker/include/RTC/RtpDictionaries.hpp +++ b/worker/include/RTC/RtpDictionaries.hpp @@ -3,10 +3,9 @@ #include "common.hpp" #include "RTC/Parameters.hpp" -#include +#include #include #include -#include #include using json = nlohmann::json; @@ -29,8 +28,8 @@ namespace RTC static const std::string& GetString(Kind kind); private: - static std::unordered_map string2Kind; - static std::map kind2String; + static absl::flat_hash_map string2Kind; + static absl::flat_hash_map kind2String; }; class RtpCodecMimeType @@ -75,10 +74,10 @@ namespace RTC }; public: - static std::unordered_map string2Type; - static std::map type2String; - static std::unordered_map string2Subtype; - static std::map subtype2String; + static absl::flat_hash_map string2Type; + static absl::flat_hash_map type2String; + static absl::flat_hash_map string2Subtype; + static absl::flat_hash_map subtype2String; public: RtpCodecMimeType() = default; @@ -145,7 +144,7 @@ namespace RTC }; private: - static std::unordered_map string2Type; + static absl::flat_hash_map string2Type; public: static Type GetType(std::string& uri); @@ -269,8 +268,8 @@ namespace RTC static std::string& GetTypeString(Type type); private: - static std::unordered_map string2Type; - static std::map type2String; + static absl::flat_hash_map string2Type; + static absl::flat_hash_map type2String; public: RtpParameters() = default; diff --git a/worker/include/RTC/RtpPacket.hpp b/worker/include/RTC/RtpPacket.hpp index ba0f01331f..2d200fb78f 100644 --- a/worker/include/RTC/RtpPacket.hpp +++ b/worker/include/RTC/RtpPacket.hpp @@ -4,7 +4,7 @@ #include "common.hpp" #include "Utils.hpp" #include "RTC/Codecs/PayloadDescriptorHandler.hpp" -#include +#include #include #include #include @@ -611,8 +611,8 @@ namespace RTC Header* header{ nullptr }; uint8_t* csrcList{ nullptr }; HeaderExtension* headerExtension{ nullptr }; - std::map mapOneByteExtensions; - std::map mapTwoBytesExtensions; + absl::btree_map mapOneByteExtensions; + absl::btree_map mapTwoBytesExtensions; uint8_t midExtensionId{ 0u }; uint8_t ridExtensionId{ 0u }; uint8_t rridExtensionId{ 0u }; diff --git a/worker/include/RTC/SenderBandwidthEstimator.hpp b/worker/include/RTC/SenderBandwidthEstimator.hpp index 7496cc1f55..68fb189669 100644 --- a/worker/include/RTC/SenderBandwidthEstimator.hpp +++ b/worker/include/RTC/SenderBandwidthEstimator.hpp @@ -102,7 +102,7 @@ namespace RTC uint32_t initialAvailableBitrate{ 0u }; uint32_t availableBitrate{ 0u }; uint64_t lastAvailableBitrateEventAtMs{ 0u }; - std::map::SeqLowerThan> sentInfos; + absl::btree_map::SeqLowerThan> sentInfos; float rtt{ 0 }; // Round trip time in ms. CummulativeResult cummulativeResult; CummulativeResult probationCummulativeResult; diff --git a/worker/include/RTC/SimulcastConsumer.hpp b/worker/include/RTC/SimulcastConsumer.hpp index 5193d9b5ba..4b53add6ce 100644 --- a/worker/include/RTC/SimulcastConsumer.hpp +++ b/worker/include/RTC/SimulcastConsumer.hpp @@ -97,7 +97,7 @@ namespace RTC // Allocated by this. RTC::RtpStreamSend* rtpStream{ nullptr }; // Others. - std::unordered_map mapMappedSsrcSpatialLayer; + absl::flat_hash_map mapMappedSsrcSpatialLayer; std::vector rtpStreams; std::vector producerRtpStreams; // Indexed by spatial layer. bool syncRequired{ false }; diff --git a/worker/include/RTC/Transport.hpp b/worker/include/RTC/Transport.hpp index ecfaf73424..d1195504a1 100644 --- a/worker/include/RTC/Transport.hpp +++ b/worker/include/RTC/Transport.hpp @@ -26,9 +26,9 @@ #include "RTC/TransportCongestionControlClient.hpp" #include "RTC/TransportCongestionControlServer.hpp" #include "handles/Timer.hpp" +#include #include #include -#include using json = nlohmann::json; @@ -273,12 +273,12 @@ namespace RTC // Passed by argument. Listener* listener{ nullptr }; // Allocated by this. - std::unordered_map mapProducers; - std::unordered_map mapConsumers; - std::unordered_map mapDataProducers; - std::unordered_map mapDataConsumers; - std::unordered_map mapSsrcConsumer; - std::unordered_map mapRtxSsrcConsumer; + absl::flat_hash_map mapProducers; + absl::flat_hash_map mapConsumers; + absl::flat_hash_map mapDataProducers; + absl::flat_hash_map mapDataConsumers; + absl::flat_hash_map mapSsrcConsumer; + absl::flat_hash_map mapRtxSsrcConsumer; Timer* rtcpTimer{ nullptr }; RTC::TransportCongestionControlClient* tccClient{ nullptr }; RTC::TransportCongestionControlServer* tccServer{ nullptr }; diff --git a/worker/include/RTC/WebRtcTransport.hpp b/worker/include/RTC/WebRtcTransport.hpp index d8e8003422..bcaed162af 100644 --- a/worker/include/RTC/WebRtcTransport.hpp +++ b/worker/include/RTC/WebRtcTransport.hpp @@ -110,8 +110,8 @@ namespace RTC // Allocated by this. RTC::IceServer* iceServer{ nullptr }; // Map of UdpSocket/TcpServer and local announced IP (if any). - std::unordered_map udpSockets; - std::unordered_map tcpServers; + absl::flat_hash_map udpSockets; + absl::flat_hash_map tcpServers; RTC::DtlsTransport* dtlsTransport{ nullptr }; RTC::SrtpSession* srtpRecvSession{ nullptr }; RTC::SrtpSession* srtpSendSession{ nullptr }; diff --git a/worker/include/Settings.hpp b/worker/include/Settings.hpp index c4225c7892..445cde97a2 100644 --- a/worker/include/Settings.hpp +++ b/worker/include/Settings.hpp @@ -4,7 +4,7 @@ #include "common.hpp" #include "LogLevel.hpp" #include "Channel/ChannelRequest.hpp" -#include +#include #include #include @@ -54,8 +54,8 @@ class Settings thread_local static struct Configuration configuration; private: - static std::map string2LogLevel; - static std::map logLevel2String; + static absl::flat_hash_map string2LogLevel; + static absl::flat_hash_map logLevel2String; }; #endif diff --git a/worker/include/Worker.hpp b/worker/include/Worker.hpp index 85ec27dc5f..bbed438e4e 100644 --- a/worker/include/Worker.hpp +++ b/worker/include/Worker.hpp @@ -9,9 +9,9 @@ #include "PayloadChannel/PayloadChannelSocket.hpp" #include "RTC/Router.hpp" #include "handles/SignalsHandler.hpp" +#include #include #include -#include using json = nlohmann::json; @@ -55,7 +55,7 @@ class Worker : public Channel::ChannelSocket::Listener, PayloadChannel::PayloadChannelSocket* payloadChannel{ nullptr }; // Allocated by this. SignalsHandler* signalsHandler{ nullptr }; - std::unordered_map mapRouters; + absl::flat_hash_map mapRouters; // Others. bool closed{ false }; }; diff --git a/worker/include/handles/TcpServerHandler.hpp b/worker/include/handles/TcpServerHandler.hpp index b3e72418b1..7c5ddc400c 100644 --- a/worker/include/handles/TcpServerHandler.hpp +++ b/worker/include/handles/TcpServerHandler.hpp @@ -4,8 +4,8 @@ #include "common.hpp" #include "handles/TcpConnectionHandler.hpp" #include +#include #include -#include class TcpServerHandler : public TcpConnectionHandler::Listener { @@ -68,7 +68,7 @@ class TcpServerHandler : public TcpConnectionHandler::Listener // Allocated by this (may be passed by argument). uv_tcp_t* uvHandle{ nullptr }; // Others. - std::unordered_set connections; + absl::flat_hash_set connections; bool closed{ false }; }; diff --git a/worker/meson.build b/worker/meson.build index eefb2d514b..b9e0294910 100644 --- a/worker/meson.build +++ b/worker/meson.build @@ -196,6 +196,7 @@ libwebrtc_include_directories = include_directories('include') subdir('deps/libwebrtc') dependencies = [ + abseil_cpp_proj.get_variable('absl_container_dep'), openssl_proj.get_variable('openssl_dep'), nlohmann_json_proj.get_variable('nlohmann_json_dep'), libuv_proj.get_variable('libuv_dep'), @@ -205,6 +206,7 @@ dependencies = [ ] link_whole = [ + abseil_cpp_proj.get_variable('absl_container_lib'), openssl_proj.get_variable('libcrypto_lib'), openssl_proj.get_variable('libssl_lib'), libuv_proj.get_variable('libuv'), diff --git a/worker/src/Channel/ChannelRequest.cpp b/worker/src/Channel/ChannelRequest.cpp index 1e40aab5d2..1171900f91 100644 --- a/worker/src/Channel/ChannelRequest.cpp +++ b/worker/src/Channel/ChannelRequest.cpp @@ -11,7 +11,7 @@ namespace Channel /* Class variables. */ // clang-format off - std::unordered_map ChannelRequest::string2MethodId = + absl::flat_hash_map ChannelRequest::string2MethodId = { { "worker.close", ChannelRequest::MethodId::WORKER_CLOSE }, { "worker.dump", ChannelRequest::MethodId::WORKER_DUMP }, diff --git a/worker/src/DepUsrSCTP.cpp b/worker/src/DepUsrSCTP.cpp index ed75cb264a..c7ef6d1e8e 100644 --- a/worker/src/DepUsrSCTP.cpp +++ b/worker/src/DepUsrSCTP.cpp @@ -55,7 +55,7 @@ inline static void sctpDebug(const char* format, ...) thread_local DepUsrSCTP::Checker* DepUsrSCTP::checker{ nullptr }; uint64_t DepUsrSCTP::numSctpAssociations{ 0u }; uintptr_t DepUsrSCTP::nextSctpAssociationId{ 0u }; -std::unordered_map DepUsrSCTP::mapIdSctpAssociation; +absl::flat_hash_map DepUsrSCTP::mapIdSctpAssociation; /* Static methods. */ diff --git a/worker/src/PayloadChannel/Notification.cpp b/worker/src/PayloadChannel/Notification.cpp index 7a04c136ca..3f259129e3 100644 --- a/worker/src/PayloadChannel/Notification.cpp +++ b/worker/src/PayloadChannel/Notification.cpp @@ -11,7 +11,7 @@ namespace PayloadChannel /* Class variables. */ // clang-format off - std::unordered_map Notification::string2EventId = + absl::flat_hash_map Notification::string2EventId = { { "transport.sendRtcp", Notification::EventId::TRANSPORT_SEND_RTCP }, { "producer.send", Notification::EventId::PRODUCER_SEND }, diff --git a/worker/src/PayloadChannel/PayloadChannelRequest.cpp b/worker/src/PayloadChannel/PayloadChannelRequest.cpp index 141b51a87f..d53a668941 100644 --- a/worker/src/PayloadChannel/PayloadChannelRequest.cpp +++ b/worker/src/PayloadChannel/PayloadChannelRequest.cpp @@ -12,7 +12,7 @@ namespace PayloadChannel /* Class variables. */ // clang-format off - std::unordered_map PayloadChannelRequest::string2MethodId = + absl::flat_hash_map PayloadChannelRequest::string2MethodId = { { "dataConsumer.send", PayloadChannelRequest::MethodId::DATA_CONSUMER_SEND }, }; diff --git a/worker/src/RTC/AudioLevelObserver.cpp b/worker/src/RTC/AudioLevelObserver.cpp index 3afc29eb1f..7a58381ec6 100644 --- a/worker/src/RTC/AudioLevelObserver.cpp +++ b/worker/src/RTC/AudioLevelObserver.cpp @@ -146,7 +146,7 @@ namespace RTC { MS_TRACE(); - std::map mapDBovsProducer; + absl::btree_map mapDBovsProducer; for (auto& kv : this->mapProducerDBovs) { diff --git a/worker/src/RTC/DtlsTransport.cpp b/worker/src/RTC/DtlsTransport.cpp index a4b187c058..234520b89a 100644 --- a/worker/src/RTC/DtlsTransport.cpp +++ b/worker/src/RTC/DtlsTransport.cpp @@ -83,7 +83,7 @@ namespace RTC thread_local SSL_CTX* DtlsTransport::sslCtx{ nullptr }; thread_local uint8_t DtlsTransport::sslReadBuffer[SslReadBufferSize]; // clang-format off - std::map DtlsTransport::string2FingerprintAlgorithm = + absl::flat_hash_map DtlsTransport::string2FingerprintAlgorithm = { { "sha-1", DtlsTransport::FingerprintAlgorithm::SHA1 }, { "sha-224", DtlsTransport::FingerprintAlgorithm::SHA224 }, @@ -91,7 +91,7 @@ namespace RTC { "sha-384", DtlsTransport::FingerprintAlgorithm::SHA384 }, { "sha-512", DtlsTransport::FingerprintAlgorithm::SHA512 } }; - std::map DtlsTransport::fingerprintAlgorithm2String = + absl::flat_hash_map DtlsTransport::fingerprintAlgorithm2String = { { DtlsTransport::FingerprintAlgorithm::SHA1, "sha-1" }, { DtlsTransport::FingerprintAlgorithm::SHA224, "sha-224" }, @@ -99,7 +99,7 @@ namespace RTC { DtlsTransport::FingerprintAlgorithm::SHA384, "sha-384" }, { DtlsTransport::FingerprintAlgorithm::SHA512, "sha-512" } }; - std::map DtlsTransport::string2Role = + absl::flat_hash_map DtlsTransport::string2Role = { { "auto", DtlsTransport::Role::AUTO }, { "client", DtlsTransport::Role::CLIENT }, diff --git a/worker/src/RTC/NackGenerator.cpp b/worker/src/RTC/NackGenerator.cpp index 15e27d2f7f..b48ca388a5 100644 --- a/worker/src/RTC/NackGenerator.cpp +++ b/worker/src/RTC/NackGenerator.cpp @@ -152,18 +152,18 @@ namespace RTC // clear it and request a keyframe. uint16_t numNewNacks = seqEnd - seqStart; - if (this->nackList.size() + numNewNacks > MaxNackPackets) + if (static_cast(this->nackList.size()) + numNewNacks > MaxNackPackets) { // clang-format off while ( RemoveNackItemsUntilKeyFrame() && - this->nackList.size() + numNewNacks > MaxNackPackets + static_cast(this->nackList.size()) + numNewNacks > MaxNackPackets ) // clang-format on { } - if (this->nackList.size() + numNewNacks > MaxNackPackets) + if (static_cast(this->nackList.size()) + numNewNacks > MaxNackPackets) { MS_WARN_TAG( rtx, "NACK list full, clearing it and requesting a key frame [seqEnd:%" PRIu16 "]", seqEnd); diff --git a/worker/src/RTC/PlainTransport.cpp b/worker/src/RTC/PlainTransport.cpp index c88e6a7088..830fd0d9ca 100644 --- a/worker/src/RTC/PlainTransport.cpp +++ b/worker/src/RTC/PlainTransport.cpp @@ -14,12 +14,12 @@ namespace RTC // NOTE: PlainTransport allows AES_CM_128_HMAC_SHA1_80 and // AES_CM_128_HMAC_SHA1_32 SRTP crypto suites. // clang-format off - std::map PlainTransport::string2SrtpCryptoSuite = + absl::flat_hash_map PlainTransport::string2SrtpCryptoSuite = { { "AES_CM_128_HMAC_SHA1_80", RTC::SrtpSession::CryptoSuite::AES_CM_128_HMAC_SHA1_80 }, { "AES_CM_128_HMAC_SHA1_32", RTC::SrtpSession::CryptoSuite::AES_CM_128_HMAC_SHA1_32 } }; - std::map PlainTransport::srtpCryptoSuite2String = + absl::flat_hash_map PlainTransport::srtpCryptoSuite2String = { { RTC::SrtpSession::CryptoSuite::AES_CM_128_HMAC_SHA1_80, "AES_CM_128_HMAC_SHA1_80" }, { RTC::SrtpSession::CryptoSuite::AES_CM_128_HMAC_SHA1_32, "AES_CM_128_HMAC_SHA1_32" } diff --git a/worker/src/RTC/PortManager.cpp b/worker/src/RTC/PortManager.cpp index 0862312733..a032a05d70 100644 --- a/worker/src/RTC/PortManager.cpp +++ b/worker/src/RTC/PortManager.cpp @@ -26,8 +26,8 @@ namespace RTC { /* Class variables. */ - thread_local std::unordered_map> PortManager::mapUdpIpPorts; - thread_local std::unordered_map> PortManager::mapTcpIpPorts; + thread_local absl::flat_hash_map> PortManager::mapUdpIpPorts; + thread_local absl::flat_hash_map> PortManager::mapTcpIpPorts; /* Class methods. */ diff --git a/worker/src/RTC/Producer.cpp b/worker/src/RTC/Producer.cpp index f10922121f..603d9410bd 100644 --- a/worker/src/RTC/Producer.cpp +++ b/worker/src/RTC/Producer.cpp @@ -11,6 +11,7 @@ #include "RTC/RTCP/FeedbackPs.hpp" #include "RTC/RTCP/FeedbackRtp.hpp" #include "RTC/RTCP/XrReceiverReferenceTime.hpp" +#include #include // std::memcpy() #include // std::ostream_iterator #include // std::ostringstream diff --git a/worker/src/RTC/RTCP/Feedback.cpp b/worker/src/RTC/RTCP/Feedback.cpp index 13e204a622..8d290e10e9 100644 --- a/worker/src/RTC/RTCP/Feedback.cpp +++ b/worker/src/RTC/RTCP/Feedback.cpp @@ -98,7 +98,7 @@ namespace RTC // clang-format off template<> - std::map FeedbackPacket::type2String = + absl::flat_hash_map FeedbackPacket::type2String = { { FeedbackPs::MessageType::PLI, "PLI" }, { FeedbackPs::MessageType::SLI, "SLI" }, @@ -188,7 +188,7 @@ namespace RTC // clang-format off template<> - std::map FeedbackPacket::type2String = + absl::flat_hash_map FeedbackPacket::type2String = { { FeedbackRtp::MessageType::NACK, "NACK" }, { FeedbackRtp::MessageType::TMMBR, "TMMBR" }, diff --git a/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp b/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp index 3f466622eb..d310110094 100644 --- a/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +++ b/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp @@ -60,7 +60,7 @@ namespace RTC int16_t FeedbackRtpTransportPacket::maxPacketDelta{ 0x7FFF }; // clang-format off - std::map FeedbackRtpTransportPacket::status2String = + absl::flat_hash_map FeedbackRtpTransportPacket::status2String = { { FeedbackRtpTransportPacket::Status::NotReceived, "NR" }, { FeedbackRtpTransportPacket::Status::SmallDelta, "SD" }, diff --git a/worker/src/RTC/RTCP/Packet.cpp b/worker/src/RTC/RTCP/Packet.cpp index cf74864939..d2f38e8c0d 100644 --- a/worker/src/RTC/RTCP/Packet.cpp +++ b/worker/src/RTC/RTCP/Packet.cpp @@ -21,7 +21,7 @@ namespace RTC /* Class variables. */ // clang-format off - std::map Packet::type2String = + absl::flat_hash_map Packet::type2String = { { Type::SR, "SR" }, { Type::RR, "RR" }, diff --git a/worker/src/RTC/RTCP/Sdes.cpp b/worker/src/RTC/RTCP/Sdes.cpp index 05ada25864..a31cd64965 100644 --- a/worker/src/RTC/RTCP/Sdes.cpp +++ b/worker/src/RTC/RTCP/Sdes.cpp @@ -13,7 +13,7 @@ namespace RTC /* Item Class variables. */ // clang-format off - std::map SdesItem::type2String = + absl::flat_hash_map SdesItem::type2String = { { SdesItem::Type::END, "END" }, { SdesItem::Type::CNAME, "CNAME" }, diff --git a/worker/src/RTC/RtpDictionaries/Media.cpp b/worker/src/RTC/RtpDictionaries/Media.cpp index 38cdd3e41b..35a780546d 100644 --- a/worker/src/RTC/RtpDictionaries/Media.cpp +++ b/worker/src/RTC/RtpDictionaries/Media.cpp @@ -11,13 +11,13 @@ namespace RTC /* Class variables. */ // clang-format off - std::unordered_map Media::string2Kind = + absl::flat_hash_map Media::string2Kind = { { "", Media::Kind::ALL }, { "audio", Media::Kind::AUDIO }, { "video", Media::Kind::VIDEO } }; - std::map Media::kind2String = + absl::flat_hash_map Media::kind2String = { { Media::Kind::ALL, "" }, { Media::Kind::AUDIO, "audio" }, diff --git a/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp b/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp index 6933fabed5..0231c25cf9 100644 --- a/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +++ b/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp @@ -11,17 +11,17 @@ namespace RTC /* Class variables. */ // clang-format off - std::unordered_map RtpCodecMimeType::string2Type = + absl::flat_hash_map RtpCodecMimeType::string2Type = { { "audio", RtpCodecMimeType::Type::AUDIO }, { "video", RtpCodecMimeType::Type::VIDEO } }; - std::map RtpCodecMimeType::type2String = + absl::flat_hash_map RtpCodecMimeType::type2String = { { RtpCodecMimeType::Type::AUDIO, "audio" }, { RtpCodecMimeType::Type::VIDEO, "video" } }; - std::unordered_map RtpCodecMimeType::string2Subtype = + absl::flat_hash_map RtpCodecMimeType::string2Subtype = { // Audio codecs: { "opus", RtpCodecMimeType::Subtype::OPUS }, @@ -48,7 +48,7 @@ namespace RTC { "x-ulpfecuc", RtpCodecMimeType::Subtype::X_ULPFECUC }, { "red", RtpCodecMimeType::Subtype::RED } }; - std::map RtpCodecMimeType::subtype2String = + absl::flat_hash_map RtpCodecMimeType::subtype2String = { // Audio codecs: { RtpCodecMimeType::Subtype::OPUS, "opus" }, diff --git a/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp b/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp index 6a49c6bd11..e4e11e67fe 100644 --- a/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp +++ b/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp @@ -10,7 +10,7 @@ namespace RTC /* Class variables. */ // clang-format off - std::unordered_map RtpHeaderExtensionUri::string2Type = + absl::flat_hash_map RtpHeaderExtensionUri::string2Type = { { "urn:ietf:params:rtp-hdrext:sdes:mid", RtpHeaderExtensionUri::Type::MID }, { "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", RtpHeaderExtensionUri::Type::RTP_STREAM_ID }, diff --git a/worker/src/RTC/RtpDictionaries/RtpParameters.cpp b/worker/src/RTC/RtpDictionaries/RtpParameters.cpp index f5251706cb..5ea8bc1bc4 100644 --- a/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +++ b/worker/src/RTC/RtpDictionaries/RtpParameters.cpp @@ -4,14 +4,14 @@ #include "Logger.hpp" #include "MediaSoupErrors.hpp" #include "RTC/RtpDictionaries.hpp" -#include +#include namespace RTC { /* Class variables. */ // clang-format off - std::unordered_map RtpParameters::string2Type = + absl::flat_hash_map RtpParameters::string2Type = { { "none", RtpParameters::Type::NONE }, { "simple", RtpParameters::Type::SIMPLE }, @@ -19,7 +19,7 @@ namespace RTC { "svc", RtpParameters::Type::SVC }, { "pipe", RtpParameters::Type::PIPE } }; - std::map RtpParameters::type2String = + absl::flat_hash_map RtpParameters::type2String = { { RtpParameters::Type::NONE, "none" }, { RtpParameters::Type::SIMPLE, "simple" }, @@ -266,7 +266,7 @@ namespace RTC static const std::string AptString{ "apt" }; - std::unordered_set payloadTypes; + absl::flat_hash_set payloadTypes; for (auto& codec : this->codecs) { diff --git a/worker/src/Settings.cpp b/worker/src/Settings.cpp index 98ad54a3d7..86137e47b6 100644 --- a/worker/src/Settings.cpp +++ b/worker/src/Settings.cpp @@ -5,8 +5,7 @@ #include "Logger.hpp" #include "MediaSoupErrors.hpp" #include "Utils.hpp" -#include // isprint() -#include +#include // isprint() #include // std::ostream_iterator #include #include @@ -24,14 +23,14 @@ static std::mutex globalSyncMutex; thread_local struct Settings::Configuration Settings::configuration; // clang-format off -std::map Settings::string2LogLevel = +absl::flat_hash_map Settings::string2LogLevel = { { "debug", LogLevel::LOG_DEBUG }, { "warn", LogLevel::LOG_WARN }, { "error", LogLevel::LOG_ERROR }, { "none", LogLevel::LOG_NONE } }; -std::map Settings::logLevel2String = +absl::flat_hash_map Settings::logLevel2String = { { LogLevel::LOG_DEBUG, "debug" }, { LogLevel::LOG_WARN, "warn" }, diff --git a/worker/src/lib.cpp b/worker/src/lib.cpp index f1d54b44a3..149eff203e 100644 --- a/worker/src/lib.cpp +++ b/worker/src/lib.cpp @@ -19,11 +19,11 @@ #include "RTC/DtlsTransport.hpp" #include "RTC/SrtpSession.hpp" #include +#include #include #include // sigaction() #include // std::_Exit(), std::genenv() #include // std::cerr, std::endl -#include #include void IgnoreSignals(); @@ -210,7 +210,7 @@ void IgnoreSignals() struct sigaction act; // NOLINT(cppcoreguidelines-pro-type-member-init) // clang-format off - std::map ignoredSignals = + absl::flat_hash_map ignoredSignals = { { "PIPE", SIGPIPE }, { "HUP", SIGHUP },