In order to avoid race conditions with WebRTC, where either side could initiate an offer when tracks have changes, we'll always initiate them from the SFU side.
25 lines
657 B
Go
25 lines
657 B
Go
package rtc_test
|
|
|
|
import (
|
|
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
|
"github.com/livekit/livekit-server/pkg/utils"
|
|
"github.com/livekit/livekit-server/proto/livekit"
|
|
)
|
|
|
|
func newMockParticipant(name string) *typesfakes.FakeParticipant {
|
|
p := &typesfakes.FakeParticipant{}
|
|
p.IDReturns(utils.NewGuid(utils.ParticipantPrefix))
|
|
p.NameReturns(name)
|
|
p.StateReturns(livekit.ParticipantInfo_JOINED)
|
|
|
|
return p
|
|
}
|
|
|
|
func newMockTrack(kind livekit.TrackType, name string) *typesfakes.FakePublishedTrack {
|
|
t := &typesfakes.FakePublishedTrack{}
|
|
t.IDReturns(utils.NewGuid(utils.TrackPrefix))
|
|
t.KindReturns(kind)
|
|
t.NameReturns(name)
|
|
return t
|
|
}
|