Przeglądaj źródła

fix(SDP<->Jingle): Reject m-line with port 0 only when a=bundle-only is not present

Use unique session id per TPC.
Translate a=rid to Jingle only when simulcast through RIDs, i.e., ssrc-less simulcast is supported
dev1
Jaya Allamsetty 5 lat temu
rodzic
commit
26f5e88813
2 zmienionych plików z 27 dodań i 4 usunięć
  1. 18
    1
      modules/browser/BrowserCapabilities.js
  2. 9
    3
      modules/xmpp/SDP.js

+ 18
- 1
modules/browser/BrowserCapabilities.js Wyświetl plik

@@ -216,6 +216,15 @@ export default class BrowserCapabilities extends BrowserDetection {
216 216
         return !this.usesUnifiedPlan();
217 217
     }
218 218
 
219
+    /**
220
+     * Checks if the browser uses SDP munging for turning on simulcast.
221
+     *
222
+     * @returns {boolean}
223
+     */
224
+    usesSdpMungingForSimulcast() {
225
+        return this.isChromiumBased() || this.isSafariWithVP8();
226
+    }
227
+
219 228
     /**
220 229
      * Checks if the browser uses unified plan.
221 230
      *
@@ -270,7 +279,15 @@ export default class BrowserCapabilities extends BrowserDetection {
270 279
      * @returns {boolean}
271 280
      */
272 281
     usesAdapter() {
273
-        return this.usesNewGumFlow();
282
+        return !this.isFirefox() && !this.isReactNative();
283
+    }
284
+
285
+    /**
286
+     * Checks if the browser uses RIDs/MIDs for siganling the simulcast streams
287
+     * to the bridge instead of the ssrcs.
288
+     */
289
+    usesRidsForSimulcast() {
290
+        return false;
274 291
     }
275 292
 
276 293
     /**

+ 9
- 3
modules/xmpp/SDP.js Wyświetl plik

@@ -1,5 +1,6 @@
1 1
 /* global $ */
2 2
 
3
+import browser from '../browser';
3 4
 import SDPUtil from './SDPUtil';
4 5
 
5 6
 /**
@@ -318,7 +319,7 @@ SDP.prototype.toJingle = function(elem, thecreator) {
318 319
 
319 320
             const ridLines = SDPUtil.findLines(this.media[i], 'a=rid');
320 321
 
321
-            if (ridLines.length) {
322
+            if (ridLines.length && browser.usesRidsForSimulcast()) {
322 323
                 // Map a line which looks like "a=rid:2 send" to just
323 324
                 // the rid ("2")
324 325
                 const rids = ridLines
@@ -406,7 +407,10 @@ SDP.prototype.toJingle = function(elem, thecreator) {
406 407
         } else if (SDPUtil.findLine(m, 'a=inactive', this.session)) {
407 408
             elem.attrs({ senders: 'none' });
408 409
         }
409
-        if (mline.port === '0') {
410
+
411
+        // Reject an m-line only when port is 0 and a=bundle-only is not present in the section.
412
+        // The port is automatically set to 0 when bundle-only is used.
413
+        if (mline.port === '0' && !SDPUtil.findLine(m, 'a=bundle-only', this.session)) {
410 414
             // estos hack to reject an m-line
411 415
             elem.attrs({ senders: 'rejected' });
412 416
         }
@@ -566,9 +570,11 @@ SDP.prototype.rtcpFbFromJingle = function(elem, payloadtype) { // XEP-0293
566 570
 // construct an SDP from a jingle stanza
567 571
 SDP.prototype.fromJingle = function(jingle) {
568 572
     const self = this;
573
+    const sessionId = (new Date()).getTime();
569 574
 
575
+    // Use a unique session id for every TPC.
570 576
     this.raw = 'v=0\r\n'
571
-        + 'o=- 1923518516 2 IN IP4 0.0.0.0\r\n'// FIXME
577
+        + `o=- ${sessionId} 2 IN IP4 0.0.0.0\r\n`
572 578
         + 's=-\r\n'
573 579
         + 't=0 0\r\n';
574 580
 

Ładowanie…
Anuluj
Zapisz