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

@ -8,7 +8,7 @@ import (
"github.com/pion/webrtc/v3"
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
"gitlab.crans.org/nounous/ghostream/stream/srt"
"gitlab.crans.org/nounous/ghostream/stream"
)
// Options holds web package configuration
@ -182,12 +182,12 @@ func getPayloadType(m webrtc.MediaEngine, codecType webrtc.RTPCodecType, codecNa
}
// Serve WebRTC media streaming server
func Serve(remoteSdpChan chan struct {
func Serve(streams map[string]*stream.Stream, remoteSdpChan chan struct {
StreamID string
RemoteDescription webrtc.SessionDescription
}, localSdpChan chan webrtc.SessionDescription, inputChannel chan srt.Packet, cfg *Options) {
}, localSdpChan chan webrtc.SessionDescription, cfg *Options) {
if !cfg.Enabled {
// SRT is not enabled, ignore
// WebRTC is not enabled, ignore
return
}
@ -197,8 +197,8 @@ func Serve(remoteSdpChan chan struct {
videoTracks = make(map[string][]*webrtc.Track)
audioTracks = make(map[string][]*webrtc.Track)
// Ingest data from SRT
go ingestFrom(inputChannel)
// Ingest data
go autoIngest(streams)
// Handle new connections
for {