Преглед изворни кода

feat: Add initial-last-n to jingle if config.channelLastN is set. (#2232)

* feat: Add initial-last-n to jingle if config.channelLastN is set.

* Also add initial-last-n to transport-accept.
master
bgrozev пре 2 година
родитељ
комит
e33c58364c
No account linked to committer's email address
2 измењених фајлова са 14 додато и 2 уклоњено
  1. 6
    0
      modules/sdp/SDP.js
  2. 8
    2
      modules/xmpp/JingleSessionPC.js

+ 6
- 0
modules/sdp/SDP.js Прегледај датотеку

@@ -198,6 +198,12 @@ SDP.prototype.toJingle = function(elem, thecreator) {
198 198
             elem.attrs({ name: mid });
199 199
         }
200 200
 
201
+        if (mline.media === 'video' && typeof this.initialLastN === 'number') {
202
+            elem.c('initial-last-n',
203
+                { xmlns: 'jitsi:colibri2',
204
+                    value: this.initialLastN }).up();
205
+        }
206
+
201 207
         if (mline.media === 'audio' || mline.media === 'video') {
202 208
             elem.c('description',
203 209
                 { xmlns: 'urn:xmpp:jingle:apps:rtp:1',

+ 8
- 2
modules/xmpp/JingleSessionPC.js Прегледај датотеку

@@ -1343,8 +1343,11 @@ export default class JingleSessionPC extends JingleSession {
1343 1343
                 this.setOfferAnswerCycle(
1344 1344
                     originalOffer,
1345 1345
                     () => {
1346
-                        const localSDP
1347
-                            = new SDP(this.peerconnection.localDescription.sdp);
1346
+                        const localSDP = new SDP(this.peerconnection.localDescription.sdp);
1347
+
1348
+                        if (typeof this.options.channelLastN === 'number' && this.options.channelLastN >= 0) {
1349
+                            localSDP.initialLastN = this.options.channelLastN;
1350
+                        }
1348 1351
 
1349 1352
                         this.sendTransportAccept(localSDP, success, failure);
1350 1353
 
@@ -1388,6 +1391,9 @@ export default class JingleSessionPC extends JingleSession {
1388 1391
         if (this.failICE) {
1389 1392
             localSDP.failICE = true;
1390 1393
         }
1394
+        if (typeof this.options.channelLastN === 'number' && this.options.channelLastN >= 0) {
1395
+            localSDP.initialLastN = this.options.channelLastN;
1396
+        }
1391 1397
         localSDP.toJingle(
1392 1398
             accept,
1393 1399
             this.initiatorJid === this.localJid ? 'initiator' : 'responder');

Loading…
Откажи
Сачувај