Move RTP-specific code into its own package.
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
// Copyright (c) 2020 by Juliusz Chroboczek.
|
||||
|
||||
// This is not open source software. Copy it, and I'll break into your
|
||||
// house and tell your three year-old that Santa doesn't exist.
|
||||
|
||||
package main
|
||||
package rtpconn
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package rtpconn
|
||||
|
||||
import (
|
||||
"sort"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package rtpconn
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -1,9 +1,4 @@
|
||||
// Copyright (c) 2020 by Juliusz Chroboczek.
|
||||
|
||||
// This is not open source software. Copy it, and I'll break into your
|
||||
// house and tell your three year-old that Santa doesn't exist.
|
||||
|
||||
package main
|
||||
package rtpconn
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -580,7 +575,7 @@ func (c *webClient) PushConn(id string, up conn.Up, tracks []conn.UpTrack, label
|
||||
return nil
|
||||
}
|
||||
|
||||
func startClient(conn *websocket.Conn) (err error) {
|
||||
func StartClient(conn *websocket.Conn) (err error) {
|
||||
var m clientMessage
|
||||
|
||||
err = conn.SetReadDeadline(time.Now().Add(15 * time.Second))
|
||||
+2
-1
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"sfu/disk"
|
||||
"sfu/group"
|
||||
"sfu/rtpconn"
|
||||
"sfu/stats"
|
||||
)
|
||||
|
||||
@@ -306,7 +307,7 @@ func wsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
err := startClient(conn)
|
||||
err := rtpconn.StartClient(conn)
|
||||
if err != nil {
|
||||
log.Printf("client: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user