Skip to content

Commit

Permalink
Add more cases when to stop remote publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Nov 11, 2024
1 parent 59895bb commit b6fc9f5
Show file tree
Hide file tree
Showing 3 changed files with 578 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proxy/proxy_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ func (s *ProxyServer) processCommand(ctx context.Context, client *ProxyClient, s
}
}

session.AddRemotePublisher(publisher, cmd.Hostname, cmd.Port, cmd.RtcpPort)
response := &signaling.ProxyServerMessage{
Id: message.Id,
Type: "command",
Expand Down Expand Up @@ -1193,6 +1194,8 @@ func (s *ProxyServer) processCommand(ctx context.Context, client *ProxyClient, s
return
}

session.RemoveRemotePublisher(publisher, cmd.Hostname, cmd.Port, cmd.RtcpPort)

response := &signaling.ProxyServerMessage{
Id: message.Id,
Type: "command",
Expand Down Expand Up @@ -1599,3 +1602,12 @@ func (s *ProxyServer) getRemoteConnection(url string) (*RemoteConnection, error)
s.remoteConnections[url] = conn
return conn, nil
}

func (s *ProxyServer) PublisherDeleted(publisher signaling.McuPublisher) {
s.sessionsLock.RLock()
defer s.sessionsLock.RUnlock()

for _, session := range s.sessions {
session.OnPublisherDeleted(publisher)
}
}
Loading

0 comments on commit b6fc9f5

Please sign in to comment.