瀏覽代碼

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 4 年之前
父節點
當前提交
69604b930a
共有 2 個文件被更改,包括 14 次插入3 次删除
  1. 7
    2
      modules/RTC/TraceablePeerConnection.js
  2. 7
    1
      modules/sdp/SDP.js

+ 7
- 2
modules/RTC/TraceablePeerConnection.js 查看文件

1460
         const sdp = transform.parse(desc.sdp);
1460
         const sdp = transform.parse(desc.sdp);
1461
         const video = sdp.media.find(mline => mline.type === 'video');
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
         video.ssrcGroups = video.ssrcGroups || [];
1464
         video.ssrcGroups = video.ssrcGroups || [];
1466
         const fidGroups = video.ssrcGroups.filter(group => group.semantics === 'FID');
1465
         const fidGroups = video.ssrcGroups.filter(group => group.semantics === 'FID');
1467
 
1466
 
1483
                 // Group already exists, no need to do anything
1482
                 // Group already exists, no need to do anything
1484
                 return desc;
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
             video.ssrcGroups.push({
1491
             video.ssrcGroups.push({
1487
                 semantics: 'SIM',
1492
                 semantics: 'SIM',
1488
                 ssrcs: ssrcs.join(' ')
1493
                 ssrcs: ssrcs.join(' ')

+ 7
- 1
modules/sdp/SDP.js 查看文件

143
         }
143
         }
144
 
144
 
145
         let ssrc;
145
         let ssrc;
146
+        const simGroup = SDPUtil.findLine(this.media[i], 'a=ssrc-group:SIM');
146
         const assrcline = SDPUtil.findLine(this.media[i], 'a=ssrc:');
147
         const assrcline = SDPUtil.findLine(this.media[i], 'a=ssrc:');
147
 
148
 
148
         if (assrcline) {
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
         } else {
156
         } else {
151
             ssrc = false;
157
             ssrc = false;
152
         }
158
         }

Loading…
取消
儲存