Przeglądaj źródła

fix(connection-quality): set min percentage when exceeding a bitrate threshold (#708)

* fix(connection-quality): set min percentage when exceeding a bitrate threshold

In some cases a high bitrate does not equate to a high quality
percentage, because the target itself might be quite high, such
as the case for 1080. In those cases, give credit for the bitrate
being high.

* squash: impl 2, use a max bitrate
master
virtuacoplenny 7 lat temu
rodzic
commit
f9644b5c70
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8
    1
      modules/connectivity/ConnectionQuality.js

+ 8
- 1
modules/connectivity/ConnectionQuality.js Wyświetl plik

@@ -57,6 +57,13 @@ const kSimulcastFormats = [
57 57
         min: 30 }
58 58
 ];
59 59
 
60
+/**
61
+ * The maximum bitrate to use as a measurement against the participant's current
62
+ * bitrate. This cap helps in the cases where the participant's bitrate is high
63
+ * but not enough to fulfill high targets, such as with 1080p.
64
+ */
65
+const MAX_TARGET_BITRATE = 2500;
66
+
60 67
 /**
61 68
  * The initial bitrate for video in kbps.
62 69
  */
@@ -353,7 +360,7 @@ export default class ConnectionQuality {
353 360
             target
354 361
                 = getTarget(isSimulcastOn, resolution, millisSinceStart);
355 362
 
356
-            target = 0.9 * target;
363
+            target = Math.min(0.9 * target, MAX_TARGET_BITRATE);
357 364
 
358 365
             quality = 100 * this._localStats.bitrate.upload / target;
359 366
 

Ładowanie…
Anuluj
Zapisz