Pārlūkot izejas kodu

fix(qualitycontrol) Throw errors if sourceName is missing in constraints when multi-stream-support is enabled.

Also, configure all the video tracks when the user changes the quality settings from UI.
dev1
Jaya Allamsetty 3 gadus atpakaļ
vecāks
revīzija
aa1e30e7c2
1 mainītis faili ar 21 papildinājumiem un 0 dzēšanām
  1. 21
    0
      modules/qualitycontrol/SendVideoController.js

+ 21
- 0
modules/qualitycontrol/SendVideoController.js Parādīt failu

@@ -1,8 +1,12 @@
1
+import { getLogger } from '@jitsi/logger';
2
+
1 3
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
2 4
 import RTCEvents from '../../service/RTC/RTCEvents';
3 5
 import FeatureFlags from '../flags/FeatureFlags';
4 6
 import MediaSessionEvents from '../xmpp/MediaSessionEvents';
5 7
 
8
+const logger = getLogger(__filename);
9
+
6 10
 /**
7 11
  * The class manages send video constraints across media sessions({@link JingleSessionPC}) which belong to
8 12
  * {@link JitsiConference}. It finds the lowest common value, between the local user's send preference and
@@ -73,6 +77,7 @@ export default class SendVideoController {
73 77
                     && (!this._sourceSenderConstraints.has(sourceName)
74 78
                     || this._sourceSenderConstraints.get(sourceName) !== idealHeight)) {
75 79
                     this._sourceSenderConstraints.set(sourceName, idealHeight);
80
+                    logger.debug(`Sender constraints for source:${sourceName} changed to idealHeight:${idealHeight}`);
76 81
                     this._propagateSendMaxFrameHeight(sourceName);
77 82
                 }
78 83
             }
@@ -91,6 +96,9 @@ export default class SendVideoController {
91 96
      * @private
92 97
      */
93 98
     _propagateSendMaxFrameHeight(sourceName = null) {
99
+        if (FeatureFlags.isSourceNameSignalingEnabled() && !sourceName) {
100
+            throw new Error('sourceName missing for calculating the sendMaxHeight for video tracks');
101
+        }
94 102
         const sendMaxFrameHeight = this.selectSendMaxFrameHeight(sourceName);
95 103
         const promises = [];
96 104
 
@@ -111,6 +119,9 @@ export default class SendVideoController {
111 119
      * @returns {number|undefined}
112 120
      */
113 121
     selectSendMaxFrameHeight(sourceName = null) {
122
+        if (FeatureFlags.isSourceNameSignalingEnabled() && !sourceName) {
123
+            throw new Error('sourceName missing for calculating the sendMaxHeight for video tracks');
124
+        }
114 125
         const activeMediaSession = this._conference.getActiveMediaSession();
115 126
         const remoteRecvMaxFrameHeight = activeMediaSession
116 127
             ? activeMediaSession.isP2P
@@ -136,6 +147,16 @@ export default class SendVideoController {
136 147
     setPreferredSendMaxFrameHeight(maxFrameHeight) {
137 148
         this._preferredSendMaxFrameHeight = maxFrameHeight;
138 149
 
150
+        if (FeatureFlags.isSourceNameSignalingEnabled()) {
151
+            const promises = [];
152
+
153
+            for (const sourceName of this._sourceSenderConstraints.keys()) {
154
+                promises.push(this._propagateSendMaxFrameHeight(sourceName));
155
+            }
156
+
157
+            return Promise.allSettled(promises);
158
+        }
159
+
139 160
         return this._propagateSendMaxFrameHeight();
140 161
     }
141 162
 }

Notiek ielāde…
Atcelt
Saglabāt