mirror of
https://github.com/livekit/livekit.git
synced 2026-08-27 22:34:25 +00:00
better debug logs around negotiations
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
type RTCClient struct {
|
||||
id string
|
||||
identity string
|
||||
conn *websocket.Conn
|
||||
PeerConn *webrtc.PeerConnection
|
||||
// sid => track
|
||||
@@ -173,13 +174,10 @@ func (c *RTCClient) Run() error {
|
||||
})
|
||||
|
||||
// create a data channel, in order to work
|
||||
dc, err := c.PeerConn.CreateDataChannel("_private", nil)
|
||||
_, err := c.PeerConn.CreateDataChannel("_private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dc.OnOpen(func() {
|
||||
logger.Debugw("data channel open")
|
||||
})
|
||||
|
||||
// run the session
|
||||
for {
|
||||
@@ -190,6 +188,7 @@ func (c *RTCClient) Run() error {
|
||||
switch msg := res.Message.(type) {
|
||||
case *livekit.SignalResponse_Join:
|
||||
c.id = msg.Join.Participant.Sid
|
||||
c.identity = msg.Join.Participant.Identity
|
||||
|
||||
c.lock.Lock()
|
||||
for _, p := range msg.Join.OtherParticipants {
|
||||
@@ -310,6 +309,7 @@ func (c *RTCClient) ReadResponse() (*livekit.SignalResponse, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: this function is not thread safe, need to cleanup
|
||||
func (c *RTCClient) SubscribedTracks() map[string][]*webrtc.TrackRemote {
|
||||
return c.subscribedTracks
|
||||
}
|
||||
@@ -517,11 +517,6 @@ func (c *RTCClient) negotiate() error {
|
||||
})
|
||||
}
|
||||
|
||||
type logEntry struct {
|
||||
msg string
|
||||
args []interface{}
|
||||
}
|
||||
|
||||
func (c *RTCClient) processTrack(track *webrtc.TrackRemote) {
|
||||
lastUpdate := time.Time{}
|
||||
pId, trackId := rtc.UnpackTrackId(track.ID())
|
||||
|
||||
Reference in New Issue
Block a user