From 056eaaac03b92382c28fdf91ea1c8371af05db6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Wed, 28 Sep 2022 14:07:18 +0200 Subject: [PATCH 1/4] wip --- lib/Device.d.ts | 18 ++- lib/Device.d.ts.map | 2 +- lib/Device.js | 7 +- lib/Producer.d.ts | 8 ++ lib/Producer.d.ts.map | 2 +- lib/Transport.d.ts.map | 2 +- lib/Transport.js | 1 + lib/handlers/Chrome74.d.ts | 4 +- lib/handlers/Chrome74.d.ts.map | 2 +- lib/handlers/Chrome74.js | 38 +++++- lib/handlers/HandlerInterface.d.ts | 5 +- lib/handlers/HandlerInterface.d.ts.map | 2 +- lib/handlers/sdp/commonUtils.d.ts | 33 ++++- lib/handlers/sdp/commonUtils.d.ts.map | 2 +- lib/handlers/sdp/commonUtils.js | 97 ++++++++++++++- src/Device.ts | 36 +++++- src/Producer.ts | 8 ++ src/Transport.ts | 2 + src/handlers/Chrome74.ts | 59 ++++++++- src/handlers/HandlerInterface.ts | 9 +- src/handlers/sdp/commonUtils.ts | 160 +++++++++++++++++++++++++ 21 files changed, 474 insertions(+), 23 deletions(-) diff --git a/lib/Device.d.ts b/lib/Device.d.ts index cda30103..2dbdf1e3 100644 --- a/lib/Device.d.ts +++ b/lib/Device.d.ts @@ -19,6 +19,20 @@ export declare type DeviceOptions = { */ Handler?: string; }; +export declare type DeviceLoadOptions = { + /** + * RTP capabilities of the mediasoup Router. + */ + routerRtpCapabilities: RtpCapabilities; + /** + * Force negotiation of abs-capture-time RTP extension for receiving in all + * Consumers created in the Transports of this Device. + * NOTE: Rationale for this option is that libwebrtc implements this RTP + * extension but lacks support for enabling it via API so SDP munging is + * needed. + */ + forceAbsCaptureTimeRtpHeaderExtension?: boolean; +}; export declare function detectDevice(): BuiltinHandlerName | undefined; export declare type DeviceObserverEvents = { newtransport: [Transport]; @@ -62,9 +76,7 @@ export declare class Device { /** * Initialize the Device. */ - load({ routerRtpCapabilities }: { - routerRtpCapabilities: RtpCapabilities; - }): Promise; + load({ routerRtpCapabilities, forceAbsCaptureTimeRtpHeaderExtension }: DeviceLoadOptions): Promise; /** * Whether we can produce audio/video. * diff --git a/lib/Device.d.ts.map b/lib/Device.d.ts.map index a2d0c20c..4a5ed38c 100644 --- a/lib/Device.d.ts.map +++ b/lib/Device.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAoB,MAAM,6BAA6B,CAAC;AAU/E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,oBAAY,kBAAkB,GAC3B,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,CAAC;AAEjB,oBAAY,aAAa,GACzB;IACC;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAOF,wBAAgB,YAAY,IAAI,kBAAkB,GAAG,SAAS,CA0H7D;AAED,oBAAY,oBAAoB,GAChC;IACC,YAAY,EAAE,CAAC,SAAS,CAAC,CAAC;CAC1B,CAAA;AAED,qBAAa,MAAM;IAGlB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,wBAAwB,CAAC,CAAM;IAEvC,OAAO,CAAC,oBAAoB,CAAC,CAAkB;IAG/C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD,OAAO,CAAC,iBAAiB,CAAC,CAAmB;IAE7C,SAAS,CAAC,QAAQ,CAAC,SAAS,6CAAoD;IAEhF;;;;OAIG;gBACS,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAE,aAAkB;IA8FxE;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAGxB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;;;OAIG;IACH,IAAI,eAAe,IAAI,eAAe,CAMrC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,gBAAgB,CAMvC;IAED,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACG,IAAI,CACT,EAAE,qBAAqB,EAAE,EACzB;QAAE,qBAAqB,EAAE,eAAe,CAAA;KAAE,GACxC,OAAO,CAAC,IAAI,CAAC;IA4EhB;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAUpC;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file +{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EA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aAAkB;IA8FtB;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAGxB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;;;OAIG;IACH,IAAI,eAAe,IAAI,eAAe,CAMrC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,gBAAgB,CAMvC;IAED,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACG,IAAI,CACT,EACC,qBAAqB,EACrB,qCAAqC,EACrC,EAAE,iBAAiB,GAClB,OAAO,CAAC,IAAI,CAAC;IAiFhB;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAUpC;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file diff --git a/lib/Device.js b/lib/Device.js index 5c8532b8..e5c38e04 100644 --- a/lib/Device.js +++ b/lib/Device.js @@ -252,7 +252,7 @@ class Device { /** * Initialize the Device. */ - async load({ routerRtpCapabilities }) { + async load({ routerRtpCapabilities, forceAbsCaptureTimeRtpHeaderExtension }) { logger.debug('load() [routerRtpCapabilities:%o]', routerRtpCapabilities); routerRtpCapabilities = utils.clone(routerRtpCapabilities, undefined); // Temporal handler to get its capabilities. @@ -263,12 +263,15 @@ class Device { // This may throw. ortc.validateRtpCapabilities(routerRtpCapabilities); handler = this._handlerFactory(); - const nativeRtpCapabilities = await handler.getNativeRtpCapabilities(); + const nativeRtpCapabilities = await handler.getNativeRtpCapabilities({ + forceAbsCaptureTimeRtpHeaderExtension + }); logger.debug('load() | got native RTP capabilities:%o', nativeRtpCapabilities); // This may throw. ortc.validateRtpCapabilities(nativeRtpCapabilities); // Get extended RTP capabilities. this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities(nativeRtpCapabilities, routerRtpCapabilities); + console.warn('--- Device this._extendedRtpCapabilities:', this._extendedRtpCapabilities); logger.debug('load() | got extended RTP capabilities:%o', this._extendedRtpCapabilities); // Check whether we can produce audio/video. this._canProduceByKind.audio = diff --git a/lib/Producer.d.ts b/lib/Producer.d.ts index 1ae00f0e..a761264d 100644 --- a/lib/Producer.d.ts +++ b/lib/Producer.d.ts @@ -20,6 +20,14 @@ export declare type ProducerCodecOptions = { videoGoogleStartBitrate?: number; videoGoogleMaxBitrate?: number; videoGoogleMinBitrate?: number; + /** + * Force negotiation of abs-capture-time RTP extension for sending in this + * Producer. + * NOTE: Rationale for this option is that libwebrtc implements this RTP + * extension but lacks support for enabling it via API so SDP munging is + * needed. + */ + forceAbsCaptureTimeExten?: boolean; }; export declare type ProducerEvents = { transportclose: []; diff --git a/lib/Producer.d.ts.map b/lib/Producer.d.ts.map index 389caa28..9a9ac27b 100644 --- a/lib/Producer.d.ts.map +++ b/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;AAE9D,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,iBAAiB,CAAC;AAIzB,oBAAY,eAAe,GAC3B;IACC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,KAAK,CAAC,EAAE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,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAiBb;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAezC;;OAEG;IACH,KAAK,IAAI,IAAI;IAkCb;;OAEG;IACH,MAAM,IAAI,IAAI;IAkCd;;OAEG;IACG,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA2DhF;;OAEG;IACG,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBvD,wBAAwB,CAC7B,MAAM,EAAE,wBAAwB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAkBhB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,aAAa;CAgBrB"} \ No newline at end of file diff --git a/lib/Transport.d.ts.map b/lib/Transport.d.ts.map index 6044b26d..12d2c632 100644 --- a/lib/Transport.d.ts.map +++ b/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;AAI9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAyB,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,i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AAC,IAAI,CAAC;IAehB;;OAEG;IACG,gBAAgB,CACrB,EAAE,UAAU,EAAE,GACd;QAAE,UAAU,CAAC,EAAE,YAAY,EAAE,CAAA;KAAO,GAClC,OAAO,CAAC,IAAI,CAAC;IAehB;;OAEG;IACG,OAAO,CACZ,EACC,KAAK,EACL,SAAS,EACT,YAAY,EACZ,KAAK,EACL,UAAiB,EACjB,mBAA0B,EAC1B,cAAsB,EACtB,OAAY,EACZ,GAAE,eAAoB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAsIpB;;OAEG;IACG,OAAO,CACZ,EACC,EAAE,EACF,UAAU,EACV,IAAI,EACJ,aAAa,EACb,OAAY,EACZ,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IAkDpB;;OAEG;IACG,WAAW,CAChB,EACC,OAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAU,EACV,QAAa,EACb,OAAY,EACZ,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IAkExB;;OAEG;IACG,WAAW,CAChB,EACC,EAAE,EACF,cAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAY,EACZ,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IA0DlB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IA2H9C,sBAAsB;IA8CtB,uBAAuB;IA8CvB,sBAAsB;IA4CtB,cAAc,IAAI,IAAI;IAkCtB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAyEzC,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAoEzC,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAQrD,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAOrD"} \ 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,wBAAw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B,sBAAsB;IA4CtB,cAAc,IAAI,IAAI;IAkCtB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAyEzC,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAoEzC,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAQrD,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAOrD"} \ No newline at end of file diff --git a/lib/Transport.js b/lib/Transport.js index faf2b8e2..8925e5d7 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -336,6 +336,7 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter { async consume({ id, producerId, kind, rtpParameters, appData = {} }) { logger.debug('consume()'); rtpParameters = utils.clone(rtpParameters, undefined); + console.warn('--- consume() rtpParameters:', rtpParameters); if (this._closed) throw new errors_1.InvalidStateError('closed'); else if (this._direction !== 'recv') diff --git a/lib/handlers/Chrome74.d.ts b/lib/handlers/Chrome74.d.ts index 97258540..0c7b62ad 100644 --- a/lib/handlers/Chrome74.d.ts +++ b/lib/handlers/Chrome74.d.ts @@ -1,4 +1,4 @@ -import { HandlerFactory, HandlerInterface, HandlerRunOptions, HandlerSendOptions, HandlerSendResult, HandlerReceiveOptions, HandlerReceiveResult, HandlerSendDataChannelOptions, HandlerSendDataChannelResult, HandlerReceiveDataChannelOptions, HandlerReceiveDataChannelResult } from './HandlerInterface'; +import { HandlerFactory, HandlerGetNativeRtpCapabilitiesOptions, HandlerInterface, HandlerRunOptions, HandlerSendOptions, HandlerSendResult, HandlerReceiveOptions, HandlerReceiveResult, HandlerSendDataChannelOptions, HandlerSendDataChannelResult, HandlerReceiveDataChannelOptions, HandlerReceiveDataChannelResult } from './HandlerInterface'; import { IceParameters } from '../Transport'; import { RtpCapabilities } from '../RtpParameters'; import { SctpCapabilities } from '../SctpParameters'; @@ -21,7 +21,7 @@ export declare class Chrome74 extends HandlerInterface { constructor(); get name(): string; close(): void; - getNativeRtpCapabilities(): Promise; + getNativeRtpCapabilities({ forceAbsCaptureTimeRtpHeaderExtension }: HandlerGetNativeRtpCapabilitiesOptions): Promise; getNativeSctpCapabilities(): Promise; run({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, extendedRtpCapabilities }: HandlerRunOptions): void; updateIceServers(iceServers: RTCIceServer[]): Promise; diff --git a/lib/handlers/Chrome74.d.ts.map b/lib/handlers/Chrome74.d.ts.map index d2f104a1..5f3429a6 100644 --- a/lib/handlers/Chrome74.d.ts.map +++ b/lib/handlers/Chrome74.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Chrome74.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome74.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EACN,eAAe,EAGf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAM3E,qBAAa,QAAS,SAAQ,gBAAgB;IAG7C,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,OAAO,CAAC,UAAU,CAAC,CAAY;IAE/B,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAGvE,OAAO,CAAC,iCAAiC,CAAC,CAAmC;IAG7E,OAAO,CAAC,oBAAoB,CAAC,CAAW;IAExC,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACxB;IAEX,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,CAAC,2BAA2B,CAAS;IAE5C,OAAO,CAAC,qB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ff --git a/lib/handlers/Chrome74.js b/lib/handlers/Chrome74.js index c9d93d12..6957c490 100644 --- a/lib/handlers/Chrome74.js +++ b/lib/handlers/Chrome74.js @@ -69,7 +69,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { } this.emit('@close'); } - async getNativeRtpCapabilities() { + async getNativeRtpCapabilities({ forceAbsCaptureTimeRtpHeaderExtension }) { logger.debug('getNativeRtpCapabilities()'); const pc = new RTCPeerConnection({ iceServers: [], @@ -88,6 +88,16 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { catch (error) { } const sdpObject = sdpTransform.parse(offer.sdp); const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({ sdpObject }); + if (forceAbsCaptureTimeRtpHeaderExtension) { + console.warn('---- Chrome74.getNativeRtpCapabilities() | adding abs-capture'); + sdpCommonUtils.addRtpExtensionToRtpCapabilities({ + rtpCapabilities: nativeRtpCapabilities, + uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time', + audio: true, + video: true, + direction: 'sendrecv' + }); + } return nativeRtpCapabilities; } catch (error) { @@ -216,6 +226,30 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { let offer = await this._pc.createOffer(); let localSdpObject = sdpTransform.parse(offer.sdp); let offerMediaObject; + // May force abs-capture-time RTP extension. + if (codecOptions === null || codecOptions === void 0 ? void 0 : codecOptions.forceAbsCaptureTimeExten) { + offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; + const exten = sdpCommonUtils.addRtpExtensionToMediaObject({ + mediaObject: offerMediaObject, + uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time' + }); + if (exten) { + offer = { type: 'offer', sdp: sdpTransform.write(localSdpObject) }; + sdpCommonUtils.addRtpExtensionToRtpParameters({ + rtpParameters: sendingRtpParameters, + extension: exten + }); + sdpCommonUtils.addRtpExtensionToRtpParameters({ + rtpParameters: sendingRemoteRtpParameters, + extension: exten + }); + console.warn('--- exten:', exten); + console.warn('--- offerMediaObject.ext:', offerMediaObject.ext); + console.warn('--- offer.sdp:', offer.sdp); + console.warn('--- sendingRtpParameters:', sendingRtpParameters); + console.warn('--- sendingRemoteRtpParameters:', sendingRemoteRtpParameters); + } + } if (!this._transportReady) { await this._setupTransport({ localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client', @@ -241,6 +275,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { } logger.debug('send() | calling pc.setLocalDescription() [offer:%o]', offer); await this._pc.setLocalDescription(offer); + console.warn('--- this._pc.localDescription.sdp:', this._pc.localDescription.sdp); // We can now get the transceiver.mid. const localId = transceiver.mid; // Set MID. @@ -289,6 +324,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('send() | calling pc.setRemoteDescription() [answer:%o]', answer); await this._pc.setRemoteDescription(answer); + console.warn('--- this._pc.remoteDescription.sdp:', this._pc.remoteDescription.sdp); // Store in the map. this._mapMidTransceiver.set(localId, transceiver); return { diff --git a/lib/handlers/HandlerInterface.d.ts b/lib/handlers/HandlerInterface.d.ts index 0c835036..0584e229 100644 --- a/lib/handlers/HandlerInterface.d.ts +++ b/lib/handlers/HandlerInterface.d.ts @@ -4,6 +4,9 @@ import { IceParameters, IceCandidate, DtlsParameters, ConnectionState } from '.. import { RtpCapabilities, RtpCodecCapability, RtpParameters, RtpEncodingParameters } from '../RtpParameters'; import { SctpCapabilities, SctpParameters, SctpStreamParameters } from '../SctpParameters'; export declare type HandlerFactory = () => HandlerInterface; +export declare type HandlerGetNativeRtpCapabilitiesOptions = { + forceAbsCaptureTimeRtpHeaderExtension?: boolean; +}; export declare type HandlerRunOptions = { direction: 'send' | 'recv'; iceParameters: IceParameters; @@ -65,7 +68,7 @@ export declare abstract class HandlerInterface extends EnhancedEventEmitter; + abstract getNativeRtpCapabilities(options?: HandlerGetNativeRtpCapabilitiesOptions): Promise; abstract getNativeSctpCapabilities(): Promise; abstract run(options: HandlerRunOptions): void; abstract updateIceServers(iceServers: RTCIceServer[]): Promise; diff --git a/lib/handlers/HandlerInterface.d.ts.map b/lib/handlers/HandlerInterface.d.ts.map index 37629c13..9db04b13 100644 --- a/lib/handlers/HandlerInterface.d.ts.map +++ b/lib/handlers/HandlerInterface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"HandlerInterface.d.ts","sourceRoot":"","sources":["../../src/handlers/HandlerInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,cAAc,GAAG,MAAM,gBAAgB,CAAC;AAEpD,oBAAY,iBAAiB,GAC7B;IACC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,uBAAuB,EAAE,GAAG,CAAC;CAC7B,CAAC;AAEF,oBAAY,kBAAkB,GAC9B;IACC,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,YAAY,CAAC,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AA4B,CAAC;IAExC,QAAQ,CAAC,OAAO,CACf,WAAW,EAAE,qBAAqB,EAAE,GACjC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAEnC,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzD,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1D,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAEnE,QAAQ,CAAC,kBAAkB,CAC1B,OAAO,EAAE,gCAAgC,GACvC,OAAO,CAAC,+BAA+B,CAAC;CAC3C"} \ No newline at end of file +{"version":3,"file":"HandlerInterface.d.ts","sourceRoot":"","sources":["../../src/handlers/HandlerInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,cAAc,GAAG,MAAM,gBAAgB,CAAC;AAEpD,oBAAY,sCAAsC,GAClD;IACC,qCAAqC,CAAC,EAAE,OAAO,CAAC;CAChD,CAAC;AAEF,oBAAY,iBAAiB,GAC7B;IACC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa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,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IAEhB,QAAQ,CAAC,kBAAkB,CAC1B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GACnC,OAAO,CAAC,IAAI,CAAC;IAEhB,QAAQ,CAAC,wBAAwB,CAChC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAC1B,OAAO,CAAC,IAAI,CAAC;IAEhB,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAEjE,QAAQ,CAAC,eAAe,CACvB,OAAO,EAAE,6BAA6B,GACpC,OAAO,CAAC,4BAA4B,CAAC;IAExC,QAAQ,CAAC,OAAO,CACf,WAAW,EAAE,qBAAqB,EAAE,GACjC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAEnC,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzD,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1D,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAEnE,QAAQ,CAAC,kBAAkB,CAC1B,OAAO,EAAE,gCAAgC,GACvC,OAAO,CAAC,+BAA+B,CAAC;CAC3C"} \ No newline at end of file diff --git a/lib/handlers/sdp/commonUtils.d.ts b/lib/handlers/sdp/commonUtils.d.ts index b6307747..afa0b305 100644 --- a/lib/handlers/sdp/commonUtils.d.ts +++ b/lib/handlers/sdp/commonUtils.d.ts @@ -1,5 +1,5 @@ import { DtlsParameters } from '../../Transport'; -import { RtpCapabilities, RtpParameters } from '../../RtpParameters'; +import { RtpCapabilities, RtpHeaderExtensionDirection, RtpHeaderExtensionParameters, RtpParameters } from '../../RtpParameters'; export declare function extractRtpCapabilities({ sdpObject }: { sdpObject: any; }): RtpCapabilities; @@ -17,4 +17,35 @@ export declare function applyCodecParameters({ offerRtpParameters, answerMediaOb offerRtpParameters: RtpParameters; answerMediaObject: any; }): void; +/** + * Adds the given RTP extension to the given SDP media object and returns a + * RtpHeaderExtensionParameters object. + * If the extension is already present, this function doesn't add anything and + * doesn't return anything. + */ +export declare function addRtpExtensionToMediaObject({ mediaObject, uri }: { + mediaObject: any; + uri: string; +}): RtpHeaderExtensionParameters | undefined; +/** + * Adds the given RTP extension to the given RTP capabilities. + * If the extension is already present, this function doesn't add anything. + */ +export declare function addRtpExtensionToRtpCapabilities({ rtpCapabilities, uri, audio, video, direction }: { + rtpCapabilities: RtpCapabilities; + uri: string; + audio: boolean; + video: boolean; + direction: RtpHeaderExtensionDirection; +}): void; +/** + * Adds the given RTP extension to the given RTP parameters. + * If the extension is already present (with same id), this function doesn't + * add anything. If the extension is present with a different id, then existing + * one is removed and the new one is added. + */ +export declare function addRtpExtensionToRtpParameters({ rtpParameters, extension }: { + rtpParameters: RtpParameters; + extension: RtpHeaderExtensionParameters; +}): void; //# sourceMappingURL=commonUtils.d.ts.map \ No newline at end of file diff --git a/lib/handlers/sdp/commonUtils.d.ts.map b/lib/handlers/sdp/commonUtils.d.ts.map index a50143f7..7b26eb31 100644 --- a/lib/handlers/sdp/commonUtils.d.ts.map +++ b/lib/handlers/sdp/commonUtils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAGf,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN"} \ No newline at end of file +{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAGf,2BAA2B,EAC3B,4BAA4B,EAC5B,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,4BAA4B,GAAG,SAAS,CA8B1C;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC/C,EACC,eAAe,EACf,GAAG,EACH,KAAK,EACL,KAAK,EACL,SAAS,EACT,EACD;IACC,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,2BAA2B,CAAC;CACvC,GACC,IAAI,CAiDN;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,EACC,aAAa,EACb,SAAS,EACT,EACD;IACC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,4BAA4B,CAAC;CACxC,GACC,IAAI,CA8BN"} \ No newline at end of file diff --git a/lib/handlers/sdp/commonUtils.js b/lib/handlers/sdp/commonUtils.js index 4eddcdbe..5312c6cd 100644 --- a/lib/handlers/sdp/commonUtils.js +++ b/lib/handlers/sdp/commonUtils.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.applyCodecParameters = exports.getCname = exports.extractDtlsParameters = exports.extractRtpCapabilities = void 0; +exports.addRtpExtensionToRtpParameters = exports.addRtpExtensionToRtpCapabilities = exports.addRtpExtensionToMediaObject = exports.applyCodecParameters = exports.getCname = exports.extractDtlsParameters = exports.extractRtpCapabilities = void 0; const sdpTransform = __importStar(require("sdp-transform")); function extractRtpCapabilities({ sdpObject }) { // Map of RtpCodecParameters indexed by payload type. @@ -192,3 +192,98 @@ function applyCodecParameters({ offerRtpParameters, answerMediaObject }) { } } exports.applyCodecParameters = applyCodecParameters; +/** + * Adds the given RTP extension to the given SDP media object and returns a + * RtpHeaderExtensionParameters object. + * If the extension is already present, this function doesn't add anything and + * doesn't return anything. + */ +function addRtpExtensionToMediaObject({ mediaObject, uri }) { + if (!Array.isArray(mediaObject.ext)) { + mediaObject.ext = []; + } + let id = 1; + for (const exten of mediaObject.ext) { + // If extension uri is already present, don't do anything. + if (exten.uri === uri) { + id = 0; + break; + } + if (exten.value >= id) + id = exten.value + 1; + } + if (id > 0) { + mediaObject.ext.push({ value: id, uri }); + // NOTE: No support for encrypt/parameters fields. + return { uri, id }; + } +} +exports.addRtpExtensionToMediaObject = addRtpExtensionToMediaObject; +/** + * Adds the given RTP extension to the given RTP capabilities. + * If the extension is already present, this function doesn't add anything. + */ +function addRtpExtensionToRtpCapabilities({ rtpCapabilities, uri, audio, video, direction }) { + let preferredId = 1; + if (!Array.isArray(rtpCapabilities.headerExtensions)) { + rtpCapabilities.headerExtensions = []; + } + for (const exten of rtpCapabilities.headerExtensions) { + // If extension uri is already present, don't do anything. + if (exten.uri === uri) { + preferredId = 0; + break; + } + if (exten.preferredId >= preferredId) + preferredId = exten.preferredId + 1; + } + if (preferredId > 0) { + if (audio) { + rtpCapabilities.headerExtensions.push({ + kind: 'audio', + uri, + preferredId, + preferredEncrypt: false, + direction + }); + } + if (video) { + rtpCapabilities.headerExtensions.push({ + kind: 'video', + uri, + preferredId, + preferredEncrypt: false, + direction + }); + } + } +} +exports.addRtpExtensionToRtpCapabilities = addRtpExtensionToRtpCapabilities; +/** + * Adds the given RTP extension to the given RTP parameters. + * If the extension is already present (with same id), this function doesn't + * add anything. If the extension is present with a different id, then existing + * one is removed and the new one is added. + */ +function addRtpExtensionToRtpParameters({ rtpParameters, extension }) { + if (!Array.isArray(rtpParameters.headerExtensions)) { + rtpParameters.headerExtensions = []; + } + let replaced = false; + for (const exten of rtpParameters.headerExtensions) { + if (exten.uri === extension.uri && exten.id === extension.id) { + console.warn('--- addRtpExtensionToRtpParameters() EXTEN ALREADY EXISTS'); + return; + } + else if (exten.uri === extension.uri && exten.id !== extension.id) { + console.warn('--- addRtpExtensionToRtpParameters() REPLACING EXTEN ID'); + exten.id = extension.id; + replaced = true; + } + } + if (!replaced) { + console.warn('--- addRtpExtensionToRtpParameters() adding exten'); + rtpParameters.headerExtensions.push(extension); + } +} +exports.addRtpExtensionToRtpParameters = addRtpExtensionToRtpParameters; diff --git a/src/Device.ts b/src/Device.ts index b8122bb7..869a2473 100644 --- a/src/Device.ts +++ b/src/Device.ts @@ -50,6 +50,22 @@ export type DeviceOptions = Handler?: string; }; +export type DeviceLoadOptions = +{ + /** + * RTP capabilities of the mediasoup Router. + */ + routerRtpCapabilities: RtpCapabilities; + /** + * Force negotiation of abs-capture-time RTP extension for receiving in all + * Consumers created in the Transports of this Device. + * NOTE: Rationale for this option is that libwebrtc implements this RTP + * extension but lacks support for enabling it via API so SDP munging is + * needed. + */ + forceAbsCaptureTimeRtpHeaderExtension?: boolean; +}; + interface InternalTransportOptions extends TransportOptions { direction: 'send' | 'recv'; @@ -209,7 +225,12 @@ export class Device * * @throws {UnsupportedError} if device is not supported. */ - constructor({ handlerName, handlerFactory, Handler }: DeviceOptions = {}) + constructor( + { + handlerName, + handlerFactory, + Handler + }: DeviceOptions = {}) { logger.debug('constructor()'); @@ -354,8 +375,10 @@ export class Device * Initialize the Device. */ async load( - { routerRtpCapabilities }: - { routerRtpCapabilities: RtpCapabilities } + { + routerRtpCapabilities, + forceAbsCaptureTimeRtpHeaderExtension + }: DeviceLoadOptions ): Promise { logger.debug('load() [routerRtpCapabilities:%o]', routerRtpCapabilities); @@ -375,7 +398,10 @@ export class Device handler = this._handlerFactory(); - const nativeRtpCapabilities = await handler.getNativeRtpCapabilities(); + const nativeRtpCapabilities = await handler.getNativeRtpCapabilities( + { + forceAbsCaptureTimeRtpHeaderExtension + }); logger.debug( 'load() | got native RTP capabilities:%o', nativeRtpCapabilities); @@ -387,6 +413,8 @@ export class Device this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities( nativeRtpCapabilities, routerRtpCapabilities); + console.warn('--- Device this._extendedRtpCapabilities:', this._extendedRtpCapabilities); + logger.debug( 'load() | got extended RTP capabilities:%o', this._extendedRtpCapabilities); diff --git a/src/Producer.ts b/src/Producer.ts index e3db90b2..110aa19e 100644 --- a/src/Producer.ts +++ b/src/Producer.ts @@ -34,6 +34,14 @@ export type ProducerCodecOptions = videoGoogleStartBitrate?: number; videoGoogleMaxBitrate?: number; videoGoogleMinBitrate?: number; + /** + * Force negotiation of abs-capture-time RTP extension for sending in this + * Producer. + * NOTE: Rationale for this option is that libwebrtc implements this RTP + * extension but lacks support for enabling it via API so SDP munging is + * needed. + */ + forceAbsCaptureTimeExten?: boolean; } export type ProducerEvents = diff --git a/src/Transport.ts b/src/Transport.ts index f1bd47ba..9fbc5414 100644 --- a/src/Transport.ts +++ b/src/Transport.ts @@ -631,6 +631,8 @@ export class Transport extends EnhancedEventEmitter rtpParameters = utils.clone(rtpParameters, undefined); + console.warn('--- consume() rtpParameters:', rtpParameters); + if (this._closed) throw new InvalidStateError('closed'); else if (this._direction !== 'recv') diff --git a/src/handlers/Chrome74.ts b/src/handlers/Chrome74.ts index 7f9b9921..323460ad 100644 --- a/src/handlers/Chrome74.ts +++ b/src/handlers/Chrome74.ts @@ -6,6 +6,7 @@ import * as sdpCommonUtils from './sdp/commonUtils'; import * as sdpUnifiedPlanUtils from './sdp/unifiedPlanUtils'; import { HandlerFactory, + HandlerGetNativeRtpCapabilitiesOptions, HandlerInterface, HandlerRunOptions, HandlerSendOptions, @@ -91,7 +92,11 @@ export class Chrome74 extends HandlerInterface this.emit('@close'); } - async getNativeRtpCapabilities(): Promise + async getNativeRtpCapabilities( + { + forceAbsCaptureTimeRtpHeaderExtension + }: HandlerGetNativeRtpCapabilitiesOptions + ): Promise { logger.debug('getNativeRtpCapabilities()'); @@ -118,6 +123,19 @@ export class Chrome74 extends HandlerInterface const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({ sdpObject }); + if (forceAbsCaptureTimeRtpHeaderExtension) + { + console.warn('---- Chrome74.getNativeRtpCapabilities() | adding abs-capture'); + sdpCommonUtils.addRtpExtensionToRtpCapabilities( + { + rtpCapabilities : nativeRtpCapabilities, + uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time', + audio : true, + video : true, + direction : 'sendrecv' + }); + } + return nativeRtpCapabilities; } catch (error) @@ -326,6 +344,41 @@ export class Chrome74 extends HandlerInterface let localSdpObject = sdpTransform.parse(offer.sdp); let offerMediaObject; + // May force abs-capture-time RTP extension. + if (codecOptions?.forceAbsCaptureTimeExten) + { + offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; + + const exten = sdpCommonUtils.addRtpExtensionToMediaObject( + { + mediaObject : offerMediaObject, + uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time' + }); + + if (exten) + { + offer = { type: 'offer', sdp: sdpTransform.write(localSdpObject) }; + + sdpCommonUtils.addRtpExtensionToRtpParameters( + { + rtpParameters : sendingRtpParameters, + extension : exten + }); + + sdpCommonUtils.addRtpExtensionToRtpParameters( + { + rtpParameters : sendingRemoteRtpParameters, + extension : exten + }); + + console.warn('--- exten:', exten); + console.warn('--- offerMediaObject.ext:', offerMediaObject.ext); + console.warn('--- offer.sdp:', offer.sdp); + console.warn('--- sendingRtpParameters:', sendingRtpParameters); + console.warn('--- sendingRemoteRtpParameters:', sendingRemoteRtpParameters); + } + } + if (!this._transportReady) { await this._setupTransport( @@ -369,6 +422,8 @@ export class Chrome74 extends HandlerInterface await this._pc.setLocalDescription(offer); + console.warn('--- this._pc.localDescription.sdp:', this._pc.localDescription.sdp); + // We can now get the transceiver.mid. const localId = transceiver.mid; @@ -443,6 +498,8 @@ export class Chrome74 extends HandlerInterface await this._pc.setRemoteDescription(answer); + console.warn('--- this._pc.remoteDescription.sdp:', this._pc.remoteDescription.sdp); + // Store in the map. this._mapMidTransceiver.set(localId, transceiver); diff --git a/src/handlers/HandlerInterface.ts b/src/handlers/HandlerInterface.ts index 29607e11..90c60b1c 100644 --- a/src/handlers/HandlerInterface.ts +++ b/src/handlers/HandlerInterface.ts @@ -20,6 +20,11 @@ import { export type HandlerFactory = () => HandlerInterface; +export type HandlerGetNativeRtpCapabilitiesOptions = +{ + forceAbsCaptureTimeRtpHeaderExtension?: boolean; +}; + export type HandlerRunOptions = { direction: 'send' | 'recv'; @@ -106,7 +111,9 @@ export abstract class HandlerInterface extends EnhancedEventEmitter; + abstract getNativeRtpCapabilities( + options?: HandlerGetNativeRtpCapabilitiesOptions + ): Promise; abstract getNativeSctpCapabilities(): Promise; diff --git a/src/handlers/sdp/commonUtils.ts b/src/handlers/sdp/commonUtils.ts index 15b948e1..06ab50cb 100644 --- a/src/handlers/sdp/commonUtils.ts +++ b/src/handlers/sdp/commonUtils.ts @@ -4,6 +4,8 @@ import { RtpCapabilities, RtpCodecCapability, RtpHeaderExtension, + RtpHeaderExtensionDirection, + RtpHeaderExtensionParameters, RtpParameters, RtcpFeedback } from '../../RtpParameters'; @@ -257,3 +259,161 @@ export function applyCodecParameters( } } } + +/** + * Adds the given RTP extension to the given SDP media object and returns a + * RtpHeaderExtensionParameters object. + * If the extension is already present, this function doesn't add anything and + * doesn't return anything. + */ +export function addRtpExtensionToMediaObject( + { mediaObject, uri }: + { mediaObject: any; uri: string } +): RtpHeaderExtensionParameters | undefined +{ + if (!Array.isArray(mediaObject.ext)) + { + mediaObject.ext = []; + } + + let id = 1; + + for (const exten of mediaObject.ext) + { + // If extension uri is already present, don't do anything. + if (exten.uri === uri) + { + id = 0; + + break; + } + + if (exten.value >= id) + id = exten.value + 1; + } + + if (id > 0) + { + mediaObject.ext.push({ value: id, uri }); + + // NOTE: No support for encrypt/parameters fields. + return { uri, id }; + } +} + +/** + * Adds the given RTP extension to the given RTP capabilities. + * If the extension is already present, this function doesn't add anything. + */ +export function addRtpExtensionToRtpCapabilities( + { + rtpCapabilities, + uri, + audio, + video, + direction + }: + { + rtpCapabilities: RtpCapabilities; + uri: string; + audio: boolean; + video: boolean; + direction: RtpHeaderExtensionDirection; + } +): void +{ + let preferredId = 1; + + if (!Array.isArray(rtpCapabilities.headerExtensions)) + { + rtpCapabilities.headerExtensions = []; + } + + for (const exten of rtpCapabilities.headerExtensions) + { + // If extension uri is already present, don't do anything. + if (exten.uri === uri) + { + preferredId = 0; + + break; + } + + if (exten.preferredId >= preferredId) + preferredId = exten.preferredId + 1; + } + + if (preferredId > 0) + { + if (audio) + { + rtpCapabilities.headerExtensions.push( + { + kind : 'audio', + uri, + preferredId, + preferredEncrypt : false, + direction + }); + } + + if (video) + { + rtpCapabilities.headerExtensions.push( + { + kind : 'video', + uri, + preferredId, + preferredEncrypt : false, + direction + }); + } + } +} + +/** + * Adds the given RTP extension to the given RTP parameters. + * If the extension is already present (with same id), this function doesn't + * add anything. If the extension is present with a different id, then existing + * one is removed and the new one is added. + */ +export function addRtpExtensionToRtpParameters( + { + rtpParameters, + extension + }: + { + rtpParameters: RtpParameters; + extension: RtpHeaderExtensionParameters; + } +): void +{ + if (!Array.isArray(rtpParameters.headerExtensions)) + { + rtpParameters.headerExtensions = []; + } + + let replaced = false; + + for (const exten of rtpParameters.headerExtensions) + { + if (exten.uri === extension.uri && exten.id === extension.id) + { + console.warn('--- addRtpExtensionToRtpParameters() EXTEN ALREADY EXISTS'); + return; + } + else if (exten.uri === extension.uri && exten.id !== extension.id) + { + console.warn('--- addRtpExtensionToRtpParameters() REPLACING EXTEN ID'); + exten.id = extension.id; + + replaced = true; + } + } + + if (!replaced) + { + console.warn('--- addRtpExtensionToRtpParameters() adding exten'); + rtpParameters.headerExtensions.push(extension); + } +} From 1ea073f775e5467fd86e7c07c13f4702f2bf654a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Wed, 28 Sep 2022 14:21:58 +0200 Subject: [PATCH 2/4] done --- lib/Device.d.ts | 18 ++----- lib/Device.d.ts.map | 2 +- lib/Device.js | 7 +-- lib/Transport.d.ts.map | 2 +- lib/Transport.js | 1 - lib/handlers/Chrome74.d.ts | 4 +- lib/handlers/Chrome74.d.ts.map | 2 +- lib/handlers/Chrome74.js | 19 +------ lib/handlers/HandlerInterface.d.ts | 5 +- lib/handlers/HandlerInterface.d.ts.map | 2 +- lib/handlers/sdp/commonUtils.d.ts | 13 +---- lib/handlers/sdp/commonUtils.d.ts.map | 2 +- lib/handlers/sdp/commonUtils.js | 45 +--------------- src/Device.ts | 36 ++----------- src/Transport.ts | 2 - src/handlers/Chrome74.ts | 30 +---------- src/handlers/HandlerInterface.ts | 9 +--- src/handlers/sdp/commonUtils.ts | 73 -------------------------- 18 files changed, 22 insertions(+), 250 deletions(-) diff --git a/lib/Device.d.ts b/lib/Device.d.ts index 2dbdf1e3..cda30103 100644 --- a/lib/Device.d.ts +++ b/lib/Device.d.ts @@ -19,20 +19,6 @@ export declare type DeviceOptions = { */ Handler?: string; }; -export declare type DeviceLoadOptions = { - /** - * RTP capabilities of the mediasoup Router. - */ - routerRtpCapabilities: RtpCapabilities; - /** - * Force negotiation of abs-capture-time RTP extension for receiving in all - * Consumers created in the Transports of this Device. - * NOTE: Rationale for this option is that libwebrtc implements this RTP - * extension but lacks support for enabling it via API so SDP munging is - * needed. - */ - forceAbsCaptureTimeRtpHeaderExtension?: boolean; -}; export declare function detectDevice(): BuiltinHandlerName | undefined; export declare type DeviceObserverEvents = { newtransport: [Transport]; @@ -76,7 +62,9 @@ export declare class Device { /** * Initialize the Device. */ - load({ routerRtpCapabilities, forceAbsCaptureTimeRtpHeaderExtension }: DeviceLoadOptions): Promise; + load({ routerRtpCapabilities }: { + routerRtpCapabilities: RtpCapabilities; + }): Promise; /** * Whether we can produce audio/video. * diff --git a/lib/Device.d.ts.map b/lib/Device.d.ts.map index 4a5ed38c..a2d0c20c 100644 --- a/lib/Device.d.ts.map +++ b/lib/Device.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EA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,IAAI,WAAW,IAAI,MAAM,CAGxB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED;;;;OAIG;IACH,IAAI,eAAe,IAAI,eAAe,CAMrC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,gBAAgB,CAMvC;IAED,IAAI,QAAQ,IAAI,oBAAoB,CAGnC;IAED;;OAEG;IACG,IAAI,CACT,EACC,qBAAqB,EACrB,qCAAqC,EACrC,EAAE,iBAAiB,GAClB,OAAO,CAAC,IAAI,CAAC;IAiFhB;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAUpC;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file +{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAoB,MAAM,6BAA6B,CAAC;AAU/E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,oBAAY,kBAAkB,GAC3B,UAAU,GACV,UAAU,GACV,UAA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IAAI,EAAE,SAAS,GAAG,OAAO;IAUpC;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ;;;;;OAKG;IACH,mBAAmB,CAClB,EACC,EAAE,EACF,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,EAAE,gBAAgB,GACjB,SAAS;IAoBZ,OAAO,CAAC,gBAAgB;CAuDxB"} \ No newline at end of file diff --git a/lib/Device.js b/lib/Device.js index e5c38e04..5c8532b8 100644 --- a/lib/Device.js +++ b/lib/Device.js @@ -252,7 +252,7 @@ class Device { /** * Initialize the Device. */ - async load({ routerRtpCapabilities, forceAbsCaptureTimeRtpHeaderExtension }) { + async load({ routerRtpCapabilities }) { logger.debug('load() [routerRtpCapabilities:%o]', routerRtpCapabilities); routerRtpCapabilities = utils.clone(routerRtpCapabilities, undefined); // Temporal handler to get its capabilities. @@ -263,15 +263,12 @@ class Device { // This may throw. ortc.validateRtpCapabilities(routerRtpCapabilities); handler = this._handlerFactory(); - const nativeRtpCapabilities = await handler.getNativeRtpCapabilities({ - forceAbsCaptureTimeRtpHeaderExtension - }); + const nativeRtpCapabilities = await handler.getNativeRtpCapabilities(); logger.debug('load() | got native RTP capabilities:%o', nativeRtpCapabilities); // This may throw. ortc.validateRtpCapabilities(nativeRtpCapabilities); // Get extended RTP capabilities. this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities(nativeRtpCapabilities, routerRtpCapabilities); - console.warn('--- Device this._extendedRtpCapabilities:', this._extendedRtpCapabilities); logger.debug('load() | got extended RTP capabilities:%o', this._extendedRtpCapabilities); // Check whether we can produce audio/video. this._canProduceByKind.audio = diff --git a/lib/Transport.d.ts.map b/lib/Transport.d.ts.map index 12d2c632..6044b26d 100644 --- a/lib/Transport.d.ts.map +++ b/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;AAI9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAyB,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxE,UAAU,wBAAyB,SAAQ,gBAAgB;IAE1D,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,uBAAuB,EAAE,GAAG,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;CACnC;AAoBD,oBAAY,gBAAgB,GAC5B;IACC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,OAAO,CAAC,E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EACtB,OAAY,EACZ,GAAE,eAAoB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAsIpB;;OAEG;IACG,OAAO,CACZ,EACC,EAAE,EACF,UAAU,EACV,IAAI,EACJ,aAAa,EACb,OAAY,EACZ,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IAkDpB;;OAEG;IACG,WAAW,CAChB,EACC,OAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAU,EACV,QAAa,EACb,OAAY,EACZ,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IAkExB;;OAEG;IACG,WAAW,CAChB,EACC,EAAE,EACF,cAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAY,EACZ,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IA0DlB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IA2H9C,sBAAsB;IA8CtB,uBAAuB;IA8CvB,sBAAsB;IA4CtB,cAAc,IAAI,IAAI;IAkCtB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAyEzC,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAoEzC,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAQrD,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAOrD"} \ No newline at end of file diff --git a/lib/Transport.js b/lib/Transport.js index 8925e5d7..faf2b8e2 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -336,7 +336,6 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter { async consume({ id, producerId, kind, rtpParameters, appData = {} }) { logger.debug('consume()'); rtpParameters = utils.clone(rtpParameters, undefined); - console.warn('--- consume() rtpParameters:', rtpParameters); if (this._closed) throw new errors_1.InvalidStateError('closed'); else if (this._direction !== 'recv') diff --git a/lib/handlers/Chrome74.d.ts b/lib/handlers/Chrome74.d.ts index 0c7b62ad..97258540 100644 --- a/lib/handlers/Chrome74.d.ts +++ b/lib/handlers/Chrome74.d.ts @@ -1,4 +1,4 @@ -import { HandlerFactory, HandlerGetNativeRtpCapabilitiesOptions, HandlerInterface, HandlerRunOptions, HandlerSendOptions, HandlerSendResult, HandlerReceiveOptions, HandlerReceiveResult, HandlerSendDataChannelOptions, HandlerSendDataChannelResult, HandlerReceiveDataChannelOptions, HandlerReceiveDataChannelResult } from './HandlerInterface'; +import { HandlerFactory, HandlerInterface, HandlerRunOptions, HandlerSendOptions, HandlerSendResult, HandlerReceiveOptions, HandlerReceiveResult, HandlerSendDataChannelOptions, HandlerSendDataChannelResult, HandlerReceiveDataChannelOptions, HandlerReceiveDataChannelResult } from './HandlerInterface'; import { IceParameters } from '../Transport'; import { RtpCapabilities } from '../RtpParameters'; import { SctpCapabilities } from '../SctpParameters'; @@ -21,7 +21,7 @@ export declare class Chrome74 extends HandlerInterface { constructor(); get name(): string; close(): void; - getNativeRtpCapabilities({ forceAbsCaptureTimeRtpHeaderExtension }: HandlerGetNativeRtpCapabilitiesOptions): Promise; + getNativeRtpCapabilities(): Promise; getNativeSctpCapabilities(): Promise; run({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, extendedRtpCapabilities }: HandlerRunOptions): void; updateIceServers(iceServers: RTCIceServer[]): Promise; diff --git a/lib/handlers/Chrome74.d.ts.map b/lib/handlers/Chrome74.d.ts.map index 5f3429a6..06e433b0 100644 --- a/lib/handlers/Chrome74.d.ts.map +++ b/lib/handlers/Chrome74.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Chrome74.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome74.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,sCAAsC,EACtC,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,E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C;IAsElC,OAAO,CACZ,WAAW,EAAE,qBAAqB,EAAE,GACjC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAkG7B,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsChD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCjD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiClD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YAgE7B,eAAe;IAuC7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Chrome74.js b/lib/handlers/Chrome74.js index 6957c490..ccad24d4 100644 --- a/lib/handlers/Chrome74.js +++ b/lib/handlers/Chrome74.js @@ -69,7 +69,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { } this.emit('@close'); } - async getNativeRtpCapabilities({ forceAbsCaptureTimeRtpHeaderExtension }) { + async getNativeRtpCapabilities() { logger.debug('getNativeRtpCapabilities()'); const pc = new RTCPeerConnection({ iceServers: [], @@ -88,16 +88,6 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { catch (error) { } const sdpObject = sdpTransform.parse(offer.sdp); const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({ sdpObject }); - if (forceAbsCaptureTimeRtpHeaderExtension) { - console.warn('---- Chrome74.getNativeRtpCapabilities() | adding abs-capture'); - sdpCommonUtils.addRtpExtensionToRtpCapabilities({ - rtpCapabilities: nativeRtpCapabilities, - uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time', - audio: true, - video: true, - direction: 'sendrecv' - }); - } return nativeRtpCapabilities; } catch (error) { @@ -243,11 +233,6 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { rtpParameters: sendingRemoteRtpParameters, extension: exten }); - console.warn('--- exten:', exten); - console.warn('--- offerMediaObject.ext:', offerMediaObject.ext); - console.warn('--- offer.sdp:', offer.sdp); - console.warn('--- sendingRtpParameters:', sendingRtpParameters); - console.warn('--- sendingRemoteRtpParameters:', sendingRemoteRtpParameters); } } if (!this._transportReady) { @@ -275,7 +260,6 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { } logger.debug('send() | calling pc.setLocalDescription() [offer:%o]', offer); await this._pc.setLocalDescription(offer); - console.warn('--- this._pc.localDescription.sdp:', this._pc.localDescription.sdp); // We can now get the transceiver.mid. const localId = transceiver.mid; // Set MID. @@ -324,7 +308,6 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('send() | calling pc.setRemoteDescription() [answer:%o]', answer); await this._pc.setRemoteDescription(answer); - console.warn('--- this._pc.remoteDescription.sdp:', this._pc.remoteDescription.sdp); // Store in the map. this._mapMidTransceiver.set(localId, transceiver); return { diff --git a/lib/handlers/HandlerInterface.d.ts b/lib/handlers/HandlerInterface.d.ts index 0584e229..0c835036 100644 --- a/lib/handlers/HandlerInterface.d.ts +++ b/lib/handlers/HandlerInterface.d.ts @@ -4,9 +4,6 @@ import { IceParameters, IceCandidate, DtlsParameters, ConnectionState } from '.. import { RtpCapabilities, RtpCodecCapability, RtpParameters, RtpEncodingParameters } from '../RtpParameters'; import { SctpCapabilities, SctpParameters, SctpStreamParameters } from '../SctpParameters'; export declare type HandlerFactory = () => HandlerInterface; -export declare type HandlerGetNativeRtpCapabilitiesOptions = { - forceAbsCaptureTimeRtpHeaderExtension?: boolean; -}; export declare type HandlerRunOptions = { direction: 'send' | 'recv'; iceParameters: IceParameters; @@ -68,7 +65,7 @@ export declare abstract class HandlerInterface extends EnhancedEventEmitter; + abstract getNativeRtpCapabilities(): Promise; abstract getNativeSctpCapabilities(): Promise; abstract run(options: HandlerRunOptions): void; abstract updateIceServers(iceServers: RTCIceServer[]): Promise; diff --git a/lib/handlers/HandlerInterface.d.ts.map b/lib/handlers/HandlerInterface.d.ts.map index 9db04b13..37629c13 100644 --- a/lib/handlers/HandlerInterface.d.ts.map +++ b/lib/handlers/HandlerInterface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"HandlerInterface.d.ts","sourceRoot":"","sources":["../../src/handlers/HandlerInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,cAAc,GAAG,MAAM,gBAAgB,CAAC;AAEpD,oBAAY,sCAAsC,GAClD;IACC,qCAAqC,CAAC,EAAE,OAAO,CAAC;CAChD,CAAC;AAEF,oBAAY,iBAAiB,GAC7B;IACC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,uBAAuB,EAAE,GAAG,CAAC;CAC7B,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import { DtlsParameters } from '../../Transport'; -import { RtpCapabilities, RtpHeaderExtensionDirection, RtpHeaderExtensionParameters, RtpParameters } from '../../RtpParameters'; +import { RtpCapabilities, RtpHeaderExtensionParameters, RtpParameters } from '../../RtpParameters'; export declare function extractRtpCapabilities({ sdpObject }: { sdpObject: any; }): RtpCapabilities; @@ -27,17 +27,6 @@ export declare function addRtpExtensionToMediaObject({ mediaObject, uri }: { mediaObject: any; uri: string; }): RtpHeaderExtensionParameters | undefined; -/** - * Adds the given RTP extension to the given RTP capabilities. - * If the extension is already present, this function doesn't add anything. - */ -export declare function addRtpExtensionToRtpCapabilities({ rtpCapabilities, uri, audio, video, direction }: { - rtpCapabilities: RtpCapabilities; - uri: string; - audio: boolean; - video: boolean; - direction: RtpHeaderExtensionDirection; -}): void; /** * Adds the given RTP extension to the given RTP parameters. * If the extension is already present (with same id), this function doesn't diff --git a/lib/handlers/sdp/commonUtils.d.ts.map b/lib/handlers/sdp/commonUtils.d.ts.map index 7b26eb31..e8204f2b 100644 --- a/lib/handlers/sdp/commonUtils.d.ts.map +++ b/lib/handlers/sdp/commonUtils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAGf,2BAA2B,EAC3B,4BAA4B,EAC5B,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,4BAA4B,GAAG,SAAS,CA8B1C;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC/C,EACC,eAAe,EACf,GAAG,EACH,KAAK,EACL,KAAK,EACL,SAAS,EACT,EACD;IACC,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,2BAA2B,CAAC;CACvC,GACC,IAAI,CAiDN;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,EACC,aAAa,EACb,SAAS,EACT,EACD;IACC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,4BAA4B,CAAC;CACxC,GACC,IAAI,CA8BN"} \ No newline at end of file +{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAIf,4BAA4B,EAC5B,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,4BAA4B,GAAG,SAAS,CA8B1C;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,EACC,aAAa,EACb,SAAS,EACT,EACD;IACC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,4BAA4B,CAAC;CACxC,GACC,IAAI,CA2BN"} \ No newline at end of file diff --git a/lib/handlers/sdp/commonUtils.js b/lib/handlers/sdp/commonUtils.js index 5312c6cd..571e7f3e 100644 --- a/lib/handlers/sdp/commonUtils.js +++ b/lib/handlers/sdp/commonUtils.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.addRtpExtensionToRtpParameters = exports.addRtpExtensionToRtpCapabilities = exports.addRtpExtensionToMediaObject = exports.applyCodecParameters = exports.getCname = exports.extractDtlsParameters = exports.extractRtpCapabilities = void 0; +exports.addRtpExtensionToRtpParameters = exports.addRtpExtensionToMediaObject = exports.applyCodecParameters = exports.getCname = exports.extractDtlsParameters = exports.extractRtpCapabilities = void 0; const sdpTransform = __importStar(require("sdp-transform")); function extractRtpCapabilities({ sdpObject }) { // Map of RtpCodecParameters indexed by payload type. @@ -219,46 +219,6 @@ function addRtpExtensionToMediaObject({ mediaObject, uri }) { } } exports.addRtpExtensionToMediaObject = addRtpExtensionToMediaObject; -/** - * Adds the given RTP extension to the given RTP capabilities. - * If the extension is already present, this function doesn't add anything. - */ -function addRtpExtensionToRtpCapabilities({ rtpCapabilities, uri, audio, video, direction }) { - let preferredId = 1; - if (!Array.isArray(rtpCapabilities.headerExtensions)) { - rtpCapabilities.headerExtensions = []; - } - for (const exten of rtpCapabilities.headerExtensions) { - // If extension uri is already present, don't do anything. - if (exten.uri === uri) { - preferredId = 0; - break; - } - if (exten.preferredId >= preferredId) - preferredId = exten.preferredId + 1; - } - if (preferredId > 0) { - if (audio) { - rtpCapabilities.headerExtensions.push({ - kind: 'audio', - uri, - preferredId, - preferredEncrypt: false, - direction - }); - } - if (video) { - rtpCapabilities.headerExtensions.push({ - kind: 'video', - uri, - preferredId, - preferredEncrypt: false, - direction - }); - } - } -} -exports.addRtpExtensionToRtpCapabilities = addRtpExtensionToRtpCapabilities; /** * Adds the given RTP extension to the given RTP parameters. * If the extension is already present (with same id), this function doesn't @@ -272,17 +232,14 @@ function addRtpExtensionToRtpParameters({ rtpParameters, extension }) { let replaced = false; for (const exten of rtpParameters.headerExtensions) { if (exten.uri === extension.uri && exten.id === extension.id) { - console.warn('--- addRtpExtensionToRtpParameters() EXTEN ALREADY EXISTS'); return; } else if (exten.uri === extension.uri && exten.id !== extension.id) { - console.warn('--- addRtpExtensionToRtpParameters() REPLACING EXTEN ID'); exten.id = extension.id; replaced = true; } } if (!replaced) { - console.warn('--- addRtpExtensionToRtpParameters() adding exten'); rtpParameters.headerExtensions.push(extension); } } diff --git a/src/Device.ts b/src/Device.ts index 869a2473..b8122bb7 100644 --- a/src/Device.ts +++ b/src/Device.ts @@ -50,22 +50,6 @@ export type DeviceOptions = Handler?: string; }; -export type DeviceLoadOptions = -{ - /** - * RTP capabilities of the mediasoup Router. - */ - routerRtpCapabilities: RtpCapabilities; - /** - * Force negotiation of abs-capture-time RTP extension for receiving in all - * Consumers created in the Transports of this Device. - * NOTE: Rationale for this option is that libwebrtc implements this RTP - * extension but lacks support for enabling it via API so SDP munging is - * needed. - */ - forceAbsCaptureTimeRtpHeaderExtension?: boolean; -}; - interface InternalTransportOptions extends TransportOptions { direction: 'send' | 'recv'; @@ -225,12 +209,7 @@ export class Device * * @throws {UnsupportedError} if device is not supported. */ - constructor( - { - handlerName, - handlerFactory, - Handler - }: DeviceOptions = {}) + constructor({ handlerName, handlerFactory, Handler }: DeviceOptions = {}) { logger.debug('constructor()'); @@ -375,10 +354,8 @@ export class Device * Initialize the Device. */ async load( - { - routerRtpCapabilities, - forceAbsCaptureTimeRtpHeaderExtension - }: DeviceLoadOptions + { routerRtpCapabilities }: + { routerRtpCapabilities: RtpCapabilities } ): Promise { logger.debug('load() [routerRtpCapabilities:%o]', routerRtpCapabilities); @@ -398,10 +375,7 @@ export class Device handler = this._handlerFactory(); - const nativeRtpCapabilities = await handler.getNativeRtpCapabilities( - { - forceAbsCaptureTimeRtpHeaderExtension - }); + const nativeRtpCapabilities = await handler.getNativeRtpCapabilities(); logger.debug( 'load() | got native RTP capabilities:%o', nativeRtpCapabilities); @@ -413,8 +387,6 @@ export class Device this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities( nativeRtpCapabilities, routerRtpCapabilities); - console.warn('--- Device this._extendedRtpCapabilities:', this._extendedRtpCapabilities); - logger.debug( 'load() | got extended RTP capabilities:%o', this._extendedRtpCapabilities); diff --git a/src/Transport.ts b/src/Transport.ts index 9fbc5414..f1bd47ba 100644 --- a/src/Transport.ts +++ b/src/Transport.ts @@ -631,8 +631,6 @@ export class Transport extends EnhancedEventEmitter rtpParameters = utils.clone(rtpParameters, undefined); - console.warn('--- consume() rtpParameters:', rtpParameters); - if (this._closed) throw new InvalidStateError('closed'); else if (this._direction !== 'recv') diff --git a/src/handlers/Chrome74.ts b/src/handlers/Chrome74.ts index 323460ad..8b3dbbe0 100644 --- a/src/handlers/Chrome74.ts +++ b/src/handlers/Chrome74.ts @@ -6,7 +6,6 @@ import * as sdpCommonUtils from './sdp/commonUtils'; import * as sdpUnifiedPlanUtils from './sdp/unifiedPlanUtils'; import { HandlerFactory, - HandlerGetNativeRtpCapabilitiesOptions, HandlerInterface, HandlerRunOptions, HandlerSendOptions, @@ -92,11 +91,7 @@ export class Chrome74 extends HandlerInterface this.emit('@close'); } - async getNativeRtpCapabilities( - { - forceAbsCaptureTimeRtpHeaderExtension - }: HandlerGetNativeRtpCapabilitiesOptions - ): Promise + async getNativeRtpCapabilities(): Promise { logger.debug('getNativeRtpCapabilities()'); @@ -123,19 +118,6 @@ export class Chrome74 extends HandlerInterface const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({ sdpObject }); - if (forceAbsCaptureTimeRtpHeaderExtension) - { - console.warn('---- Chrome74.getNativeRtpCapabilities() | adding abs-capture'); - sdpCommonUtils.addRtpExtensionToRtpCapabilities( - { - rtpCapabilities : nativeRtpCapabilities, - uri : 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time', - audio : true, - video : true, - direction : 'sendrecv' - }); - } - return nativeRtpCapabilities; } catch (error) @@ -370,12 +352,6 @@ export class Chrome74 extends HandlerInterface rtpParameters : sendingRemoteRtpParameters, extension : exten }); - - console.warn('--- exten:', exten); - console.warn('--- offerMediaObject.ext:', offerMediaObject.ext); - console.warn('--- offer.sdp:', offer.sdp); - console.warn('--- sendingRtpParameters:', sendingRtpParameters); - console.warn('--- sendingRemoteRtpParameters:', sendingRemoteRtpParameters); } } @@ -422,8 +398,6 @@ export class Chrome74 extends HandlerInterface await this._pc.setLocalDescription(offer); - console.warn('--- this._pc.localDescription.sdp:', this._pc.localDescription.sdp); - // We can now get the transceiver.mid. const localId = transceiver.mid; @@ -498,8 +472,6 @@ export class Chrome74 extends HandlerInterface await this._pc.setRemoteDescription(answer); - console.warn('--- this._pc.remoteDescription.sdp:', this._pc.remoteDescription.sdp); - // Store in the map. this._mapMidTransceiver.set(localId, transceiver); diff --git a/src/handlers/HandlerInterface.ts b/src/handlers/HandlerInterface.ts index 90c60b1c..29607e11 100644 --- a/src/handlers/HandlerInterface.ts +++ b/src/handlers/HandlerInterface.ts @@ -20,11 +20,6 @@ import { export type HandlerFactory = () => HandlerInterface; -export type HandlerGetNativeRtpCapabilitiesOptions = -{ - forceAbsCaptureTimeRtpHeaderExtension?: boolean; -}; - export type HandlerRunOptions = { direction: 'send' | 'recv'; @@ -111,9 +106,7 @@ export abstract class HandlerInterface extends EnhancedEventEmitter; + abstract getNativeRtpCapabilities(): Promise; abstract getNativeSctpCapabilities(): Promise; diff --git a/src/handlers/sdp/commonUtils.ts b/src/handlers/sdp/commonUtils.ts index 06ab50cb..055fcf1e 100644 --- a/src/handlers/sdp/commonUtils.ts +++ b/src/handlers/sdp/commonUtils.ts @@ -301,76 +301,6 @@ export function addRtpExtensionToMediaObject( } } -/** - * Adds the given RTP extension to the given RTP capabilities. - * If the extension is already present, this function doesn't add anything. - */ -export function addRtpExtensionToRtpCapabilities( - { - rtpCapabilities, - uri, - audio, - video, - direction - }: - { - rtpCapabilities: RtpCapabilities; - uri: string; - audio: boolean; - video: boolean; - direction: RtpHeaderExtensionDirection; - } -): void -{ - let preferredId = 1; - - if (!Array.isArray(rtpCapabilities.headerExtensions)) - { - rtpCapabilities.headerExtensions = []; - } - - for (const exten of rtpCapabilities.headerExtensions) - { - // If extension uri is already present, don't do anything. - if (exten.uri === uri) - { - preferredId = 0; - - break; - } - - if (exten.preferredId >= preferredId) - preferredId = exten.preferredId + 1; - } - - if (preferredId > 0) - { - if (audio) - { - rtpCapabilities.headerExtensions.push( - { - kind : 'audio', - uri, - preferredId, - preferredEncrypt : false, - direction - }); - } - - if (video) - { - rtpCapabilities.headerExtensions.push( - { - kind : 'video', - uri, - preferredId, - preferredEncrypt : false, - direction - }); - } - } -} - /** * Adds the given RTP extension to the given RTP parameters. * If the extension is already present (with same id), this function doesn't @@ -399,12 +329,10 @@ export function addRtpExtensionToRtpParameters( { if (exten.uri === extension.uri && exten.id === extension.id) { - console.warn('--- addRtpExtensionToRtpParameters() EXTEN ALREADY EXISTS'); return; } else if (exten.uri === extension.uri && exten.id !== extension.id) { - console.warn('--- addRtpExtensionToRtpParameters() REPLACING EXTEN ID'); exten.id = extension.id; replaced = true; @@ -413,7 +341,6 @@ export function addRtpExtensionToRtpParameters( if (!replaced) { - console.warn('--- addRtpExtensionToRtpParameters() adding exten'); rtpParameters.headerExtensions.push(extension); } } From 14da6f8bd3a6b467a7c016fa03681c5390ba63af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Wed, 28 Sep 2022 14:23:45 +0200 Subject: [PATCH 3/4] fix lint --- lib/handlers/sdp/commonUtils.d.ts.map | 2 +- src/handlers/sdp/commonUtils.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/handlers/sdp/commonUtils.d.ts.map b/lib/handlers/sdp/commonUtils.d.ts.map index e8204f2b..07ae6790 100644 --- a/lib/handlers/sdp/commonUtils.d.ts.map +++ b/lib/handlers/sdp/commonUtils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAIf,4BAA4B,EAC5B,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,4BAA4B,GAAG,SAAS,CA8B1C;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,EACC,aAAa,EACb,SAAS,EACT,EACD;IACC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,4BAA4B,CAAC;CACxC,GACC,IAAI,CA2BN"} \ No newline at end of file +{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACN,eAAe,EAGf,4BAA4B,EAC5B,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CACrC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,eAAe,CAsHjB;AAED,wBAAgB,qBAAqB,CACpC,EAAE,SAAS,EAAE,EACb;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,GAChB,cAAc,CAuChB;AAED,wBAAgB,QAAQ,CACvB,EAAE,gBAAgB,EAAE,EACpB;IAAE,gBAAgB,EAAE,GAAG,CAAA;CAAE,GACvB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,EACC,kBAAkB,EAClB,iBAAiB,EACjB,EACD;IACC,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC;CACvB,GACC,IAAI,CAsDN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,4BAA4B,GAAG,SAAS,CA8B1C;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,EACC,aAAa,EACb,SAAS,EACT,EACD;IACC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,4BAA4B,CAAC;CACxC,GACC,IAAI,CA2BN"} \ No newline at end of file diff --git a/src/handlers/sdp/commonUtils.ts b/src/handlers/sdp/commonUtils.ts index 055fcf1e..e2482a6f 100644 --- a/src/handlers/sdp/commonUtils.ts +++ b/src/handlers/sdp/commonUtils.ts @@ -4,7 +4,6 @@ import { RtpCapabilities, RtpCodecCapability, RtpHeaderExtension, - RtpHeaderExtensionDirection, RtpHeaderExtensionParameters, RtpParameters, RtcpFeedback From 86f7eba570f06fc17ea2c414cb501dc7713c0b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Wed, 28 Sep 2022 17:53:16 +0200 Subject: [PATCH 4/4] Force it in Chrome74 and remove optional param --- lib/Producer.d.ts | 8 -------- lib/Producer.d.ts.map | 2 +- lib/handlers/Chrome74.d.ts.map | 2 +- lib/handlers/Chrome74.js | 7 +++---- src/Producer.ts | 8 -------- src/handlers/Chrome74.ts | 7 ++----- 6 files changed, 7 insertions(+), 27 deletions(-) diff --git a/lib/Producer.d.ts b/lib/Producer.d.ts index a761264d..1ae00f0e 100644 --- a/lib/Producer.d.ts +++ b/lib/Producer.d.ts @@ -20,14 +20,6 @@ export declare type ProducerCodecOptions = { videoGoogleStartBitrate?: number; videoGoogleMaxBitrate?: number; videoGoogleMinBitrate?: number; - /** - * Force negotiation of abs-capture-time RTP extension for sending in this - * Producer. - * NOTE: Rationale for this option is that libwebrtc implements this RTP - * extension but lacks support for enabling it via API so SDP munging is - * needed. - */ - forceAbsCaptureTimeExten?: boolean; }; export declare type ProducerEvents = { transportclose: []; diff --git a/lib/Producer.d.ts.map b/lib/Producer.d.ts.map index 9a9ac27b..389caa28 100644 --- a/lib/Producer.d.ts.map +++ b/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;AAE9D,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,iBAAiB,CAAC;AAIzB,oBAAY,eAAe,GAC3B;IACC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;AAGD,oBAAY,oBAAoB,GAChC;IACC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAA;AAED,oBAAY,cAAc,GAC1B;IACC,cAAc,EAAE,EAAE,CAAC;IACnB,UAAU,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AM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrE,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxD,eAAe,CACpB,EACC,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,QAAQ,EACR,EAAE,6BAA6B,GAC9B,OAAO,CAAC,4BAA4B,CAAC;IAsElC,OAAO,CACZ,WAAW,EAAE,qBAAqB,EAAE,GACjC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAkG7B,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsChD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCjD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiClD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YAgE7B,eAAe;IAuC7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Chrome74.js b/lib/handlers/Chrome74.js index ccad24d4..c03ddc85 100644 --- a/lib/handlers/Chrome74.js +++ b/lib/handlers/Chrome74.js @@ -215,10 +215,9 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { }); let offer = await this._pc.createOffer(); let localSdpObject = sdpTransform.parse(offer.sdp); - let offerMediaObject; - // May force abs-capture-time RTP extension. - if (codecOptions === null || codecOptions === void 0 ? void 0 : codecOptions.forceAbsCaptureTimeExten) { - offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; + let offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; + // May force abs-capture-time RTP extension negotiation. + { const exten = sdpCommonUtils.addRtpExtensionToMediaObject({ mediaObject: offerMediaObject, uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time' diff --git a/src/Producer.ts b/src/Producer.ts index 110aa19e..e3db90b2 100644 --- a/src/Producer.ts +++ b/src/Producer.ts @@ -34,14 +34,6 @@ export type ProducerCodecOptions = videoGoogleStartBitrate?: number; videoGoogleMaxBitrate?: number; videoGoogleMinBitrate?: number; - /** - * Force negotiation of abs-capture-time RTP extension for sending in this - * Producer. - * NOTE: Rationale for this option is that libwebrtc implements this RTP - * extension but lacks support for enabling it via API so SDP munging is - * needed. - */ - forceAbsCaptureTimeExten?: boolean; } export type ProducerEvents = diff --git a/src/handlers/Chrome74.ts b/src/handlers/Chrome74.ts index 8b3dbbe0..9a987e29 100644 --- a/src/handlers/Chrome74.ts +++ b/src/handlers/Chrome74.ts @@ -324,13 +324,10 @@ export class Chrome74 extends HandlerInterface }); let offer = await this._pc.createOffer(); let localSdpObject = sdpTransform.parse(offer.sdp); - let offerMediaObject; + let offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; - // May force abs-capture-time RTP extension. - if (codecOptions?.forceAbsCaptureTimeExten) + // May force abs-capture-time RTP extension negotiation. { - offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; - const exten = sdpCommonUtils.addRtpExtensionToMediaObject( { mediaObject : offerMediaObject,