Sfoglia il codice sorgente

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 3 anni fa
parent
commit
a1c966058c
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5
    3
      modules/RTC/TraceablePeerConnection.js

+ 5
- 3
modules/RTC/TraceablePeerConnection.js Vedi File

2519
 
2519
 
2520
     // For p2p and cases and where simulcast is explicitly disabled.
2520
     // For p2p and cases and where simulcast is explicitly disabled.
2521
     } else if (frameHeight > 0) {
2521
     } else if (frameHeight > 0) {
2522
+        let scaleFactor = HD_SCALE_FACTOR;
2523
+
2522
         // Do not scale down encodings for desktop tracks for non-simulcast case.
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
         parameters.encodings[0].active = true;
2529
         parameters.encodings[0].active = true;
2528
         parameters.encodings[0].scaleResolutionDownBy = scaleFactor;
2530
         parameters.encodings[0].scaleResolutionDownBy = scaleFactor;

Loading…
Annulla
Salva