Explorar el Código

fix(video-quality): Fix p2p desktop share quality.

In p2p mode, 'scaleResolutionDownBy' is used for downscaling a stream when needed, i.e. when the user receives a receive constraint of 360p because the other participant is in tile view. When desktop share is started, the encoding config has to be scaled back up so that the other participant starts receiving HD resolution for the share as desktop shares are autopinned. Therefore, encodings have to enabled/disabled for desktop shares as well. Earlier it was done only for camera tracks.
dev1
Jaya Allamsetty hace 5 años
padre
commit
3ed4e3caee
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 3
    1
      modules/RTC/TPCUtils.js
  2. 1
    1
      modules/RTC/TraceablePeerConnection.js

+ 3
- 1
modules/RTC/TPCUtils.js Ver fichero

@@ -273,7 +273,9 @@ export class TPCUtils {
273 273
         }
274 274
 
275 275
         const localVideoHeightConstraints = [];
276
-        const height = localTrack.getSettings().height;
276
+
277
+        // Firefox doesn't return the height of the desktop track, assume a min. height of 720.
278
+        const { height = 720 } = localTrack.getSettings();
277 279
 
278 280
         for (const encoding of this.localStreamEncodingsConfig) {
279 281
             localVideoHeightConstraints.push(height / encoding.scaleResolutionDownBy);

+ 1
- 1
modules/RTC/TraceablePeerConnection.js Ver fichero

@@ -2289,7 +2289,7 @@ TraceablePeerConnection.prototype.setSenderVideoConstraint = function(frameHeigh
2289 2289
 
2290 2290
     const localVideoTrack = this.getLocalVideoTrack();
2291 2291
 
2292
-    if (!localVideoTrack || localVideoTrack.isMuted() || localVideoTrack.videoType !== VideoType.CAMERA) {
2292
+    if (!localVideoTrack || localVideoTrack.isMuted()) {
2293 2293
         return Promise.resolve();
2294 2294
     }
2295 2295
     const videoSender = this.findSenderByKind(MediaType.VIDEO);

Loading…
Cancelar
Guardar