diff --git a/go.mod b/go.mod index 97991c1d4..cd2491925 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/hashicorp/golang-lru v0.5.4 github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b - github.com/livekit/protocol v0.10.5 + github.com/livekit/protocol v0.10.6-0.20211208200546-ef32549a05d8 github.com/magefile/mage v1.11.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index d60e5abf1..673bf4f55 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY/mKrcvA= github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= -github.com/livekit/protocol v0.10.5 h1:cFGhMH9dPckX7zBfmZNtHq2B+gocYs7PV9BkQU1Wi1I= -github.com/livekit/protocol v0.10.5/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg= +github.com/livekit/protocol v0.10.6-0.20211208200546-ef32549a05d8 h1:nIeeGnAkPDG6ESFpYNv7BVokmQ7HQvl9OK9Jpl0dKII= +github.com/livekit/protocol v0.10.6-0.20211208200546-ef32549a05d8/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg= github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls= github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= diff --git a/pkg/routing/interfaces.go b/pkg/routing/interfaces.go index 5894fe399..3ba9e8fa1 100644 --- a/pkg/routing/interfaces.go +++ b/pkg/routing/interfaces.go @@ -5,7 +5,7 @@ import ( "github.com/go-redis/redis/v8" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/routing/localrouter.go b/pkg/routing/localrouter.go index 46b91716c..958c0324d 100644 --- a/pkg/routing/localrouter.go +++ b/pkg/routing/localrouter.go @@ -6,7 +6,7 @@ import ( "time" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" ) diff --git a/pkg/routing/messagechannel_test.go b/pkg/routing/messagechannel_test.go index 0d7907e08..c601b2c09 100644 --- a/pkg/routing/messagechannel_test.go +++ b/pkg/routing/messagechannel_test.go @@ -4,7 +4,7 @@ import ( "sync" "testing" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/livekit-server/pkg/routing" ) diff --git a/pkg/routing/node.go b/pkg/routing/node.go index 6e547982e..b0dceb733 100644 --- a/pkg/routing/node.go +++ b/pkg/routing/node.go @@ -8,7 +8,7 @@ import ( "time" "github.com/jxskiss/base62" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/routing/redis.go b/pkg/routing/redis.go index 76774e201..0367fdc8a 100644 --- a/pkg/routing/redis.go +++ b/pkg/routing/redis.go @@ -4,7 +4,7 @@ import ( "context" "github.com/go-redis/redis/v8" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" ) diff --git a/pkg/routing/redisrouter.go b/pkg/routing/redisrouter.go index 39c985768..1f91372ab 100644 --- a/pkg/routing/redisrouter.go +++ b/pkg/routing/redisrouter.go @@ -6,7 +6,7 @@ import ( "github.com/go-redis/redis/v8" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pkg/errors" "google.golang.org/protobuf/proto" diff --git a/pkg/routing/routingfakes/fake_router.go b/pkg/routing/routingfakes/fake_router.go index 14cee43fa..41fa6d063 100644 --- a/pkg/routing/routingfakes/fake_router.go +++ b/pkg/routing/routingfakes/fake_router.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakeRouter struct { diff --git a/pkg/routing/selector/interfaces.go b/pkg/routing/selector/interfaces.go index ffcb47b14..ee06e9e1d 100644 --- a/pkg/routing/selector/interfaces.go +++ b/pkg/routing/selector/interfaces.go @@ -3,7 +3,7 @@ package selector import ( "errors" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/livekit-server/pkg/config" ) diff --git a/pkg/routing/selector/random.go b/pkg/routing/selector/random.go index 67d4f045f..179c1f7ed 100644 --- a/pkg/routing/selector/random.go +++ b/pkg/routing/selector/random.go @@ -1,7 +1,7 @@ package selector import ( - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/thoas/go-funk" ) diff --git a/pkg/routing/selector/regionaware.go b/pkg/routing/selector/regionaware.go index 06556a317..9c148e90d 100644 --- a/pkg/routing/selector/regionaware.go +++ b/pkg/routing/selector/regionaware.go @@ -3,7 +3,7 @@ package selector import ( "math" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/thoas/go-funk" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/routing/selector/regionaware_test.go b/pkg/routing/selector/regionaware_test.go index 19a0bfbfb..b176264a2 100644 --- a/pkg/routing/selector/regionaware_test.go +++ b/pkg/routing/selector/regionaware_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/stretchr/testify/require" diff --git a/pkg/routing/selector/sysload.go b/pkg/routing/selector/sysload.go index 2bc41182a..40f1e27c6 100644 --- a/pkg/routing/selector/sysload.go +++ b/pkg/routing/selector/sysload.go @@ -1,7 +1,7 @@ package selector import ( - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/thoas/go-funk" ) diff --git a/pkg/routing/selector/sysload_test.go b/pkg/routing/selector/sysload_test.go index 8af8ea4ef..916494b80 100644 --- a/pkg/routing/selector/sysload_test.go +++ b/pkg/routing/selector/sysload_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/routing/selector" diff --git a/pkg/routing/selector/utils.go b/pkg/routing/selector/utils.go index d1c2d104e..aab4963c2 100644 --- a/pkg/routing/selector/utils.go +++ b/pkg/routing/selector/utils.go @@ -4,7 +4,7 @@ import ( "time" "github.com/livekit/livekit-server/pkg/config" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/thoas/go-funk" ) diff --git a/pkg/routing/selector/utils_test.go b/pkg/routing/selector/utils_test.go index ec0cc064b..f93d006ab 100644 --- a/pkg/routing/selector/utils_test.go +++ b/pkg/routing/selector/utils_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/livekit/livekit-server/pkg/routing/selector" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" ) diff --git a/pkg/rtc/helper_test.go b/pkg/rtc/helper_test.go index 6e08648f6..8c5eaae9e 100644 --- a/pkg/rtc/helper_test.go +++ b/pkg/rtc/helper_test.go @@ -1,7 +1,7 @@ package rtc_test import ( - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/livekit/livekit-server/pkg/rtc/types" diff --git a/pkg/rtc/mediaengine.go b/pkg/rtc/mediaengine.go index 35168b586..93d39650e 100644 --- a/pkg/rtc/mediaengine.go +++ b/pkg/rtc/mediaengine.go @@ -3,7 +3,7 @@ package rtc import ( "strings" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/sdp/v3" "github.com/pion/webrtc/v3" ) diff --git a/pkg/rtc/mediaengine_test.go b/pkg/rtc/mediaengine_test.go index 5682ee117..6ae3b73ce 100644 --- a/pkg/rtc/mediaengine_test.go +++ b/pkg/rtc/mediaengine_test.go @@ -3,7 +3,7 @@ package rtc import ( "testing" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" ) diff --git a/pkg/rtc/mediatrack.go b/pkg/rtc/mediatrack.go index 3fa510045..5efda814f 100644 --- a/pkg/rtc/mediatrack.go +++ b/pkg/rtc/mediatrack.go @@ -8,8 +8,8 @@ import ( "sync/atomic" "time" + "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/rtcp" "github.com/pion/webrtc/v3" @@ -100,9 +100,6 @@ func NewMediaTrack(track *webrtc.TrackRemote, params MediaTrackParams) *MediaTra return t } -func (t *MediaTrack) Start() { -} - func (t *MediaTrack) ID() string { return t.params.TrackInfo.Sid } diff --git a/pkg/rtc/mediatrack_test.go b/pkg/rtc/mediatrack_test.go index 3ef07f415..46401ab10 100644 --- a/pkg/rtc/mediatrack_test.go +++ b/pkg/rtc/mediatrack_test.go @@ -3,7 +3,7 @@ package rtc import ( "testing" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" ) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 0b69012b4..a7b62fc5b 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -9,8 +9,8 @@ import ( "time" lru "github.com/hashicorp/golang-lru" + "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/rtcp" "github.com/pion/webrtc/v3" @@ -1075,8 +1075,6 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) { } p.lock.Unlock() - track.Start() - track.AddOnClose(func() { // cleanup p.lock.Lock() diff --git a/pkg/rtc/participant_internal_test.go b/pkg/rtc/participant_internal_test.go index eb3dbf9f3..568f12f2e 100644 --- a/pkg/rtc/participant_internal_test.go +++ b/pkg/rtc/participant_internal_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index 86298ced2..688bae8d3 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -9,7 +9,7 @@ import ( "github.com/go-logr/logr" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/rtc/room_test.go b/pkg/rtc/room_test.go index 3e47211ff..b474e1d3b 100644 --- a/pkg/rtc/room_test.go +++ b/pkg/rtc/room_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/rtc/subscribedtrack.go b/pkg/rtc/subscribedtrack.go index 25f2a9227..a548dbd78 100644 --- a/pkg/rtc/subscribedtrack.go +++ b/pkg/rtc/subscribedtrack.go @@ -7,7 +7,7 @@ import ( "github.com/bep/debounce" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/sfu" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pion/webrtc/v3" ) @@ -17,7 +17,7 @@ const ( ) type SubscribedTrack struct { - publishedTrack types.PublishedTrack + publishedTrack types.MediaTrack dt *sfu.DownTrack publisherIdentity string subMuted utils.AtomicFlag @@ -27,9 +27,9 @@ type SubscribedTrack struct { debouncer func(func()) } -func NewSubscribedTrack(publishedTrack types.PublishedTrack, publisherIdentity string, dt *sfu.DownTrack) *SubscribedTrack { +func NewSubscribedTrack(mediaTrack types.MediaTrack, publisherIdentity string, dt *sfu.DownTrack) *SubscribedTrack { return &SubscribedTrack{ - publishedTrack: publishedTrack, + publishedTrack: mediaTrack, publisherIdentity: publisherIdentity, dt: dt, debouncer: debounce.New(subscriptionDebounceInterval), diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index d1987ea89..f5b8df7f1 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -6,7 +6,7 @@ import ( "github.com/bep/debounce" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/interceptor" "github.com/pion/webrtc/v3" diff --git a/pkg/rtc/transport_test.go b/pkg/rtc/transport_test.go index 46a1a854b..4ee73507e 100644 --- a/pkg/rtc/transport_test.go +++ b/pkg/rtc/transport_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" diff --git a/pkg/rtc/types/interfaces.go b/pkg/rtc/types/interfaces.go index 57cc27e31..f6093fbab 100644 --- a/pkg/rtc/types/interfaces.go +++ b/pkg/rtc/types/interfaces.go @@ -3,7 +3,7 @@ package types import ( "time" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" "github.com/pion/rtcp" "github.com/pion/webrtc/v3" @@ -61,7 +61,6 @@ type Participant interface { GetSubscribedParticipants() []string // permissions - CanPublish() bool CanSubscribe() bool CanPublishData() bool @@ -91,14 +90,10 @@ type Participant interface { DebugInfo() map[string]interface{} } -// PublishedTrack is the main interface representing a track published to the room -// it's responsible for managing subscribers and forwarding data from the input track to all subscribers -//counterfeiter:generate . PublishedTrack -type PublishedTrack interface { - Start() +// MediaTrack represents a media track +//counterfeiter:generate . MediaTrack +type MediaTrack interface { ID() string - SignalCid() string - SdpCid() string Kind() livekit.TrackType Name() string IsMuted() bool @@ -112,10 +107,21 @@ type PublishedTrack interface { RemoveAllSubscribers() // returns quality information that's appropriate for width & height GetQualityForDimension(width, height uint32) livekit.VideoQuality +} + +// PublishedTrack is the main interface representing a track published to the room +// it's responsible for managing subscribers and forwarding data from the input track to all subscribers +//counterfeiter:generate . PublishedTrack +type PublishedTrack interface { + MediaTrack + + SignalCid() string + SdpCid() string + ToProto() *livekit.TrackInfo + // returns number of uptracks that are publishing, registered NumUpTracks() (uint32, uint32) PublishLossPercentage() uint32 - ToProto() *livekit.TrackInfo Receiver() sfu.TrackReceiver // callbacks diff --git a/pkg/rtc/types/typesfakes/fake_media_track.go b/pkg/rtc/types/typesfakes/fake_media_track.go new file mode 100644 index 000000000..fa5cdf309 --- /dev/null +++ b/pkg/rtc/types/typesfakes/fake_media_track.go @@ -0,0 +1,674 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package typesfakes + +import ( + "sync" + + "github.com/livekit/livekit-server/pkg/rtc/types" + "github.com/livekit/protocol/livekit" +) + +type FakeMediaTrack struct { + AddSubscriberStub func(types.Participant) error + addSubscriberMutex sync.RWMutex + addSubscriberArgsForCall []struct { + arg1 types.Participant + } + addSubscriberReturns struct { + result1 error + } + addSubscriberReturnsOnCall map[int]struct { + result1 error + } + GetQualityForDimensionStub func(uint32, uint32) livekit.VideoQuality + getQualityForDimensionMutex sync.RWMutex + getQualityForDimensionArgsForCall []struct { + arg1 uint32 + arg2 uint32 + } + getQualityForDimensionReturns struct { + result1 livekit.VideoQuality + } + getQualityForDimensionReturnsOnCall map[int]struct { + result1 livekit.VideoQuality + } + IDStub func() string + iDMutex sync.RWMutex + iDArgsForCall []struct { + } + iDReturns struct { + result1 string + } + iDReturnsOnCall map[int]struct { + result1 string + } + IsMutedStub func() bool + isMutedMutex sync.RWMutex + isMutedArgsForCall []struct { + } + isMutedReturns struct { + result1 bool + } + isMutedReturnsOnCall map[int]struct { + result1 bool + } + IsSubscriberStub func(string) bool + isSubscriberMutex sync.RWMutex + isSubscriberArgsForCall []struct { + arg1 string + } + isSubscriberReturns struct { + result1 bool + } + isSubscriberReturnsOnCall map[int]struct { + result1 bool + } + KindStub func() livekit.TrackType + kindMutex sync.RWMutex + kindArgsForCall []struct { + } + kindReturns struct { + result1 livekit.TrackType + } + kindReturnsOnCall map[int]struct { + result1 livekit.TrackType + } + NameStub func() string + nameMutex sync.RWMutex + nameArgsForCall []struct { + } + nameReturns struct { + result1 string + } + nameReturnsOnCall map[int]struct { + result1 string + } + RemoveAllSubscribersStub func() + removeAllSubscribersMutex sync.RWMutex + removeAllSubscribersArgsForCall []struct { + } + RemoveSubscriberStub func(string) + removeSubscriberMutex sync.RWMutex + removeSubscriberArgsForCall []struct { + arg1 string + } + SetMutedStub func(bool) + setMutedMutex sync.RWMutex + setMutedArgsForCall []struct { + arg1 bool + } + UpdateVideoLayersStub func([]*livekit.VideoLayer) + updateVideoLayersMutex sync.RWMutex + updateVideoLayersArgsForCall []struct { + arg1 []*livekit.VideoLayer + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeMediaTrack) AddSubscriber(arg1 types.Participant) error { + fake.addSubscriberMutex.Lock() + ret, specificReturn := fake.addSubscriberReturnsOnCall[len(fake.addSubscriberArgsForCall)] + fake.addSubscriberArgsForCall = append(fake.addSubscriberArgsForCall, struct { + arg1 types.Participant + }{arg1}) + stub := fake.AddSubscriberStub + fakeReturns := fake.addSubscriberReturns + fake.recordInvocation("AddSubscriber", []interface{}{arg1}) + fake.addSubscriberMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) AddSubscriberCallCount() int { + fake.addSubscriberMutex.RLock() + defer fake.addSubscriberMutex.RUnlock() + return len(fake.addSubscriberArgsForCall) +} + +func (fake *FakeMediaTrack) AddSubscriberCalls(stub func(types.Participant) error) { + fake.addSubscriberMutex.Lock() + defer fake.addSubscriberMutex.Unlock() + fake.AddSubscriberStub = stub +} + +func (fake *FakeMediaTrack) AddSubscriberArgsForCall(i int) types.Participant { + fake.addSubscriberMutex.RLock() + defer fake.addSubscriberMutex.RUnlock() + argsForCall := fake.addSubscriberArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeMediaTrack) AddSubscriberReturns(result1 error) { + fake.addSubscriberMutex.Lock() + defer fake.addSubscriberMutex.Unlock() + fake.AddSubscriberStub = nil + fake.addSubscriberReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeMediaTrack) AddSubscriberReturnsOnCall(i int, result1 error) { + fake.addSubscriberMutex.Lock() + defer fake.addSubscriberMutex.Unlock() + fake.AddSubscriberStub = nil + if fake.addSubscriberReturnsOnCall == nil { + fake.addSubscriberReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.addSubscriberReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeMediaTrack) GetQualityForDimension(arg1 uint32, arg2 uint32) livekit.VideoQuality { + fake.getQualityForDimensionMutex.Lock() + ret, specificReturn := fake.getQualityForDimensionReturnsOnCall[len(fake.getQualityForDimensionArgsForCall)] + fake.getQualityForDimensionArgsForCall = append(fake.getQualityForDimensionArgsForCall, struct { + arg1 uint32 + arg2 uint32 + }{arg1, arg2}) + stub := fake.GetQualityForDimensionStub + fakeReturns := fake.getQualityForDimensionReturns + fake.recordInvocation("GetQualityForDimension", []interface{}{arg1, arg2}) + fake.getQualityForDimensionMutex.Unlock() + if stub != nil { + return stub(arg1, arg2) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) GetQualityForDimensionCallCount() int { + fake.getQualityForDimensionMutex.RLock() + defer fake.getQualityForDimensionMutex.RUnlock() + return len(fake.getQualityForDimensionArgsForCall) +} + +func (fake *FakeMediaTrack) GetQualityForDimensionCalls(stub func(uint32, uint32) livekit.VideoQuality) { + fake.getQualityForDimensionMutex.Lock() + defer fake.getQualityForDimensionMutex.Unlock() + fake.GetQualityForDimensionStub = stub +} + +func (fake *FakeMediaTrack) GetQualityForDimensionArgsForCall(i int) (uint32, uint32) { + fake.getQualityForDimensionMutex.RLock() + defer fake.getQualityForDimensionMutex.RUnlock() + argsForCall := fake.getQualityForDimensionArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2 +} + +func (fake *FakeMediaTrack) GetQualityForDimensionReturns(result1 livekit.VideoQuality) { + fake.getQualityForDimensionMutex.Lock() + defer fake.getQualityForDimensionMutex.Unlock() + fake.GetQualityForDimensionStub = nil + fake.getQualityForDimensionReturns = struct { + result1 livekit.VideoQuality + }{result1} +} + +func (fake *FakeMediaTrack) GetQualityForDimensionReturnsOnCall(i int, result1 livekit.VideoQuality) { + fake.getQualityForDimensionMutex.Lock() + defer fake.getQualityForDimensionMutex.Unlock() + fake.GetQualityForDimensionStub = nil + if fake.getQualityForDimensionReturnsOnCall == nil { + fake.getQualityForDimensionReturnsOnCall = make(map[int]struct { + result1 livekit.VideoQuality + }) + } + fake.getQualityForDimensionReturnsOnCall[i] = struct { + result1 livekit.VideoQuality + }{result1} +} + +func (fake *FakeMediaTrack) ID() string { + fake.iDMutex.Lock() + ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)] + fake.iDArgsForCall = append(fake.iDArgsForCall, struct { + }{}) + stub := fake.IDStub + fakeReturns := fake.iDReturns + fake.recordInvocation("ID", []interface{}{}) + fake.iDMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) IDCallCount() int { + fake.iDMutex.RLock() + defer fake.iDMutex.RUnlock() + return len(fake.iDArgsForCall) +} + +func (fake *FakeMediaTrack) IDCalls(stub func() string) { + fake.iDMutex.Lock() + defer fake.iDMutex.Unlock() + fake.IDStub = stub +} + +func (fake *FakeMediaTrack) IDReturns(result1 string) { + fake.iDMutex.Lock() + defer fake.iDMutex.Unlock() + fake.IDStub = nil + fake.iDReturns = struct { + result1 string + }{result1} +} + +func (fake *FakeMediaTrack) IDReturnsOnCall(i int, result1 string) { + fake.iDMutex.Lock() + defer fake.iDMutex.Unlock() + fake.IDStub = nil + if fake.iDReturnsOnCall == nil { + fake.iDReturnsOnCall = make(map[int]struct { + result1 string + }) + } + fake.iDReturnsOnCall[i] = struct { + result1 string + }{result1} +} + +func (fake *FakeMediaTrack) IsMuted() bool { + fake.isMutedMutex.Lock() + ret, specificReturn := fake.isMutedReturnsOnCall[len(fake.isMutedArgsForCall)] + fake.isMutedArgsForCall = append(fake.isMutedArgsForCall, struct { + }{}) + stub := fake.IsMutedStub + fakeReturns := fake.isMutedReturns + fake.recordInvocation("IsMuted", []interface{}{}) + fake.isMutedMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) IsMutedCallCount() int { + fake.isMutedMutex.RLock() + defer fake.isMutedMutex.RUnlock() + return len(fake.isMutedArgsForCall) +} + +func (fake *FakeMediaTrack) IsMutedCalls(stub func() bool) { + fake.isMutedMutex.Lock() + defer fake.isMutedMutex.Unlock() + fake.IsMutedStub = stub +} + +func (fake *FakeMediaTrack) IsMutedReturns(result1 bool) { + fake.isMutedMutex.Lock() + defer fake.isMutedMutex.Unlock() + fake.IsMutedStub = nil + fake.isMutedReturns = struct { + result1 bool + }{result1} +} + +func (fake *FakeMediaTrack) IsMutedReturnsOnCall(i int, result1 bool) { + fake.isMutedMutex.Lock() + defer fake.isMutedMutex.Unlock() + fake.IsMutedStub = nil + if fake.isMutedReturnsOnCall == nil { + fake.isMutedReturnsOnCall = make(map[int]struct { + result1 bool + }) + } + fake.isMutedReturnsOnCall[i] = struct { + result1 bool + }{result1} +} + +func (fake *FakeMediaTrack) IsSubscriber(arg1 string) bool { + fake.isSubscriberMutex.Lock() + ret, specificReturn := fake.isSubscriberReturnsOnCall[len(fake.isSubscriberArgsForCall)] + fake.isSubscriberArgsForCall = append(fake.isSubscriberArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.IsSubscriberStub + fakeReturns := fake.isSubscriberReturns + fake.recordInvocation("IsSubscriber", []interface{}{arg1}) + fake.isSubscriberMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) IsSubscriberCallCount() int { + fake.isSubscriberMutex.RLock() + defer fake.isSubscriberMutex.RUnlock() + return len(fake.isSubscriberArgsForCall) +} + +func (fake *FakeMediaTrack) IsSubscriberCalls(stub func(string) bool) { + fake.isSubscriberMutex.Lock() + defer fake.isSubscriberMutex.Unlock() + fake.IsSubscriberStub = stub +} + +func (fake *FakeMediaTrack) IsSubscriberArgsForCall(i int) string { + fake.isSubscriberMutex.RLock() + defer fake.isSubscriberMutex.RUnlock() + argsForCall := fake.isSubscriberArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeMediaTrack) IsSubscriberReturns(result1 bool) { + fake.isSubscriberMutex.Lock() + defer fake.isSubscriberMutex.Unlock() + fake.IsSubscriberStub = nil + fake.isSubscriberReturns = struct { + result1 bool + }{result1} +} + +func (fake *FakeMediaTrack) IsSubscriberReturnsOnCall(i int, result1 bool) { + fake.isSubscriberMutex.Lock() + defer fake.isSubscriberMutex.Unlock() + fake.IsSubscriberStub = nil + if fake.isSubscriberReturnsOnCall == nil { + fake.isSubscriberReturnsOnCall = make(map[int]struct { + result1 bool + }) + } + fake.isSubscriberReturnsOnCall[i] = struct { + result1 bool + }{result1} +} + +func (fake *FakeMediaTrack) Kind() livekit.TrackType { + fake.kindMutex.Lock() + ret, specificReturn := fake.kindReturnsOnCall[len(fake.kindArgsForCall)] + fake.kindArgsForCall = append(fake.kindArgsForCall, struct { + }{}) + stub := fake.KindStub + fakeReturns := fake.kindReturns + fake.recordInvocation("Kind", []interface{}{}) + fake.kindMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) KindCallCount() int { + fake.kindMutex.RLock() + defer fake.kindMutex.RUnlock() + return len(fake.kindArgsForCall) +} + +func (fake *FakeMediaTrack) KindCalls(stub func() livekit.TrackType) { + fake.kindMutex.Lock() + defer fake.kindMutex.Unlock() + fake.KindStub = stub +} + +func (fake *FakeMediaTrack) KindReturns(result1 livekit.TrackType) { + fake.kindMutex.Lock() + defer fake.kindMutex.Unlock() + fake.KindStub = nil + fake.kindReturns = struct { + result1 livekit.TrackType + }{result1} +} + +func (fake *FakeMediaTrack) KindReturnsOnCall(i int, result1 livekit.TrackType) { + fake.kindMutex.Lock() + defer fake.kindMutex.Unlock() + fake.KindStub = nil + if fake.kindReturnsOnCall == nil { + fake.kindReturnsOnCall = make(map[int]struct { + result1 livekit.TrackType + }) + } + fake.kindReturnsOnCall[i] = struct { + result1 livekit.TrackType + }{result1} +} + +func (fake *FakeMediaTrack) Name() string { + fake.nameMutex.Lock() + ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)] + fake.nameArgsForCall = append(fake.nameArgsForCall, struct { + }{}) + stub := fake.NameStub + fakeReturns := fake.nameReturns + fake.recordInvocation("Name", []interface{}{}) + fake.nameMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeMediaTrack) NameCallCount() int { + fake.nameMutex.RLock() + defer fake.nameMutex.RUnlock() + return len(fake.nameArgsForCall) +} + +func (fake *FakeMediaTrack) NameCalls(stub func() string) { + fake.nameMutex.Lock() + defer fake.nameMutex.Unlock() + fake.NameStub = stub +} + +func (fake *FakeMediaTrack) NameReturns(result1 string) { + fake.nameMutex.Lock() + defer fake.nameMutex.Unlock() + fake.NameStub = nil + fake.nameReturns = struct { + result1 string + }{result1} +} + +func (fake *FakeMediaTrack) NameReturnsOnCall(i int, result1 string) { + fake.nameMutex.Lock() + defer fake.nameMutex.Unlock() + fake.NameStub = nil + if fake.nameReturnsOnCall == nil { + fake.nameReturnsOnCall = make(map[int]struct { + result1 string + }) + } + fake.nameReturnsOnCall[i] = struct { + result1 string + }{result1} +} + +func (fake *FakeMediaTrack) RemoveAllSubscribers() { + fake.removeAllSubscribersMutex.Lock() + fake.removeAllSubscribersArgsForCall = append(fake.removeAllSubscribersArgsForCall, struct { + }{}) + stub := fake.RemoveAllSubscribersStub + fake.recordInvocation("RemoveAllSubscribers", []interface{}{}) + fake.removeAllSubscribersMutex.Unlock() + if stub != nil { + fake.RemoveAllSubscribersStub() + } +} + +func (fake *FakeMediaTrack) RemoveAllSubscribersCallCount() int { + fake.removeAllSubscribersMutex.RLock() + defer fake.removeAllSubscribersMutex.RUnlock() + return len(fake.removeAllSubscribersArgsForCall) +} + +func (fake *FakeMediaTrack) RemoveAllSubscribersCalls(stub func()) { + fake.removeAllSubscribersMutex.Lock() + defer fake.removeAllSubscribersMutex.Unlock() + fake.RemoveAllSubscribersStub = stub +} + +func (fake *FakeMediaTrack) RemoveSubscriber(arg1 string) { + fake.removeSubscriberMutex.Lock() + fake.removeSubscriberArgsForCall = append(fake.removeSubscriberArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.RemoveSubscriberStub + fake.recordInvocation("RemoveSubscriber", []interface{}{arg1}) + fake.removeSubscriberMutex.Unlock() + if stub != nil { + fake.RemoveSubscriberStub(arg1) + } +} + +func (fake *FakeMediaTrack) RemoveSubscriberCallCount() int { + fake.removeSubscriberMutex.RLock() + defer fake.removeSubscriberMutex.RUnlock() + return len(fake.removeSubscriberArgsForCall) +} + +func (fake *FakeMediaTrack) RemoveSubscriberCalls(stub func(string)) { + fake.removeSubscriberMutex.Lock() + defer fake.removeSubscriberMutex.Unlock() + fake.RemoveSubscriberStub = stub +} + +func (fake *FakeMediaTrack) RemoveSubscriberArgsForCall(i int) string { + fake.removeSubscriberMutex.RLock() + defer fake.removeSubscriberMutex.RUnlock() + argsForCall := fake.removeSubscriberArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeMediaTrack) SetMuted(arg1 bool) { + fake.setMutedMutex.Lock() + fake.setMutedArgsForCall = append(fake.setMutedArgsForCall, struct { + arg1 bool + }{arg1}) + stub := fake.SetMutedStub + fake.recordInvocation("SetMuted", []interface{}{arg1}) + fake.setMutedMutex.Unlock() + if stub != nil { + fake.SetMutedStub(arg1) + } +} + +func (fake *FakeMediaTrack) SetMutedCallCount() int { + fake.setMutedMutex.RLock() + defer fake.setMutedMutex.RUnlock() + return len(fake.setMutedArgsForCall) +} + +func (fake *FakeMediaTrack) SetMutedCalls(stub func(bool)) { + fake.setMutedMutex.Lock() + defer fake.setMutedMutex.Unlock() + fake.SetMutedStub = stub +} + +func (fake *FakeMediaTrack) SetMutedArgsForCall(i int) bool { + fake.setMutedMutex.RLock() + defer fake.setMutedMutex.RUnlock() + argsForCall := fake.setMutedArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeMediaTrack) UpdateVideoLayers(arg1 []*livekit.VideoLayer) { + var arg1Copy []*livekit.VideoLayer + if arg1 != nil { + arg1Copy = make([]*livekit.VideoLayer, len(arg1)) + copy(arg1Copy, arg1) + } + fake.updateVideoLayersMutex.Lock() + fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct { + arg1 []*livekit.VideoLayer + }{arg1Copy}) + stub := fake.UpdateVideoLayersStub + fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1Copy}) + fake.updateVideoLayersMutex.Unlock() + if stub != nil { + fake.UpdateVideoLayersStub(arg1) + } +} + +func (fake *FakeMediaTrack) UpdateVideoLayersCallCount() int { + fake.updateVideoLayersMutex.RLock() + defer fake.updateVideoLayersMutex.RUnlock() + return len(fake.updateVideoLayersArgsForCall) +} + +func (fake *FakeMediaTrack) UpdateVideoLayersCalls(stub func([]*livekit.VideoLayer)) { + fake.updateVideoLayersMutex.Lock() + defer fake.updateVideoLayersMutex.Unlock() + fake.UpdateVideoLayersStub = stub +} + +func (fake *FakeMediaTrack) UpdateVideoLayersArgsForCall(i int) []*livekit.VideoLayer { + fake.updateVideoLayersMutex.RLock() + defer fake.updateVideoLayersMutex.RUnlock() + argsForCall := fake.updateVideoLayersArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeMediaTrack) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + fake.addSubscriberMutex.RLock() + defer fake.addSubscriberMutex.RUnlock() + fake.getQualityForDimensionMutex.RLock() + defer fake.getQualityForDimensionMutex.RUnlock() + fake.iDMutex.RLock() + defer fake.iDMutex.RUnlock() + fake.isMutedMutex.RLock() + defer fake.isMutedMutex.RUnlock() + fake.isSubscriberMutex.RLock() + defer fake.isSubscriberMutex.RUnlock() + fake.kindMutex.RLock() + defer fake.kindMutex.RUnlock() + fake.nameMutex.RLock() + defer fake.nameMutex.RUnlock() + fake.removeAllSubscribersMutex.RLock() + defer fake.removeAllSubscribersMutex.RUnlock() + fake.removeSubscriberMutex.RLock() + defer fake.removeSubscriberMutex.RUnlock() + fake.setMutedMutex.RLock() + defer fake.setMutedMutex.RUnlock() + fake.updateVideoLayersMutex.RLock() + defer fake.updateVideoLayersMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeMediaTrack) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ types.MediaTrack = new(FakeMediaTrack) diff --git a/pkg/rtc/types/typesfakes/fake_participant.go b/pkg/rtc/types/typesfakes/fake_participant.go index d17a1b35a..b9bdccb2b 100644 --- a/pkg/rtc/types/typesfakes/fake_participant.go +++ b/pkg/rtc/types/typesfakes/fake_participant.go @@ -7,7 +7,7 @@ import ( "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" "github.com/pion/rtcp" webrtc "github.com/pion/webrtc/v3" ) diff --git a/pkg/rtc/types/typesfakes/fake_published_track.go b/pkg/rtc/types/typesfakes/fake_published_track.go index 2844792da..1ec9d64e0 100644 --- a/pkg/rtc/types/typesfakes/fake_published_track.go +++ b/pkg/rtc/types/typesfakes/fake_published_track.go @@ -6,7 +6,7 @@ import ( "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/sfu" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakePublishedTrack struct { @@ -155,10 +155,6 @@ type FakePublishedTrack struct { signalCidReturnsOnCall map[int]struct { result1 string } - StartStub func() - startMutex sync.RWMutex - startArgsForCall []struct { - } ToProtoStub func() *livekit.TrackInfo toProtoMutex sync.RWMutex toProtoArgsForCall []struct { @@ -962,30 +958,6 @@ func (fake *FakePublishedTrack) SignalCidReturnsOnCall(i int, result1 string) { }{result1} } -func (fake *FakePublishedTrack) Start() { - fake.startMutex.Lock() - fake.startArgsForCall = append(fake.startArgsForCall, struct { - }{}) - stub := fake.StartStub - fake.recordInvocation("Start", []interface{}{}) - fake.startMutex.Unlock() - if stub != nil { - fake.StartStub() - } -} - -func (fake *FakePublishedTrack) StartCallCount() int { - fake.startMutex.RLock() - defer fake.startMutex.RUnlock() - return len(fake.startArgsForCall) -} - -func (fake *FakePublishedTrack) StartCalls(stub func()) { - fake.startMutex.Lock() - defer fake.startMutex.Unlock() - fake.StartStub = stub -} - func (fake *FakePublishedTrack) ToProto() *livekit.TrackInfo { fake.toProtoMutex.Lock() ret, specificReturn := fake.toProtoReturnsOnCall[len(fake.toProtoArgsForCall)] @@ -1111,8 +1083,6 @@ func (fake *FakePublishedTrack) Invocations() map[string][][]interface{} { defer fake.setMutedMutex.RUnlock() fake.signalCidMutex.RLock() defer fake.signalCidMutex.RUnlock() - fake.startMutex.RLock() - defer fake.startMutex.RUnlock() fake.toProtoMutex.RLock() defer fake.toProtoMutex.RUnlock() fake.updateVideoLayersMutex.RLock() diff --git a/pkg/rtc/types/typesfakes/fake_subscribed_track.go b/pkg/rtc/types/typesfakes/fake_subscribed_track.go index c0b40022c..d2127c17a 100644 --- a/pkg/rtc/types/typesfakes/fake_subscribed_track.go +++ b/pkg/rtc/types/typesfakes/fake_subscribed_track.go @@ -6,7 +6,7 @@ import ( "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/sfu" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakeSubscribedTrack struct { diff --git a/pkg/rtc/utils.go b/pkg/rtc/utils.go index c5c17e262..9b9d1c6f1 100644 --- a/pkg/rtc/utils.go +++ b/pkg/rtc/utils.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/webrtc/v3" "github.com/livekit/livekit-server/pkg/rtc/types" diff --git a/pkg/service/interfaces.go b/pkg/service/interfaces.go index 8f1ed4950..ebb3df150 100644 --- a/pkg/service/interfaces.go +++ b/pkg/service/interfaces.go @@ -4,7 +4,7 @@ import ( "context" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" ) //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate diff --git a/pkg/service/localroomstore.go b/pkg/service/localroomstore.go index 9bdf0a042..fd35e379e 100644 --- a/pkg/service/localroomstore.go +++ b/pkg/service/localroomstore.go @@ -5,7 +5,7 @@ import ( "sync" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" ) // encapsulates CRUD operations for room settings diff --git a/pkg/service/recordingservice.go b/pkg/service/recordingservice.go index c1c531922..5b9aef901 100644 --- a/pkg/service/recordingservice.go +++ b/pkg/service/recordingservice.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/recording" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" diff --git a/pkg/service/redisroomstore.go b/pkg/service/redisroomstore.go index 64db0e182..49123b976 100644 --- a/pkg/service/redisroomstore.go +++ b/pkg/service/redisroomstore.go @@ -5,7 +5,7 @@ import ( "time" "github.com/go-redis/redis/v8" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pkg/errors" "google.golang.org/protobuf/proto" diff --git a/pkg/service/redisroomstore_test.go b/pkg/service/redisroomstore_test.go index 2f67fdee6..71d974775 100644 --- a/pkg/service/redisroomstore_test.go +++ b/pkg/service/redisroomstore_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/service" diff --git a/pkg/service/roomallocator.go b/pkg/service/roomallocator.go index 9b4fed6da..8054dd27b 100644 --- a/pkg/service/roomallocator.go +++ b/pkg/service/roomallocator.go @@ -5,7 +5,7 @@ import ( "time" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/service/roomallocator_test.go b/pkg/service/roomallocator_test.go index 783bb493d..d851030f2 100644 --- a/pkg/service/roomallocator_test.go +++ b/pkg/service/roomallocator_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/config" diff --git a/pkg/service/roommanager.go b/pkg/service/roommanager.go index a8de05532..f8876c394 100644 --- a/pkg/service/roommanager.go +++ b/pkg/service/roommanager.go @@ -7,7 +7,7 @@ import ( "time" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/routing" diff --git a/pkg/service/roomservice.go b/pkg/service/roomservice.go index 2e9d06bef..f0898b983 100644 --- a/pkg/service/roomservice.go +++ b/pkg/service/roomservice.go @@ -3,7 +3,7 @@ package service import ( "context" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pkg/errors" "github.com/thoas/go-funk" "github.com/twitchtv/twirp" diff --git a/pkg/service/roomservice_test.go b/pkg/service/roomservice_test.go index 3c563c502..4ec3e9770 100644 --- a/pkg/service/roomservice_test.go +++ b/pkg/service/roomservice_test.go @@ -8,7 +8,7 @@ import ( "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/service/servicefakes" "github.com/livekit/protocol/auth" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" ) diff --git a/pkg/service/rtcservice.go b/pkg/service/rtcservice.go index a7de1b783..6218e4ef4 100644 --- a/pkg/service/rtcservice.go +++ b/pkg/service/rtcservice.go @@ -10,7 +10,7 @@ import ( "github.com/gorilla/websocket" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/routing" diff --git a/pkg/service/server.go b/pkg/service/server.go index 83e31fd46..3c4c23aaa 100644 --- a/pkg/service/server.go +++ b/pkg/service/server.go @@ -12,7 +12,7 @@ import ( "github.com/livekit/protocol/auth" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pion/turn/v2" "github.com/prometheus/client_golang/prometheus/promhttp" diff --git a/pkg/service/servicefakes/fake_room_allocator.go b/pkg/service/servicefakes/fake_room_allocator.go index 51f622fa6..47609f364 100644 --- a/pkg/service/servicefakes/fake_room_allocator.go +++ b/pkg/service/servicefakes/fake_room_allocator.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakeRoomAllocator struct { diff --git a/pkg/service/servicefakes/fake_room_store.go b/pkg/service/servicefakes/fake_room_store.go index 3ed10bf1b..d6c46dab7 100644 --- a/pkg/service/servicefakes/fake_room_store.go +++ b/pkg/service/servicefakes/fake_room_store.go @@ -7,7 +7,7 @@ import ( "time" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakeRoomStore struct { diff --git a/pkg/service/servicefakes/fake_roroom_store.go b/pkg/service/servicefakes/fake_roroom_store.go index 2d0850809..2469e90d6 100644 --- a/pkg/service/servicefakes/fake_roroom_store.go +++ b/pkg/service/servicefakes/fake_roroom_store.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/livekit" ) type FakeRORoomStore struct { diff --git a/pkg/service/utils.go b/pkg/service/utils.go index 001ece188..d8ff0f91c 100644 --- a/pkg/service/utils.go +++ b/pkg/service/utils.go @@ -6,7 +6,7 @@ import ( "github.com/livekit/protocol/auth" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" ) func handleError(w http.ResponseWriter, status int, msg string) { diff --git a/pkg/service/wire.go b/pkg/service/wire.go index 431f3a315..df3827ba1 100644 --- a/pkg/service/wire.go +++ b/pkg/service/wire.go @@ -10,7 +10,7 @@ import ( "github.com/go-redis/redis/v8" "github.com/google/wire" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pkg/errors" "github.com/livekit/protocol/auth" diff --git a/pkg/service/wsprotocol.go b/pkg/service/wsprotocol.go index 04349f2d0..6af4f4af6 100644 --- a/pkg/service/wsprotocol.go +++ b/pkg/service/wsprotocol.go @@ -6,7 +6,7 @@ import ( "github.com/gorilla/websocket" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" diff --git a/pkg/telemetry/analytics.go b/pkg/telemetry/analytics.go index 4106a7cdb..373fffce9 100644 --- a/pkg/telemetry/analytics.go +++ b/pkg/telemetry/analytics.go @@ -4,7 +4,7 @@ import ( "context" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/routing" diff --git a/pkg/telemetry/events.go b/pkg/telemetry/events.go index 3ebbac09c..a9fe6ad11 100644 --- a/pkg/telemetry/events.go +++ b/pkg/telemetry/events.go @@ -5,7 +5,7 @@ import ( "time" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/webhook" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/pkg/telemetry/interceptor.go b/pkg/telemetry/interceptor.go index 28b347219..daf8eecdb 100644 --- a/pkg/telemetry/interceptor.go +++ b/pkg/telemetry/interceptor.go @@ -1,7 +1,7 @@ package telemetry import ( - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/pion/interceptor" "github.com/pion/rtcp" ) diff --git a/pkg/telemetry/prometheus/node.go b/pkg/telemetry/prometheus/node.go index c66ddf702..f63d64641 100644 --- a/pkg/telemetry/prometheus/node.go +++ b/pkg/telemetry/prometheus/node.go @@ -4,7 +4,7 @@ import ( "sync/atomic" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/prometheus/client_golang/prometheus" ) diff --git a/pkg/telemetry/prometheus/node_linux.go b/pkg/telemetry/prometheus/node_linux.go index 27863c343..3ac786f65 100644 --- a/pkg/telemetry/prometheus/node_linux.go +++ b/pkg/telemetry/prometheus/node_linux.go @@ -5,7 +5,7 @@ package prometheus import ( linuxproc "github.com/c9s/goprocinfo/linux" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" ) func updateCurrentNodeSystemStats(nodeStats *livekit.NodeStats) error { diff --git a/pkg/telemetry/prometheus/node_nonlinux.go b/pkg/telemetry/prometheus/node_nonlinux.go index e713fd050..48c675833 100644 --- a/pkg/telemetry/prometheus/node_nonlinux.go +++ b/pkg/telemetry/prometheus/node_nonlinux.go @@ -3,7 +3,7 @@ package prometheus -import livekit "github.com/livekit/protocol/proto" +import livekit "github.com/livekit/protocol/livekit" func updateCurrentNodeSystemStats(nodeStats *livekit.NodeStats) error { return nil diff --git a/pkg/telemetry/service.go b/pkg/telemetry/service.go index 8176ebc8a..fb4e41d79 100644 --- a/pkg/telemetry/service.go +++ b/pkg/telemetry/service.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/gammazero/workerpool" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/webhook" "github.com/pion/rtcp" diff --git a/pkg/telemetry/statsworker.go b/pkg/telemetry/statsworker.go index 9316ecf47..726ca8d99 100644 --- a/pkg/telemetry/statsworker.go +++ b/pkg/telemetry/statsworker.go @@ -5,7 +5,7 @@ import ( "sync" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "google.golang.org/protobuf/types/known/timestamppb" "github.com/livekit/livekit-server/pkg/sfu/buffer" diff --git a/test/client/client.go b/test/client/client.go index 82b1a690c..d1e4ea16e 100644 --- a/test/client/client.go +++ b/test/client/client.go @@ -12,7 +12,7 @@ import ( "time" "github.com/gorilla/websocket" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pion/rtcp" "github.com/pion/rtp" diff --git a/test/integration_helpers.go b/test/integration_helpers.go index ca7ef96c6..032344193 100644 --- a/test/integration_helpers.go +++ b/test/integration_helpers.go @@ -11,7 +11,7 @@ import ( "github.com/go-redis/redis/v8" "github.com/livekit/protocol/auth" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/twitchtv/twirp" diff --git a/test/multinode_test.go b/test/multinode_test.go index cd1d54768..30919bbce 100644 --- a/test/multinode_test.go +++ b/test/multinode_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/livekit/livekit-server/pkg/rtc" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/testutils" diff --git a/test/scenarios.go b/test/scenarios.go index 76c93f559..5da1f8bdd 100644 --- a/test/scenarios.go +++ b/test/scenarios.go @@ -5,7 +5,7 @@ import ( "time" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/stretchr/testify/require" diff --git a/test/turn_test.go b/test/turn_test.go index 24795674b..f02b3a713 100644 --- a/test/turn_test.go +++ b/test/turn_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/pion/turn/v2" "github.com/stretchr/testify/require" diff --git a/test/webhook_test.go b/test/webhook_test.go index cbbf6f46b..a20500b6f 100644 --- a/test/webhook_test.go +++ b/test/webhook_test.go @@ -10,7 +10,7 @@ import ( "github.com/livekit/protocol/auth" "github.com/livekit/protocol/logger" - livekit "github.com/livekit/protocol/proto" + livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" "github.com/stretchr/testify/require"