MCPcopy Create free account
hub / github.com/livekit/livekit / handleDataTrackMessage

Method handleDataTrackMessage

test/client/client.go:1158–1177  ·  view source on GitHub ↗
(data []byte, _arrivalTime int64)

Source from the content-addressed store, hash-verified

1156}
1157
1158func (c *RTCClient) handleDataTrackMessage(data []byte, _arrivalTime int64) {
1159 var packet datatrack.Packet
1160 if err := packet.Unmarshal(data); err != nil {
1161 return
1162 }
1163
1164 var dataTrackRemote *DataTrackRemote
1165 c.lock.Lock()
1166 for _, tracks := range c.subscribedDataTracks {
1167 if tracks[packet.Handle] != nil {
1168 dataTrackRemote = tracks[packet.Handle]
1169 break
1170 }
1171 }
1172 c.lock.Unlock()
1173
1174 if dataTrackRemote != nil {
1175 dataTrackRemote.PacketReceived(&packet)
1176 }
1177}
1178
1179// handles a server initiated offer, handle on subscriber PC
1180func (c *RTCClient) handleOffer(desc webrtc.SessionDescription, offerId uint32, _midToTrackID map[string]string) {

Callers

nothing calls this directly

Calls 2

UnmarshalMethod · 0.95
PacketReceivedMethod · 0.95

Tested by

no test coverage detected