mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-29 11:00:55 +02:00
Define streams in main.go
This commit is contained in:
16
main.go
16
main.go
@ -10,6 +10,7 @@ import (
|
||||
"gitlab.crans.org/nounous/ghostream/auth"
|
||||
"gitlab.crans.org/nounous/ghostream/internal/config"
|
||||
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
|
||||
"gitlab.crans.org/nounous/ghostream/stream"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/forwarding"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/srt"
|
||||
"gitlab.crans.org/nounous/ghostream/stream/telnet"
|
||||
@ -43,17 +44,16 @@ func main() {
|
||||
})
|
||||
localSdpChan := make(chan webrtc.SessionDescription)
|
||||
|
||||
// SRT channel for forwarding and webrtc
|
||||
forwardingChannel := make(chan srt.Packet, 64)
|
||||
webrtcChannel := make(chan srt.Packet, 64)
|
||||
// Init streams messaging
|
||||
streams := make(map[string]*stream.Stream)
|
||||
|
||||
// Start routines
|
||||
go forwarding.Serve(forwardingChannel, cfg.Forwarding)
|
||||
go forwarding.Serve(streams, cfg.Forwarding)
|
||||
go monitoring.Serve(&cfg.Monitoring)
|
||||
go srt.Serve(&cfg.Srt, authBackend, forwardingChannel, webrtcChannel)
|
||||
go telnet.Serve(&cfg.Telnet)
|
||||
go web.Serve(remoteSdpChan, localSdpChan, &cfg.Web)
|
||||
go webrtc.Serve(remoteSdpChan, localSdpChan, webrtcChannel, &cfg.WebRTC)
|
||||
go srt.Serve(streams, authBackend, &cfg.Srt)
|
||||
go telnet.Serve(streams, &cfg.Telnet)
|
||||
go web.Serve(streams, remoteSdpChan, localSdpChan, &cfg.Web)
|
||||
go webrtc.Serve(streams, remoteSdpChan, localSdpChan, &cfg.WebRTC)
|
||||
|
||||
// Wait for routines
|
||||
select {}
|
||||
|
Reference in New Issue
Block a user