瀏覽代碼

strip all rtx if we're using unified plan (since sdp-interop doesn't

necessarily handle the translation of groups correctly)
dev1
brian baldino 8 年之前
父節點
當前提交
c1b1a69c86
共有 3 個檔案被更改,包括 14 行新增8 行删除
  1. 4
    0
      modules/xmpp/RtxModifier.js
  2. 8
    5
      modules/xmpp/RtxModifier.spec.js
  3. 2
    3
      modules/xmpp/TraceablePeerConnection.js

+ 4
- 0
modules/xmpp/RtxModifier.js 查看文件

@@ -240,6 +240,10 @@ export default class RtxModifier {
240 240
           logger.info("RtxModifier doing nothing, no video ssrcs present");
241 241
           return sdpStr;
242 242
         }
243
+        if (!videoMLine.ssrcGroups) {
244
+          logger.info("RtxModifier doing nothing, no video ssrcGroups present");
245
+          return sdpStr;
246
+        }
243 247
         const fidGroups = videoMLine.ssrcGroups
244 248
             .filter(group => group.semantics === "FID");
245 249
         // Remove the fid groups from the mline

+ 8
- 5
modules/xmpp/RtxModifier.spec.js 查看文件

@@ -290,16 +290,19 @@ describe ("RtxModifier", function() {
290 290
 
291 291
     describe("stripRtx", function() {
292 292
         beforeEach(function() {
293
-            this.sdpStr = transform.write(SampleSdpStrings.rtxVideoSdp);
294 293
         });
295 294
         it ("should strip all rtx streams from an sdp with rtx", function() {
296
-            const newSdpStr = this.rtxModifier.stripRtx(this.sdpStr);
295
+            const sdpStr = transform.write(SampleSdpStrings.rtxVideoSdp);
296
+            const newSdpStr = this.rtxModifier.stripRtx(sdpStr);
297 297
             const newSdp = transform.parse(newSdpStr);
298 298
             const fidGroups = getVideoGroups(newSdp, "FID");
299 299
             expect(fidGroups.length).toEqual(0);
300
-            const videoMLine = SDPUtil.getMedia(newSdp, "video");
301
-            expect(videoMLine.ssrcs.length).toEqual(1);
302
-
300
+            expect(numVideoSsrcs(newSdp)).toEqual(1);
301
+        });
302
+        it ("should do nothing to an sdp with no rtx", function() {
303
+            const sdpStr = transform.write(SampleSdpStrings.plainVideoSdp);
304
+            const newSdpStr = this.rtxModifier.stripRtx(sdpStr);
305
+            expect(newSdpStr).toEqual(sdpStr);
303 306
         });
304 307
     });
305 308
 });

+ 2
- 3
modules/xmpp/TraceablePeerConnection.js 查看文件

@@ -389,11 +389,10 @@ TraceablePeerConnection.prototype.setRemoteDescription
389 389
     description = this.simulcast.mungeRemoteDescription(description);
390 390
     this.trace('setRemoteDescription::postTransform (simulcast)', dumpSDP(description));
391 391
 
392
-    //description.sdp = this.rtxModifier.implodeRemoteRtxSsrcs(description.sdp);
393
-    //this.trace('setRemoteDescription::postTransform (implodeRemoteRtxSsrcs)', dumpSDP(description));
394
-
395 392
     // if we're running on FF, transform to Plan A first.
396 393
     if (RTCBrowserType.usesUnifiedPlan()) {
394
+        description.sdp = this.rtxModifier.stripRtx(description.sdp);
395
+        this.trace('setRemoteDescription::postTransform (stripRtx)', dumpSDP(description));
397 396
         description = this.interop.toUnifiedPlan(description);
398 397
         this.trace('setRemoteDescription::postTransform (Plan A)', dumpSDP(description));
399 398
     }

Loading…
取消
儲存