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

Add basic SRT support

This commit is contained in:
Alexandre Iooss
2020-09-27 11:14:22 +02:00
parent e1d3c4a37f
commit d4aa09c632
5 changed files with 50 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"gitlab.crans.org/nounous/ghostream/auth"
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
"gitlab.crans.org/nounous/ghostream/stream"
"gitlab.crans.org/nounous/ghostream/stream/srt"
"gitlab.crans.org/nounous/ghostream/web"
)
@ -45,6 +46,7 @@ func loadConfiguration() {
viper.SetDefault("Auth.LDAP.URI", "ldap://127.0.0.1:389")
viper.SetDefault("Auth.LDAP.UserDn", "cn=users,dc=example,dc=com")
viper.SetDefault("Monitoring.ListenAddress", ":2112")
viper.SetDefault("Srt.ListenAddress", ":9710")
viper.SetDefault("Web.ListenAddress", "127.0.0.1:8080")
viper.SetDefault("Web.Name", "Ghostream")
viper.SetDefault("Web.Hostname", "localhost")
@ -57,6 +59,7 @@ func main() {
cfg := struct {
Auth auth.Options
Monitoring monitoring.Options
Srt srt.Options
Web web.Options
}{}
if err := viper.Unmarshal(&cfg); err != nil {
@ -75,6 +78,7 @@ func main() {
localSdpChan := make(chan webrtc.SessionDescription)
// Start stream, web and monitoring server
go srt.Serve(&cfg.Srt)
go stream.Serve(remoteSdpChan, localSdpChan)
go web.Serve(remoteSdpChan, localSdpChan, &cfg.Web)
go monitoring.Serve(&cfg.Monitoring)