|
@@ -5,7 +5,6 @@ import transform from 'sdp-transform';
|
5
|
5
|
|
6
|
6
|
import * as GlobalOnErrorHandler from '../util/GlobalOnErrorHandler';
|
7
|
7
|
import JitsiRemoteTrack from './JitsiRemoteTrack';
|
8
|
|
-import * as JitsiTrackEvents from '../../JitsiTrackEvents';
|
9
|
8
|
import * as MediaType from '../../service/RTC/MediaType';
|
10
|
9
|
import LocalSdpMunger from './LocalSdpMunger';
|
11
|
10
|
import RTC from './RTC';
|
|
@@ -13,6 +12,7 @@ import RTCUtils from './RTCUtils';
|
13
|
12
|
import browser from '../browser';
|
14
|
13
|
import RTCEvents from '../../service/RTC/RTCEvents';
|
15
|
14
|
import RtxModifier from '../xmpp/RtxModifier';
|
|
15
|
+import { SIM_LAYER_RIDS, TPCUtils } from './TPCUtils';
|
16
|
16
|
|
17
|
17
|
// FIXME SDP tools should end up in some kind of util module
|
18
|
18
|
import SDP from '../xmpp/SDP';
|
|
@@ -22,12 +22,7 @@ import SDPUtil from '../xmpp/SDPUtil';
|
22
|
22
|
import * as SignalingEvents from '../../service/RTC/SignalingEvents';
|
23
|
23
|
|
24
|
24
|
const logger = getLogger(__filename);
|
25
|
|
-const SIMULCAST_LAYERS = 3;
|
26
|
|
-const SIM_LAYER_1_RID = '1';
|
27
|
|
-const SIM_LAYER_2_RID = '2';
|
28
|
|
-const SIM_LAYER_3_RID = '3';
|
29
|
|
-const SIM_LAYER_RIDS = [ SIM_LAYER_1_RID, SIM_LAYER_2_RID, SIM_LAYER_3_RID ];
|
30
|
|
-const SIM_LAYER_BITRATES_BPS = [ 200000, 700000, 2500000 ];
|
|
25
|
+const MAX_BITRATE = 2500000;
|
31
|
26
|
const DESKSTOP_SHARE_RATE = 500000;
|
32
|
27
|
|
33
|
28
|
/* eslint-disable max-params */
|
|
@@ -215,6 +210,7 @@ export default function TraceablePeerConnection(
|
215
|
210
|
|
216
|
211
|
this.peerconnection
|
217
|
212
|
= new RTCUtils.RTCPeerConnectionType(iceConfig, constraints);
|
|
213
|
+ this.tpcUtils = new TPCUtils(this);
|
218
|
214
|
this.updateLog = [];
|
219
|
215
|
this.stats = {};
|
220
|
216
|
this.statsinterval = null;
|
|
@@ -229,8 +225,12 @@ export default function TraceablePeerConnection(
|
229
|
225
|
this.interop = new Interop();
|
230
|
226
|
const Simulcast = require('@jitsi/sdp-simulcast');
|
231
|
227
|
|
232
|
|
- this.simulcast = new Simulcast({ numOfLayers: SIMULCAST_LAYERS,
|
233
|
|
- explodeRemoteSimulcast: false });
|
|
228
|
+ this.simulcast = new Simulcast(
|
|
229
|
+ {
|
|
230
|
+ numOfLayers: SIM_LAYER_RIDS.length,
|
|
231
|
+ explodeRemoteSimulcast: false,
|
|
232
|
+ usesUnifiedPlan: browser.usesUnifiedPlan()
|
|
233
|
+ });
|
234
|
234
|
this.sdpConsistency = new SdpConsistency(this.toString());
|
235
|
235
|
|
236
|
236
|
/**
|
|
@@ -1268,7 +1268,7 @@ TraceablePeerConnection.prototype._injectSsrcGroupForUnifiedSimulcast
|
1268
|
1268
|
const sdp = transform.parse(desc.sdp);
|
1269
|
1269
|
const video = sdp.media.find(mline => mline.type === 'video');
|
1270
|
1270
|
|
1271
|
|
- if (video.simulcast_03) {
|
|
1271
|
+ if (video.simulcast) {
|
1272
|
1272
|
const ssrcs = [];
|
1273
|
1273
|
|
1274
|
1274
|
video.ssrcs.forEach(ssrc => {
|
|
@@ -1377,7 +1377,7 @@ TraceablePeerConnection.prototype._getSSRC = function(rtcId) {
|
1377
|
1377
|
* Add {@link JitsiLocalTrack} to this TPC.
|
1378
|
1378
|
* @param {JitsiLocalTrack} track
|
1379
|
1379
|
*/
|
1380
|
|
-TraceablePeerConnection.prototype.addTrack = function(track) {
|
|
1380
|
+TraceablePeerConnection.prototype.addTrack = function(track, isInitiator = false) {
|
1381
|
1381
|
const rtcId = track.rtcId;
|
1382
|
1382
|
|
1383
|
1383
|
logger.info(`add ${track} to: ${this}`);
|
|
@@ -1389,6 +1389,9 @@ TraceablePeerConnection.prototype.addTrack = function(track) {
|
1389
|
1389
|
}
|
1390
|
1390
|
|
1391
|
1391
|
this.localTracks.set(rtcId, track);
|
|
1392
|
+ if (browser.usesUnifiedPlan() && isInitiator) {
|
|
1393
|
+ return this.tpcUtils.addTrack(track, isInitiator);
|
|
1394
|
+ }
|
1392
|
1395
|
|
1393
|
1396
|
const webrtcStream = track.getOriginalStream();
|
1394
|
1397
|
|
|
@@ -1430,6 +1433,9 @@ TraceablePeerConnection.prototype.addTrack = function(track) {
|
1430
|
1433
|
this.rtxModifier.setSsrcCache(rtxSsrcMapping);
|
1431
|
1434
|
}
|
1432
|
1435
|
}
|
|
1436
|
+ if (browser.usesUnifiedPlan() && !browser.usesSdpMungingForSimulcast()) {
|
|
1437
|
+ this.tpcUtils.setEncodings(track);
|
|
1438
|
+ }
|
1433
|
1439
|
};
|
1434
|
1440
|
|
1435
|
1441
|
/**
|
|
@@ -1446,6 +1452,9 @@ TraceablePeerConnection.prototype.addTrackUnmute = function(track) {
|
1446
|
1452
|
}
|
1447
|
1453
|
|
1448
|
1454
|
logger.info(`Adding ${track} as unmute to ${this}`);
|
|
1455
|
+ if (browser.usesUnifiedPlan()) {
|
|
1456
|
+ return this.tpcUtils.addTrackUnmute(track);
|
|
1457
|
+ }
|
1449
|
1458
|
const webRtcStream = track.getOriginalStream();
|
1450
|
1459
|
|
1451
|
1460
|
if (!webRtcStream) {
|
|
@@ -1525,6 +1534,9 @@ TraceablePeerConnection.prototype.isMediaStreamInPc = function(mediaStream) {
|
1525
|
1534
|
* The same applies to addTrack.
|
1526
|
1535
|
*/
|
1527
|
1536
|
TraceablePeerConnection.prototype.removeTrack = function(localTrack) {
|
|
1537
|
+ if (browser.usesUnifiedPlan()) {
|
|
1538
|
+ return this.tpcUtils.removeTrack(localTrack);
|
|
1539
|
+ }
|
1528
|
1540
|
const webRtcStream = localTrack.getOriginalStream();
|
1529
|
1541
|
|
1530
|
1542
|
this.trace(
|
|
@@ -1590,50 +1602,9 @@ TraceablePeerConnection.prototype.findSenderByStream = function(stream) {
|
1590
|
1602
|
* renegotiation will be needed. Otherwise no renegotiation is needed.
|
1591
|
1603
|
*/
|
1592
|
1604
|
TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
|
1593
|
|
- if (browser.supportsRtpSender() && oldTrack && newTrack) {
|
1594
|
|
- // Add and than remove stream in FF leads to wrong local SDP. In order
|
1595
|
|
- // to workaround the issue we need to use sender.replaceTrack().
|
1596
|
|
- const sender = this.findSenderByStream(oldTrack.getOriginalStream());
|
1597
|
|
- const stream = newTrack.getOriginalStream();
|
1598
|
|
-
|
1599
|
|
- if (sender && stream) {
|
1600
|
|
- const track = stream.getTracks()[0];
|
1601
|
|
-
|
1602
|
|
- if (track) {
|
1603
|
|
- return sender.replaceTrack(track, stream).then(() => {
|
1604
|
|
- // Since there is no need to do renegotiations we need to
|
1605
|
|
- // fix all ssrc-msid mappings here.
|
1606
|
|
- // NOTE: after sender.replaceTrack the sdp will remain the
|
1607
|
|
- // same but the stream attach to the new JitsiLocalTrack
|
1608
|
|
- // will have different msid. Luckily on FF we are not doing
|
1609
|
|
- // all the transformations related to video mute.
|
1610
|
|
-
|
1611
|
|
- const ssrc = this.localSSRCs.get(oldTrack.rtcId);
|
1612
|
|
-
|
1613
|
|
- this.localTracks.delete(oldTrack.rtcId);
|
1614
|
|
- this.localSSRCs.delete(oldTrack.rtcId);
|
1615
|
|
- this._addedStreams
|
1616
|
|
- = this._addedStreams.filter(s => s !== stream);
|
1617
|
|
-
|
1618
|
|
- this.localTracks.set(newTrack.rtcId, newTrack);
|
1619
|
|
-
|
1620
|
|
- // Override the msid of JitsiLocalTrack in order to be
|
1621
|
|
- // consistent with the SDP values.
|
1622
|
|
- newTrack.storedMSID = oldTrack.storedMSID;
|
1623
|
|
- this._addedStreams.push(stream);
|
1624
|
|
-
|
1625
|
|
- this.localSSRCs.set(newTrack.rtcId, ssrc);
|
1626
|
|
- this.eventEmitter.emit(
|
1627
|
|
- RTCEvents.LOCAL_TRACK_SSRC_UPDATED,
|
1628
|
|
- newTrack,
|
1629
|
|
- extractPrimarySSRC(ssrc));
|
1630
|
|
-
|
1631
|
|
- return false;
|
1632
|
|
- });
|
1633
|
|
- }
|
1634
|
|
- }
|
|
1605
|
+ if (browser.usesUnifiedPlan()) {
|
|
1606
|
+ return this.tpcUtils.replaceTrack(oldTrack, newTrack);
|
1635
|
1607
|
}
|
1636
|
|
-
|
1637
|
1608
|
if (oldTrack) {
|
1638
|
1609
|
this.removeTrack(oldTrack);
|
1639
|
1610
|
}
|
|
@@ -1644,33 +1615,6 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
|
1644
|
1615
|
return Promise.resolve(true);
|
1645
|
1616
|
};
|
1646
|
1617
|
|
1647
|
|
-/**
|
1648
|
|
- * Replaces the existing media stream from the underlying peerconnection with the new
|
1649
|
|
- * mediastream that has been added to the JitsiLocalTrack. Renegotiation with the remote
|
1650
|
|
- * peer is not needed in this case.
|
1651
|
|
- * @param {JitsiLocalTrack} localTrack - the localtrack whose mediastream has been updated.
|
1652
|
|
- * @return {Promise} - Promise resolved with undefined if the track is replaced,
|
1653
|
|
- * or rejected with <tt>InvalidModificationError<tt> if the track cannot be replaced.
|
1654
|
|
- */
|
1655
|
|
-TraceablePeerConnection.prototype.replaceTrackWithoutOfferAnswer = function(localTrack) {
|
1656
|
|
- const newTrack = localTrack.stream.getTracks()[0];
|
1657
|
|
- const sender = this.findSenderByKind(newTrack.kind);
|
1658
|
|
-
|
1659
|
|
- if (!sender) {
|
1660
|
|
- return Promise.reject(new Error(`Could not find RTCRtpSender for ${newTrack.kind}`));
|
1661
|
|
- }
|
1662
|
|
-
|
1663
|
|
- return sender.replaceTrack(newTrack)
|
1664
|
|
- .then(() => {
|
1665
|
|
- this._addedStreams = this._addedStreams.filter(s => s !== localTrack._originalStream);
|
1666
|
|
- this._addedStreams.push(localTrack.stream);
|
1667
|
|
- localTrack.emit(JitsiTrackEvents.TRACK_MUTE_CHANGED, localTrack);
|
1668
|
|
- })
|
1669
|
|
- .catch(err => {
|
1670
|
|
- logger.error(`replaceTrackWithoutOfferAnswer - replaceTrack failed for ${newTrack.kind}`, err);
|
1671
|
|
- });
|
1672
|
|
-};
|
1673
|
|
-
|
1674
|
1618
|
/**
|
1675
|
1619
|
* Removes local track as part of the mute operation.
|
1676
|
1620
|
* @param {JitsiLocalTrack} localTrack the local track to be remove as part of
|
|
@@ -1689,7 +1633,9 @@ TraceablePeerConnection.prototype.removeTrackMute = function(localTrack) {
|
1689
|
1633
|
// Abort - nothing to be done here
|
1690
|
1634
|
return false;
|
1691
|
1635
|
}
|
1692
|
|
-
|
|
1636
|
+ if (browser.usesUnifiedPlan()) {
|
|
1637
|
+ return this.tpcUtils.removeTrackMute(localTrack);
|
|
1638
|
+ }
|
1693
|
1639
|
if (webRtcStream) {
|
1694
|
1640
|
logger.info(
|
1695
|
1641
|
`Removing ${localTrack} as mute from ${this}`);
|
|
@@ -1896,6 +1842,9 @@ TraceablePeerConnection.prototype.setLocalDescription = function(description) {
|
1896
|
1842
|
*/
|
1897
|
1843
|
TraceablePeerConnection.prototype.setAudioTransferActive = function(active) {
|
1898
|
1844
|
logger.debug(`${this} audio transfer active: ${active}`);
|
|
1845
|
+ if (browser.usesUnifiedPlan()) {
|
|
1846
|
+ return this.tpcUtils.setAudioTransferActive(active);
|
|
1847
|
+ }
|
1899
|
1848
|
const changed = this.audioTransferActive !== active;
|
1900
|
1849
|
|
1901
|
1850
|
this.audioTransferActive = active;
|
|
@@ -1903,47 +1852,6 @@ TraceablePeerConnection.prototype.setAudioTransferActive = function(active) {
|
1903
|
1852
|
return changed;
|
1904
|
1853
|
};
|
1905
|
1854
|
|
1906
|
|
-/**
|
1907
|
|
- * Takes in a *unified plan* offer and inserts the appropriate
|
1908
|
|
- * parameters for adding simulcast receive support.
|
1909
|
|
- * @param {Object} desc - A session description object
|
1910
|
|
- * @param {String} desc.type - the type (offer/answer)
|
1911
|
|
- * @param {String} desc.sdp - the sdp content
|
1912
|
|
- *
|
1913
|
|
- * @return {Object} A session description (same format as above) object
|
1914
|
|
- * with its sdp field modified to advertise simulcast receive support
|
1915
|
|
- */
|
1916
|
|
-TraceablePeerConnection.prototype._insertUnifiedPlanSimulcastReceive
|
1917
|
|
- = function(desc) {
|
1918
|
|
- const sdp = transform.parse(desc.sdp);
|
1919
|
|
- const video = sdp.media.find(mline => mline.type === 'video');
|
1920
|
|
-
|
1921
|
|
- // In order of lowest to highest spatial quality
|
1922
|
|
- video.rids = [
|
1923
|
|
- {
|
1924
|
|
- id: SIM_LAYER_1_RID,
|
1925
|
|
- direction: 'recv'
|
1926
|
|
- },
|
1927
|
|
- {
|
1928
|
|
- id: SIM_LAYER_2_RID,
|
1929
|
|
- direction: 'recv'
|
1930
|
|
- },
|
1931
|
|
- {
|
1932
|
|
- id: SIM_LAYER_3_RID,
|
1933
|
|
- direction: 'recv'
|
1934
|
|
- }
|
1935
|
|
- ];
|
1936
|
|
- // eslint-disable-next-line camelcase
|
1937
|
|
- video.simulcast_03 = {
|
1938
|
|
- value: `recv rid=${SIM_LAYER_RIDS.join(';')}`
|
1939
|
|
- };
|
1940
|
|
-
|
1941
|
|
- return new RTCSessionDescription({
|
1942
|
|
- type: desc.type,
|
1943
|
|
- sdp: transform.write(sdp)
|
1944
|
|
- });
|
1945
|
|
- };
|
1946
|
|
-
|
1947
|
1855
|
/**
|
1948
|
1856
|
* Sets the max bitrate on the RTCRtpSender so that the
|
1949
|
1857
|
* bitrate of the enocder doesn't exceed the configured value.
|
|
@@ -1955,9 +1863,13 @@ TraceablePeerConnection.prototype._insertUnifiedPlanSimulcastReceive
|
1955
|
1863
|
TraceablePeerConnection.prototype.setMaxBitRate = function(localTrack) {
|
1956
|
1864
|
const mediaType = localTrack.type;
|
1957
|
1865
|
|
1958
|
|
- if (!this.options.capScreenshareBitrate
|
1959
|
|
- || mediaType === MediaType.AUDIO) {
|
1960
|
|
-
|
|
1866
|
+ // No need to set max bitrates on the streams in the following cases.
|
|
1867
|
+ // 1. When an audio track has been replaced.
|
|
1868
|
+ // 2. When a 'camera' track is replaced in plan-b mode, since its a new sender.
|
|
1869
|
+ // 3. When the config.js option for capping the SS bitrate is not enabled.
|
|
1870
|
+ if ((mediaType === MediaType.AUDIO)
|
|
1871
|
+ || (browser.usesPlanB() && !this.options.capScreenshareBitrate)
|
|
1872
|
+ || (browser.usesPlanB() && localTrack.videoType === 'camera')) {
|
1961
|
1873
|
return;
|
1962
|
1874
|
}
|
1963
|
1875
|
if (!this.peerconnection.getSenders) {
|
|
@@ -1974,18 +1886,25 @@ TraceablePeerConnection.prototype.setMaxBitRate = function(localTrack) {
|
1974
|
1886
|
try {
|
1975
|
1887
|
const parameters = sender.getParameters();
|
1976
|
1888
|
|
1977
|
|
- if (parameters.encodings && parameters.encodings.length) {
|
1978
|
|
- logger.info('Setting max bitrate on video stream');
|
1979
|
|
- for (const encoding in parameters.encodings) {
|
1980
|
|
- if (parameters.encodings.hasOwnProperty(encoding)) {
|
1981
|
|
- parameters.encodings[encoding].maxBitrate
|
1982
|
|
- = videoType === 'desktop'
|
1983
|
|
- ? DESKSTOP_SHARE_RATE
|
1984
|
|
- : SIM_LAYER_BITRATES_BPS[encoding];
|
1985
|
|
- }
|
|
1889
|
+ if (!parameters.encodings || !parameters.encodings.length) {
|
|
1890
|
+ return;
|
|
1891
|
+ }
|
|
1892
|
+ logger.info('Setting max bitrate on video stream');
|
|
1893
|
+ for (const encoding in parameters.encodings) {
|
|
1894
|
+ if (parameters.encodings.hasOwnProperty(encoding)) {
|
|
1895
|
+ parameters.encodings[encoding].maxBitrate
|
|
1896
|
+ = videoType === 'desktop' && browser.usesPlanB()
|
|
1897
|
+ ? DESKSTOP_SHARE_RATE
|
|
1898
|
+
|
|
1899
|
+ // In unified plan, simulcast for SS is on by default.
|
|
1900
|
+ // When simulcast is disabled through a config.js option,
|
|
1901
|
+ // we cap the bitrate on desktop and camera tracks to 2500 Kbps.
|
|
1902
|
+ : this.isSimulcastOn()
|
|
1903
|
+ ? this.tpcUtils.simulcastEncodings[encoding].maxBitrate
|
|
1904
|
+ : MAX_BITRATE;
|
1986
|
1905
|
}
|
1987
|
|
- sender.setParameters(parameters);
|
1988
|
1906
|
}
|
|
1907
|
+ sender.setParameters(parameters);
|
1989
|
1908
|
} catch (err) {
|
1990
|
1909
|
logger.error('Browser does not support getParameters/setParamters '
|
1991
|
1910
|
+ 'or setting max bitrate on the encodings: ', err);
|
|
@@ -2036,7 +1955,7 @@ TraceablePeerConnection.prototype.setRemoteDescription = function(description) {
|
2036
|
1955
|
|
2037
|
1956
|
if (this.isSimulcastOn()) {
|
2038
|
1957
|
// eslint-disable-next-line no-param-reassign
|
2039
|
|
- description = this._insertUnifiedPlanSimulcastReceive(description);
|
|
1958
|
+ description = this.tpcUtils._insertUnifiedPlanSimulcastReceive(description);
|
2040
|
1959
|
this.trace(
|
2041
|
1960
|
'setRemoteDescription::postTransform (sim receive)',
|
2042
|
1961
|
dumpSDP(description));
|
|
@@ -2164,6 +2083,9 @@ TraceablePeerConnection.prototype._injectH264IfNotPresent = function(
|
2164
|
2083
|
*/
|
2165
|
2084
|
TraceablePeerConnection.prototype.setVideoTransferActive = function(active) {
|
2166
|
2085
|
logger.debug(`${this} video transfer active: ${active}`);
|
|
2086
|
+ if (browser.usesUnifiedPlan()) {
|
|
2087
|
+ return this.tpcUtils.setVideoTransferActive(active);
|
|
2088
|
+ }
|
2167
|
2089
|
const changed = this.videoTransferActive !== active;
|
2168
|
2090
|
|
2169
|
2091
|
this.videoTransferActive = active;
|
|
@@ -2361,19 +2283,7 @@ TraceablePeerConnection.prototype.createAnswer = function(constraints) {
|
2361
|
2283
|
= this.peerconnection.getSenders().find(sender =>
|
2362
|
2284
|
sender.track !== null && sender.track.kind === 'video');
|
2363
|
2285
|
const simParams = {
|
2364
|
|
- encodings: [
|
2365
|
|
- {
|
2366
|
|
- rid: SIM_LAYER_1_RID,
|
2367
|
|
- scaleResolutionDownBy: 4
|
2368
|
|
- },
|
2369
|
|
- {
|
2370
|
|
- rid: SIM_LAYER_2_RID,
|
2371
|
|
- scaleResolutionDownBy: 2
|
2372
|
|
- },
|
2373
|
|
- {
|
2374
|
|
- rid: SIM_LAYER_3_RID
|
2375
|
|
- }
|
2376
|
|
- ]
|
|
2286
|
+ encodings: this.tpcUtils.simulcastEncodings
|
2377
|
2287
|
};
|
2378
|
2288
|
|
2379
|
2289
|
videoSender.setParameters(simParams);
|
|
@@ -2458,7 +2368,7 @@ TraceablePeerConnection.prototype._createOfferOrAnswer = function(
|
2458
|
2368
|
// configure simulcast for camera tracks always and for
|
2459
|
2369
|
// desktop tracks only when the testing flag for maxbitrates
|
2460
|
2370
|
// in config.js is disabled.
|
2461
|
|
- if (this.isSimulcastOn()
|
|
2371
|
+ if (this.isSimulcastOn() && browser.usesSdpMungingForSimulcast()
|
2462
|
2372
|
&& (!this.options.capScreenshareBitrate
|
2463
|
2373
|
|| (this.options.capScreenshareBitrate && hasCameraTrack(this)))) {
|
2464
|
2374
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -2546,7 +2456,7 @@ TraceablePeerConnection.prototype._createOfferOrAnswer = function(
|
2546
|
2456
|
* @param {TrackSSRCInfo} ssrcObj
|
2547
|
2457
|
* @return {number|null} the primary SSRC or <tt>null</tt>
|
2548
|
2458
|
*/
|
2549
|
|
-function extractPrimarySSRC(ssrcObj) {
|
|
2459
|
+TraceablePeerConnection.prototype._extractPrimarySSRC = function(ssrcObj) {
|
2550
|
2460
|
if (ssrcObj && ssrcObj.groups && ssrcObj.groups.length) {
|
2551
|
2461
|
return ssrcObj.groups[0].ssrcs[0];
|
2552
|
2462
|
} else if (ssrcObj && ssrcObj.ssrcs && ssrcObj.ssrcs.length) {
|
|
@@ -2554,7 +2464,7 @@ function extractPrimarySSRC(ssrcObj) {
|
2554
|
2464
|
}
|
2555
|
2465
|
|
2556
|
2466
|
return null;
|
2557
|
|
-}
|
|
2467
|
+};
|
2558
|
2468
|
|
2559
|
2469
|
/**
|
2560
|
2470
|
* Goes over the SSRC map extracted from the latest local description and tries
|
|
@@ -2576,8 +2486,8 @@ TraceablePeerConnection.prototype._processLocalSSRCsMap = function(ssrcMap) {
|
2576
|
2486
|
return;
|
2577
|
2487
|
}
|
2578
|
2488
|
const oldSSRC = this.localSSRCs.get(track.rtcId);
|
2579
|
|
- const newSSRCNum = extractPrimarySSRC(newSSRC);
|
2580
|
|
- const oldSSRCNum = extractPrimarySSRC(oldSSRC);
|
|
2489
|
+ const newSSRCNum = this._extractPrimarySSRC(newSSRC);
|
|
2490
|
+ const oldSSRCNum = this._extractPrimarySSRC(oldSSRC);
|
2581
|
2491
|
|
2582
|
2492
|
// eslint-disable-next-line no-negated-condition
|
2583
|
2493
|
if (newSSRCNum !== oldSSRCNum) {
|
|
@@ -2672,7 +2582,7 @@ TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function(track) {
|
2672
|
2582
|
ssrcs: [],
|
2673
|
2583
|
groups: []
|
2674
|
2584
|
};
|
2675
|
|
- for (let i = 0; i < SIMULCAST_LAYERS; i++) {
|
|
2585
|
+ for (let i = 0; i < SIM_LAYER_RIDS.length; i++) {
|
2676
|
2586
|
ssrcInfo.ssrcs.push(SDPUtil.generateSsrc());
|
2677
|
2587
|
}
|
2678
|
2588
|
ssrcInfo.groups.push({
|