Move subscribe/unsubscribe queue to participant. (#813)

* Move subscribe/unsubscribe queue to participant.

As subscribe/unsubscribe operation can come from both
local media track or remote media track, participant
needs to have it.

* Remove comment

* Stop reneg timer on close

* address comments
This commit is contained in:
Raja Subramanian
2022-07-06 17:27:32 +05:30
committed by GitHub
parent fbbcbe77df
commit fbb1f9fc80
11 changed files with 600 additions and 194 deletions
+9
View File
@@ -267,6 +267,13 @@ func (t *PCTransport) IsEstablished() bool {
}
func (t *PCTransport) Close() {
t.lock.Lock()
if t.signalStateCheckTimer != nil {
t.signalStateCheckTimer.Stop()
t.signalStateCheckTimer = nil
}
t.lock.Unlock()
if t.streamAllocator != nil {
t.streamAllocator.Stop()
}
@@ -288,6 +295,7 @@ func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error {
if t.signalStateCheckTimer != nil {
t.signalStateCheckTimer.Stop()
t.signalStateCheckTimer = nil
}
for _, c := range t.pendingCandidates {
@@ -434,6 +442,7 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
negotiateVersion := t.negotiateCounter.Inc()
if t.signalStateCheckTimer != nil {
t.signalStateCheckTimer.Stop()
t.signalStateCheckTimer = nil
}
t.signalStateCheckTimer = time.AfterFunc(negotiationFailedTimout, func() {
t.lock.RLock()