Bläddra i källkod

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

dev1
Jaya Allamsetty 5 år sedan
förälder
incheckning
d370247518
1 ändrade filer med 11 tillägg och 11 borttagningar
  1. 11
    11
      modules/RTC/TraceablePeerConnection.js

+ 11
- 11
modules/RTC/TraceablePeerConnection.js Visa fil

221
         high: HD_BITRATE
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
         ? this.options.videoQuality.maxBitratesVideo
227
         ? this.options.videoQuality.maxBitratesVideo
229
         : standardVideoBitrates;
228
         : standardVideoBitrates;
230
 
229
 
2013
     const trackId = localTrack.track.id;
2012
     const trackId = localTrack.track.id;
2014
     const videoType = localTrack.videoType;
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
         return;
2022
         return;
2024
     }
2023
     }
2024
+
2025
     if (!this.peerconnection.getSenders) {
2025
     if (!this.peerconnection.getSenders) {
2026
         logger.debug('Browser doesn\'t support RTCRtpSender');
2026
         logger.debug('Browser doesn\'t support RTCRtpSender');
2027
 
2027
 

Laddar…
Avbryt
Spara