Browse Source

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 years ago
parent
commit
aa1e30e7c2
1 changed files with 21 additions and 0 deletions
  1. 21
    0
      modules/qualitycontrol/SendVideoController.js

+ 21
- 0
modules/qualitycontrol/SendVideoController.js View File

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

Loading…
Cancel
Save