Add subscriber stream start event notification (#4449)
This commit is contained in:
+5
-2
@@ -2021,8 +2021,11 @@ func (l participantTelemetryListener) OnTrackUnsubscribed(pID livekit.Participan
|
||||
l.room.telemetry.TrackUnsubscribed(context.Background(), l.room.ID(), l.room.Name(), pID, ti, shouldSendEvent)
|
||||
}
|
||||
|
||||
func (l participantTelemetryListener) OnTrackSubscribeFailed(pID livekit.ParticipantID, ti livekit.TrackID, err error, isUserError bool) {
|
||||
l.room.telemetry.TrackSubscribeFailed(context.Background(), l.room.ID(), l.room.Name(), pID, ti, err, isUserError)
|
||||
func (l participantTelemetryListener) OnTrackSubscribeFailed(pID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool) {
|
||||
l.room.telemetry.TrackSubscribeFailed(context.Background(), l.room.ID(), l.room.Name(), pID, trackID, err, isUserError)
|
||||
}
|
||||
|
||||
func (l participantTelemetryListener) OnTrackSubscribeStreamStarted(pID livekit.ParticipantID, ti *livekit.TrackInfo) {
|
||||
}
|
||||
|
||||
func (l participantTelemetryListener) OnTrackMuted(pID livekit.ParticipantID, ti *livekit.TrackInfo) {
|
||||
|
||||
@@ -480,3 +480,7 @@ func (t *SubscribedTrack) OnDownTrackClose(isExpectedToResume bool) {
|
||||
}
|
||||
t.Close(isExpectedToResume)
|
||||
}
|
||||
|
||||
func (t *SubscribedTrack) OnStreamStarted() {
|
||||
t.params.TelemetryListener.OnTrackSubscribeStreamStarted(t.params.Subscriber.ID(), t.params.MediaTrack.ToProto())
|
||||
}
|
||||
|
||||
@@ -650,7 +650,8 @@ type ParticipantTelemetryListener interface {
|
||||
OnTrackSubscribeRequested(pID livekit.ParticipantID, ti *livekit.TrackInfo)
|
||||
OnTrackSubscribed(pID livekit.ParticipantID, ti *livekit.TrackInfo, publisherInfo *livekit.ParticipantInfo, shouldSendEvent bool)
|
||||
OnTrackUnsubscribed(pID livekit.ParticipantID, ti *livekit.TrackInfo, shouldSendEvent bool)
|
||||
OnTrackSubscribeFailed(pID livekit.ParticipantID, ti livekit.TrackID, err error, isUserError bool)
|
||||
OnTrackSubscribeFailed(pID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)
|
||||
OnTrackSubscribeStreamStarted(pID livekit.ParticipantID, ti *livekit.TrackInfo)
|
||||
OnTrackMuted(pID livekit.ParticipantID, ti *livekit.TrackInfo)
|
||||
OnTrackUnmuted(pID livekit.ParticipantID, ti *livekit.TrackInfo)
|
||||
OnTrackPublishedUpdate(pID livekit.ParticipantID, ti *livekit.TrackInfo)
|
||||
@@ -677,7 +678,9 @@ func (NullParticipantTelemetryListener) OnTrackSubscribed(pID livekit.Participan
|
||||
}
|
||||
func (NullParticipantTelemetryListener) OnTrackUnsubscribed(pID livekit.ParticipantID, ti *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
}
|
||||
func (NullParticipantTelemetryListener) OnTrackSubscribeFailed(pID livekit.ParticipantID, ti livekit.TrackID, err error, isUserError bool) {
|
||||
func (NullParticipantTelemetryListener) OnTrackSubscribeFailed(pID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool) {
|
||||
}
|
||||
func (NullParticipantTelemetryListener) OnTrackSubscribeStreamStarted(pID livekit.ParticipantID, ti *livekit.TrackInfo) {
|
||||
}
|
||||
func (NullParticipantTelemetryListener) OnTrackMuted(pID livekit.ParticipantID, ti *livekit.TrackInfo) {
|
||||
}
|
||||
|
||||
@@ -83,6 +83,12 @@ type FakeParticipantTelemetryListener struct {
|
||||
arg1 livekit.ParticipantID
|
||||
arg2 *livekit.TrackInfo
|
||||
}
|
||||
OnTrackSubscribeStreamStartedStub func(livekit.ParticipantID, *livekit.TrackInfo)
|
||||
onTrackSubscribeStreamStartedMutex sync.RWMutex
|
||||
onTrackSubscribeStreamStartedArgsForCall []struct {
|
||||
arg1 livekit.ParticipantID
|
||||
arg2 *livekit.TrackInfo
|
||||
}
|
||||
OnTrackSubscribedStub func(livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool)
|
||||
onTrackSubscribedMutex sync.RWMutex
|
||||
onTrackSubscribedArgsForCall []struct {
|
||||
@@ -458,6 +464,39 @@ func (fake *FakeParticipantTelemetryListener) OnTrackSubscribeRequestedArgsForCa
|
||||
return argsForCall.arg1, argsForCall.arg2
|
||||
}
|
||||
|
||||
func (fake *FakeParticipantTelemetryListener) OnTrackSubscribeStreamStarted(arg1 livekit.ParticipantID, arg2 *livekit.TrackInfo) {
|
||||
fake.onTrackSubscribeStreamStartedMutex.Lock()
|
||||
fake.onTrackSubscribeStreamStartedArgsForCall = append(fake.onTrackSubscribeStreamStartedArgsForCall, struct {
|
||||
arg1 livekit.ParticipantID
|
||||
arg2 *livekit.TrackInfo
|
||||
}{arg1, arg2})
|
||||
stub := fake.OnTrackSubscribeStreamStartedStub
|
||||
fake.recordInvocation("OnTrackSubscribeStreamStarted", []interface{}{arg1, arg2})
|
||||
fake.onTrackSubscribeStreamStartedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.OnTrackSubscribeStreamStartedStub(arg1, arg2)
|
||||
}
|
||||
}
|
||||
|
||||
func (fake *FakeParticipantTelemetryListener) OnTrackSubscribeStreamStartedCallCount() int {
|
||||
fake.onTrackSubscribeStreamStartedMutex.RLock()
|
||||
defer fake.onTrackSubscribeStreamStartedMutex.RUnlock()
|
||||
return len(fake.onTrackSubscribeStreamStartedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeParticipantTelemetryListener) OnTrackSubscribeStreamStartedCalls(stub func(livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
fake.onTrackSubscribeStreamStartedMutex.Lock()
|
||||
defer fake.onTrackSubscribeStreamStartedMutex.Unlock()
|
||||
fake.OnTrackSubscribeStreamStartedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeParticipantTelemetryListener) OnTrackSubscribeStreamStartedArgsForCall(i int) (livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
fake.onTrackSubscribeStreamStartedMutex.RLock()
|
||||
defer fake.onTrackSubscribeStreamStartedMutex.RUnlock()
|
||||
argsForCall := fake.onTrackSubscribeStreamStartedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2
|
||||
}
|
||||
|
||||
func (fake *FakeParticipantTelemetryListener) OnTrackSubscribed(arg1 livekit.ParticipantID, arg2 *livekit.TrackInfo, arg3 *livekit.ParticipantInfo, arg4 bool) {
|
||||
fake.onTrackSubscribedMutex.Lock()
|
||||
fake.onTrackSubscribedArgsForCall = append(fake.onTrackSubscribedArgsForCall, struct {
|
||||
|
||||
Reference in New Issue
Block a user