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

💩 Split webrtc tracks by stream id (need to clean this, stream ID must pass between the session descriptor and the webrtc flux transmit)

This commit is contained in:
Yohann D'ANELLO
2020-10-05 22:00:08 +02:00
parent 76f009efe3
commit 022f6fb098
5 changed files with 87 additions and 30 deletions

View File

@ -30,8 +30,11 @@ var (
cfg *Options
// WebRTC session description channels
remoteSdpChan chan webrtc.SessionDescription
localSdpChan chan webrtc.SessionDescription
remoteSdpChan chan struct {
StreamID string
RemoteDescription webrtc.SessionDescription
}
localSdpChan chan webrtc.SessionDescription
// Preload templates
templates *template.Template
@ -71,7 +74,10 @@ func loadTemplates() error {
}
// Serve HTTP server
func Serve(rSdpChan chan webrtc.SessionDescription, lSdpChan chan webrtc.SessionDescription, c *Options) {
func Serve(rSdpChan chan struct {
StreamID string
RemoteDescription webrtc.SessionDescription
}, lSdpChan chan webrtc.SessionDescription, c *Options) {
remoteSdpChan = rSdpChan
localSdpChan = lSdpChan
cfg = c