Single peer connection mode (#3873)

* WIP

* check using protocol version

* revert

* clean up

* sdp cid argument

* WIP

* WIP

* test

* clean up

* clean up

* fixes

* clean up

* clean up

* clean up

* conditional checks

* tests for both dual and single peer connection

* test

* test

* test

* type check

* test

* todo

* munges

* combined config

* populate mid

* limit to receive only

* clean up

* clean up

* clean up

* older test

* clean up

* alternative audio codec

* dtx

* don't need to copy

* Anunay feedback

* use the available peer connection

* publisher check

* WIP

* WIP

* WIP

* no mid

* media sections requirement

* mage generate

* WIP

* WIP

* set data channel receive size for test

* handle early media better

* WIP

* do not do ICERestart if no subscriber

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* start up subscriber RTCP worker

* WIP

* WIP

* clean up

* clean up

* flag to indicate use of single peer connection

* remove unused interface method

* clean up

* clean up

* Jie feedback #1

* deps

* do not access subscriber in one shot mode

* more places for one shot mode

* more one shot fixes

* deps

* deps

* test
This commit is contained in:
Raja Subramanian
2025-08-28 12:16:18 +05:30
committed by GitHub
parent bfe98eaa09
commit 890fd94249
33 changed files with 2768 additions and 1792 deletions
+8 -5
View File
@@ -610,6 +610,10 @@ func (r *Room) Join(
} else {
participant.Negotiate(true)
}
} else {
if participant.IsUsingSinglePeerConnection() {
go r.subscribeToExistingTracks(participant, false)
}
}
prometheus.ServiceOperationCounter.WithLabelValues("participant_join", "success", "").Add(1)
@@ -1114,13 +1118,12 @@ func (r *Room) onTrackPublished(participant types.LocalParticipant, track types.
continue
}
r.logger.Debugw(
existingParticipant.GetLogger().Debugw(
"subscribing to new track",
"participant", existingParticipant.Identity(),
"pID", existingParticipant.ID(),
"publisher", participant.Identity(),
"publisherID", participant.ID(),
"trackID", track.ID())
"trackID", track.ID(),
)
existingParticipant.SubscribeToTrack(track.ID(), false)
}
onParticipantChanged := r.onParticipantChanged
@@ -1393,7 +1396,7 @@ func (r *Room) subscribeToExistingTracks(p types.LocalParticipant, isSync bool)
}
}
if len(trackIDs) > 0 {
r.logger.Debugw("subscribed participant to existing tracks", "trackID", trackIDs)
p.GetLogger().Debugw("subscribed participant to existing tracks", "trackID", trackIDs)
}
}