1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-29 21:31: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

@ -5,24 +5,24 @@ import (
"testing"
"github.com/pion/webrtc/v3"
"gitlab.crans.org/nounous/ghostream/stream/srt"
"gitlab.crans.org/nounous/ghostream/stream"
)
func TestServe(t *testing.T) {
// Serve WebRTC server
// Init streams messaging and WebRTC server
streams := make(map[string]*stream.Stream)
remoteSdpChan := make(chan struct {
StreamID string
RemoteDescription webrtc.SessionDescription
})
localSdpChan := make(chan webrtc.SessionDescription)
webrtcChannel := make(chan srt.Packet, 64)
cfg := Options{
Enabled: true,
MinPortUDP: 10000,
MaxPortUDP: 10005,
STUNServers: []string{"stun:stun.l.google.com:19302"},
}
go Serve(remoteSdpChan, localSdpChan, webrtcChannel, &cfg)
go Serve(streams, remoteSdpChan, localSdpChan, &cfg)
// New client connection
mediaEngine := webrtc.MediaEngine{}