2323import org .jitsi .jicofo .auth .*;
2424import org .jitsi .jicofo .bridge .*;
2525import org .jitsi .jicofo .conference .colibri .*;
26- import org .jitsi .jicofo .conference .colibri .v1 .*;
2726import org .jitsi .jicofo .conference .colibri .v2 .*;
2827import org .jitsi .jicofo .conference .source .*;
2928import org .jitsi .jicofo .lipsynchack .*;
@@ -218,8 +217,6 @@ public class JitsiMeetConferenceImpl
218217 */
219218 private boolean videoLimitReached = false ;
220219
221- private final long gid ;
222-
223220 /**
224221 * Requested bridge version from a pin. null if not pinned.
225222 */
@@ -245,7 +242,6 @@ public JitsiMeetConferenceImpl(
245242 ConferenceListener listener ,
246243 @ NotNull JitsiMeetConfig config ,
247244 Level logLevel ,
248- long gid ,
249245 String jvbVersion ,
250246 boolean includeInStatistics )
251247 {
@@ -260,21 +256,12 @@ public JitsiMeetConferenceImpl(
260256 this .includeInStatistics = includeInStatistics ;
261257
262258 this .jicofoServices = Objects .requireNonNull (JicofoServices .jicofoServicesSingleton );
263- this .gid = gid ;
264259 this .jvbVersion = jvbVersion ;
265- if (ColibriConfig .config .getEnableColibri2 ())
266- {
267- colibriSessionManager = new ColibriV2SessionManager (
268- jicofoServices .getXmppServices ().getServiceConnection ().getXmppConnection (),
269- jicofoServices .getBridgeSelector (),
270- this ,
271- logger );
272- }
273- else
274- {
275- colibriSessionManager
276- = new ColibriV1SessionManager (jicofoServices , gid , this , colibriRequestCallback , logger );
277- }
260+ colibriSessionManager = new ColibriV2SessionManager (
261+ jicofoServices .getXmppServices ().getServiceConnection ().getXmppConnection (),
262+ jicofoServices .getBridgeSelector (),
263+ this ,
264+ logger );
278265 colibriSessionManager .addListener (colibriSessionManagerListener );
279266
280267 logger .info ("Created new conference." );
@@ -285,10 +272,9 @@ public JitsiMeetConferenceImpl(
285272 ConferenceListener listener ,
286273 @ NotNull JitsiMeetConfig config ,
287274 Level logLevel ,
288- long gid ,
289275 String jvbVersion )
290276 {
291- this (roomName , listener , config , logLevel , gid , jvbVersion , false );
277+ this (roomName , listener , config , logLevel , jvbVersion , false );
292278 }
293279
294280 /**
@@ -1085,10 +1071,9 @@ public StanzaError onSessionTerminate(@NotNull JingleSession session, JingleIQ i
10851071 */
10861072 private void propagateNewSources (Participant sourceOwner , ConferenceSourceMap sources )
10871073 {
1088- final ConferenceSourceMap finalSources = sources
1089- .copy ()
1090- .strip (ConferenceConfig .config .stripSimulcast (), true )
1091- .unmodifiable ();
1074+ final ConferenceSourceMap finalSources = (ConferenceConfig .config .stripSimulcast ())
1075+ ? sources .copy ().stripSimulcast ().unmodifiable ()
1076+ : sources .copy ().unmodifiable ();
10921077 if (finalSources .isEmpty ())
10931078 {
10941079 logger .debug ("No new sources to propagate." );
@@ -1117,7 +1102,7 @@ public void onTransportInfo(@NotNull JingleSession session, List<ContentPacketEx
11171102 return ;
11181103 }
11191104
1120- colibriSessionManager .updateParticipant (participant , getTransport (contentList ), null , null );
1105+ colibriSessionManager .updateParticipant (participant , getTransport (contentList ), null );
11211106 }
11221107
11231108 /**
@@ -1220,7 +1205,7 @@ public StanzaError onAddSource(@NotNull JingleSession jingleSession, List<Conten
12201205 // Updates source groups on the bridge
12211206 // We may miss the notification, but the state will be synced up
12221207 // after conference has been relocated to the new bridge
1223- colibriSessionManager .addSources (participant , sourcesAccepted );
1208+ colibriSessionManager .updateParticipant (participant , null , participant . getSources () );
12241209
12251210 propagateNewSources (participant , sourcesAccepted );
12261211
@@ -1284,18 +1269,6 @@ private StanzaError onSessionAcceptInternal(
12841269 {
12851270 logger .debug ("Received initial sources from " + participantId + ": " + sourcesAdvertised );
12861271 }
1287- if (sourcesAdvertised .isEmpty () && ConferenceConfig .config .injectSsrcForRecvOnlyEndpoints ()
1288- && !(ColibriConfig .config .getEnableColibri2 ()))
1289- {
1290- // We inject an SSRC in order to ensure that the participant has
1291- // at least one SSRC advertised. Otherwise, non-local bridges in the
1292- // conference will not be aware of the participant.
1293- // This is not necessary (and might trigger unexpected behavior) with colibri2.
1294- long ssrc = RANDOM .nextInt () & 0xffff_ffffL ;
1295- logger .info (participant + " did not advertise any SSRCs. Injecting " + ssrc );
1296- sourcesAdvertised = new EndpointSourceSet (
1297- new Source (ssrc , MediaType .AUDIO , participantId + "-injected0" , null , true ));
1298- }
12991272 ConferenceSourceMap sourcesAccepted ;
13001273 try
13011274 {
@@ -1315,8 +1288,7 @@ private StanzaError onSessionAcceptInternal(
13151288 colibriSessionManager .updateParticipant (
13161289 participant ,
13171290 getTransport (contents ),
1318- sourcesAccepted ,
1319- getRtpDescriptions (contents ));
1291+ sourcesAccepted );
13201292
13211293 // Propagate [participant]'s sources to the other participants.
13221294 propagateNewSources (participant , sourcesAccepted );
@@ -1326,26 +1298,6 @@ private StanzaError onSessionAcceptInternal(
13261298 return null ;
13271299 }
13281300
1329- /**
1330- * Extract a map from content name to the first child of type {@link RtpDescriptionPacketExtension}.
1331- */
1332- private Map <String , RtpDescriptionPacketExtension > getRtpDescriptions (
1333- @ NotNull List <ContentPacketExtension > contents )
1334- {
1335- Map <String , RtpDescriptionPacketExtension > rtpDescriptions = new HashMap <>();
1336- for (ContentPacketExtension content : contents )
1337- {
1338- RtpDescriptionPacketExtension rtpDescription
1339- = content .getFirstChildOfType (RtpDescriptionPacketExtension .class );
1340- if (rtpDescription != null )
1341- {
1342- rtpDescriptions .put (content .getName (), rtpDescription );
1343- }
1344- }
1345-
1346- return rtpDescriptions ;
1347- }
1348-
13491301 /**
13501302 * Find the first {@link IceUdpTransportPacketExtension} in a list of Jingle contents.
13511303 */
@@ -1416,10 +1368,11 @@ private StanzaError removeSources(
14161368 return null ;
14171369 }
14181370
1419- colibriSessionManager .removeSources (
1371+ colibriSessionManager .updateParticipant (
14201372 participant ,
1421- sourcesAcceptedToBeRemoved ,
1422- removeColibriSourcesFromLocalBridge );
1373+ null ,
1374+ participant .getSources (),
1375+ !removeColibriSourcesFromLocalBridge );
14231376
14241377 if (sendSourceRemove )
14251378 {
@@ -1436,10 +1389,9 @@ private StanzaError removeSources(
14361389 */
14371390 private void sendSourceRemove (ConferenceSourceMap sources , Participant except )
14381391 {
1439- final ConferenceSourceMap finalSources = sources
1440- .copy ()
1441- .strip (ConferenceConfig .config .stripSimulcast (), true )
1442- .unmodifiable ();
1392+ final ConferenceSourceMap finalSources = ConferenceConfig .config .stripSimulcast ()
1393+ ? sources .copy ().stripSimulcast ().unmodifiable ()
1394+ : sources .copy ().unmodifiable ();
14431395 if (finalSources .isEmpty ())
14441396 {
14451397 logger .debug ("No sources to remove." );
@@ -1616,8 +1568,6 @@ public OrderedJsonObject getDebugState()
16161568 o .put ("conference_sources" , conferenceSources .toJson ());
16171569 o .put ("audio_limit_reached" , audioLimitReached );
16181570 o .put ("video_limit_reached" , videoLimitReached );
1619- o .put ("gid" , gid );
1620-
16211571
16221572 return o ;
16231573 }
@@ -1704,14 +1654,6 @@ public int getParticipantCount()
17041654 return participants .size ();
17051655 }
17061656
1707- /**
1708- * Conference ID.
1709- */
1710- public long getId ()
1711- {
1712- return gid ;
1713- }
1714-
17151657 /**
17161658 * Get pinned bridge version. Returns null if not pinned.
17171659 */
@@ -2104,9 +2046,9 @@ public void numVideoSendersChanged(int numVideoSenders)
21042046 }
21052047
21062048 /**
2107- * Listener for events from {@link ColibriV1SessionManager }.
2049+ * Listener for events from {@link ColibriSessionManager }.
21082050 */
2109- private class ColibriSessionManagerListener implements ColibriV1SessionManager .Listener
2051+ private class ColibriSessionManagerListener implements ColibriSessionManager .Listener
21102052 {
21112053 @ Override
21122054 public void bridgeCountChanged (int bridgeCount )
0 commit comments