1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-29 11:00:55 +02:00

Use channels to send SRT packets to forwarded streams

This commit is contained in:
Yohann D'ANELLO
2020-10-01 12:00:59 +02:00
parent dc7a3fef9f
commit efa44488c0
5 changed files with 54 additions and 21 deletions

View File

@ -90,14 +90,17 @@ func main() {
remoteSdpChan := make(chan webrtc.SessionDescription)
localSdpChan := make(chan webrtc.SessionDescription)
// SRT channel, to propagate forwarding
forwardingChannel := make(chan srt.Packet)
// Start stream, web and monitoring server
go monitoring.Serve(&cfg.Monitoring)
go srt.Serve(&cfg.Srt)
go srt.Serve(&cfg.Srt, forwardingChannel)
go web.Serve(remoteSdpChan, localSdpChan, &cfg.Web)
go webrtc.Serve(remoteSdpChan, localSdpChan, &cfg.WebRTC)
// Configure stream forwarding
forwarding.New(cfg.Forwarding)
forwarding.New(cfg.Forwarding, forwardingChannel)
// Wait for routines
select {}