Переглянути джерело

fix(SendVideoController): Apply the sender constraint only when it changes.

There were cases where the bridge was sending the same constraint multiple times causing redundant calls to getParameters/setParameters on the RTCRtpSender.
dev1
Jaya Allamsetty 4 роки тому
джерело
коміт
7f919faacc
1 змінених файлів з 5 додано та 2 видалено
  1. 5
    2
      modules/qualitycontrol/SendVideoController.js

+ 5
- 2
modules/qualitycontrol/SendVideoController.js Переглянути файл

@@ -30,8 +30,11 @@ export class SendVideoController {
30 30
         this.rtc.on(
31 31
             RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED,
32 32
             videoConstraints => {
33
-                this._senderVideoConstraints = videoConstraints;
34
-                this._propagateSendMaxFrameHeight(videoConstraints);
33
+                // Propagate the sender constraint only if it has changed.
34
+                if (this._senderVideoConstraints?.idealHeight !== videoConstraints.idealHeight) {
35
+                    this._senderVideoConstraints = videoConstraints;
36
+                    this._propagateSendMaxFrameHeight();
37
+                }
35 38
             });
36 39
     }
37 40
 

Завантаження…
Відмінити
Зберегти