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

Use messaging system in SRT package

This commit is contained in:
Alexandre Iooss
2020-10-17 12:26:24 +02:00
parent e0911ab050
commit 68d4ad8aee
4 changed files with 64 additions and 68 deletions

View File

@ -5,6 +5,8 @@ import (
"os/exec"
"testing"
"time"
"gitlab.crans.org/nounous/ghostream/stream"
)
// TestSplitHostPort Try to split a host like 127.0.0.1:1234 in host, port (127.0.0.1, 1234à
@ -55,7 +57,9 @@ func TestServeSRT(t *testing.T) {
t.Skip("WARNING: FFMPEG is not installed. Skipping stream test")
}
go Serve(&Options{Enabled: true, ListenAddress: ":9711", MaxClients: 2}, nil, nil, nil)
// Init streams messaging and SRT server
streams := make(map[string]stream.Stream)
go Serve(streams, nil, &Options{Enabled: true, ListenAddress: ":9711", MaxClients: 2})
ffmpeg := exec.Command("ffmpeg", "-hide_banner", "-loglevel", "error",
"-f", "lavfi", "-i", "testsrc=size=640x480:rate=10",
@ -78,6 +82,4 @@ func TestServeSRT(t *testing.T) {
}()
time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s
// TODO Kill SRT server
}