瀏覽代碼

fix(RTC): Remove support for plan-b SDP. (#2430)

* fix(RTC): Remove support for plan-b SDP.
Since unified plan mode becomes the default mode, so does multi-stream mode.

* squash: Remove plan-b unit tests and fix comments

* squash: address review comments
release-8443
Jaya Allamsetty 1 年之前
父節點
當前提交
d53d010679
沒有連結到貢獻者的電子郵件帳戶。

+ 6
- 8
JitsiConference.js 查看文件

1088
 
1088
 
1089
         // Currently, only adding multiple video streams of different video types is supported.
1089
         // Currently, only adding multiple video streams of different video types is supported.
1090
         // TODO - remove this limitation once issues with jitsi-meet trying to add multiple camera streams is fixed.
1090
         // TODO - remove this limitation once issues with jitsi-meet trying to add multiple camera streams is fixed.
1091
-        if (FeatureFlags.isMultiStreamSendSupportEnabled()
1092
-            && mediaType === MediaType.VIDEO
1091
+        if (mediaType === MediaType.VIDEO
1093
             && !localTracks.find(t => t.getVideoType() === track.getVideoType())) {
1092
             && !localTracks.find(t => t.getVideoType() === track.getVideoType())) {
1094
             const sourceName = getSourceNameForJitsiTrack(
1093
             const sourceName = getSourceNameForJitsiTrack(
1095
                 this.myUserId(),
1094
                 this.myUserId(),
1122
             // Presence needs to be sent here for desktop track since we need the presence to reach the remote peer
1121
             // Presence needs to be sent here for desktop track since we need the presence to reach the remote peer
1123
             // before signaling so that a fake participant tile is created for screenshare. Otherwise, presence will
1122
             // before signaling so that a fake participant tile is created for screenshare. Otherwise, presence will
1124
             // only be sent after a session-accept or source-add is ack'ed.
1123
             // only be sent after a session-accept or source-add is ack'ed.
1125
-            if (track.getVideoType() === VideoType.DESKTOP && FeatureFlags.isMultiStreamSendSupportEnabled()) {
1124
+            if (track.getVideoType() === VideoType.DESKTOP) {
1126
                 this._updateRoomPresence(this.getActiveMediaSession());
1125
                 this._updateRoomPresence(this.getActiveMediaSession());
1127
             }
1126
             }
1128
         });
1127
         });
1260
     const mediaType = oldTrack?.getType() || newTrack?.getType();
1259
     const mediaType = oldTrack?.getType() || newTrack?.getType();
1261
     const newVideoType = newTrack?.getVideoType();
1260
     const newVideoType = newTrack?.getVideoType();
1262
 
1261
 
1263
-    if (FeatureFlags.isMultiStreamSendSupportEnabled() && oldTrack && newTrack && oldVideoType !== newVideoType) {
1262
+    if (oldTrack && newTrack && oldVideoType !== newVideoType) {
1264
         throw new Error(`Replacing a track of videoType=${oldVideoType} with a track of videoType=${newVideoType} is`
1263
         throw new Error(`Replacing a track of videoType=${oldVideoType} with a track of videoType=${newVideoType} is`
1265
             + ' not supported in this mode.');
1264
             + ' not supported in this mode.');
1266
     }
1265
     }
2087
  */
2086
  */
2088
 JitsiConference.prototype._onIncomingCallP2P = function(jingleSession, jingleOffer) {
2087
 JitsiConference.prototype._onIncomingCallP2P = function(jingleSession, jingleOffer) {
2089
     let rejectReason;
2088
     let rejectReason;
2090
-    const usesUnifiedPlan = browser.supportsUnifiedPlan();
2091
     const contentName = jingleOffer.find('>content').attr('name');
2089
     const contentName = jingleOffer.find('>content').attr('name');
2092
     const peerUsesUnifiedPlan = contentName === '0' || contentName === '1';
2090
     const peerUsesUnifiedPlan = contentName === '0' || contentName === '1';
2093
 
2091
 
2094
     // Reject P2P between endpoints that are not running in the same mode w.r.t to SDPs (plan-b and unified plan).
2092
     // Reject P2P between endpoints that are not running in the same mode w.r.t to SDPs (plan-b and unified plan).
2095
-    if (usesUnifiedPlan !== peerUsesUnifiedPlan) {
2093
+    if (!peerUsesUnifiedPlan) {
2096
         rejectReason = {
2094
         rejectReason = {
2097
             reason: 'decline',
2095
             reason: 'decline',
2098
             reasonDescription: 'P2P disabled',
2096
             reasonDescription: 'P2P disabled',
2227
             localTracks
2225
             localTracks
2228
         );
2226
         );
2229
 
2227
 
2230
-        // Enable or disable simulcast for plan-b screensharing based on the capture fps if it is set through the UI.
2228
+        // Set the capture fps for screenshare if it is set through the UI.
2231
         this._desktopSharingFrameRate
2229
         this._desktopSharingFrameRate
2232
             && jingleSession.peerconnection.setDesktopSharingFrameRate(this._desktopSharingFrameRate);
2230
             && jingleSession.peerconnection.setDesktopSharingFrameRate(this._desktopSharingFrameRate);
2233
 
2231
 
3518
 
3516
 
3519
     this._desktopSharingFrameRate = maxFps;
3517
     this._desktopSharingFrameRate = maxFps;
3520
 
3518
 
3521
-    // Enable or disable simulcast for plan-b screensharing based on the capture fps.
3519
+    // Set capture fps for screenshare.
3522
     this.jvbJingleSession && this.jvbJingleSession.peerconnection.setDesktopSharingFrameRate(maxFps);
3520
     this.jvbJingleSession && this.jvbJingleSession.peerconnection.setDesktopSharingFrameRate(maxFps);
3523
 
3521
 
3524
     // Set the capture rate for desktop sharing.
3522
     // Set the capture rate for desktop sharing.

+ 2
- 6
modules/RTC/JitsiLocalTrack.js 查看文件

20
     createNoDataFromSourceEvent
20
     createNoDataFromSourceEvent
21
 } from '../../service/statistics/AnalyticsEvents';
21
 } from '../../service/statistics/AnalyticsEvents';
22
 import browser from '../browser';
22
 import browser from '../browser';
23
-import FeatureFlags from '../flags/FeatureFlags';
24
 import Statistics from '../statistics/statistics';
23
 import Statistics from '../statistics/statistics';
25
 
24
 
26
 import JitsiTrack from './JitsiTrack';
25
 import JitsiTrack from './JitsiTrack';
354
      * @returns {Promise}
353
      * @returns {Promise}
355
      */
354
      */
356
     _setMuted(muted) {
355
     _setMuted(muted) {
357
-        if (this.isMuted() === muted
358
-            && !(this.videoType === VideoType.DESKTOP && FeatureFlags.isMultiStreamSendSupportEnabled())) {
356
+        if (this.isMuted() === muted && this.videoType !== VideoType.DESKTOP) {
359
             return Promise.resolve();
357
             return Promise.resolve();
360
         }
358
         }
361
 
359
 
377
         // conference. This is needed because we don't want the client to signal a source-remove to the remote peer for
375
         // conference. This is needed because we don't want the client to signal a source-remove to the remote peer for
378
         // the desktop track when screenshare is stopped. Later when screenshare is started again, the same sender will
376
         // the desktop track when screenshare is stopped. Later when screenshare is started again, the same sender will
379
         // be re-used without the need for signaling a new ssrc through source-add.
377
         // be re-used without the need for signaling a new ssrc through source-add.
380
-        if (this.isAudioTrack()
381
-                || (this.videoType === VideoType.DESKTOP && !FeatureFlags.isMultiStreamSendSupportEnabled())
382
-                || !doesVideoMuteByStreamRemove) {
378
+        if (this.isAudioTrack() || !doesVideoMuteByStreamRemove) {
383
             logMuteInfo();
379
             logMuteInfo();
384
 
380
 
385
             // If we have a stream effect that implements its own mute functionality, prioritize it before
381
             // If we have a stream effect that implements its own mute functionality, prioritize it before

+ 0
- 9
modules/RTC/RTC.js 查看文件

363
      * enabled on the PeerConnection.
363
      * enabled on the PeerConnection.
364
      * @param {boolean} options.forceTurnRelay If set to true, the browser will generate only Relay ICE candidates.
364
      * @param {boolean} options.forceTurnRelay If set to true, the browser will generate only Relay ICE candidates.
365
      * @param {boolean} options.startSilent If set to 'true' no audio will be sent or received.
365
      * @param {boolean} options.startSilent If set to 'true' no audio will be sent or received.
366
-     * @param {boolean} options.usesUnifiedPlan Indicates if the  browser is running in unified plan mode.
367
      * @param {Object} options.videoQuality - Quality settings to applied on the outbound video streams.
366
      * @param {Object} options.videoQuality - Quality settings to applied on the outbound video streams.
368
      * @return {TraceablePeerConnection}
367
      * @return {TraceablePeerConnection}
369
      */
368
      */
375
             pcConfig.encodedInsertableStreams = true;
374
             pcConfig.encodedInsertableStreams = true;
376
         }
375
         }
377
 
376
 
378
-        // TODO: remove this.
379
-        const supportsSdpSemantics = browser.isChromiumBased() && !options.usesUnifiedPlan;
380
-
381
-        if (supportsSdpSemantics) {
382
-            logger.debug('WebRTC application is running in plan-b mode');
383
-            pcConfig.sdpSemantics = 'plan-b';
384
-        }
385
-
386
         if (options.forceTurnRelay) {
377
         if (options.forceTurnRelay) {
387
             pcConfig.iceTransportPolicy = 'relay';
378
             pcConfig.iceTransportPolicy = 'relay';
388
         }
379
         }

+ 1
- 9
modules/RTC/TPCUtils.js 查看文件

10
 import VideoEncoderScalabilityMode from '../../service/RTC/VideoEncoderScalabilityMode';
10
 import VideoEncoderScalabilityMode from '../../service/RTC/VideoEncoderScalabilityMode';
11
 import { VideoType } from '../../service/RTC/VideoType';
11
 import { VideoType } from '../../service/RTC/VideoType';
12
 import browser from '../browser';
12
 import browser from '../browser';
13
-import FeatureFlags from '../flags/FeatureFlags';
14
 
13
 
15
 const logger = getLogger(__filename);
14
 const logger = getLogger(__filename);
16
 const DESKTOP_SHARE_RATE = 500000;
15
 const DESKTOP_SHARE_RATE = 500000;
379
      * @returns {Array<number>}
378
      * @returns {Array<number>}
380
      */
379
      */
381
     calculateEncodingsBitrates(localVideoTrack, codec, newHeight) {
380
     calculateEncodingsBitrates(localVideoTrack, codec, newHeight) {
382
-        const videoType = localVideoTrack.getVideoType();
383
         const desktopShareBitrate = this.pc.options?.videoQuality?.desktopbitrate || DESKTOP_SHARE_RATE;
381
         const desktopShareBitrate = this.pc.options?.videoQuality?.desktopbitrate || DESKTOP_SHARE_RATE;
384
         const encodingsBitrates = this._getVideoStreamEncodings(localVideoTrack.getVideoType(), codec)
382
         const encodingsBitrates = this._getVideoStreamEncodings(localVideoTrack.getVideoType(), codec)
385
         .map((encoding, idx) => {
383
         .map((encoding, idx) => {
395
             // Multiple video streams.
393
             // Multiple video streams.
396
             if (this._isScreenshareBitrateCapped(localVideoTrack)) {
394
             if (this._isScreenshareBitrateCapped(localVideoTrack)) {
397
                 bitrate = desktopShareBitrate;
395
                 bitrate = desktopShareBitrate;
398
-            } else if (videoType === VideoType.DESKTOP && browser.isChromiumBased() && !this.pc.usesUnifiedPlan()) {
399
-                // For high fps screenshare, 'maxBitrate' setting must be cleared on Chrome in plan-b, because
400
-                // if simulcast is enabled for screen and maxBitrates are set then Chrome will not send the
401
-                // desktop stream.
402
-                bitrate = undefined;
403
             }
396
             }
404
 
397
 
405
             return bitrate;
398
             return bitrate;
666
         const mediaType = newTrack?.getType() ?? oldTrack?.getType();
659
         const mediaType = newTrack?.getType() ?? oldTrack?.getType();
667
         const localTracks = this.pc.getLocalTracks(mediaType);
660
         const localTracks = this.pc.getLocalTracks(mediaType);
668
         const track = newTrack?.getTrack() ?? null;
661
         const track = newTrack?.getTrack() ?? null;
669
-        const isNewLocalSource = FeatureFlags.isMultiStreamSendSupportEnabled()
670
-            && localTracks?.length
662
+        const isNewLocalSource = localTracks?.length
671
             && !oldTrack
663
             && !oldTrack
672
             && newTrack
664
             && newTrack
673
             && !localTracks.find(t => t === newTrack);
665
             && !localTracks.find(t => t === newTrack);

+ 136
- 749
modules/RTC/TraceablePeerConnection.js
文件差異過大導致無法顯示
查看文件


+ 0
- 11
modules/browser/BrowserCapabilities.js 查看文件

289
             && window.RTCRtpReceiver.getCapabilities('audio').codecs.some(codec => codec.mimeType === 'audio/red'));
289
             && window.RTCRtpReceiver.getCapabilities('audio').codecs.some(codec => codec.mimeType === 'audio/red'));
290
     }
290
     }
291
 
291
 
292
-    /**
293
-     * Checks if the browser supports unified plan.
294
-     *
295
-     * @returns {boolean}
296
-     */
297
-    supportsUnifiedPlan() {
298
-        // We do not want to enable unified plan on Electron clients that have Chromium version < 96 because of
299
-        // performance and screensharing issues.
300
-        return !(this.isElectron() && this.isEngineVersionLessThan(96));
301
-    }
302
-
303
     /**
292
     /**
304
      * Checks if the browser supports voice activity detection via the @type {VADAudioAnalyser} service.
293
      * Checks if the browser supports voice activity detection via the @type {VADAudioAnalyser} service.
305
      *
294
      *

+ 0
- 9
modules/flags/FeatureFlags.js 查看文件

19
         this._joinAsVisitor = Boolean(flags.enableJoinAsVisitor ?? true);
19
         this._joinAsVisitor = Boolean(flags.enableJoinAsVisitor ?? true);
20
     }
20
     }
21
 
21
 
22
-    /**
23
-     * Checks if multiple local video streams support is enabled.
24
-     *
25
-     * @returns {boolean}
26
-     */
27
-    isMultiStreamSendSupportEnabled() {
28
-        return browser.supportsUnifiedPlan();
29
-    }
30
-
31
     /**
22
     /**
32
      * Checks if the run in lite mode is enabled.
23
      * Checks if the run in lite mode is enabled.
33
      * This will cause any media to be received and not decoded. (Insertable streams are used to discard
24
      * This will cause any media to be received and not decoded. (Insertable streams are used to discard

+ 0
- 162
modules/sdp/LocalSdpMunger.js 查看文件

3
 import { MediaDirection } from '../../service/RTC/MediaDirection';
3
 import { MediaDirection } from '../../service/RTC/MediaDirection';
4
 import { MediaType } from '../../service/RTC/MediaType';
4
 import { MediaType } from '../../service/RTC/MediaType';
5
 import { getSourceNameForJitsiTrack } from '../../service/RTC/SignalingLayer';
5
 import { getSourceNameForJitsiTrack } from '../../service/RTC/SignalingLayer';
6
-import { VideoType } from '../../service/RTC/VideoType';
7
 import browser from '../browser';
6
 import browser from '../browser';
8
-import FeatureFlags from '../flags/FeatureFlags';
9
 
7
 
10
 import { SdpTransformWrap } from './SdpTransformUtil';
8
 import { SdpTransformWrap } from './SdpTransformUtil';
11
 
9
 
34
         this.videoSourcesToMsidMap = new Map();
32
         this.videoSourcesToMsidMap = new Map();
35
     }
33
     }
36
 
34
 
37
-    /**
38
-     * Makes sure that muted local video tracks associated with the parent
39
-     * {@link TraceablePeerConnection} are described in the local SDP. It's done
40
-     * in order to prevent from sending 'source-remove'/'source-add' Jingle
41
-     * notifications when local video track is muted (<tt>MediaStream</tt> is
42
-     * removed from the peerconnection).
43
-     *
44
-     * NOTE 1 video track is assumed
45
-     *
46
-     * @param {SdpTransformWrap} transformer the transformer instance which will
47
-     * be used to process the SDP.
48
-     * @return {boolean} <tt>true</tt> if there were any modifications to
49
-     * the SDP wrapped by <tt>transformer</tt>.
50
-     * @private
51
-     */
52
-    _addMutedLocalVideoTracksToSDP(transformer) {
53
-        // Go over each video tracks and check if the SDP has to be changed
54
-        const localVideos = this.tpc.getLocalTracks(MediaType.VIDEO);
55
-
56
-        if (!localVideos.length) {
57
-            return false;
58
-        } else if (localVideos.length !== 1) {
59
-            logger.error(
60
-                `${this.tpc} there is more than 1 video track ! `
61
-                    + 'Strange things may happen !', localVideos);
62
-        }
63
-
64
-        const videoMLine = transformer.selectMedia(MediaType.VIDEO)?.[0];
65
-
66
-        if (!videoMLine) {
67
-            logger.debug(
68
-                `${this.tpc} unable to hack local video track SDP`
69
-                    + '- no "video" media');
70
-
71
-            return false;
72
-        }
73
-
74
-        let modified = false;
75
-
76
-        for (const videoTrack of localVideos) {
77
-            const muted = videoTrack.isMuted();
78
-            const mediaStream = videoTrack.getOriginalStream();
79
-            const isCamera = videoTrack.videoType === VideoType.CAMERA;
80
-
81
-            // During the mute/unmute operation there are periods of time when
82
-            // the track's underlying MediaStream is not added yet to
83
-            // the PeerConnection. The SDP needs to be munged in such case.
84
-            const isInPeerConnection
85
-                = mediaStream && this.tpc.isMediaStreamInPc(mediaStream);
86
-            const shouldFakeSdp = isCamera && (muted || !isInPeerConnection);
87
-
88
-            if (!shouldFakeSdp) {
89
-                continue; // eslint-disable-line no-continue
90
-            }
91
-
92
-            // Inject removed SSRCs
93
-            const requiredSSRCs
94
-                = this.tpc.isSpatialScalabilityOn()
95
-                    ? this.tpc.simulcast.ssrcCache
96
-                    : [ this.tpc.sdpConsistency.cachedPrimarySsrc ];
97
-
98
-            if (!requiredSSRCs.length) {
99
-                logger.error(`No SSRCs stored for: ${videoTrack} in ${this.tpc}`);
100
-
101
-                continue; // eslint-disable-line no-continue
102
-            }
103
-
104
-            modified = true;
105
-
106
-            // We need to fake sendrecv.
107
-            // NOTE the SDP produced here goes only to Jicofo and is never set
108
-            // as localDescription. That's why
109
-            // TraceablePeerConnection.mediaTransferActive is ignored here.
110
-            videoMLine.direction = MediaDirection.SENDRECV;
111
-
112
-            // Check if the recvonly has MSID
113
-            const primarySSRC = requiredSSRCs[0];
114
-
115
-            // FIXME The cname could come from the stream, but may turn out to
116
-            // be too complex. It is fine to come up with any value, as long as
117
-            // we only care about the actual SSRC values when deciding whether
118
-            // or not an update should be sent.
119
-            const primaryCname = `injected-${primarySSRC}`;
120
-
121
-            for (const ssrcNum of requiredSSRCs) {
122
-                // Remove old attributes
123
-                videoMLine.removeSSRC(ssrcNum);
124
-
125
-                // Inject
126
-                videoMLine.addSSRCAttribute({
127
-                    id: ssrcNum,
128
-                    attribute: 'cname',
129
-                    value: primaryCname
130
-                });
131
-                videoMLine.addSSRCAttribute({
132
-                    id: ssrcNum,
133
-                    attribute: 'msid',
134
-                    value: videoTrack.storedMSID
135
-                });
136
-            }
137
-            if (requiredSSRCs.length > 1) {
138
-                const group = {
139
-                    ssrcs: requiredSSRCs.join(' '),
140
-                    semantics: 'SIM'
141
-                };
142
-
143
-                if (!videoMLine.findGroup(group.semantics, group.ssrcs)) {
144
-                    // Inject the group
145
-                    videoMLine.addSSRCGroup(group);
146
-                }
147
-            }
148
-
149
-            // Insert RTX
150
-            // FIXME in P2P RTX is used by Chrome regardless of config option
151
-            // status. Because of that 'source-remove'/'source-add'
152
-            // notifications are still sent to remove/add RTX SSRC and FID group
153
-            if (!this.tpc.options.disableRtx) {
154
-                this.tpc.rtxModifier.modifyRtxSsrcs2(videoMLine);
155
-            }
156
-        }
157
-
158
-        return modified;
159
-    }
160
-
161
     /**
35
     /**
162
      * Returns a string that can be set as the MSID attribute for a source.
36
      * Returns a string that can be set as the MSID attribute for a source.
163
      *
37
      *
277
         }
151
         }
278
     }
152
     }
279
 
153
 
280
-    /**
281
-     * Maybe modifies local description to fake local video tracks SDP when
282
-     * those are muted.
283
-     *
284
-     * @param {object} desc the WebRTC SDP object instance for the local
285
-     * description.
286
-     * @returns {RTCSessionDescription}
287
-     */
288
-    maybeAddMutedLocalVideoTracksToSDP(desc) {
289
-        if (!desc) {
290
-            throw new Error('No local description passed in.');
291
-        }
292
-
293
-        const transformer = new SdpTransformWrap(desc.sdp);
294
-
295
-        if (this._addMutedLocalVideoTracksToSDP(transformer)) {
296
-            return new RTCSessionDescription({
297
-                type: desc.type,
298
-                sdp: transformer.toRawSDP()
299
-            });
300
-        }
301
-
302
-        return desc;
303
-    }
304
-
305
     /**
154
     /**
306
      * This transformation will make sure that stream identifiers are unique
155
      * This transformation will make sure that stream identifiers are unique
307
      * across all of the local PeerConnections even if the same stream is used
156
      * across all of the local PeerConnections even if the same stream is used
333
 
182
 
334
         const videoMlines = transformer.selectMedia(MediaType.VIDEO);
183
         const videoMlines = transformer.selectMedia(MediaType.VIDEO);
335
 
184
 
336
-        if (!FeatureFlags.isMultiStreamSendSupportEnabled()) {
337
-            videoMlines.splice(1);
338
-        }
339
-
340
         for (const videoMLine of videoMlines) {
185
         for (const videoMLine of videoMlines) {
341
             this._transformMediaIdentifiers(videoMLine);
186
             this._transformMediaIdentifiers(videoMLine);
342
             this._injectSourceNames(videoMLine);
187
             this._injectSourceNames(videoMLine);
343
         }
188
         }
344
 
189
 
345
-        // Plan-b clients generate new SSRCs and trackIds whenever tracks are removed and added back to the
346
-        // peerconnection, therefore local track based map for msids needs to be reset after every transformation.
347
-        if (!this.tpc._usesUnifiedPlan) {
348
-            this.audioSourcesToMsidMap.clear();
349
-            this.videoSourcesToMsidMap.clear();
350
-        }
351
-
352
         return new RTCSessionDescription({
190
         return new RTCSessionDescription({
353
             type: sessionDesc.type,
191
             type: sessionDesc.type,
354
             sdp: transformer.toRawSDP()
192
             sdp: transformer.toRawSDP()

+ 0
- 60
modules/sdp/LocalSdpMunger.spec.js 查看文件

141
         expect(videoMsid).toBe('sRdpsdg-video-0-1');
141
         expect(videoMsid).toBe('sRdpsdg-video-0-1');
142
     });
142
     });
143
 });
143
 });
144
-
145
-describe('Track replace operations in plan-b', () => {
146
-    const tpc = new MockPeerConnection('1', false);
147
-    const localEndpointId = 'sRdpsdg';
148
-    let desc, newSdp, sdpStr, transformedDesc, videoMsid, videoMsidLine;
149
-    const localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
150
-
151
-    it('should not increment track index for new tracks', () => {
152
-        FeatureFlags.init({ });
153
-
154
-        sdpStr = transform.write(SampleSdpStrings.simulcastRtxSdp);
155
-        desc = new RTCSessionDescription({
156
-            type: 'offer',
157
-            sdp: sdpStr
158
-        });
159
-        transformedDesc = localSdpMunger.transformStreamIdentifiers(desc);
160
-        newSdp = transform.parse(transformedDesc.sdp);
161
-
162
-        videoMsidLine = getSsrcLines(newSdp, 'video').find(ssrc => ssrc.attribute === 'msid')?.value;
163
-        videoMsid = videoMsidLine.split(' ')[0];
164
-
165
-        expect(videoMsid).toBe('sRdpsdg-video-0-1');
166
-
167
-        sdpStr = transform.write(SampleSdpStrings.simulcastRtxSdpReplacedTrack);
168
-        desc = new RTCSessionDescription({
169
-            type: 'offer',
170
-            sdp: sdpStr
171
-        });
172
-        transformedDesc = localSdpMunger.transformStreamIdentifiers(desc);
173
-        newSdp = transform.parse(transformedDesc.sdp);
174
-
175
-        videoMsidLine = getSsrcLines(newSdp, 'video').find(ssrc => ssrc.attribute === 'msid')?.value;
176
-        videoMsid = videoMsidLine.split(' ')[0];
177
-
178
-        expect(videoMsid).toBe('sRdpsdg-video-0-1');
179
-    });
180
-});
181
-
182
-describe('Transform msids for plan-b', () => {
183
-    const tpc = new MockPeerConnection('1', false);
184
-    const localEndpointId = 'sRdpsdg';
185
-    let desc, newSdp, sdpStr, transformedDesc;
186
-    const localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
187
-
188
-    it('should inject source-names', () => {
189
-        sdpStr = transform.write(SampleSdpStrings.simulcastRtxSdp);
190
-        desc = new RTCSessionDescription({
191
-            type: 'offer',
192
-            sdp: sdpStr
193
-        });
194
-        transformedDesc = localSdpMunger.transformStreamIdentifiers(desc);
195
-        newSdp = transform.parse(transformedDesc.sdp);
196
-
197
-        const audioSsrcs = getSsrcLines(newSdp, 'audio');
198
-        const videoSsrcs = getSsrcLines(newSdp, 'video');
199
-
200
-        expect(audioSsrcs.length).toEqual(1 + 1 /* injected source name */);
201
-        expect(videoSsrcs.length).toEqual(6 + 6 /* injected source name into each ssrc */);
202
-    });
203
-});

+ 0
- 127
modules/sdp/SdpConsistency.js 查看文件

1
-import { getLogger } from '@jitsi/logger';
2
-
3
-import { MediaType } from '../../service/RTC/MediaType';
4
-
5
-import {
6
-    SdpTransformWrap,
7
-    parsePrimarySSRC,
8
-    parseSecondarySSRC
9
-} from './SdpTransformUtil';
10
-
11
-const logger = getLogger(__filename);
12
-
13
-/**
14
- * Handles the work of keeping video ssrcs consistent across multiple
15
- * o/a cycles, making it such that all stream operations can be
16
- * kept local and do not need to be signaled.
17
- * NOTE: This only keeps the 'primary' video ssrc consistent: meaning
18
- * the primary video stream
19
- */
20
-export default class SdpConsistency {
21
-    /**
22
-     * Constructor
23
-     * @param {string} logPrefix the log prefix appended to every logged
24
-     * message, currently used to distinguish for which
25
-     * <tt>TraceablePeerConnection</tt> the instance works.
26
-     */
27
-    constructor(logPrefix) {
28
-        this.clearVideoSsrcCache();
29
-        this.logPrefix = logPrefix;
30
-    }
31
-
32
-    /**
33
-     * Clear the cached video primary and primary rtx ssrcs so that
34
-     *  they will not be used for the next call to
35
-     *  makeVideoPrimarySsrcsConsistent
36
-     */
37
-    clearVideoSsrcCache() {
38
-        this.cachedPrimarySsrc = null;
39
-        this.injectRecvOnly = false;
40
-    }
41
-
42
-    /**
43
-     * Explicitly set the primary ssrc to be used in
44
-     *  makeVideoPrimarySsrcsConsistent
45
-     * @param {number} primarySsrc the primarySsrc to be used
46
-     *  in future calls to makeVideoPrimarySsrcsConsistent
47
-     * @throws Error if <tt>primarySsrc</tt> is not a number
48
-     */
49
-    setPrimarySsrc(primarySsrc) {
50
-        if (typeof primarySsrc !== 'number') {
51
-            throw new Error('Primary SSRC must be a number!');
52
-        }
53
-        this.cachedPrimarySsrc = primarySsrc;
54
-    }
55
-
56
-    /**
57
-     * Checks whether or not there is a primary video SSRC cached already.
58
-     * @return {boolean}
59
-     */
60
-    hasPrimarySsrcCached() {
61
-        return Boolean(this.cachedPrimarySsrc);
62
-    }
63
-
64
-    /**
65
-     * Given an sdp string, either:
66
-     *  1) record the primary video and primary rtx ssrcs to be
67
-     *   used in future calls to makeVideoPrimarySsrcsConsistent or
68
-     *  2) change the primary and primary rtx ssrcs in the given sdp
69
-     *   to match the ones previously cached
70
-     * @param {string} sdpStr the sdp string to (potentially)
71
-     *  change to make the video ssrcs consistent
72
-     * @returns {string} a (potentially) modified sdp string
73
-     *  with ssrcs consistent with this class' cache
74
-     */
75
-    makeVideoPrimarySsrcsConsistent(sdpStr) {
76
-        const sdpTransformer = new SdpTransformWrap(sdpStr);
77
-        const videoMLine = sdpTransformer.selectMedia(MediaType.VIDEO)?.[0];
78
-
79
-        if (!videoMLine) {
80
-            logger.debug(`${this.logPrefix} no 'video' media found in the sdp: ${sdpStr}`);
81
-
82
-            return sdpStr;
83
-        }
84
-
85
-        if (videoMLine.direction === 'recvonly') {
86
-            // If the mline is recvonly, we'll add the primary
87
-            //  ssrc as a recvonly ssrc
88
-            if (this.cachedPrimarySsrc && this.injectRecvOnly) {
89
-                videoMLine.addSSRCAttribute({
90
-                    id: this.cachedPrimarySsrc,
91
-                    attribute: 'cname',
92
-                    value: `recvonly-${this.cachedPrimarySsrc}`
93
-                });
94
-            } else {
95
-                logger.info(`${this.logPrefix} no SSRC found for the recvonly video stream!`);
96
-            }
97
-        } else {
98
-            const newPrimarySsrc = videoMLine.getPrimaryVideoSsrc();
99
-
100
-            if (!newPrimarySsrc) {
101
-                logger.info(`${this.logPrefix} sdp-consistency couldn't parse new primary ssrc`);
102
-
103
-                return sdpStr;
104
-            }
105
-            if (this.cachedPrimarySsrc) {
106
-                videoMLine.replaceSSRC(newPrimarySsrc, this.cachedPrimarySsrc);
107
-                for (const group of videoMLine.ssrcGroups) {
108
-                    if (group.semantics === 'FID') {
109
-                        const primarySsrc = parsePrimarySSRC(group);
110
-                        const rtxSsrc = parseSecondarySSRC(group);
111
-
112
-                        // eslint-disable-next-line max-depth
113
-                        if (primarySsrc === newPrimarySsrc) {
114
-                            group.ssrcs
115
-                                = `${this.cachedPrimarySsrc} ${rtxSsrc}`;
116
-                        }
117
-                    }
118
-                }
119
-            } else {
120
-                this.cachedPrimarySsrc = newPrimarySsrc;
121
-            }
122
-            this.injectRecvOnly = true;
123
-        }
124
-
125
-        return sdpTransformer.toRawSDP();
126
-    }
127
-}

+ 40
- 145
modules/xmpp/JingleSessionPC.js 查看文件

412
         }
412
         }
413
         pcOptions.forceTurnRelay = options.forceTurnRelay;
413
         pcOptions.forceTurnRelay = options.forceTurnRelay;
414
         pcOptions.audioQuality = options.audioQuality;
414
         pcOptions.audioQuality = options.audioQuality;
415
-        pcOptions.usesUnifiedPlan = this.usesUnifiedPlan = browser.supportsUnifiedPlan();
416
         pcOptions.disableSimulcast = this.isP2P ? true : options.disableSimulcast;
415
         pcOptions.disableSimulcast = this.isP2P ? true : options.disableSimulcast;
417
 
416
 
418
         if (!this.isP2P) {
417
         if (!this.isP2P) {
557
                 if (!this.wasConnected
556
                 if (!this.wasConnected
558
                     && (this.wasstable
557
                     && (this.wasstable
559
                         || isStable
558
                         || isStable
560
-                        || (this.usesUnifiedPlan && this.isInitiator
561
-                            && (browser.isChromiumBased() || browser.isReactNative())))) {
559
+                        || (this.isInitiator && (browser.isChromiumBased() || browser.isReactNative())))) {
562
 
560
 
563
                     Statistics.sendAnalytics(
561
                     Statistics.sendAnalytics(
564
                         ICE_DURATION,
562
                         ICE_DURATION,
641
             const state = this.peerconnection.signalingState;
639
             const state = this.peerconnection.signalingState;
642
             const remoteDescription = this.peerconnection.remoteDescription;
640
             const remoteDescription = this.peerconnection.remoteDescription;
643
 
641
 
644
-            if (this.usesUnifiedPlan
645
-                && !this.isP2P
642
+            if (!this.isP2P
646
                 && state === 'stable'
643
                 && state === 'stable'
647
                 && remoteDescription
644
                 && remoteDescription
648
                 && typeof remoteDescription.sdp === 'string') {
645
                 && typeof remoteDescription.sdp === 'string') {
948
         });
945
         });
949
     }
946
     }
950
 
947
 
951
-    /**
952
-     * Makes the underlying TraceablePeerConnection generate new SSRC for
953
-     * the recvonly video stream.
954
-     * @deprecated
955
-     */
956
-    generateRecvonlySsrc() {
957
-        if (this.peerconnection) {
958
-            this.peerconnection.generateRecvonlySsrc();
959
-        } else {
960
-            logger.error(`${this} Unable to generate recvonly SSRC - no peerconnection`);
961
-        }
962
-    }
963
-
964
     /**
948
     /**
965
      * Returns the video codec configured as the preferred codec on the peerconnection.
949
      * Returns the video codec configured as the preferred codec on the peerconnection.
966
      */
950
      */
1005
                     const videoTracks = localTracks.filter(track => track.getType() === MediaType.VIDEO);
989
                     const videoTracks = localTracks.filter(track => track.getType() === MediaType.VIDEO);
1006
 
990
 
1007
                     videoTracks.length && videoTracks.splice(0, 1);
991
                     videoTracks.length && videoTracks.splice(0, 1);
1008
-                    if (FeatureFlags.isMultiStreamSendSupportEnabled() && videoTracks.length) {
1009
-                        this.addTracks(videoTracks);
1010
-                    }
992
+                    videoTracks.length && this.addTracks(videoTracks);
1011
                 },
993
                 },
1012
                 error => {
994
                 error => {
1013
                     failure(error);
995
                     failure(error);
1150
         // Add only 1 video track at a time. Adding 2 or more video tracks to the peerconnection at the same time
1132
         // Add only 1 video track at a time. Adding 2 or more video tracks to the peerconnection at the same time
1151
         // makes the browser go into a renegotiation loop by firing 'negotiationneeded' event after every
1133
         // makes the browser go into a renegotiation loop by firing 'negotiationneeded' event after every
1152
         // renegotiation.
1134
         // renegotiation.
1153
-        if (FeatureFlags.isMultiStreamSendSupportEnabled() && videoTracks.length > 1) {
1135
+        if (videoTracks.length > 1) {
1154
             tracks = [ ...audioTracks, videoTracks[0] ];
1136
             tracks = [ ...audioTracks, videoTracks[0] ];
1155
         }
1137
         }
1156
         for (const track of tracks) {
1138
         for (const track of tracks) {
1716
                 if (currentRemoteSdp.containsSSRC(ssrc)) {
1698
                 if (currentRemoteSdp.containsSSRC(ssrc)) {
1717
 
1699
 
1718
                     // Do not print the warning for unified plan p2p case since ssrcs are never removed from the SDP.
1700
                     // Do not print the warning for unified plan p2p case since ssrcs are never removed from the SDP.
1719
-                    !(self.usesUnifiedPlan && self.isP2P)
1720
-                        && logger.warn(`${self} Source-add request for existing SSRC: ${ssrc}`);
1701
+                    !self.isP2P && logger.warn(`${self} Source-add request for existing SSRC: ${ssrc}`);
1721
 
1702
 
1722
                     return;
1703
                     return;
1723
                 }
1704
                 }
1994
      *  in removeSsrcInfo
1975
      *  in removeSsrcInfo
1995
      */
1976
      */
1996
     _processRemoteRemoveSource(removeSsrcInfo) {
1977
     _processRemoteRemoveSource(removeSsrcInfo) {
1997
-        const remoteSdp = this.usesUnifiedPlan
1998
-            ? new SDP(this.peerconnection.peerconnection.remoteDescription.sdp)
1999
-            : new SDP(this.peerconnection.remoteDescription.sdp);
1978
+        const remoteSdp = new SDP(this.peerconnection.peerconnection.remoteDescription.sdp);
2000
         let ssrcs;
1979
         let ssrcs;
2001
 
1980
 
2002
-        removeSsrcInfo.forEach((lines, idx) => {
1981
+        removeSsrcInfo.forEach(lines => {
2003
             // eslint-disable-next-line no-param-reassign
1982
             // eslint-disable-next-line no-param-reassign
2004
             lines = lines.split('\r\n');
1983
             lines = lines.split('\r\n');
2005
             lines.pop(); // remove empty last element;
1984
             lines.pop(); // remove empty last element;
2006
             ssrcs = lines.map(line => Number(line.split('a=ssrc:')[1]?.split(' ')[0]));
1985
             ssrcs = lines.map(line => Number(line.split('a=ssrc:')[1]?.split(' ')[0]));
2007
 
1986
 
2008
-            if (this.usesUnifiedPlan) {
2009
-                let mid;
2010
-
2011
-                lines.forEach(line => {
2012
-                    mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
2013
-                    if (mid > -1) {
2014
-                        remoteSdp.media[mid] = remoteSdp.media[mid].replace(`${line}\r\n`, '');
2015
-                        if (this.isP2P) {
2016
-                            const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
2017
-                            const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
2018
-
2019
-                            [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
2020
-                                remoteSdp.media[mid] = remoteSdp.media[mid]
2021
-                                    .replace(`a=${direction}`, `a=${desiredDirection}`);
2022
-                            });
2023
-                        } else {
2024
-                            // Jvb connections will have direction set to 'sendonly' for the remote sources.
1987
+            let mid;
1988
+
1989
+            lines.forEach(line => {
1990
+                mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
1991
+                if (mid > -1) {
1992
+                    remoteSdp.media[mid] = remoteSdp.media[mid].replace(`${line}\r\n`, '');
1993
+                    if (this.isP2P) {
1994
+                        const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
1995
+                        const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
1996
+
1997
+                        [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
2025
                             remoteSdp.media[mid] = remoteSdp.media[mid]
1998
                             remoteSdp.media[mid] = remoteSdp.media[mid]
2026
-                                .replace(`a=${MediaDirection.SENDONLY}`, `a=${MediaDirection.INACTIVE}`);
1999
+                                .replace(`a=${direction}`, `a=${desiredDirection}`);
2000
+                        });
2001
+                    } else {
2002
+                        // Jvb connections will have direction set to 'sendonly' for the remote sources.
2003
+                        remoteSdp.media[mid] = remoteSdp.media[mid]
2004
+                            .replace(`a=${MediaDirection.SENDONLY}`, `a=${MediaDirection.INACTIVE}`);
2027
 
2005
 
2028
-                            // Reject the m-line so that the browser removes the associated transceiver from the list
2029
-                            // of available transceivers. This will prevent the client from trying to re-use these
2030
-                            // inactive transceivers when additional video sources are added to the peerconnection.
2031
-                            const { media, port } = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0]);
2006
+                        // Reject the m-line so that the browser removes the associated transceiver from the list
2007
+                        // of available transceivers. This will prevent the client from trying to re-use these
2008
+                        // inactive transceivers when additional video sources are added to the peerconnection.
2009
+                        const { media, port } = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0]);
2032
 
2010
 
2033
-                            remoteSdp.media[mid] = remoteSdp.media[mid].replace(`m=${media} ${port}`, `m=${media} 0`);
2034
-                        }
2011
+                        remoteSdp.media[mid] = remoteSdp.media[mid].replace(`m=${media} ${port}`, `m=${media} 0`);
2035
                     }
2012
                     }
2036
-                });
2037
-            } else {
2038
-                lines.forEach(line => {
2039
-                    remoteSdp.media[idx] = remoteSdp.media[idx].replace(`${line}\r\n`, '');
2040
-                });
2041
-            }
2013
+                }
2014
+            });
2042
         });
2015
         });
2043
 
2016
 
2044
         // Update the ssrc owners list.
2017
         // Update the ssrc owners list.
2061
 
2034
 
2062
         // Add a new m-line in the remote description if the source info for a secondary video source is recceived from
2035
         // Add a new m-line in the remote description if the source info for a secondary video source is recceived from
2063
         // the remote p2p peer when multi-stream support is enabled.
2036
         // the remote p2p peer when multi-stream support is enabled.
2064
-        if (addSsrcInfo.length > remoteSdp.media.length
2065
-            && this.isP2P
2066
-            && this.usesUnifiedPlan) {
2037
+        if (addSsrcInfo.length > remoteSdp.media.length && this.isP2P) {
2067
             remoteSdp.addMlineForNewLocalSource(MediaType.VIDEO);
2038
             remoteSdp.addMlineForNewLocalSource(MediaType.VIDEO);
2068
             remoteSdp = new SDP(remoteSdp.raw);
2039
             remoteSdp = new SDP(remoteSdp.raw);
2069
         }
2040
         }
2072
 
2043
 
2073
             // Make sure to change the direction to 'sendrecv/sendonly' only for p2p connections. For jvb connections,
2044
             // Make sure to change the direction to 'sendrecv/sendonly' only for p2p connections. For jvb connections,
2074
             // a new m-line is added for the new remote sources.
2045
             // a new m-line is added for the new remote sources.
2075
-            if (this.isP2P && this.usesUnifiedPlan) {
2046
+            if (this.isP2P) {
2076
                 const mediaType = SDPUtil.parseMLine(remoteSdp.media[idx].split('\r\n')[0])?.media;
2047
                 const mediaType = SDPUtil.parseMLine(remoteSdp.media[idx].split('\r\n')[0])?.media;
2077
                 const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, true);
2048
                 const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, true);
2078
 
2049
 
2152
      * otherwise.
2123
      * otherwise.
2153
      */
2124
      */
2154
     addTracks(localTracks = null) {
2125
     addTracks(localTracks = null) {
2155
-        if (!FeatureFlags.isMultiStreamSendSupportEnabled()
2156
-            || !localTracks?.length
2157
-            || localTracks.find(track => track.getType() !== MediaType.VIDEO)) {
2126
+        if (!localTracks?.length) {
2127
+            Promise.reject(new Error('No tracks passed'));
2128
+        }
2129
+
2130
+        if (localTracks.find(track => track.getType() !== MediaType.VIDEO)) {
2158
             return Promise.reject(new Error('Multiple tracks of the given media type are not supported'));
2131
             return Promise.reject(new Error('Multiple tracks of the given media type are not supported'));
2159
         }
2132
         }
2160
 
2133
 
2254
         const workFunction = finishedCallback => {
2227
         const workFunction = finishedCallback => {
2255
             logger.debug(`${this} replaceTrack worker started. oldTrack = ${oldTrack}, newTrack = ${newTrack}`);
2228
             logger.debug(`${this} replaceTrack worker started. oldTrack = ${oldTrack}, newTrack = ${newTrack}`);
2256
 
2229
 
2257
-            if (!this.usesUnifiedPlan) {
2258
-                // NOTE the code below assumes that no more than 1 video track
2259
-                // can be added to the peer connection.
2260
-                // Transition from camera to desktop share
2261
-                // or transition from one camera source to another.
2262
-                if (this.peerconnection.options.capScreenshareBitrate
2263
-                    && oldTrack && newTrack && newTrack.isVideoTrack()) {
2264
-                    // Clearing current primary SSRC will make
2265
-                    // the SdpConsistency generate a new one which will result
2266
-                    // with:
2267
-                    // 1. source-remove for the old video stream.
2268
-                    // 2. source-add for the new video stream.
2269
-                    this.peerconnection.clearRecvonlySsrc();
2270
-                }
2271
-
2272
-                // Transition from no video to video (unmute).
2273
-                if (!oldTrack && newTrack && newTrack.isVideoTrack()) {
2274
-                    // Clearing current primary SSRC will make
2275
-                    // the SdpConsistency generate a new one which will result
2276
-                    // with:
2277
-                    // 1. source-remove for the recvonly
2278
-                    // 2. source-add for the new video stream
2279
-                    this.peerconnection.clearRecvonlySsrc();
2280
-
2281
-                // Transition from video to no video
2282
-                } else if (oldTrack && oldTrack.isVideoTrack() && !newTrack) {
2283
-                    // Clearing current primary SSRC and generating the recvonly
2284
-                    // will result in:
2285
-                    // 1. source-remove for the old video stream
2286
-                    // 2. source-add for the recvonly stream
2287
-                    this.peerconnection.clearRecvonlySsrc();
2288
-                    this.peerconnection.generateRecvonlySsrc();
2289
-                }
2290
-            }
2291
-
2292
             this.peerconnection.replaceTrack(oldTrack, newTrack)
2230
             this.peerconnection.replaceTrack(oldTrack, newTrack)
2293
                 .then(shouldRenegotiate => {
2231
                 .then(shouldRenegotiate => {
2294
                     let promise = Promise.resolve();
2232
                     let promise = Promise.resolve();
2407
         return removeSsrcInfo;
2345
         return removeSsrcInfo;
2408
     }
2346
     }
2409
 
2347
 
2410
-    /**
2411
-     * Will print an error if there is any difference, between the SSRCs given
2412
-     * in the <tt>oldSDP</tt> and the ones currently described in
2413
-     * the peerconnection's local description.
2414
-     * @param {string} operationName the operation's name which will be printed
2415
-     * in the error message.
2416
-     * @param {SDP} oldSDP the old local SDP which will be compared with
2417
-     * the current one.
2418
-     * @return {boolean} <tt>true</tt> if there was any change or <tt>false</tt>
2419
-     * otherwise.
2420
-     * @private
2421
-     */
2422
-    _verifyNoSSRCChanged(operationName, oldSDP) {
2423
-        const currentLocalSDP
2424
-            = new SDP(this.peerconnection.localDescription.sdp);
2425
-        let sdpDiff = new SDPDiffer(oldSDP, currentLocalSDP);
2426
-        const addedMedia = sdpDiff.getNewMedia();
2427
-
2428
-        if (Object.keys(addedMedia).length) {
2429
-            logger.error(`${this} - some SSRC were added on ${operationName}`, addedMedia);
2430
-
2431
-            return false;
2432
-        }
2433
-
2434
-        sdpDiff = new SDPDiffer(currentLocalSDP, oldSDP);
2435
-        const removedMedia = sdpDiff.getNewMedia();
2436
-
2437
-        if (Object.keys(removedMedia).length) {
2438
-            logger.error(`${this} - some SSRCs were removed on ${operationName}`, removedMedia);
2439
-
2440
-            return false;
2441
-        }
2442
-
2443
-        return true;
2444
-    }
2445
-
2446
     /**
2348
     /**
2447
      * Adds local track back to the peerconnection associated with this session.
2349
      * Adds local track back to the peerconnection associated with this session.
2448
      * @param {JitsiLocalTrack} track
2350
      * @param {JitsiLocalTrack} track
2492
 
2394
 
2493
                 return;
2395
                 return;
2494
             }
2396
             }
2495
-            const oldLocalSDP = tpc.localDescription.sdp;
2496
             const operationPromise
2397
             const operationPromise
2497
                 = isRemove
2398
                 = isRemove
2498
                     ? tpc.removeTrackFromPc(track)
2399
                     ? tpc.removeTrackFromPc(track)
2500
 
2401
 
2501
             operationPromise
2402
             operationPromise
2502
                 .then(shouldRenegotiate => {
2403
                 .then(shouldRenegotiate => {
2503
-                    if (shouldRenegotiate && oldLocalSDP && tpc.remoteDescription.sdp) {
2504
-                        this._renegotiate()
2505
-                            .then(() => {
2506
-                                // The results are ignored, as this check failure is not enough to fail the whole
2507
-                                // operation. It will log an error inside for plan-b.
2508
-                                !this.usesUnifiedPlan && this._verifyNoSSRCChanged(operationName, new SDP(oldLocalSDP));
2509
-                                finishedCallback();
2510
-                            });
2404
+                    if (shouldRenegotiate) {
2405
+                        this._renegotiate().then(finishedCallback);
2511
                     } else {
2406
                     } else {
2512
                         finishedCallback();
2407
                         finishedCallback();
2513
                     }
2408
                     }

+ 0
- 17
package-lock.json 查看文件

14
         "@jitsi/logger": "2.0.2",
14
         "@jitsi/logger": "2.0.2",
15
         "@jitsi/rtcstats": "9.7.0",
15
         "@jitsi/rtcstats": "9.7.0",
16
         "@jitsi/sdp-interop": "git+https://github.com/jitsi/sdp-interop#3d49eb4aa26863a3f8d32d7581cdb4321244266b",
16
         "@jitsi/sdp-interop": "git+https://github.com/jitsi/sdp-interop#3d49eb4aa26863a3f8d32d7581cdb4321244266b",
17
-        "@jitsi/sdp-simulcast": "0.4.0",
18
         "@testrtc/watchrtc-sdk": "1.36.3",
17
         "@testrtc/watchrtc-sdk": "1.36.3",
19
         "async-es": "3.2.4",
18
         "async-es": "3.2.4",
20
         "base64-js": "1.3.1",
19
         "base64-js": "1.3.1",
2063
         "sdp-verify": "checker.js"
2062
         "sdp-verify": "checker.js"
2064
       }
2063
       }
2065
     },
2064
     },
2066
-    "node_modules/@jitsi/sdp-simulcast": {
2067
-      "version": "0.4.0",
2068
-      "resolved": "https://registry.npmjs.org/@jitsi/sdp-simulcast/-/sdp-simulcast-0.4.0.tgz",
2069
-      "integrity": "sha512-jXJM3/XM853UwPlxhSJx5Fc13G4158RIeTgjis3lA286Y7lp18GOR0xFlRvx/5UyhtE3qT2NzSmAwR+CpJohFw==",
2070
-      "dependencies": {
2071
-        "sdp-transform": "2.3.0"
2072
-      }
2073
-    },
2074
     "node_modules/@jridgewell/gen-mapping": {
2065
     "node_modules/@jridgewell/gen-mapping": {
2075
       "version": "0.3.2",
2066
       "version": "0.3.2",
2076
       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
2067
       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
8818
         }
8809
         }
8819
       }
8810
       }
8820
     },
8811
     },
8821
-    "@jitsi/sdp-simulcast": {
8822
-      "version": "0.4.0",
8823
-      "resolved": "https://registry.npmjs.org/@jitsi/sdp-simulcast/-/sdp-simulcast-0.4.0.tgz",
8824
-      "integrity": "sha512-jXJM3/XM853UwPlxhSJx5Fc13G4158RIeTgjis3lA286Y7lp18GOR0xFlRvx/5UyhtE3qT2NzSmAwR+CpJohFw==",
8825
-      "requires": {
8826
-        "sdp-transform": "2.3.0"
8827
-      }
8828
-    },
8829
     "@jridgewell/gen-mapping": {
8812
     "@jridgewell/gen-mapping": {
8830
       "version": "0.3.2",
8813
       "version": "0.3.2",
8831
       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
8814
       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",

+ 0
- 1
package.json 查看文件

20
     "@jitsi/logger": "2.0.2",
20
     "@jitsi/logger": "2.0.2",
21
     "@jitsi/rtcstats": "9.7.0",
21
     "@jitsi/rtcstats": "9.7.0",
22
     "@jitsi/sdp-interop": "git+https://github.com/jitsi/sdp-interop#3d49eb4aa26863a3f8d32d7581cdb4321244266b",
22
     "@jitsi/sdp-interop": "git+https://github.com/jitsi/sdp-interop#3d49eb4aa26863a3f8d32d7581cdb4321244266b",
23
-    "@jitsi/sdp-simulcast": "0.4.0",
24
     "@testrtc/watchrtc-sdk": "1.36.3",
23
     "@testrtc/watchrtc-sdk": "1.36.3",
25
     "async-es": "3.2.4",
24
     "async-es": "3.2.4",
26
     "base64-js": "1.3.1",
25
     "base64-js": "1.3.1",

+ 0
- 7
types/hand-crafted/modules/RTC/TraceablePeerConnection.d.ts 查看文件

3
 import JitsiRemoteTrack from './JitsiRemoteTrack';
3
 import JitsiRemoteTrack from './JitsiRemoteTrack';
4
 import JitsiLocalTrack from './JitsiLocalTrack';
4
 import JitsiLocalTrack from './JitsiLocalTrack';
5
 import LocalSdpMunger from '../sdp/LocalSdpMunger';
5
 import LocalSdpMunger from '../sdp/LocalSdpMunger';
6
-import SdpConsistency from '../sdp/SdpConsistency';
7
 import RtxModifier from '../sdp/RtxModifier';
6
 import RtxModifier from '../sdp/RtxModifier';
8
 import SignalingLayer from '../../service/RTC/SignalingLayer';
7
 import SignalingLayer from '../../service/RTC/SignalingLayer';
9
 import { MediaType } from '../../service/RTC/MediaType';
8
 import { MediaType } from '../../service/RTC/MediaType';
16
   disabledCodec: string;
15
   disabledCodec: string;
17
   preferredCodec: string;
16
   preferredCodec: string;
18
   startSilent: boolean;
17
   startSilent: boolean;
19
-  usesUnifiedPlan: boolean;
20
 } ): void; // TODO:
18
 } ): void; // TODO:
21
 
19
 
22
 export default class TraceablePeerConnection {
20
 export default class TraceablePeerConnection {
60
   maxstats: unknown; // TODO:
58
   maxstats: unknown; // TODO:
61
   interop: unknown; // TODO: unknown = Interop refers to @jitsi/sdp-interop
59
   interop: unknown; // TODO: unknown = Interop refers to @jitsi/sdp-interop
62
   simulcast: unknown; // TODO: unknown = Simulcast refers to @jitsi/sdp-simulcast
60
   simulcast: unknown; // TODO: unknown = Simulcast refers to @jitsi/sdp-simulcast
63
-  sdpConsistency: SdpConsistency; // TODO:
64
   localSdpMunger: LocalSdpMunger; // TODO:
61
   localSdpMunger: LocalSdpMunger; // TODO:
65
   eventEmitter: unknown; // TODO:
62
   eventEmitter: unknown; // TODO:
66
   rtxModifier: RtxModifier; // TODO:
63
   rtxModifier: RtxModifier; // TODO:
109
   setSenderVideoConstraint: ( frameHeight: number ) => Promise<void>;
106
   setSenderVideoConstraint: ( frameHeight: number ) => Promise<void>;
110
   setVideoTransferActive: ( active: boolean ) => boolean;
107
   setVideoTransferActive: ( active: boolean ) => boolean;
111
   sendTones: ( tones: string, duration: number, interToneGap: number ) => void;
108
   sendTones: ( tones: string, duration: number, interToneGap: number ) => void;
112
-  generateRecvonlySsrc: () => void;
113
-  clearRecvonlySsrc: () => void;
114
   close: () => void;
109
   close: () => void;
115
   createAnswer: ( constraints: unknown ) => unknown; // TODO:
110
   createAnswer: ( constraints: unknown ) => unknown; // TODO:
116
   createOffer: ( constraints: unknown ) => unknown; // TODO:
111
   createOffer: ( constraints: unknown ) => unknown; // TODO:
117
   addIceCandidate: ( candidate: unknown ) => unknown; // TODO:
112
   addIceCandidate: ( candidate: unknown ) => unknown; // TODO:
118
-  generateNewStreamSSRCInfo: (track: JitsiLocalTrack) => TraceablePeerConnection['localSSRCs'];
119
-  usesUnifiedPlan: () => boolean;
120
   getStats: () => unknown; // TODO:
113
   getStats: () => unknown; // TODO:
121
   toString: () => string;
114
   toString: () => string;
122
 }
115
 }

+ 0
- 1
types/hand-crafted/modules/browser/BrowserCapabilities.d.ts 查看文件

19
   supportsGetDisplayMedia: () => boolean;
19
   supportsGetDisplayMedia: () => boolean;
20
   supportsInsertableStreams: () => boolean;
20
   supportsInsertableStreams: () => boolean;
21
   supportsAudioRed: () => boolean;
21
   supportsAudioRed: () => boolean;
22
-  supportsUnifiedPlan: () => boolean;
23
   supportsVADDetection: () => boolean;
22
   supportsVADDetection: () => boolean;
24
 }
23
 }

+ 0
- 1
types/hand-crafted/modules/sdp/LocalSdpMunger.d.ts 查看文件

2
 
2
 
3
 export default class LocalSdpMunger {
3
 export default class LocalSdpMunger {
4
   constructor( tpc: TraceablePeerConnection, localEndpointId: string );
4
   constructor( tpc: TraceablePeerConnection, localEndpointId: string );
5
-  maybeAddMutedLocalVideoTracksToSDP: ( desc: unknown ) => RTCSessionDescription; // TODO:
6
   transformStreamIdentifiers: ( sessionDesc: RTCSessionDescription ) => RTCSessionDescription;
5
   transformStreamIdentifiers: ( sessionDesc: RTCSessionDescription ) => RTCSessionDescription;
7
 }
6
 }

+ 0
- 7
types/hand-crafted/modules/sdp/SdpConsistency.d.ts 查看文件

1
-export default class SdpConsistency {
2
-  constructor( logPrefix: string );
3
-  clearVideoSsrcCache: () => void;
4
-  setPrimarySsrc: ( primarySsrc: number ) => void;
5
-  hasPrimarySsrcCached: () => void;
6
-  makeVideoPrimarySsrcsConsistent: ( sdpStr: string ) => string;
7
-}

+ 0
- 1
types/hand-crafted/modules/xmpp/JingleSessionPC.d.ts 查看文件

14
   sendIceFailedNotification: () => void;
14
   sendIceFailedNotification: () => void;
15
   addIceCandidates: ( elem: unknown ) => void; // TODO:
15
   addIceCandidates: ( elem: unknown ) => void; // TODO:
16
   readSsrcInfo: ( contents: unknown ) => void; // TODO:
16
   readSsrcInfo: ( contents: unknown ) => void; // TODO:
17
-  generateRecvonlySsrc: () => void;
18
   getConfiguredVideoCodec: () => CodecMimeType;
17
   getConfiguredVideoCodec: () => CodecMimeType;
19
   acceptOffer: ( jingleOffer: JQuery, success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown, localTracks?: JitsiLocalTrack[] ) => void; // TODO:
18
   acceptOffer: ( jingleOffer: JQuery, success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown, localTracks?: JitsiLocalTrack[] ) => void; // TODO:
20
   invite: ( localTracks?: JitsiLocalTrack[] ) => void;
19
   invite: ( localTracks?: JitsiLocalTrack[] ) => void;

Loading…
取消
儲存