소스 검색

fix(ssrc-rewriting) Set track owners to null when remote participant leaves.

master
Jaya Allamsetty 2 년 전
부모
커밋
a8ef8bef02
2개의 변경된 파일21개의 추가작업 그리고 14개의 파일을 삭제
  1. 17
    13
      JitsiConference.js
  2. 4
    1
      modules/statistics/RTPStatsCollector.js

+ 17
- 13
JitsiConference.js 파일 보기

1909
         return;
1909
         return;
1910
     }
1910
     }
1911
 
1911
 
1912
-    if (!FeatureFlags.isSsrcRewritingSupported()) {
1913
-        const mediaSessions = this.getMediaSessions();
1914
-        let tracksToBeRemoved = [];
1912
+    const mediaSessions = this.getMediaSessions();
1913
+    let tracksToBeRemoved = [];
1915
 
1914
 
1916
-        for (const session of mediaSessions) {
1917
-            const remoteTracks = session.peerconnection.getRemoteTracks(id);
1915
+    for (const session of mediaSessions) {
1916
+        const remoteTracks = session.peerconnection.getRemoteTracks(id);
1918
 
1917
 
1919
-            remoteTracks && (tracksToBeRemoved = [ ...tracksToBeRemoved, ...remoteTracks ]);
1920
-
1921
-            // Update the SSRC owners list.
1922
-            session._signalingLayer.updateSsrcOwnersOnLeave(id);
1918
+        remoteTracks && (tracksToBeRemoved = [ ...tracksToBeRemoved, ...remoteTracks ]);
1923
 
1919
 
1920
+        // Update the SSRC owners list.
1921
+        session._signalingLayer.updateSsrcOwnersOnLeave(id);
1922
+        if (!FeatureFlags.isSsrcRewritingSupported()) {
1924
             // Remove the ssrcs from the remote description and renegotiate.
1923
             // Remove the ssrcs from the remote description and renegotiate.
1925
             session.removeRemoteStreamsOnLeave(id);
1924
             session.removeRemoteStreamsOnLeave(id);
1926
         }
1925
         }
1926
+    }
1927
 
1927
 
1928
-        // Fire the event before renegotiation is done so that the thumbnails can be removed immediately.
1929
-        tracksToBeRemoved.forEach(track => {
1928
+    tracksToBeRemoved.forEach(track => {
1929
+        if (FeatureFlags.isSsrcRewritingSupported()) {
1930
+            track.setSourceName(null);
1931
+            track.setOwner(null);
1932
+        } else {
1933
+            // Fire the event before renegotiation is done so that the thumbnails can be removed immediately.
1930
             this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
1934
             this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
1931
-        });
1932
-    }
1935
+        }
1936
+    });
1933
 
1937
 
1934
     const participant = this.participants.get(id);
1938
     const participant = this.participants.get(id);
1935
 
1939
 

+ 4
- 1
modules/statistics/RTPStatsCollector.js 파일 보기

3
 import { MediaType } from '../../service/RTC/MediaType';
3
 import { MediaType } from '../../service/RTC/MediaType';
4
 import * as StatisticsEvents from '../../service/statistics/Events';
4
 import * as StatisticsEvents from '../../service/statistics/Events';
5
 import browser from '../browser';
5
 import browser from '../browser';
6
+import FeatureFlags from '../flags/FeatureFlags';
6
 
7
 
7
 const GlobalOnErrorHandler = require('../util/GlobalOnErrorHandler');
8
 const GlobalOnErrorHandler = require('../util/GlobalOnErrorHandler');
8
 
9
 
340
                 };
341
                 };
341
 
342
 
342
                 codecs[participantId] = userCodecs;
343
                 codecs[participantId] = userCodecs;
343
-            } else {
344
+
345
+            // All tracks in ssrc-rewriting mode need not have a participant associated with it.
346
+            } else if (!FeatureFlags.isSsrcRewritingSupported()) {
344
                 logger.error(`No participant ID returned by ${track}`);
347
                 logger.error(`No participant ID returned by ${track}`);
345
             }
348
             }
346
         }
349
         }

Loading…
취소
저장