Data tracks (#4089)
* WIP * WIP * Starting to add some signalling integration testing. * Working tests. * fix tests * Forward data packets (#4096) * WIP commit * WIP * WIP * fix forwarding * address PR comments * move some methods from LocalParticipant to Participant interface * handle subscription update * add extensions and tests * more packet tests * add test for replace extension and fix a bug * update protocol and add config
This commit is contained in:
@@ -502,6 +502,7 @@ func (r *RoomManager) StartSession(
|
||||
DatachannelLossyTargetLatency: r.config.RTC.DatachannelLossyTargetLatency,
|
||||
FireOnTrackBySdp: true,
|
||||
UseSinglePeerConnection: pi.UseSinglePeerConnection,
|
||||
EnableDataTracks: r.config.EnableDataTracks,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -664,7 +665,7 @@ func (r *RoomManager) getOrCreateRoom(ctx context.Context, createRoom *livekit.C
|
||||
}
|
||||
})
|
||||
|
||||
newRoom.OnParticipantChanged(func(p types.LocalParticipant) {
|
||||
newRoom.OnParticipantChanged(func(p types.Participant) {
|
||||
if !p.IsDisconnected() {
|
||||
if err := r.roomStore.StoreParticipant(ctx, roomName, p.ToProto()); err != nil {
|
||||
newRoom.Logger().Errorw("could not handle participant change", err)
|
||||
@@ -1118,6 +1119,10 @@ func (h *roomManagerParticipantHelper) ResolveMediaTrack(lp types.LocalParticipa
|
||||
return h.room.ResolveMediaTrackForSubscriber(lp, trackID)
|
||||
}
|
||||
|
||||
func (h *roomManagerParticipantHelper) ResolveDataTrack(lp types.LocalParticipant, trackID livekit.TrackID) types.DataResolverResult {
|
||||
return h.room.ResolveDataTrackForSubscriber(lp, trackID)
|
||||
}
|
||||
|
||||
func (h *roomManagerParticipantHelper) ShouldRegressCodec() bool {
|
||||
return h.codecRegressionThreshold == 0 || h.room.GetParticipantCount() < h.codecRegressionThreshold
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user