Quellcode durchsuchen

fix(Jingle) Reverse the order of ssrcs signaled for Firefox.

This fixes an issue where the bridge doesn't forward the HD stream from Firefox to other users in the call. The order of the ssrcs produced by the browser is from Highest resolution to lowest whereas the bridge assumes it to be from lowest to highest as is the case in Chrome and Safari.
tags/v0.0.2
Jaya Allamsetty vor 4 Jahren
Ursprung
Commit
69604b930a
2 geänderte Dateien mit 14 neuen und 3 gelöschten Zeilen
  1. 7
    2
      modules/RTC/TraceablePeerConnection.js
  2. 7
    1
      modules/sdp/SDP.js

+ 7
- 2
modules/RTC/TraceablePeerConnection.js Datei anzeigen

@@ -1460,8 +1460,7 @@ TraceablePeerConnection.prototype._injectSsrcGroupForUnifiedSimulcast
1460 1460
         const sdp = transform.parse(desc.sdp);
1461 1461
         const video = sdp.media.find(mline => mline.type === 'video');
1462 1462
 
1463
-        // Check if the browser supports RTX, add only the primary ssrcs to the
1464
-        // SIM group if that is the case.
1463
+        // Check if the browser supports RTX, add only the primary ssrcs to the SIM group if that is the case.
1465 1464
         video.ssrcGroups = video.ssrcGroups || [];
1466 1465
         const fidGroups = video.ssrcGroups.filter(group => group.semantics === 'FID');
1467 1466
 
@@ -1483,6 +1482,12 @@ TraceablePeerConnection.prototype._injectSsrcGroupForUnifiedSimulcast
1483 1482
                 // Group already exists, no need to do anything
1484 1483
                 return desc;
1485 1484
             }
1485
+
1486
+            // Reverse the order of the SSRCs when signaling them to the bridge. On Firefox, the first SSRC corresponds
1487
+            // to the highest resolution stream whereas the bridge assumes it to be that of the lowest resolution
1488
+            // stream as is the case with the other browsers.
1489
+            browser.isFirefox() && ssrcs.reverse();
1490
+
1486 1491
             video.ssrcGroups.push({
1487 1492
                 semantics: 'SIM',
1488 1493
                 ssrcs: ssrcs.join(' ')

+ 7
- 1
modules/sdp/SDP.js Datei anzeigen

@@ -143,10 +143,16 @@ SDP.prototype.toJingle = function(elem, thecreator) {
143 143
         }
144 144
 
145 145
         let ssrc;
146
+        const simGroup = SDPUtil.findLine(this.media[i], 'a=ssrc-group:SIM');
146 147
         const assrcline = SDPUtil.findLine(this.media[i], 'a=ssrc:');
147 148
 
148 149
         if (assrcline) {
149
-            ssrc = assrcline.substring(7).split(' ')[0]; // take the first
150
+            if (browser.isFirefox() && simGroup) {
151
+                // Use the first ssrc from the SIM group since the order of the SSRCs need to be reversed for Firefox.
152
+                ssrc = simGroup.substring(17).split(' ')[0];
153
+            } else {
154
+                ssrc = assrcline.substring(7).split(' ')[0]; // take the first
155
+            }
150 156
         } else {
151 157
             ssrc = false;
152 158
         }

Laden…
Abbrechen
Speichern