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

Make webrtc and forwarding work with new messaging

This commit is contained in:
Alexandre Iooss
2020-10-18 16:05:28 +02:00
parent 37d944621b
commit b9da2ab3a7
6 changed files with 144 additions and 120 deletions

View File

@ -6,6 +6,7 @@ import (
"testing"
"time"
"gitlab.crans.org/nounous/ghostream/stream"
"gitlab.crans.org/nounous/ghostream/stream/srt"
)
@ -30,16 +31,15 @@ func TestForwardStream(t *testing.T) {
}
}()
forwardingList := make(map[string][]string)
forwardingList["demo"] = []string{"rtmp://127.0.0.1:1936/live/app"}
forwardingChannel := make(chan srt.Packet)
cfg := make(map[string][]string)
cfg["demo"] = []string{"rtmp://127.0.0.1:1936/live/app"}
// Register forwarding stream list
go Serve(forwardingChannel, forwardingList)
streams := make(map[string]*stream.Stream)
go Serve(streams, cfg)
// Serve SRT Server without authentification backend
go srt.Serve(&srt.Options{Enabled: true, ListenAddress: ":9712", MaxClients: 2}, nil, forwardingChannel, nil)
go srt.Serve(streams, nil, &srt.Options{Enabled: true, ListenAddress: ":9712", MaxClients: 2})
ffmpeg := exec.Command("ffmpeg", "-hide_banner", "-loglevel", "error",
"-re", "-f", "lavfi", "-i", "testsrc=size=640x480:rate=10",