Procházet zdrojové kódy

fix(TPC): Select 1 as the default scale factor for p2p.

This fixes an issue where a user is not able to unmute their video if the MediaStreamTrack associated with the camera stream returns a null value for the track height.
dev1
Jaya Allamsetty před 3 roky
rodič
revize
a1c966058c
1 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 5
    3
      modules/RTC/TraceablePeerConnection.js

+ 5
- 3
modules/RTC/TraceablePeerConnection.js Zobrazit soubor

@@ -2519,10 +2519,12 @@ TraceablePeerConnection.prototype.setSenderVideoConstraints = function(frameHeig
2519 2519
 
2520 2520
     // For p2p and cases and where simulcast is explicitly disabled.
2521 2521
     } else if (frameHeight > 0) {
2522
+        let scaleFactor = HD_SCALE_FACTOR;
2523
+
2522 2524
         // Do not scale down encodings for desktop tracks for non-simulcast case.
2523
-        const scaleFactor = videoType === VideoType.DESKTOP || localVideoTrack.resolution <= frameHeight
2524
-            ? HD_SCALE_FACTOR
2525
-            : Math.floor(localVideoTrack.resolution / frameHeight);
2525
+        if (videoType === VideoType.CAMERA && localVideoTrack.resolution > frameHeight) {
2526
+            scaleFactor = Math.floor(localVideoTrack.resolution / frameHeight);
2527
+        }
2526 2528
 
2527 2529
         parameters.encodings[0].active = true;
2528 2530
         parameters.encodings[0].scaleResolutionDownBy = scaleFactor;

Načítá se…
Zrušit
Uložit