Dev debug info (#50)

This commit is contained in:
David Colburn
2021-07-13 14:05:25 -05:00
committed by GitHub
parent 0cf6efdae9
commit 5fdb6361cd
8 changed files with 184 additions and 3 deletions
+29
View File
@@ -373,3 +373,32 @@ func (t *MediaTrack) sendDownTrackBindingReports(sub types.Participant) {
}
}()
}
func (t *MediaTrack) DebugInfo() map[string]interface{} {
info := map[string]interface{}{
"ID": t.ID(),
"SSRC": t.ssrc,
"Kind": t.kind.String(),
"PubMuted": t.muted.Get(),
}
subscribedTrackInfo := make([]map[string]interface{}, 0)
t.lock.RLock()
for _, track := range t.subscribedTracks {
dt := track.dt.DebugInfo()
dt["PubMuted"] = track.pubMuted.Get()
dt["SubMuted"] = track.subMuted.Get()
subscribedTrackInfo = append(subscribedTrackInfo, dt)
}
t.lock.RUnlock()
info["DownTracks"] = subscribedTrackInfo
if t.receiver != nil {
receiverInfo := t.receiver.DebugInfo()
for k, v := range receiverInfo {
info[k] = v
}
}
return info
}