Преглед изворни кода

ref(video-quality): List the conditions when max. bitrates are applied

dev1
Jaya Allamsetty пре 5 година
родитељ
комит
d370247518
1 измењених фајлова са 11 додато и 11 уклоњено
  1. 11
    11
      modules/RTC/TraceablePeerConnection.js

+ 11
- 11
modules/RTC/TraceablePeerConnection.js Прегледај датотеку

@@ -221,10 +221,9 @@ export default function TraceablePeerConnection(
221 221
         high: HD_BITRATE
222 222
     };
223 223
 
224
-    // Check if the max. bitrates for video are specified through config.js
225
-    // videoQuality settings. These bitrates will be applied on all browsers
226
-    // for camera sources in simulcast mode.
227
-    const videoBitrates = this.options.videoQuality
224
+    // Check if the max. bitrates for video are specified through config.js videoQuality settings.
225
+    // These bitrates will be applied on all browsers for camera sources in simulcast mode.
226
+    const videoBitrates = this.options.videoQuality && this.options.videoQuality.maxBitratesVideo
228 227
         ? this.options.videoQuality.maxBitratesVideo
229 228
         : standardVideoBitrates;
230 229
 
@@ -2013,15 +2012,16 @@ TraceablePeerConnection.prototype.setMaxBitRate = function(localTrack = null) {
2013 2012
     const trackId = localTrack.track.id;
2014 2013
     const videoType = localTrack.videoType;
2015 2014
 
2016
-    // No need to set max bitrates on the streams in the following cases.
2017
-    // 1. When a 'camera' track is replaced in plan-b mode, since its a new sender.
2018
-    // 2. When the config.js option for capping the SS bitrate is not enabled.
2019
-    // The above two conditions are ignored When max video bitrates are specified through config.js.
2020
-    if (((browser.usesPlanB() && !this.options.capScreenshareBitrate)
2021
-        || (browser.usesPlanB() && videoType === VideoType.CAMERA))
2022
-        && !(this.options.videoQuality && this.options.videoQuality.maxBitratesVideo)) {
2015
+    // Apply the maxbitrates on the video track when one of the conditions is met.
2016
+    // 1. Max. bitrates for video are specified through videoQuality settings in config.js
2017
+    // 2. Track is a desktop track and bitrate is capped using capScreenshareBitrate option in plan-b mode.
2018
+    // 3. The client is running in Unified plan mode.
2019
+    if (!((this.options.videoQuality && this.options.videoQuality.maxBitratesVideo)
2020
+        || (browser.usesPlanB() && this.options.capScreenshareBitrate && videoType === VideoType.DESKTOP))
2021
+        || browser.usesUnifiedPlan()) {
2023 2022
         return;
2024 2023
     }
2024
+
2025 2025
     if (!this.peerconnection.getSenders) {
2026 2026
         logger.debug('Browser doesn\'t support RTCRtpSender');
2027 2027
 

Loading…
Откажи
Сачувај