소스 검색

feat(multi-stream) Enable multi-stream by default (if not disabled explicitly) (#2116)

* feat(multi-stream) Enable multi-stream by default (if not disabled explicitly).
dev1
Jaya Allamsetty 3 년 전
부모
커밋
f49afde547
No account linked to committer's email address
4개의 변경된 파일17개의 추가작업 그리고 18개의 파일을 삭제
  1. 4
    3
      JitsiMeetJS.js
  2. 4
    6
      modules/flags/FeatureFlags.js
  3. 6
    6
      modules/sdp/LocalSdpMunger.spec.js
  4. 3
    3
      types/auto/modules/flags/FeatureFlags.d.ts

+ 4
- 3
JitsiMeetJS.js 파일 보기

146
     init(options = {}) {
146
     init(options = {}) {
147
         Settings.init(options.externalStorage);
147
         Settings.init(options.externalStorage);
148
         Statistics.init(options);
148
         Statistics.init(options);
149
+        const flags = options.flags || {};
149
 
150
 
150
         // Multi-stream is supported only on endpoints running in Unified plan mode and the flag to disable unified
151
         // Multi-stream is supported only on endpoints running in Unified plan mode and the flag to disable unified
151
         // plan also needs to be taken into consideration.
152
         // plan also needs to be taken into consideration.
152
-        if (typeof options.enableUnifiedOnChrome !== 'undefined' && options.flags) {
153
-            options.flags.enableUnifiedOnChrome = options.enableUnifiedOnChrome;
153
+        if (typeof options.enableUnifiedOnChrome !== 'undefined') {
154
+            flags.enableUnifiedOnChrome = options.enableUnifiedOnChrome;
154
         }
155
         }
155
 
156
 
156
         // Configure the feature flags.
157
         // Configure the feature flags.
157
-        FeatureFlags.init(options.flags || { });
158
+        FeatureFlags.init(flags);
158
 
159
 
159
         // Initialize global window.connectionTimes
160
         // Initialize global window.connectionTimes
160
         // FIXME do not use 'window'
161
         // FIXME do not use 'window'

+ 4
- 6
modules/flags/FeatureFlags.js 파일 보기

16
      * @param {boolean} flags.receiveMultipleVideoStreams - Signal support for receiving multiple video streams.
16
      * @param {boolean} flags.receiveMultipleVideoStreams - Signal support for receiving multiple video streams.
17
      */
17
      */
18
     init(flags) {
18
     init(flags) {
19
+        this._receiveMultipleVideoStreams = flags.receiveMultipleVideoStreams ?? true;
19
         this._runInLiteMode = Boolean(flags.runInLiteMode);
20
         this._runInLiteMode = Boolean(flags.runInLiteMode);
20
-
21
-        this._sourceNameSignaling = Boolean(flags.sourceNameSignaling);
22
-        this._receiveMultipleVideoStreams = Boolean(flags.receiveMultipleVideoStreams);
23
-        this._sendMultipleVideoStreams = Boolean(flags.sendMultipleVideoStreams);
24
-        this._ssrcRewriting = Boolean(flags.ssrcRewritingOnBridgeSupported);
21
+        this._sendMultipleVideoStreams = flags.sendMultipleVideoStreams ?? true;
22
+        this._sourceNameSignaling = flags.sourceNameSignaling ?? true;
23
+        this._ssrcRewriting = Boolean(flags.ssrcRewritingEnabled);
25
 
24
 
26
         // For Chromium, check if Unified plan is enabled.
25
         // For Chromium, check if Unified plan is enabled.
27
         this._usesUnifiedPlan = browser.supportsUnifiedPlan()
26
         this._usesUnifiedPlan = browser.supportsUnifiedPlan()
29
 
28
 
30
         logger.info(`Source name signaling: ${this._sourceNameSignaling},`
29
         logger.info(`Source name signaling: ${this._sourceNameSignaling},`
31
             + ` Send multiple video streams: ${this._sendMultipleVideoStreams},`
30
             + ` Send multiple video streams: ${this._sendMultipleVideoStreams},`
32
-            + ` SSRC rewriting supported: ${this._ssrcRewriting},`
33
             + ` uses Unified plan: ${this._usesUnifiedPlan}`);
31
             + ` uses Unified plan: ${this._usesUnifiedPlan}`);
34
     }
32
     }
35
 
33
 

+ 6
- 6
modules/sdp/LocalSdpMunger.spec.js 파일 보기

26
     const localEndpointId = 'sRdpsdg';
26
     const localEndpointId = 'sRdpsdg';
27
 
27
 
28
     beforeEach(() => {
28
     beforeEach(() => {
29
-        FeatureFlags.init({ });
29
+        FeatureFlags.init({ sourceNameSignaling: false });
30
         localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
30
         localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
31
     });
31
     });
32
     describe('dontStripSsrcs', () => {
32
     describe('dontStripSsrcs', () => {
70
                 expect(videoSsrcs.length).toEqual(6);
70
                 expect(videoSsrcs.length).toEqual(6);
71
             });
71
             });
72
             it('with source name signaling enabled (injected source name)', () => {
72
             it('with source name signaling enabled (injected source name)', () => {
73
-                FeatureFlags.init({ sourceNameSignaling: true });
73
+                FeatureFlags.init({ });
74
                 transformStreamIdentifiers();
74
                 transformStreamIdentifiers();
75
 
75
 
76
                 expect(audioSsrcs.length).toEqual(4 + 1 /* injected source name */);
76
                 expect(audioSsrcs.length).toEqual(4 + 1 /* injected source name */);
125
     const localEndpointId = 'sRdpsdg';
125
     const localEndpointId = 'sRdpsdg';
126
 
126
 
127
     beforeEach(() => {
127
     beforeEach(() => {
128
-        FeatureFlags.init({ });
128
+        FeatureFlags.init({ sourceNameSignaling: false });
129
         localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
129
         localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
130
     });
130
     });
131
     describe('stripSsrcs', () => {
131
     describe('stripSsrcs', () => {
154
                 expect(videoSsrcs.length).toEqual(1);
154
                 expect(videoSsrcs.length).toEqual(1);
155
             });
155
             });
156
             it('with source name signaling', () => {
156
             it('with source name signaling', () => {
157
-                FeatureFlags.init({ sourceNameSignaling: true });
157
+                FeatureFlags.init({ });
158
                 transformStreamIdentifiers();
158
                 transformStreamIdentifiers();
159
 
159
 
160
                 expect(audioSsrcs.length).toEqual(1 + 1 /* injected source name */);
160
                 expect(audioSsrcs.length).toEqual(1 + 1 /* injected source name */);
194
     });
194
     });
195
 
195
 
196
     it('should transform', () => {
196
     it('should transform', () => {
197
-        FeatureFlags.init({ sourceNameSignaling: true });
197
+        FeatureFlags.init({ });
198
         transformStreamIdentifiers();
198
         transformStreamIdentifiers();
199
 
199
 
200
         expect(audioMsid).toBe('sRdpsdg-audio-0-1');
200
         expect(audioMsid).toBe('sRdpsdg-audio-0-1');
209
     const localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
209
     const localSdpMunger = new LocalSdpMunger(tpc, localEndpointId);
210
 
210
 
211
     it('should not increment track index for new tracks', () => {
211
     it('should not increment track index for new tracks', () => {
212
-        FeatureFlags.init({ sourceNameSignaling: true });
212
+        FeatureFlags.init({ });
213
 
213
 
214
         sdpStr = transform.write(SampleSdpStrings.simulcastRtxSdp);
214
         sdpStr = transform.write(SampleSdpStrings.simulcastRtxSdp);
215
         desc = new RTCSessionDescription({
215
         desc = new RTCSessionDescription({

+ 3
- 3
types/auto/modules/flags/FeatureFlags.d.ts 파일 보기

12
      * @param {boolean} flags.receiveMultipleVideoStreams - Signal support for receiving multiple video streams.
12
      * @param {boolean} flags.receiveMultipleVideoStreams - Signal support for receiving multiple video streams.
13
      */
13
      */
14
     init(flags: any): void;
14
     init(flags: any): void;
15
+    _receiveMultipleVideoStreams: any;
15
     _runInLiteMode: boolean;
16
     _runInLiteMode: boolean;
16
-    _sourceNameSignaling: boolean;
17
-    _receiveMultipleVideoStreams: boolean;
18
-    _sendMultipleVideoStreams: boolean;
17
+    _sendMultipleVideoStreams: any;
18
+    _sourceNameSignaling: any;
19
     _ssrcRewriting: boolean;
19
     _ssrcRewriting: boolean;
20
     _usesUnifiedPlan: any;
20
     _usesUnifiedPlan: any;
21
     /**
21
     /**

Loading…
취소
저장