Browse Source

fix(TPC): Implode the simulcast group only after toUnifiedPlan conversion.

This fixes a regression introduced by the previous commit.
dev1
Jaya Allamsetty 3 years ago
parent
commit
adf2f15d00
1 changed files with 12 additions and 9 deletions
  1. 12
    9
      modules/RTC/TraceablePeerConnection.js

+ 12
- 9
modules/RTC/TraceablePeerConnection.js View File

2374
     // Munge stereo flag and opusMaxAverageBitrate based on config.js
2374
     // Munge stereo flag and opusMaxAverageBitrate based on config.js
2375
     remoteDescription = this._mungeOpus(remoteDescription);
2375
     remoteDescription = this._mungeOpus(remoteDescription);
2376
 
2376
 
2377
-    if (this.isSimulcastOn()) {
2378
-        // Add x-google-conference flag for plan-b mode.
2379
-        const addGoogConfFlag = (browser.isChromiumBased() || browser.isReactNative()) && !this._usesUnifiedPlan;
2380
-
2381
-        // Implode the simulcast ssrcs so that the remote sdp has only the first ssrc in the SIM group.
2382
-        remoteDescription = this.simulcast.mungeRemoteDescription(remoteDescription, addGoogConfFlag);
2383
-        this.trace('setRemoteDescription::postTransform (simulcast)', dumpSDP(remoteDescription));
2384
-    }
2385
-
2386
     if (this._usesUnifiedPlan) {
2377
     if (this._usesUnifiedPlan) {
2387
         // Translate the SDP to Unified plan format first for the jvb case, p2p case will only have 2 m-lines.
2378
         // Translate the SDP to Unified plan format first for the jvb case, p2p case will only have 2 m-lines.
2388
         if (!this.isP2P) {
2379
         if (!this.isP2P) {
2392
             this.trace('setRemoteDescription::postTransform (Unified)', dumpSDP(remoteDescription));
2383
             this.trace('setRemoteDescription::postTransform (Unified)', dumpSDP(remoteDescription));
2393
         }
2384
         }
2394
         if (this.isSimulcastOn()) {
2385
         if (this.isSimulcastOn()) {
2386
+            // Implode the simulcast ssrcs so that the remote sdp has only the first ssrc in the SIM group.
2387
+            remoteDescription = this.simulcast.mungeRemoteDescription(remoteDescription);
2388
+            this.trace('setRemoteDescription::postTransform (simulcast)', dumpSDP(remoteDescription));
2389
+
2395
             remoteDescription = this.tpcUtils.insertUnifiedPlanSimulcastReceive(remoteDescription);
2390
             remoteDescription = this.tpcUtils.insertUnifiedPlanSimulcastReceive(remoteDescription);
2396
             this.trace('setRemoteDescription::postTransform (sim receive)', dumpSDP(remoteDescription));
2391
             this.trace('setRemoteDescription::postTransform (sim receive)', dumpSDP(remoteDescription));
2397
         }
2392
         }
2398
         remoteDescription = this.tpcUtils.ensureCorrectOrderOfSsrcs(remoteDescription);
2393
         remoteDescription = this.tpcUtils.ensureCorrectOrderOfSsrcs(remoteDescription);
2399
         this.trace('setRemoteDescription::postTransform (correct ssrc order)', dumpSDP(remoteDescription));
2394
         this.trace('setRemoteDescription::postTransform (correct ssrc order)', dumpSDP(remoteDescription));
2400
     } else {
2395
     } else {
2396
+        if (this.isSimulcastOn()) {
2397
+            // Implode the simulcast ssrcs so that the remote sdp has only the first ssrc in the SIM group.
2398
+            remoteDescription = this.simulcast.mungeRemoteDescription(
2399
+                remoteDescription,
2400
+                true /* add x-google-conference flag */);
2401
+            this.trace('setRemoteDescription::postTransform (simulcast)', dumpSDP(remoteDescription));
2402
+        }
2401
         remoteDescription = normalizePlanB(remoteDescription);
2403
         remoteDescription = normalizePlanB(remoteDescription);
2402
     }
2404
     }
2403
 
2405
 
2404
     // Munge the order of the codecs based on the preferences set through config.js.
2406
     // Munge the order of the codecs based on the preferences set through config.js.
2405
     remoteDescription = this._mungeCodecOrder(remoteDescription);
2407
     remoteDescription = this._mungeCodecOrder(remoteDescription);
2408
+    this.trace('setRemoteDescription::postTransform (munge codec order)', dumpSDP(remoteDescription));
2406
 
2409
 
2407
     return new Promise((resolve, reject) => {
2410
     return new Promise((resolve, reject) => {
2408
         this.peerconnection.setRemoteDescription(remoteDescription)
2411
         this.peerconnection.setRemoteDescription(remoteDescription)

Loading…
Cancel
Save