From fa5f4ef33caf288027f5b4e5b523ca891adad23c Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Wed, 13 Aug 2025 10:53:16 +0530 Subject: [PATCH] Populate SDP cid in track info when available. (#3845) * Populate SDP cid in track info when available. - Adding SDP cid to TrackInfo. Browsers like FF uses a different stream id for AddTrack and actual SDP offer. So, have to look up using both on server side. To make it easier, store both (only if different) in TrackInfo. - Use a codec in TrackInfo for audio also. There is some discussion around doing simulcast codec for audio so that something like PSTN can use G.711 without any transcoding. So, just keep it consistent between audio and video. - Populate SDP cid when SDP offer is received. It could populate a pending track or an already published track if the new offer is for a back up codec where the primary codec is already published. - Passed around parsed offer to more places to avoid parsing multiple times. - Clean up MediaTrack interface a bit and remove unneeded methods. * WIP * WIP * deps * stream allocator mime aware * clean up * populate SDP cid before munging * interface methods --- pkg/routing/routingfakes/fake_message_sink.go | 8 - .../routingfakes/fake_message_source.go | 8 - .../routingfakes/fake_room_manager_client.go | 4 - pkg/routing/routingfakes/fake_router.go | 26 -- .../routingfakes/fake_signal_client.go | 4 - pkg/rtc/mediatrack.go | 55 ++- pkg/rtc/mediatrackreceiver.go | 50 ++- pkg/rtc/participant.go | 221 ++++++++----- pkg/rtc/participant_internal_test.go | 2 +- pkg/rtc/participant_sdp.go | 185 ++++++++--- pkg/rtc/transport.go | 7 +- .../transport/transportfakes/fake_handler.go | 26 -- pkg/rtc/transportmanager.go | 14 +- pkg/rtc/types/interfaces.go | 2 +- .../typesfakes/fake_local_media_track.go | 215 ++++-------- .../typesfakes/fake_local_participant.go | 312 ------------------ .../fake_local_participant_helper.go | 12 - pkg/rtc/types/typesfakes/fake_media_track.go | 62 ---- pkg/rtc/types/typesfakes/fake_participant.go | 48 --- pkg/rtc/types/typesfakes/fake_room.go | 14 - .../types/typesfakes/fake_subscribed_track.go | 38 --- .../types/typesfakes/fake_websocket_client.go | 10 - pkg/service/servicefakes/fake_agent_store.go | 10 - pkg/service/servicefakes/fake_egress_store.go | 8 - .../servicefakes/fake_ingress_store.go | 14 - pkg/service/servicefakes/fake_ioclient.go | 10 - pkg/service/servicefakes/fake_object_store.go | 20 -- .../servicefakes/fake_room_allocator.go | 8 - .../servicefakes/fake_service_store.go | 10 - .../servicefakes/fake_session_handler.go | 4 - pkg/service/servicefakes/fake_sipstore.go | 28 -- pkg/sfu/mime/mimetype.go | 35 ++ .../telemetryfakes/fake_analytics_service.go | 8 - .../telemetryfakes/fake_telemetry_service.go | 76 ----- 34 files changed, 503 insertions(+), 1051 deletions(-) diff --git a/pkg/routing/routingfakes/fake_message_sink.go b/pkg/routing/routingfakes/fake_message_sink.go index 70c417288..5069f8bdf 100644 --- a/pkg/routing/routingfakes/fake_message_sink.go +++ b/pkg/routing/routingfakes/fake_message_sink.go @@ -243,14 +243,6 @@ func (fake *FakeMessageSink) WriteMessageReturnsOnCall(i int, result1 error) { func (fake *FakeMessageSink) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.connectionIDMutex.RLock() - defer fake.connectionIDMutex.RUnlock() - fake.isClosedMutex.RLock() - defer fake.isClosedMutex.RUnlock() - fake.writeMessageMutex.RLock() - defer fake.writeMessageMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/routing/routingfakes/fake_message_source.go b/pkg/routing/routingfakes/fake_message_source.go index 02161abea..37eec2f14 100644 --- a/pkg/routing/routingfakes/fake_message_source.go +++ b/pkg/routing/routingfakes/fake_message_source.go @@ -234,14 +234,6 @@ func (fake *FakeMessageSource) ReadChanReturnsOnCall(i int, result1 <-chan proto func (fake *FakeMessageSource) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.connectionIDMutex.RLock() - defer fake.connectionIDMutex.RUnlock() - fake.isClosedMutex.RLock() - defer fake.isClosedMutex.RUnlock() - fake.readChanMutex.RLock() - defer fake.readChanMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/routing/routingfakes/fake_room_manager_client.go b/pkg/routing/routingfakes/fake_room_manager_client.go index d164ac1e3..6e7e652df 100644 --- a/pkg/routing/routingfakes/fake_room_manager_client.go +++ b/pkg/routing/routingfakes/fake_room_manager_client.go @@ -129,10 +129,6 @@ func (fake *FakeRoomManagerClient) CreateRoomReturnsOnCall(i int, result1 *livek func (fake *FakeRoomManagerClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.createRoomMutex.RLock() - defer fake.createRoomMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/routing/routingfakes/fake_router.go b/pkg/routing/routingfakes/fake_router.go index ca8377511..48fec0b10 100644 --- a/pkg/routing/routingfakes/fake_router.go +++ b/pkg/routing/routingfakes/fake_router.go @@ -845,32 +845,6 @@ func (fake *FakeRouter) UnregisterNodeReturnsOnCall(i int, result1 error) { func (fake *FakeRouter) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.clearRoomStateMutex.RLock() - defer fake.clearRoomStateMutex.RUnlock() - fake.createRoomMutex.RLock() - defer fake.createRoomMutex.RUnlock() - fake.drainMutex.RLock() - defer fake.drainMutex.RUnlock() - fake.getNodeForRoomMutex.RLock() - defer fake.getNodeForRoomMutex.RUnlock() - fake.getRegionMutex.RLock() - defer fake.getRegionMutex.RUnlock() - fake.listNodesMutex.RLock() - defer fake.listNodesMutex.RUnlock() - fake.registerNodeMutex.RLock() - defer fake.registerNodeMutex.RUnlock() - fake.removeDeadNodesMutex.RLock() - defer fake.removeDeadNodesMutex.RUnlock() - fake.setNodeForRoomMutex.RLock() - defer fake.setNodeForRoomMutex.RUnlock() - fake.startMutex.RLock() - defer fake.startMutex.RUnlock() - fake.startParticipantSignalMutex.RLock() - defer fake.startParticipantSignalMutex.RUnlock() - fake.stopMutex.RLock() - defer fake.stopMutex.RUnlock() - fake.unregisterNodeMutex.RLock() - defer fake.unregisterNodeMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/routing/routingfakes/fake_signal_client.go b/pkg/routing/routingfakes/fake_signal_client.go index 0562b7c44..c7eeff1b7 100644 --- a/pkg/routing/routingfakes/fake_signal_client.go +++ b/pkg/routing/routingfakes/fake_signal_client.go @@ -173,10 +173,6 @@ func (fake *FakeSignalClient) StartParticipantSignalReturnsOnCall(i int, result1 func (fake *FakeSignalClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.activeCountMutex.RLock() - defer fake.activeCountMutex.RUnlock() - fake.startParticipantSignalMutex.RLock() - defer fake.startParticipantSignalMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/mediatrack.go b/pkg/rtc/mediatrack.go index b858e2f7c..9da1d3d6e 100644 --- a/pkg/rtc/mediatrack.go +++ b/pkg/rtc/mediatrack.go @@ -64,8 +64,6 @@ type MediaTrack struct { } type MediaTrackParams struct { - SignalCid string - SdpCid string ParticipantID func() livekit.ParticipantID ParticipantIdentity livekit.ParticipantIdentity ParticipantVersion uint32 @@ -191,15 +189,7 @@ func (t *MediaTrack) ClearSubscriberNodesMaxQuality() { } } -func (t *MediaTrack) SignalCid() string { - return t.params.SignalCid -} - -func (t *MediaTrack) HasSdpCid(cid string) bool { - if t.params.SdpCid == cid { - return true - } - +func (t *MediaTrack) HasSignalCid(cid string) bool { ti := t.MediaTrackReceiver.TrackInfoClone() for _, c := range ti.Codecs { if c.Cid == cid { @@ -209,6 +199,36 @@ func (t *MediaTrack) HasSdpCid(cid string) bool { return false } +func (t *MediaTrack) HasSdpCid(cid string) bool { + ti := t.MediaTrackReceiver.TrackInfoClone() + for _, c := range ti.Codecs { + if c.Cid == cid || c.SdpCid == cid { + return true + } + } + return false +} + +func (t *MediaTrack) GetMimeTypeForSdpCid(cid string) mime.MimeType { + ti := t.MediaTrackReceiver.TrackInfoClone() + for _, c := range ti.Codecs { + if c.Cid == cid || c.SdpCid == cid { + return mime.NormalizeMimeType(c.MimeType) + } + } + return mime.MimeTypeUnknown +} + +func (t *MediaTrack) GetCidsForMimeType(mimeType mime.MimeType) (string, string) { + ti := t.MediaTrackReceiver.TrackInfoClone() + for _, c := range ti.Codecs { + if mime.NormalizeMimeType(c.MimeType) == mimeType { + return c.Cid, c.SdpCid + } + } + return "", "" +} + func (t *MediaTrack) ToProto() *livekit.TrackInfo { return t.MediaTrackReceiver.TrackInfoClone() } @@ -300,6 +320,11 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track sfu.TrackRe switch len(ti.Codecs) { case 0: // audio track + t.params.Logger.Warnw( + "unexpected 0 codecs in track info", nil, + "mime", mimeType, + "track", logger.Proto(ti), + ) priority = 0 case 1: // older clients or non simulcast-codec, mime type only set later @@ -309,7 +334,11 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track sfu.TrackRe } } if priority < 0 { - t.params.Logger.Warnw("could not find codec for webrtc receiver", nil, "webrtcCodec", mimeType, "track", logger.Proto(ti)) + t.params.Logger.Warnw( + "could not find codec for webrtc receiver", nil, + "mime", mimeType, + "track", logger.Proto(ti), + ) t.lock.Unlock() return newCodec, false } @@ -486,7 +515,7 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track sfu.TrackRe } func (t *MediaTrack) GetConnectionScoreAndQuality() (float32, livekit.ConnectionQuality) { - receiver := t.PrimaryReceiver() + receiver := t.ActiveReceiver() if rtcReceiver, ok := receiver.(*sfu.WebRTCReceiver); ok { return rtcReceiver.GetConnectionScoreAndQuality() } diff --git a/pkg/rtc/mediatrackreceiver.go b/pkg/rtc/mediatrackreceiver.go index 7d6079a4b..b0ba9c3be 100644 --- a/pkg/rtc/mediatrackreceiver.go +++ b/pkg/rtc/mediatrackreceiver.go @@ -711,7 +711,6 @@ func (t *MediaTrackReceiver) UpdateCodecInfo(codecs []*livekit.SimulcastCodec) { mimeType := mime.NormalizeMimeType(origin.MimeType) for _, layer := range origin.Layers { layer.SpatialLayer = buffer.VideoQualityToSpatialLayer(mimeType, layer.Quality, trackInfo) - // SIMULCAST-CODEC-TODO: need to map RIDs from SDP -> SimulcastCodecInfo layer.Rid = buffer.VideoQualityToRid(mimeType, layer.Quality, trackInfo, buffer.DefaultVideoLayersRid) } } @@ -726,6 +725,43 @@ func (t *MediaTrackReceiver) UpdateCodecInfo(codecs []*livekit.SimulcastCodec) { t.updateTrackInfoOfReceivers() } +func (t *MediaTrackReceiver) UpdateCodecSdpCid(mimeType mime.MimeType, sdpCid string) { + t.lock.Lock() + trackInfo := t.TrackInfoClone() + for _, origin := range trackInfo.Codecs { + if mime.NormalizeMimeType(origin.MimeType) == mimeType { + if sdpCid != origin.Cid { + origin.SdpCid = sdpCid + } + } + } + t.trackInfo.Store(trackInfo) + t.lock.Unlock() + + t.updateTrackInfoOfReceivers() +} + +func (t *MediaTrackReceiver) UpdateCodecRids(mimeType mime.MimeType, rids buffer.VideoLayersRid) { + t.lock.Lock() + trackInfo := t.TrackInfoClone() + for _, origin := range trackInfo.Codecs { + originMimeType := mime.NormalizeMimeType(origin.MimeType) + if originMimeType != mimeType { + continue + } + + for _, layer := range origin.Layers { + layer.SpatialLayer = buffer.VideoQualityToSpatialLayer(mimeType, layer.Quality, trackInfo) + layer.Rid = buffer.VideoQualityToRid(mimeType, layer.Quality, trackInfo, rids) + } + break + } + t.trackInfo.Store(trackInfo) + t.lock.Unlock() + + t.updateTrackInfoOfReceivers() +} + func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo) { updateMute := false clonedInfo := utils.CloneProto(ti) @@ -915,7 +951,7 @@ func (t *MediaTrackReceiver) GetQualityForDimension(mimeType mime.MimeType, widt } func (t *MediaTrackReceiver) GetAudioLevel() (float64, bool) { - receiver := t.PrimaryReceiver() + receiver := t.ActiveReceiver() if receiver == nil { return 0, false } @@ -960,6 +996,16 @@ func (t *MediaTrackReceiver) PrimaryReceiver() sfu.TrackReceiver { return receivers[0].TrackReceiver } +func (t *MediaTrackReceiver) ActiveReceiver() sfu.TrackReceiver { + for _, r := range t.loadReceivers() { + if r.IsRegressed() { + return r.TrackReceiver + } + } + + return t.PrimaryReceiver() +} + func (t *MediaTrackReceiver) Receiver(mime mime.MimeType) sfu.TrackReceiver { for _, r := range t.loadReceivers() { if r.Mime() == mime { diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 6cdbca123..ec91ad118 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -27,6 +27,7 @@ import ( "github.com/frostbyte73/core" lru "github.com/hashicorp/golang-lru/v2" "github.com/pion/rtcp" + "github.com/pion/sdp/v3" "github.com/pion/webrtc/v4" "github.com/pkg/errors" "go.uber.org/atomic" @@ -1009,13 +1010,8 @@ func (p *ParticipantImpl) HandleSignalSourceClose() { } } -func (p *ParticipantImpl) synthesizeAddTrackRequests(offer webrtc.SessionDescription) error { - parsed, err := offer.Unmarshal() - if err != nil { - return err - } - - for _, m := range parsed.MediaDescriptions { +func (p *ParticipantImpl) synthesizeAddTrackRequests(parsedOffer *sdp.SessionDescription) error { + for _, m := range parsedOffer.MediaDescriptions { if !strings.EqualFold(m.MediaName.Media, "audio") && !strings.EqualFold(m.MediaName.Media, "video") { continue } @@ -1068,18 +1064,9 @@ func (p *ParticipantImpl) synthesizeAddTrackRequests(offer webrtc.SessionDescrip return nil } -func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) { - if offer == nil { - return - } - - parsed, err := offer.Unmarshal() - if err != nil { - return - } - +func (p *ParticipantImpl) updateRidsFromSDP(parsed *sdp.SessionDescription, unmatchVideos []*sdp.MediaDescription) { for _, m := range parsed.MediaDescriptions { - if m.MediaName.Media != "video" { + if m.MediaName.Media != "video" || !slices.Contains(unmatchVideos, m) { continue } @@ -1088,33 +1075,75 @@ func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) { continue } - // SIMULCAST-CODEC-TODO - have to update published track's TrackInfo when backup codec starts publishing - - p.pendingTracksLock.Lock() - pti := p.pendingTracks[mst] - if pti != nil { + getRids := func(inRids buffer.VideoLayersRid) buffer.VideoLayersRid { + var outRids buffer.VideoLayersRid rids, ok := sdpHelper.GetSimulcastRids(m) if ok { - // does not work for clients that use a different media stream track in SDP (e.g. Firefox) - // one option is to look up by track type, but that fails when there are multiple pending tracks - // of the same type - n := min(len(rids), len(pti.sdpRids)) + n := min(len(rids), len(inRids)) for i := 0; i < n; i++ { - pti.sdpRids[i] = rids[i] + outRids[i] = rids[i] } - for i := n; i < len(pti.sdpRids); i++ { - pti.sdpRids[i] = "" + for i := n; i < len(inRids); i++ { + outRids[i] = "" } - pti.sdpRids = buffer.NormalizeVideoLayersRid(pti.sdpRids) + outRids = buffer.NormalizeVideoLayersRid(outRids) + } else { + for i := 0; i < len(inRids); i++ { + outRids[i] = "" + } + } - p.pubLogger.Debugw( - "pending track rids updated", - "trackID", pti.trackInfos[0].Sid, - "pendingTrack", pti, - ) + return outRids + } + + p.pendingTracksLock.Lock() + pti := p.getPendingTrackPrimaryBySdpCid(mst, true) + if pti != nil { + pti.sdpRids = getRids(pti.sdpRids) + p.pubLogger.Debugw( + "pending track rids updated", + "trackID", pti.trackInfos[0].Sid, + "pendingTrack", pti, + ) + + ti := pti.trackInfos[0] + for _, codec := range ti.Codecs { + if codec.Cid == mst || codec.SdpCid == mst { + mimeType := mime.NormalizeMimeType(codec.MimeType) + for _, layer := range codec.Layers { + layer.SpatialLayer = buffer.VideoQualityToSpatialLayer(mimeType, layer.Quality, ti) + layer.Rid = buffer.VideoQualityToRid(mimeType, layer.Quality, ti, pti.sdpRids) + } + } } } p.pendingTracksLock.Unlock() + + if pti == nil { + // track could already be published, but this could be back up codec offer, + // so check in published tracks also + mt := p.getPublishedTrackBySdpCid(mst) + if mt != nil { + mimeType := mt.(*MediaTrack).GetMimeTypeForSdpCid(mst) + if mimeType != mime.MimeTypeUnknown { + rids := getRids(buffer.DefaultVideoLayersRid) + mt.(*MediaTrack).UpdateCodecRids(mimeType, rids) + p.pubLogger.Debugw( + "published track rids updated", + "trackID", mt.ID(), + "mime", mimeType, + "track", logger.Proto(mt.ToProto()), + ) + } else { + p.pubLogger.Warnw( + "could not get mime type for sdp cid", nil, + "trackID", mt.ID(), + "sdpCid", mst, + "track", logger.Proto(mt.ToProto()), + ) + } + } + } } } @@ -1127,25 +1156,50 @@ func (p *ParticipantImpl) HandleOffer(offer webrtc.SessionDescription, offerId u "offerId", offerId, ) + parsedOffer, err := offer.Unmarshal() + if err != nil { + p.pubLogger.Warnw( + "could not parse offer", err, + "transport", livekit.SignalTarget_PUBLISHER, + "offer", offer, + "offerId", offerId, + ) + return err + } + if p.params.UseOneShotSignallingMode { - if err := p.synthesizeAddTrackRequests(offer); err != nil { + if err := p.synthesizeAddTrackRequests(parsedOffer); err != nil { return err } } - shouldPend := false - if p.MigrateState() == types.MigrateStateInit { - shouldPend = true + unmatchAudios, unmatchVideos := p.populateSdpCid(parsedOffer) + parsedOffer = p.setCodecPreferencesForPublisher(parsedOffer, unmatchAudios, unmatchVideos) + p.updateRidsFromSDP(parsedOffer, unmatchVideos) + + // put together munged offer after setting codec preferences + bytes, err := parsedOffer.Marshal() + if err != nil { + p.pubLogger.Errorw("failed to marshal offer", err) + return err + } + + offer = webrtc.SessionDescription{ + Type: offer.Type, + SDP: string(bytes), + } + + err = p.TransportManager.HandleOffer(offer, offerId, p.MigrateState() == types.MigrateStateInit) + if err != nil { + return err } - offer = p.setCodecPreferencesForPublisher(offer) - p.updateRidsFromSDP(&offer) - err := p.TransportManager.HandleOffer(offer, offerId, shouldPend) if p.params.UseOneShotSignallingMode { if onSubscriberReady := p.getOnSubscriberReady(); onSubscriberReady != nil { go onSubscriberReady(p) } } + return err } @@ -1217,7 +1271,12 @@ func (p *ParticipantImpl) handleMigrateTracks() []*MediaTrack { } if len(pti.trackInfos) > 1 { - p.pubLogger.Warnw("too many pending migrated tracks", nil, "trackID", pti.trackInfos[0].Sid, "count", len(pti.trackInfos), "cid", cid) + p.pubLogger.Warnw( + "too many pending migrated tracks", nil, + "trackID", pti.trackInfos[0].Sid, + "count", len(pti.trackInfos), + "cid", cid, + ) } mt := p.addMigratedTrack(cid, pti.trackInfos[0]) @@ -1282,20 +1341,18 @@ func (p *ParticipantImpl) SetMigrateInfo( p.pendingTracks[t.GetCid()] = &pendingTrackInfo{ trackInfos: []*livekit.TrackInfo{ti}, - sdpRids: buffer.DefaultVideoLayersRid, migrated: true, createdAt: time.Now(), } p.pubLogger.Infow( "pending track added (migration)", "trackID", ti.Sid, + "cid", t.GetCid(), "pendingTrack", p.pendingTracks[t.GetCid()], ) } p.pendingTracksLock.Unlock() - p.updateRidsFromSDP(previousOffer) - if len(mediaTracks) != 0 { p.setIsPublisher(true) } @@ -2627,8 +2684,7 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l } track.(*MediaTrack).UpdateCodecInfo(req.SimulcastCodecs) - ti := track.ToProto() - return ti + return track.ToProto() } backupCodecPolicy := req.BackupCodecPolicy @@ -2637,6 +2693,10 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l } cloneLayers := func(layers []*livekit.VideoLayer) []*livekit.VideoLayer { + if len(layers) == 0 { + return nil + } + clonedLayers := make([]*livekit.VideoLayer, 0, len(layers)) for _, l := range layers { clonedLayers = append(clonedLayers, utils.CloneProto(l)) @@ -2672,13 +2732,11 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l p.setTrackID(req.Cid, ti) if len(req.SimulcastCodecs) == 0 { - if req.Type == livekit.TrackType_VIDEO { - // clients not supporting simulcast codecs, synthesise a codec - ti.Codecs = append(ti.Codecs, &livekit.SimulcastCodecInfo{ - Cid: req.Cid, - Layers: cloneLayers(req.Layers), - }) - } + // clients not supporting simulcast codecs, synthesise a codec + ti.Codecs = append(ti.Codecs, &livekit.SimulcastCodecInfo{ + Cid: req.Cid, + Layers: cloneLayers(req.Layers), + }) } else { seenCodecs := make(map[string]struct{}) for _, codec := range req.SimulcastCodecs { @@ -2944,15 +3002,7 @@ func (p *ParticipantImpl) mediaTrackReceived(track sfu.TrackRemote, rtpReceiver layer.Rid = buffer.VideoQualityToRid(mimeType, layer.Quality, ti, sdpRids) } - for _, codec := range ti.Codecs { - mimeType := mime.NormalizeMimeType(codec.MimeType) - for _, layer := range codec.Layers { - layer.SpatialLayer = buffer.VideoQualityToSpatialLayer(mimeType, layer.Quality, ti) - layer.Rid = buffer.VideoQualityToRid(mimeType, layer.Quality, ti, sdpRids) - } - } - - mt = p.addMediaTrack(signalCid, track.ID(), ti) + mt = p.addMediaTrack(signalCid, ti) newTrack = true // if the addTrackRequest is sent before participant active then it means the client tries to publish @@ -2964,7 +3014,6 @@ func (p *ParticipantImpl) mediaTrackReceived(track sfu.TrackRemote, rtpReceiver pubTime = time.Since(createdAt) p.dirty.Store(true) } - p.pendingTracksLock.Unlock() _, isReceiverAdded := mt.AddReceiver(rtpReceiver, track, mid) @@ -3011,11 +3060,15 @@ func (p *ParticipantImpl) addMigratedTrack(cid string, ti *livekit.TrackInfo) *M p.pubLogger.Infow("add migrated track", "cid", cid, "trackID", ti.Sid, "track", logger.Proto(ti)) rtpReceiver := p.TransportManager.GetPublisherRTPReceiver(ti.Mid) if rtpReceiver == nil { - p.pubLogger.Errorw("could not find receiver for migrated track", nil, "trackID", ti.Sid, "mid", ti.Mid) + p.pubLogger.Errorw( + "could not find receiver for migrated track", nil, + "trackID", ti.Sid, + "mid", ti.Mid, + ) return nil } - mt := p.addMediaTrack(cid, cid, ti) + mt := p.addMediaTrack(cid, ti) potentialCodecs := make([]webrtc.RTPCodecParameters, 0, len(ti.Codecs)) parameters := rtpReceiver.GetParameters() @@ -3058,10 +3111,8 @@ func (p *ParticipantImpl) addMigratedTrack(cid string, ti *livekit.TrackInfo) *M return mt } -func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *livekit.TrackInfo) *MediaTrack { +func (p *ParticipantImpl) addMediaTrack(signalCid string, ti *livekit.TrackInfo) *MediaTrack { mt := NewMediaTrack(MediaTrackParams{ - SignalCid: signalCid, - SdpCid: sdpCid, ParticipantID: p.ID, ParticipantIdentity: p.params.Identity, ParticipantVersion: p.version.Load(), @@ -3112,12 +3163,12 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *liv } trackID := livekit.TrackID(ti.Sid) - mt.AddOnClose(func(isExpectedToRsume bool) { + mt.AddOnClose(func(isExpectedToResume bool) { if p.supervisor != nil { p.supervisor.ClearPublishedTrack(trackID, mt) } - if !isExpectedToRsume { + if !isExpectedToResume { p.params.Telemetry.TrackUnpublished( context.Background(), p.ID(), @@ -3137,7 +3188,12 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *liv p.dirty.Store(true) - p.pubLogger.Debugw("track unpublished", "trackID", ti.Sid, "expectedToRsume", isExpectedToRsume, "track", logger.Proto(ti)) + p.pubLogger.Debugw( + "track unpublished", + "trackID", ti.Sid, + "expectedToResume", isExpectedToResume, + "track", logger.Proto(ti), + ) if onTrackUnpublished := p.getOnTrackUnpublished(); onTrackUnpublished != nil { onTrackUnpublished(p, mt) } @@ -3232,6 +3288,20 @@ func (p *ParticipantImpl) getPendingTrack(clientId string, kind livekit.TrackTyp return signalCid, utils.CloneProto(pendingInfo.trackInfos[0]), pendingInfo.sdpRids, pendingInfo.migrated, pendingInfo.createdAt } +func (p *ParticipantImpl) getPendingTrackPrimaryBySdpCid(sdpCid string, skipQueued bool) *pendingTrackInfo { + for _, pti := range p.pendingTracks { + ti := pti.trackInfos[0] + if len(ti.Codecs) == 0 { + continue + } + if ti.Codecs[0].Cid == sdpCid || ti.Codecs[0].SdpCid == sdpCid { + return pti + } + } + + return nil +} + // setTrackID either generates a new TrackID for an AddTrackRequest func (p *ParticipantImpl) setTrackID(cid string, info *livekit.TrackInfo) { var trackID string @@ -3266,7 +3336,8 @@ func (p *ParticipantImpl) setTrackID(cid string, info *livekit.TrackInfo) { func (p *ParticipantImpl) getPublishedTrackBySignalCid(clientId string) types.MediaTrack { for _, publishedTrack := range p.GetPublishedTracks() { - if publishedTrack.(types.LocalMediaTrack).SignalCid() == clientId { + if publishedTrack.(types.LocalMediaTrack).HasSignalCid(clientId) { + p.pubLogger.Debugw("found track by signal cid", "signalCid", clientId, "trackID", publishedTrack.ID()) return publishedTrack } } diff --git a/pkg/rtc/participant_internal_test.go b/pkg/rtc/participant_internal_test.go index 213d11511..a342ee81d 100644 --- a/pkg/rtc/participant_internal_test.go +++ b/pkg/rtc/participant_internal_test.go @@ -140,7 +140,7 @@ func TestTrackPublishing(t *testing.T) { sink := p.params.Sink.(*routingfakes.FakeMessageSink) track := &typesfakes.FakeLocalMediaTrack{} - track.SignalCidReturns("cid") + track.HasSignalCidCalls(func(s string) bool { return s == "cid" }) track.ToProtoReturns(&livekit.TrackInfo{}) // directly add to publishedTracks without lock - for testing purpose only p.UpTrackManager.publishedTracks["cid"] = track diff --git a/pkg/rtc/participant_sdp.go b/pkg/rtc/participant_sdp.go index 046e6f710..c16ce7d89 100644 --- a/pkg/rtc/participant_sdp.go +++ b/pkg/rtc/participant_sdp.go @@ -22,23 +22,145 @@ import ( "github.com/pion/sdp/v3" "github.com/pion/webrtc/v4" + "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/sfu/mime" "github.com/livekit/protocol/livekit" lksdp "github.com/livekit/protocol/sdp" + "github.com/livekit/protocol/utils" ) -func (p *ParticipantImpl) setCodecPreferencesForPublisher(offer webrtc.SessionDescription) webrtc.SessionDescription { - offer = p.setCodecPreferencesOpusRedForPublisher(offer) - offer = p.setCodecPreferencesVideoForPublisher(offer) - return offer -} +func (p *ParticipantImpl) populateSdpCid(parsedOffer *sdp.SessionDescription) ([]*sdp.MediaDescription, []*sdp.MediaDescription) { + processUnmatch := func(unmatches []*sdp.MediaDescription, trackType livekit.TrackType) { + for _, unmatch := range unmatches { + streamID, ok := lksdp.ExtractStreamID(unmatch) + if !ok { + continue + } -func (p *ParticipantImpl) setCodecPreferencesOpusRedForPublisher(offer webrtc.SessionDescription) webrtc.SessionDescription { - parsed, unmatchAudios, err := p.TransportManager.GetUnmatchMediaForOffer(offer, "audio") - if err != nil || len(unmatchAudios) == 0 { - return offer + sdpCodecs, err := lksdp.CodecsFromMediaDescription(unmatch) + if err != nil || len(sdpCodecs) == 0 { + p.pubLogger.Errorw( + "extract codecs from media section failed", err, + "media", unmatch, + "parsedOffer", parsedOffer, + ) + continue + } + + p.pendingTracksLock.Lock() + signalCid, info, _, migrated, _ := p.getPendingTrack(streamID, trackType, false) + if migrated { + p.pendingTracksLock.Unlock() + continue + } + + if info == nil { + p.pendingTracksLock.Unlock() + + // could be already published track and the unmatch could be a back up codec publish + numUnmatchedTracks := 0 + var unmatchedTrack types.MediaTrack + var unmatchedSdpMimeType mime.MimeType + + found := false + for _, sdpCodec := range sdpCodecs { + sdpMimeType := mime.NormalizeMimeTypeCodec(sdpCodec.Name).ToMimeType() + for _, publishedTrack := range p.GetPublishedTracks() { + if sigCid, sdpCid := publishedTrack.(*MediaTrack).GetCidsForMimeType(sdpMimeType); sigCid != "" && sdpCid == "" { + // a back up codec has a SDP cid match + if sigCid == streamID { + found = true + break + } else { + numUnmatchedTracks++ + unmatchedTrack = publishedTrack + unmatchedSdpMimeType = sdpMimeType + } + } + } + if found { + break + } + } + if !found && unmatchedTrack != nil { + if numUnmatchedTracks != 1 { + p.pubLogger.Warnw( + "too many unmatched tracks", nil, + "media", unmatch, + "parsedOffer", parsedOffer, + ) + } + unmatchedTrack.(*MediaTrack).UpdateCodecSdpCid(unmatchedSdpMimeType, streamID) + } + continue + } + + found := false + updated := false + for _, sdpCodec := range sdpCodecs { + if mime.NormalizeMimeTypeCodec(sdpCodec.Name) == mime.GetMimeTypeCodec(info.Codecs[0].MimeType) { + // set SdpCid only if different from SignalCid + if streamID != info.Codecs[0].Cid { + info.Codecs[0].SdpCid = streamID + updated = true + } + found = true + break + } + if found { + break + } + } + + if !found { + // not using SimulcastCodec, i. e. mime type not available till track publish + if len(info.Codecs) == 1 { + // set SdpCid only if different from SignalCid + if streamID != info.Codecs[0].Cid { + info.Codecs[0].SdpCid = streamID + updated = true + } + } + } + + if updated { + p.pendingTracks[signalCid].trackInfos[0] = utils.CloneProto(info) + } + p.pendingTracksLock.Unlock() + } } + unmatchAudios, err := p.TransportManager.GetUnmatchMediaForOffer(parsedOffer, "audio") + if err != nil { + p.pubLogger.Warnw("could not get unmatch audios", err) + return nil, nil + } + + unmatchVideos, err := p.TransportManager.GetUnmatchMediaForOffer(parsedOffer, "video") + if err != nil { + p.pubLogger.Warnw("could not get unmatch audios", err) + return nil, nil + } + + processUnmatch(unmatchAudios, livekit.TrackType_AUDIO) + processUnmatch(unmatchVideos, livekit.TrackType_VIDEO) + return unmatchAudios, unmatchVideos +} + +func (p *ParticipantImpl) setCodecPreferencesForPublisher( + parsedOffer *sdp.SessionDescription, + unmatchAudios []*sdp.MediaDescription, + unmatchVideos []*sdp.MediaDescription, +) *sdp.SessionDescription { + parsedOffer = p.setCodecPreferencesOpusRedForPublisher(parsedOffer, unmatchAudios) + parsedOffer = p.setCodecPreferencesVideoForPublisher(parsedOffer, unmatchVideos) + return parsedOffer +} + +func (p *ParticipantImpl) setCodecPreferencesOpusRedForPublisher( + parsedOffer *sdp.SessionDescription, + unmatchAudios []*sdp.MediaDescription, +) *sdp.SessionDescription { for _, unmatchAudio := range unmatchAudios { streamID, ok := lksdp.ExtractStreamID(unmatchAudio) if !ok { @@ -53,7 +175,11 @@ func (p *ParticipantImpl) setCodecPreferencesOpusRedForPublisher(offer webrtc.Se codecs, err := lksdp.CodecsFromMediaDescription(unmatchAudio) if err != nil { - p.pubLogger.Errorw("extract codecs from media section failed", err, "media", unmatchAudio, "offer", offer) + p.pubLogger.Errorw( + "extract codecs from media section failed", err, + "media", unmatchAudio, + "parsedOffer", parsedOffer, + ) continue } @@ -102,23 +228,13 @@ func (p *ParticipantImpl) setCodecPreferencesOpusRedForPublisher(offer webrtc.Se unmatchAudio.MediaName.Formats = append(unmatchAudio.MediaName.Formats, leftCodecs...) } - bytes, err := parsed.Marshal() - if err != nil { - p.pubLogger.Errorw("failed to marshal offer", err) - return offer - } - - return webrtc.SessionDescription{ - Type: offer.Type, - SDP: string(bytes), - } + return parsedOffer } -func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.SessionDescription) webrtc.SessionDescription { - parsed, unmatchVideos, err := p.TransportManager.GetUnmatchMediaForOffer(offer, "video") - if err != nil || len(unmatchVideos) == 0 { - return offer - } +func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher( + parsedOffer *sdp.SessionDescription, + unmatchVideos []*sdp.MediaDescription, +) *sdp.SessionDescription { // unmatched video is pending for publish, set codec preference for _, unmatchVideo := range unmatchVideos { streamID, ok := lksdp.ExtractStreamID(unmatchVideo) @@ -141,7 +257,7 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess } var mimeType string for _, c := range info.Codecs { - if c.Cid == streamID { + if c.Cid == streamID || c.SdpCid == streamID { mimeType = c.MimeType break } @@ -154,7 +270,11 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess if mimeType != "" { codecs, err := lksdp.CodecsFromMediaDescription(unmatchVideo) if err != nil { - p.pubLogger.Errorw("extract codecs from media section failed", err, "media", unmatchVideo, "offer", offer) + p.pubLogger.Errorw( + "extract codecs from media section failed", err, + "media", unmatchVideo, + "parsedOffer", parsedOffer, + ) continue } @@ -175,16 +295,7 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess } } - bytes, err := parsed.Marshal() - if err != nil { - p.pubLogger.Errorw("failed to marshal offer", err) - return offer - } - - return webrtc.SessionDescription{ - Type: offer.Type, - SDP: string(bytes), - } + return parsedOffer } // configure publisher answer for audio track's dtx and stereo settings diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index cb9a19811..e4af28af2 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -41,6 +41,7 @@ import ( "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/rtc/transport" "github.com/livekit/livekit-server/pkg/rtc/types" + "github.com/livekit/livekit-server/pkg/sfu/buffer" "github.com/livekit/livekit-server/pkg/sfu/bwe" "github.com/livekit/livekit-server/pkg/sfu/bwe/remotebwe" "github.com/livekit/livekit-server/pkg/sfu/bwe/sendsidebwe" @@ -1717,9 +1718,13 @@ func (t *PCTransport) AddTrackToStreamAllocator(subTrack types.SubscribedTrack) return } + layers := buffer.GetVideoLayersForMimeType( + subTrack.DownTrack().Mime(), + subTrack.MediaTrack().ToProto(), + ) t.streamAllocator.AddTrack(subTrack.DownTrack(), streamallocator.AddTrackParams{ Source: subTrack.MediaTrack().Source(), - IsMultiLayered: len(subTrack.MediaTrack().ToProto().GetLayers()) > 1, + IsMultiLayered: len(layers) > 1, PublisherID: subTrack.MediaTrack().PublisherID(), }) } diff --git a/pkg/rtc/transport/transportfakes/fake_handler.go b/pkg/rtc/transport/transportfakes/fake_handler.go index fd46b60ba..05618f8bd 100644 --- a/pkg/rtc/transport/transportfakes/fake_handler.go +++ b/pkg/rtc/transport/transportfakes/fake_handler.go @@ -635,32 +635,6 @@ func (fake *FakeHandler) OnTrackArgsForCall(i int) (*webrtc.TrackRemote, *webrtc func (fake *FakeHandler) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.onAnswerMutex.RLock() - defer fake.onAnswerMutex.RUnlock() - fake.onDataMessageMutex.RLock() - defer fake.onDataMessageMutex.RUnlock() - fake.onDataMessageUnlabeledMutex.RLock() - defer fake.onDataMessageUnlabeledMutex.RUnlock() - fake.onDataSendErrorMutex.RLock() - defer fake.onDataSendErrorMutex.RUnlock() - fake.onFailedMutex.RLock() - defer fake.onFailedMutex.RUnlock() - fake.onFullyEstablishedMutex.RLock() - defer fake.onFullyEstablishedMutex.RUnlock() - fake.onICECandidateMutex.RLock() - defer fake.onICECandidateMutex.RUnlock() - fake.onInitialConnectedMutex.RLock() - defer fake.onInitialConnectedMutex.RUnlock() - fake.onNegotiationFailedMutex.RLock() - defer fake.onNegotiationFailedMutex.RUnlock() - fake.onNegotiationStateChangedMutex.RLock() - defer fake.onNegotiationStateChangedMutex.RUnlock() - fake.onOfferMutex.RLock() - defer fake.onOfferMutex.RUnlock() - fake.onStreamStateChangeMutex.RLock() - defer fake.onStreamStateChangeMutex.RUnlock() - fake.onTrackMutex.RLock() - defer fake.onTrackMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/transportmanager.go b/pkg/rtc/transportmanager.go index c10fd0840..a064fdf4c 100644 --- a/pkg/rtc/transportmanager.go +++ b/pkg/rtc/transportmanager.go @@ -392,14 +392,8 @@ func (t *TransportManager) createDataChannelsForSubscriber(pendingDataChannels [ return nil } -func (t *TransportManager) GetUnmatchMediaForOffer(offer webrtc.SessionDescription, mediaType string) (parsed *sdp.SessionDescription, unmatched []*sdp.MediaDescription, err error) { +func (t *TransportManager) GetUnmatchMediaForOffer(parsedOffer *sdp.SessionDescription, mediaType string) (unmatched []*sdp.MediaDescription, err error) { // prefer codec from offer for clients that don't support setCodecPreferences - parsed, err = offer.Unmarshal() - if err != nil { - t.params.Logger.Errorw("failed to parse offer for codec preference", err) - return - } - var lastMatchedMid string lastAnswer := t.lastPublisherAnswer.Load() if lastAnswer != nil { @@ -408,7 +402,7 @@ func (t *TransportManager) GetUnmatchMediaForOffer(offer webrtc.SessionDescripti if err1 != nil { // should not happen t.params.Logger.Errorw("failed to parse last answer", err1) - return parsed, unmatched, err1 + return unmatched, err1 } for i := len(parsedAnswer.MediaDescriptions) - 1; i >= 0; i-- { @@ -420,8 +414,8 @@ func (t *TransportManager) GetUnmatchMediaForOffer(offer webrtc.SessionDescripti } } - for i := len(parsed.MediaDescriptions) - 1; i >= 0; i-- { - media := parsed.MediaDescriptions[i] + for i := len(parsedOffer.MediaDescriptions) - 1; i >= 0; i-- { + media := parsedOffer.MediaDescriptions[i] if media.MediaName.Media == mediaType { mid, _ := media.Attribute(sdp.AttrKeyMID) if mid == lastMatchedMid { diff --git a/pkg/rtc/types/interfaces.go b/pkg/rtc/types/interfaces.go index 95d4afd65..020d3cf72 100644 --- a/pkg/rtc/types/interfaces.go +++ b/pkg/rtc/types/interfaces.go @@ -610,7 +610,7 @@ type LocalMediaTrack interface { Restart() - SignalCid() string + HasSignalCid(cid string) bool HasSdpCid(cid string) bool GetConnectionScoreAndQuality() (float32, livekit.ConnectionQuality) diff --git a/pkg/rtc/types/typesfakes/fake_local_media_track.go b/pkg/rtc/types/typesfakes/fake_local_media_track.go index cca91feed..115e0ac45 100644 --- a/pkg/rtc/types/typesfakes/fake_local_media_track.go +++ b/pkg/rtc/types/typesfakes/fake_local_media_track.go @@ -135,6 +135,17 @@ type FakeLocalMediaTrack struct { hasSdpCidReturnsOnCall map[int]struct { result1 bool } + HasSignalCidStub func(string) bool + hasSignalCidMutex sync.RWMutex + hasSignalCidArgsForCall []struct { + arg1 string + } + hasSignalCidReturns struct { + result1 bool + } + hasSignalCidReturnsOnCall map[int]struct { + result1 bool + } IDStub func() livekit.TrackID iDMutex sync.RWMutex iDArgsForCall []struct { @@ -303,16 +314,6 @@ type FakeLocalMediaTrack struct { setRTTArgsForCall []struct { arg1 uint32 } - SignalCidStub func() string - signalCidMutex sync.RWMutex - signalCidArgsForCall []struct { - } - signalCidReturns struct { - result1 string - } - signalCidReturnsOnCall map[int]struct { - result1 string - } SourceStub func() livekit.TrackSource sourceMutex sync.RWMutex sourceArgsForCall []struct { @@ -1004,6 +1005,67 @@ func (fake *FakeLocalMediaTrack) HasSdpCidReturnsOnCall(i int, result1 bool) { }{result1} } +func (fake *FakeLocalMediaTrack) HasSignalCid(arg1 string) bool { + fake.hasSignalCidMutex.Lock() + ret, specificReturn := fake.hasSignalCidReturnsOnCall[len(fake.hasSignalCidArgsForCall)] + fake.hasSignalCidArgsForCall = append(fake.hasSignalCidArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.HasSignalCidStub + fakeReturns := fake.hasSignalCidReturns + fake.recordInvocation("HasSignalCid", []interface{}{arg1}) + fake.hasSignalCidMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeLocalMediaTrack) HasSignalCidCallCount() int { + fake.hasSignalCidMutex.RLock() + defer fake.hasSignalCidMutex.RUnlock() + return len(fake.hasSignalCidArgsForCall) +} + +func (fake *FakeLocalMediaTrack) HasSignalCidCalls(stub func(string) bool) { + fake.hasSignalCidMutex.Lock() + defer fake.hasSignalCidMutex.Unlock() + fake.HasSignalCidStub = stub +} + +func (fake *FakeLocalMediaTrack) HasSignalCidArgsForCall(i int) string { + fake.hasSignalCidMutex.RLock() + defer fake.hasSignalCidMutex.RUnlock() + argsForCall := fake.hasSignalCidArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeLocalMediaTrack) HasSignalCidReturns(result1 bool) { + fake.hasSignalCidMutex.Lock() + defer fake.hasSignalCidMutex.Unlock() + fake.HasSignalCidStub = nil + fake.hasSignalCidReturns = struct { + result1 bool + }{result1} +} + +func (fake *FakeLocalMediaTrack) HasSignalCidReturnsOnCall(i int, result1 bool) { + fake.hasSignalCidMutex.Lock() + defer fake.hasSignalCidMutex.Unlock() + fake.HasSignalCidStub = nil + if fake.hasSignalCidReturnsOnCall == nil { + fake.hasSignalCidReturnsOnCall = make(map[int]struct { + result1 bool + }) + } + fake.hasSignalCidReturnsOnCall[i] = struct { + result1 bool + }{result1} +} + func (fake *FakeLocalMediaTrack) ID() livekit.TrackID { fake.iDMutex.Lock() ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)] @@ -1930,59 +1992,6 @@ func (fake *FakeLocalMediaTrack) SetRTTArgsForCall(i int) uint32 { return argsForCall.arg1 } -func (fake *FakeLocalMediaTrack) SignalCid() string { - fake.signalCidMutex.Lock() - ret, specificReturn := fake.signalCidReturnsOnCall[len(fake.signalCidArgsForCall)] - fake.signalCidArgsForCall = append(fake.signalCidArgsForCall, struct { - }{}) - stub := fake.SignalCidStub - fakeReturns := fake.signalCidReturns - fake.recordInvocation("SignalCid", []interface{}{}) - fake.signalCidMutex.Unlock() - if stub != nil { - return stub() - } - if specificReturn { - return ret.result1 - } - return fakeReturns.result1 -} - -func (fake *FakeLocalMediaTrack) SignalCidCallCount() int { - fake.signalCidMutex.RLock() - defer fake.signalCidMutex.RUnlock() - return len(fake.signalCidArgsForCall) -} - -func (fake *FakeLocalMediaTrack) SignalCidCalls(stub func() string) { - fake.signalCidMutex.Lock() - defer fake.signalCidMutex.Unlock() - fake.SignalCidStub = stub -} - -func (fake *FakeLocalMediaTrack) SignalCidReturns(result1 string) { - fake.signalCidMutex.Lock() - defer fake.signalCidMutex.Unlock() - fake.SignalCidStub = nil - fake.signalCidReturns = struct { - result1 string - }{result1} -} - -func (fake *FakeLocalMediaTrack) SignalCidReturnsOnCall(i int, result1 string) { - fake.signalCidMutex.Lock() - defer fake.signalCidMutex.Unlock() - fake.SignalCidStub = nil - if fake.signalCidReturnsOnCall == nil { - fake.signalCidReturnsOnCall = make(map[int]struct { - result1 string - }) - } - fake.signalCidReturnsOnCall[i] = struct { - result1 string - }{result1} -} - func (fake *FakeLocalMediaTrack) Source() livekit.TrackSource { fake.sourceMutex.Lock() ret, specificReturn := fake.sourceReturnsOnCall[len(fake.sourceArgsForCall)] @@ -2241,86 +2250,6 @@ func (fake *FakeLocalMediaTrack) UpdateVideoTrackArgsForCall(i int) *livekit.Upd func (fake *FakeLocalMediaTrack) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.addOnCloseMutex.RLock() - defer fake.addOnCloseMutex.RUnlock() - fake.addSubscriberMutex.RLock() - defer fake.addSubscriberMutex.RUnlock() - fake.clearAllReceiversMutex.RLock() - defer fake.clearAllReceiversMutex.RUnlock() - fake.clearSubscriberNodesMaxQualityMutex.RLock() - defer fake.clearSubscriberNodesMaxQualityMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.getAllSubscribersMutex.RLock() - defer fake.getAllSubscribersMutex.RUnlock() - fake.getAudioLevelMutex.RLock() - defer fake.getAudioLevelMutex.RUnlock() - fake.getConnectionScoreAndQualityMutex.RLock() - defer fake.getConnectionScoreAndQualityMutex.RUnlock() - fake.getNumSubscribersMutex.RLock() - defer fake.getNumSubscribersMutex.RUnlock() - fake.getQualityForDimensionMutex.RLock() - defer fake.getQualityForDimensionMutex.RUnlock() - fake.getTemporalLayerForSpatialFpsMutex.RLock() - defer fake.getTemporalLayerForSpatialFpsMutex.RUnlock() - fake.getTrackStatsMutex.RLock() - defer fake.getTrackStatsMutex.RUnlock() - fake.hasSdpCidMutex.RLock() - defer fake.hasSdpCidMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.isEncryptedMutex.RLock() - defer fake.isEncryptedMutex.RUnlock() - fake.isMutedMutex.RLock() - defer fake.isMutedMutex.RUnlock() - fake.isOpenMutex.RLock() - defer fake.isOpenMutex.RUnlock() - fake.isSubscriberMutex.RLock() - defer fake.isSubscriberMutex.RUnlock() - fake.kindMutex.RLock() - defer fake.kindMutex.RUnlock() - fake.loggerMutex.RLock() - defer fake.loggerMutex.RUnlock() - fake.nameMutex.RLock() - defer fake.nameMutex.RUnlock() - fake.notifySubscriberNodeMaxQualityMutex.RLock() - defer fake.notifySubscriberNodeMaxQualityMutex.RUnlock() - fake.notifySubscriberNodeMediaLossMutex.RLock() - defer fake.notifySubscriberNodeMediaLossMutex.RUnlock() - fake.onTrackSubscribedMutex.RLock() - defer fake.onTrackSubscribedMutex.RUnlock() - fake.publisherIDMutex.RLock() - defer fake.publisherIDMutex.RUnlock() - fake.publisherIdentityMutex.RLock() - defer fake.publisherIdentityMutex.RUnlock() - fake.publisherVersionMutex.RLock() - defer fake.publisherVersionMutex.RUnlock() - fake.receiversMutex.RLock() - defer fake.receiversMutex.RUnlock() - fake.removeSubscriberMutex.RLock() - defer fake.removeSubscriberMutex.RUnlock() - fake.restartMutex.RLock() - defer fake.restartMutex.RUnlock() - fake.revokeDisallowedSubscribersMutex.RLock() - defer fake.revokeDisallowedSubscribersMutex.RUnlock() - fake.setMutedMutex.RLock() - defer fake.setMutedMutex.RUnlock() - fake.setRTTMutex.RLock() - defer fake.setRTTMutex.RUnlock() - fake.signalCidMutex.RLock() - defer fake.signalCidMutex.RUnlock() - fake.sourceMutex.RLock() - defer fake.sourceMutex.RUnlock() - fake.streamMutex.RLock() - defer fake.streamMutex.RUnlock() - fake.toProtoMutex.RLock() - defer fake.toProtoMutex.RUnlock() - fake.updateAudioTrackMutex.RLock() - defer fake.updateAudioTrackMutex.RUnlock() - fake.updateTrackInfoMutex.RLock() - defer fake.updateTrackInfoMutex.RUnlock() - fake.updateVideoTrackMutex.RLock() - defer fake.updateVideoTrackMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_local_participant.go b/pkg/rtc/types/typesfakes/fake_local_participant.go index 108a0df49..b6494291c 100644 --- a/pkg/rtc/types/typesfakes/fake_local_participant.go +++ b/pkg/rtc/types/typesfakes/fake_local_participant.go @@ -9065,318 +9065,6 @@ func (fake *FakeLocalParticipant) WriteSubscriberRTCPReturnsOnCall(i int, result func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.addICECandidateMutex.RLock() - defer fake.addICECandidateMutex.RUnlock() - fake.addTrackMutex.RLock() - defer fake.addTrackMutex.RUnlock() - fake.addTrackLocalMutex.RLock() - defer fake.addTrackLocalMutex.RUnlock() - fake.addTransceiverFromTrackLocalMutex.RLock() - defer fake.addTransceiverFromTrackLocalMutex.RUnlock() - fake.cacheDownTrackMutex.RLock() - defer fake.cacheDownTrackMutex.RUnlock() - fake.canPublishMutex.RLock() - defer fake.canPublishMutex.RUnlock() - fake.canPublishDataMutex.RLock() - defer fake.canPublishDataMutex.RUnlock() - fake.canPublishSourceMutex.RLock() - defer fake.canPublishSourceMutex.RUnlock() - fake.canSkipBroadcastMutex.RLock() - defer fake.canSkipBroadcastMutex.RUnlock() - fake.canSubscribeMutex.RLock() - defer fake.canSubscribeMutex.RUnlock() - fake.checkMetadataLimitsMutex.RLock() - defer fake.checkMetadataLimitsMutex.RUnlock() - fake.claimGrantsMutex.RLock() - defer fake.claimGrantsMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.closeReasonMutex.RLock() - defer fake.closeReasonMutex.RUnlock() - fake.closeSignalConnectionMutex.RLock() - defer fake.closeSignalConnectionMutex.RUnlock() - fake.connectedAtMutex.RLock() - defer fake.connectedAtMutex.RUnlock() - fake.debugInfoMutex.RLock() - defer fake.debugInfoMutex.RUnlock() - fake.disconnectedMutex.RLock() - defer fake.disconnectedMutex.RUnlock() - fake.getAdaptiveStreamMutex.RLock() - defer fake.getAdaptiveStreamMutex.RUnlock() - fake.getAnswerMutex.RLock() - defer fake.getAnswerMutex.RUnlock() - fake.getAudioLevelMutex.RLock() - defer fake.getAudioLevelMutex.RUnlock() - fake.getBufferFactoryMutex.RLock() - defer fake.getBufferFactoryMutex.RUnlock() - fake.getCachedDownTrackMutex.RLock() - defer fake.getCachedDownTrackMutex.RUnlock() - fake.getClientConfigurationMutex.RLock() - defer fake.getClientConfigurationMutex.RUnlock() - fake.getClientInfoMutex.RLock() - defer fake.getClientInfoMutex.RUnlock() - fake.getConnectionQualityMutex.RLock() - defer fake.getConnectionQualityMutex.RUnlock() - fake.getCountryMutex.RLock() - defer fake.getCountryMutex.RUnlock() - fake.getDisableSenderReportPassThroughMutex.RLock() - defer fake.getDisableSenderReportPassThroughMutex.RUnlock() - fake.getEnabledPublishCodecsMutex.RLock() - defer fake.getEnabledPublishCodecsMutex.RUnlock() - fake.getICEConfigMutex.RLock() - defer fake.getICEConfigMutex.RUnlock() - fake.getICEConnectionInfoMutex.RLock() - defer fake.getICEConnectionInfoMutex.RUnlock() - fake.getLastReliableSequenceMutex.RLock() - defer fake.getLastReliableSequenceMutex.RUnlock() - fake.getLoggerMutex.RLock() - defer fake.getLoggerMutex.RUnlock() - fake.getLoggerResolverMutex.RLock() - defer fake.getLoggerResolverMutex.RUnlock() - fake.getPacerMutex.RLock() - defer fake.getPacerMutex.RUnlock() - fake.getPendingTrackMutex.RLock() - defer fake.getPendingTrackMutex.RUnlock() - fake.getPlayoutDelayConfigMutex.RLock() - defer fake.getPlayoutDelayConfigMutex.RUnlock() - fake.getPublishedTrackMutex.RLock() - defer fake.getPublishedTrackMutex.RUnlock() - fake.getPublishedTracksMutex.RLock() - defer fake.getPublishedTracksMutex.RUnlock() - fake.getPublisherICESessionUfragMutex.RLock() - defer fake.getPublisherICESessionUfragMutex.RUnlock() - fake.getReporterMutex.RLock() - defer fake.getReporterMutex.RUnlock() - fake.getReporterResolverMutex.RLock() - defer fake.getReporterResolverMutex.RUnlock() - fake.getResponseSinkMutex.RLock() - defer fake.getResponseSinkMutex.RUnlock() - fake.getSubscribedParticipantsMutex.RLock() - defer fake.getSubscribedParticipantsMutex.RUnlock() - fake.getSubscribedTracksMutex.RLock() - defer fake.getSubscribedTracksMutex.RUnlock() - fake.getTrailerMutex.RLock() - defer fake.getTrailerMutex.RUnlock() - fake.handleAnswerMutex.RLock() - defer fake.handleAnswerMutex.RUnlock() - fake.handleICERestartSDPFragmentMutex.RLock() - defer fake.handleICERestartSDPFragmentMutex.RUnlock() - fake.handleICETrickleSDPFragmentMutex.RLock() - defer fake.handleICETrickleSDPFragmentMutex.RUnlock() - fake.handleLeaveRequestMutex.RLock() - defer fake.handleLeaveRequestMutex.RUnlock() - fake.handleMetricsMutex.RLock() - defer fake.handleMetricsMutex.RUnlock() - fake.handleOfferMutex.RLock() - defer fake.handleOfferMutex.RUnlock() - fake.handleReceiverReportMutex.RLock() - defer fake.handleReceiverReportMutex.RUnlock() - fake.handleReconnectAndSendResponseMutex.RLock() - defer fake.handleReconnectAndSendResponseMutex.RUnlock() - fake.handleSignalMessageMutex.RLock() - defer fake.handleSignalMessageMutex.RUnlock() - fake.handleSignalSourceCloseMutex.RLock() - defer fake.handleSignalSourceCloseMutex.RUnlock() - fake.handleSimulateScenarioMutex.RLock() - defer fake.handleSimulateScenarioMutex.RUnlock() - fake.handleSyncStateMutex.RLock() - defer fake.handleSyncStateMutex.RUnlock() - fake.handleUpdateSubscriptionPermissionMutex.RLock() - defer fake.handleUpdateSubscriptionPermissionMutex.RUnlock() - fake.handleUpdateSubscriptionsMutex.RLock() - defer fake.handleUpdateSubscriptionsMutex.RUnlock() - fake.hasConnectedMutex.RLock() - defer fake.hasConnectedMutex.RUnlock() - fake.hasPermissionMutex.RLock() - defer fake.hasPermissionMutex.RUnlock() - fake.hiddenMutex.RLock() - defer fake.hiddenMutex.RUnlock() - fake.iCERestartMutex.RLock() - defer fake.iCERestartMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.identityMutex.RLock() - defer fake.identityMutex.RUnlock() - fake.isAgentMutex.RLock() - defer fake.isAgentMutex.RUnlock() - fake.isClosedMutex.RLock() - defer fake.isClosedMutex.RUnlock() - fake.isDependentMutex.RLock() - defer fake.isDependentMutex.RUnlock() - fake.isDisconnectedMutex.RLock() - defer fake.isDisconnectedMutex.RUnlock() - fake.isIdleMutex.RLock() - defer fake.isIdleMutex.RUnlock() - fake.isPublisherMutex.RLock() - defer fake.isPublisherMutex.RUnlock() - fake.isReadyMutex.RLock() - defer fake.isReadyMutex.RUnlock() - fake.isReconnectMutex.RLock() - defer fake.isReconnectMutex.RUnlock() - fake.isRecorderMutex.RLock() - defer fake.isRecorderMutex.RUnlock() - fake.isSubscribedToMutex.RLock() - defer fake.isSubscribedToMutex.RUnlock() - fake.isTrackNameSubscribedMutex.RLock() - defer fake.isTrackNameSubscribedMutex.RUnlock() - fake.issueFullReconnectMutex.RLock() - defer fake.issueFullReconnectMutex.RUnlock() - fake.kindMutex.RLock() - defer fake.kindMutex.RUnlock() - fake.maybeStartMigrationMutex.RLock() - defer fake.maybeStartMigrationMutex.RUnlock() - fake.migrateStateMutex.RLock() - defer fake.migrateStateMutex.RUnlock() - fake.moveToRoomMutex.RLock() - defer fake.moveToRoomMutex.RUnlock() - fake.negotiateMutex.RLock() - defer fake.negotiateMutex.RUnlock() - fake.notifyMigrationMutex.RLock() - defer fake.notifyMigrationMutex.RUnlock() - fake.onClaimsChangedMutex.RLock() - defer fake.onClaimsChangedMutex.RUnlock() - fake.onCloseMutex.RLock() - defer fake.onCloseMutex.RUnlock() - fake.onDataMessageMutex.RLock() - defer fake.onDataMessageMutex.RUnlock() - fake.onDataPacketMutex.RLock() - defer fake.onDataPacketMutex.RUnlock() - fake.onICEConfigChangedMutex.RLock() - defer fake.onICEConfigChangedMutex.RUnlock() - fake.onLeaveMutex.RLock() - defer fake.onLeaveMutex.RUnlock() - fake.onMetricsMutex.RLock() - defer fake.onMetricsMutex.RUnlock() - fake.onMigrateStateChangeMutex.RLock() - defer fake.onMigrateStateChangeMutex.RUnlock() - fake.onParticipantUpdateMutex.RLock() - defer fake.onParticipantUpdateMutex.RUnlock() - fake.onSimulateScenarioMutex.RLock() - defer fake.onSimulateScenarioMutex.RUnlock() - fake.onStateChangeMutex.RLock() - defer fake.onStateChangeMutex.RUnlock() - fake.onSubscribeStatusChangedMutex.RLock() - defer fake.onSubscribeStatusChangedMutex.RUnlock() - fake.onSubscriberReadyMutex.RLock() - defer fake.onSubscriberReadyMutex.RUnlock() - fake.onSyncStateMutex.RLock() - defer fake.onSyncStateMutex.RUnlock() - fake.onTrackPublishedMutex.RLock() - defer fake.onTrackPublishedMutex.RUnlock() - fake.onTrackUnpublishedMutex.RLock() - defer fake.onTrackUnpublishedMutex.RUnlock() - fake.onTrackUpdatedMutex.RLock() - defer fake.onTrackUpdatedMutex.RUnlock() - fake.onUpdateSubscriptionPermissionMutex.RLock() - defer fake.onUpdateSubscriptionPermissionMutex.RUnlock() - fake.onUpdateSubscriptionsMutex.RLock() - defer fake.onUpdateSubscriptionsMutex.RUnlock() - fake.protocolVersionMutex.RLock() - defer fake.protocolVersionMutex.RUnlock() - fake.removePublishedTrackMutex.RLock() - defer fake.removePublishedTrackMutex.RUnlock() - fake.removeTrackLocalMutex.RLock() - defer fake.removeTrackLocalMutex.RUnlock() - fake.sendConnectionQualityUpdateMutex.RLock() - defer fake.sendConnectionQualityUpdateMutex.RUnlock() - fake.sendDataMessageMutex.RLock() - defer fake.sendDataMessageMutex.RUnlock() - fake.sendDataMessageUnlabeledMutex.RLock() - defer fake.sendDataMessageUnlabeledMutex.RUnlock() - fake.sendJoinResponseMutex.RLock() - defer fake.sendJoinResponseMutex.RUnlock() - fake.sendParticipantUpdateMutex.RLock() - defer fake.sendParticipantUpdateMutex.RUnlock() - fake.sendRefreshTokenMutex.RLock() - defer fake.sendRefreshTokenMutex.RUnlock() - fake.sendRequestResponseMutex.RLock() - defer fake.sendRequestResponseMutex.RUnlock() - fake.sendRoomMovedResponseMutex.RLock() - defer fake.sendRoomMovedResponseMutex.RUnlock() - fake.sendRoomUpdateMutex.RLock() - defer fake.sendRoomUpdateMutex.RUnlock() - fake.sendSpeakerUpdateMutex.RLock() - defer fake.sendSpeakerUpdateMutex.RUnlock() - fake.sendSubscriptionPermissionUpdateMutex.RLock() - defer fake.sendSubscriptionPermissionUpdateMutex.RUnlock() - fake.setAttributesMutex.RLock() - defer fake.setAttributesMutex.RUnlock() - fake.setICEConfigMutex.RLock() - defer fake.setICEConfigMutex.RUnlock() - fake.setMetadataMutex.RLock() - defer fake.setMetadataMutex.RUnlock() - fake.setMigrateInfoMutex.RLock() - defer fake.setMigrateInfoMutex.RUnlock() - fake.setMigrateStateMutex.RLock() - defer fake.setMigrateStateMutex.RUnlock() - fake.setNameMutex.RLock() - defer fake.setNameMutex.RUnlock() - fake.setPermissionMutex.RLock() - defer fake.setPermissionMutex.RUnlock() - fake.setResponseSinkMutex.RLock() - defer fake.setResponseSinkMutex.RUnlock() - fake.setSignalSourceValidMutex.RLock() - defer fake.setSignalSourceValidMutex.RUnlock() - fake.setSubscriberAllowPauseMutex.RLock() - defer fake.setSubscriberAllowPauseMutex.RUnlock() - fake.setSubscriberChannelCapacityMutex.RLock() - defer fake.setSubscriberChannelCapacityMutex.RUnlock() - fake.setTrackMutedMutex.RLock() - defer fake.setTrackMutedMutex.RUnlock() - fake.stateMutex.RLock() - defer fake.stateMutex.RUnlock() - fake.stopAndGetSubscribedTracksForwarderStateMutex.RLock() - defer fake.stopAndGetSubscribedTracksForwarderStateMutex.RUnlock() - fake.subscribeToTrackMutex.RLock() - defer fake.subscribeToTrackMutex.RUnlock() - fake.subscriberAsPrimaryMutex.RLock() - defer fake.subscriberAsPrimaryMutex.RUnlock() - fake.subscriptionPermissionMutex.RLock() - defer fake.subscriptionPermissionMutex.RUnlock() - fake.supportsCodecChangeMutex.RLock() - defer fake.supportsCodecChangeMutex.RUnlock() - fake.supportsMovingMutex.RLock() - defer fake.supportsMovingMutex.RUnlock() - fake.supportsSyncStreamIDMutex.RLock() - defer fake.supportsSyncStreamIDMutex.RUnlock() - fake.supportsTransceiverReuseMutex.RLock() - defer fake.supportsTransceiverReuseMutex.RUnlock() - fake.toProtoMutex.RLock() - defer fake.toProtoMutex.RUnlock() - fake.toProtoWithVersionMutex.RLock() - defer fake.toProtoWithVersionMutex.RUnlock() - fake.uncacheDownTrackMutex.RLock() - defer fake.uncacheDownTrackMutex.RUnlock() - fake.unsubscribeFromTrackMutex.RLock() - defer fake.unsubscribeFromTrackMutex.RUnlock() - fake.updateAudioTrackMutex.RLock() - defer fake.updateAudioTrackMutex.RUnlock() - fake.updateLastSeenSignalMutex.RLock() - defer fake.updateLastSeenSignalMutex.RUnlock() - fake.updateMediaLossMutex.RLock() - defer fake.updateMediaLossMutex.RUnlock() - fake.updateMediaRTTMutex.RLock() - defer fake.updateMediaRTTMutex.RUnlock() - fake.updateSignalingRTTMutex.RLock() - defer fake.updateSignalingRTTMutex.RUnlock() - fake.updateSubscribedQualityMutex.RLock() - defer fake.updateSubscribedQualityMutex.RUnlock() - fake.updateSubscribedTrackSettingsMutex.RLock() - defer fake.updateSubscribedTrackSettingsMutex.RUnlock() - fake.updateSubscriptionPermissionMutex.RLock() - defer fake.updateSubscriptionPermissionMutex.RUnlock() - fake.updateVideoTrackMutex.RLock() - defer fake.updateVideoTrackMutex.RUnlock() - fake.verifyMutex.RLock() - defer fake.verifyMutex.RUnlock() - fake.verifySubscribeParticipantInfoMutex.RLock() - defer fake.verifySubscribeParticipantInfoMutex.RUnlock() - fake.versionMutex.RLock() - defer fake.versionMutex.RUnlock() - fake.waitUntilSubscribedMutex.RLock() - defer fake.waitUntilSubscribedMutex.RUnlock() - fake.writeSubscriberRTCPMutex.RLock() - defer fake.writeSubscriberRTCPMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_local_participant_helper.go b/pkg/rtc/types/typesfakes/fake_local_participant_helper.go index 00df1c304..3deea6b0c 100644 --- a/pkg/rtc/types/typesfakes/fake_local_participant_helper.go +++ b/pkg/rtc/types/typesfakes/fake_local_participant_helper.go @@ -446,18 +446,6 @@ func (fake *FakeLocalParticipantHelper) ShouldRegressCodecReturnsOnCall(i int, r func (fake *FakeLocalParticipantHelper) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.getCachedReliableDataMessageMutex.RLock() - defer fake.getCachedReliableDataMessageMutex.RUnlock() - fake.getParticipantInfoMutex.RLock() - defer fake.getParticipantInfoMutex.RUnlock() - fake.getRegionSettingsMutex.RLock() - defer fake.getRegionSettingsMutex.RUnlock() - fake.getSubscriberForwarderStateMutex.RLock() - defer fake.getSubscriberForwarderStateMutex.RUnlock() - fake.resolveMediaTrackMutex.RLock() - defer fake.resolveMediaTrackMutex.RUnlock() - fake.shouldRegressCodecMutex.RLock() - defer fake.shouldRegressCodecMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_media_track.go b/pkg/rtc/types/typesfakes/fake_media_track.go index c98b13b9b..ba44585f1 100644 --- a/pkg/rtc/types/typesfakes/fake_media_track.go +++ b/pkg/rtc/types/typesfakes/fake_media_track.go @@ -1799,68 +1799,6 @@ func (fake *FakeMediaTrack) UpdateVideoTrackArgsForCall(i int) *livekit.UpdateLo func (fake *FakeMediaTrack) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.addOnCloseMutex.RLock() - defer fake.addOnCloseMutex.RUnlock() - fake.addSubscriberMutex.RLock() - defer fake.addSubscriberMutex.RUnlock() - fake.clearAllReceiversMutex.RLock() - defer fake.clearAllReceiversMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.getAllSubscribersMutex.RLock() - defer fake.getAllSubscribersMutex.RUnlock() - fake.getAudioLevelMutex.RLock() - defer fake.getAudioLevelMutex.RUnlock() - fake.getNumSubscribersMutex.RLock() - defer fake.getNumSubscribersMutex.RUnlock() - fake.getQualityForDimensionMutex.RLock() - defer fake.getQualityForDimensionMutex.RUnlock() - fake.getTemporalLayerForSpatialFpsMutex.RLock() - defer fake.getTemporalLayerForSpatialFpsMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.isEncryptedMutex.RLock() - defer fake.isEncryptedMutex.RUnlock() - fake.isMutedMutex.RLock() - defer fake.isMutedMutex.RUnlock() - fake.isOpenMutex.RLock() - defer fake.isOpenMutex.RUnlock() - fake.isSubscriberMutex.RLock() - defer fake.isSubscriberMutex.RUnlock() - fake.kindMutex.RLock() - defer fake.kindMutex.RUnlock() - fake.loggerMutex.RLock() - defer fake.loggerMutex.RUnlock() - fake.nameMutex.RLock() - defer fake.nameMutex.RUnlock() - fake.onTrackSubscribedMutex.RLock() - defer fake.onTrackSubscribedMutex.RUnlock() - fake.publisherIDMutex.RLock() - defer fake.publisherIDMutex.RUnlock() - fake.publisherIdentityMutex.RLock() - defer fake.publisherIdentityMutex.RUnlock() - fake.publisherVersionMutex.RLock() - defer fake.publisherVersionMutex.RUnlock() - fake.receiversMutex.RLock() - defer fake.receiversMutex.RUnlock() - fake.removeSubscriberMutex.RLock() - defer fake.removeSubscriberMutex.RUnlock() - fake.revokeDisallowedSubscribersMutex.RLock() - defer fake.revokeDisallowedSubscribersMutex.RUnlock() - fake.setMutedMutex.RLock() - defer fake.setMutedMutex.RUnlock() - fake.sourceMutex.RLock() - defer fake.sourceMutex.RUnlock() - fake.streamMutex.RLock() - defer fake.streamMutex.RUnlock() - fake.toProtoMutex.RLock() - defer fake.toProtoMutex.RUnlock() - fake.updateAudioTrackMutex.RLock() - defer fake.updateAudioTrackMutex.RUnlock() - fake.updateTrackInfoMutex.RLock() - defer fake.updateTrackInfoMutex.RUnlock() - fake.updateVideoTrackMutex.RLock() - defer fake.updateVideoTrackMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_participant.go b/pkg/rtc/types/typesfakes/fake_participant.go index d305384cf..8c55fd97d 100644 --- a/pkg/rtc/types/typesfakes/fake_participant.go +++ b/pkg/rtc/types/typesfakes/fake_participant.go @@ -1536,54 +1536,6 @@ func (fake *FakeParticipant) VersionReturnsOnCall(i int, result1 utils.TimedVers func (fake *FakeParticipant) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.canSkipBroadcastMutex.RLock() - defer fake.canSkipBroadcastMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.closeReasonMutex.RLock() - defer fake.closeReasonMutex.RUnlock() - fake.connectedAtMutex.RLock() - defer fake.connectedAtMutex.RUnlock() - fake.debugInfoMutex.RLock() - defer fake.debugInfoMutex.RUnlock() - fake.getAudioLevelMutex.RLock() - defer fake.getAudioLevelMutex.RUnlock() - fake.getPublishedTrackMutex.RLock() - defer fake.getPublishedTrackMutex.RUnlock() - fake.getPublishedTracksMutex.RLock() - defer fake.getPublishedTracksMutex.RUnlock() - fake.hasPermissionMutex.RLock() - defer fake.hasPermissionMutex.RUnlock() - fake.hiddenMutex.RLock() - defer fake.hiddenMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.identityMutex.RLock() - defer fake.identityMutex.RUnlock() - fake.isAgentMutex.RLock() - defer fake.isAgentMutex.RUnlock() - fake.isDependentMutex.RLock() - defer fake.isDependentMutex.RUnlock() - fake.isPublisherMutex.RLock() - defer fake.isPublisherMutex.RUnlock() - fake.isRecorderMutex.RLock() - defer fake.isRecorderMutex.RUnlock() - fake.kindMutex.RLock() - defer fake.kindMutex.RUnlock() - fake.onMetricsMutex.RLock() - defer fake.onMetricsMutex.RUnlock() - fake.removePublishedTrackMutex.RLock() - defer fake.removePublishedTrackMutex.RUnlock() - fake.stateMutex.RLock() - defer fake.stateMutex.RUnlock() - fake.subscriptionPermissionMutex.RLock() - defer fake.subscriptionPermissionMutex.RUnlock() - fake.toProtoMutex.RLock() - defer fake.toProtoMutex.RUnlock() - fake.updateSubscriptionPermissionMutex.RLock() - defer fake.updateSubscriptionPermissionMutex.RUnlock() - fake.versionMutex.RLock() - defer fake.versionMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_room.go b/pkg/rtc/types/typesfakes/fake_room.go index e4ae5e3df..38519ca41 100644 --- a/pkg/rtc/types/typesfakes/fake_room.go +++ b/pkg/rtc/types/typesfakes/fake_room.go @@ -445,20 +445,6 @@ func (fake *FakeRoom) UpdateSubscriptionsArgsForCall(i int) (types.LocalParticip func (fake *FakeRoom) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.getLocalParticipantsMutex.RLock() - defer fake.getLocalParticipantsMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.isDataMessageUserPacketDuplicateMutex.RLock() - defer fake.isDataMessageUserPacketDuplicateMutex.RUnlock() - fake.nameMutex.RLock() - defer fake.nameMutex.RUnlock() - fake.removeParticipantMutex.RLock() - defer fake.removeParticipantMutex.RUnlock() - fake.resolveMediaTrackForSubscriberMutex.RLock() - defer fake.resolveMediaTrackForSubscriberMutex.RUnlock() - fake.updateSubscriptionsMutex.RLock() - defer fake.updateSubscriptionsMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_subscribed_track.go b/pkg/rtc/types/typesfakes/fake_subscribed_track.go index 6a836a267..2123548b9 100644 --- a/pkg/rtc/types/typesfakes/fake_subscribed_track.go +++ b/pkg/rtc/types/typesfakes/fake_subscribed_track.go @@ -1052,44 +1052,6 @@ func (fake *FakeSubscribedTrack) UpdateVideoLayerCalls(stub func()) { func (fake *FakeSubscribedTrack) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.addOnBindMutex.RLock() - defer fake.addOnBindMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.downTrackMutex.RLock() - defer fake.downTrackMutex.RUnlock() - fake.iDMutex.RLock() - defer fake.iDMutex.RUnlock() - fake.isBoundMutex.RLock() - defer fake.isBoundMutex.RUnlock() - fake.isMutedMutex.RLock() - defer fake.isMutedMutex.RUnlock() - fake.mediaTrackMutex.RLock() - defer fake.mediaTrackMutex.RUnlock() - fake.needsNegotiationMutex.RLock() - defer fake.needsNegotiationMutex.RUnlock() - fake.onCloseMutex.RLock() - defer fake.onCloseMutex.RUnlock() - fake.publisherIDMutex.RLock() - defer fake.publisherIDMutex.RUnlock() - fake.publisherIdentityMutex.RLock() - defer fake.publisherIdentityMutex.RUnlock() - fake.publisherVersionMutex.RLock() - defer fake.publisherVersionMutex.RUnlock() - fake.rTPSenderMutex.RLock() - defer fake.rTPSenderMutex.RUnlock() - fake.setPublisherMutedMutex.RLock() - defer fake.setPublisherMutedMutex.RUnlock() - fake.subscriberMutex.RLock() - defer fake.subscriberMutex.RUnlock() - fake.subscriberIDMutex.RLock() - defer fake.subscriberIDMutex.RUnlock() - fake.subscriberIdentityMutex.RLock() - defer fake.subscriberIdentityMutex.RUnlock() - fake.updateSubscriberSettingsMutex.RLock() - defer fake.updateSubscriberSettingsMutex.RUnlock() - fake.updateVideoLayerMutex.RLock() - defer fake.updateVideoLayerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/rtc/types/typesfakes/fake_websocket_client.go b/pkg/rtc/types/typesfakes/fake_websocket_client.go index 93d0957ad..6d5b44c8d 100644 --- a/pkg/rtc/types/typesfakes/fake_websocket_client.go +++ b/pkg/rtc/types/typesfakes/fake_websocket_client.go @@ -384,16 +384,6 @@ func (fake *FakeWebsocketClient) WriteMessageReturnsOnCall(i int, result1 error) func (fake *FakeWebsocketClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.closeMutex.RLock() - defer fake.closeMutex.RUnlock() - fake.readMessageMutex.RLock() - defer fake.readMessageMutex.RUnlock() - fake.setReadDeadlineMutex.RLock() - defer fake.setReadDeadlineMutex.RUnlock() - fake.writeControlMutex.RLock() - defer fake.writeControlMutex.RUnlock() - fake.writeMessageMutex.RLock() - defer fake.writeMessageMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_agent_store.go b/pkg/service/servicefakes/fake_agent_store.go index 71d43f567..6727597e3 100644 --- a/pkg/service/servicefakes/fake_agent_store.go +++ b/pkg/service/servicefakes/fake_agent_store.go @@ -392,16 +392,6 @@ func (fake *FakeAgentStore) StoreAgentJobReturnsOnCall(i int, result1 error) { func (fake *FakeAgentStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.deleteAgentDispatchMutex.RLock() - defer fake.deleteAgentDispatchMutex.RUnlock() - fake.deleteAgentJobMutex.RLock() - defer fake.deleteAgentJobMutex.RUnlock() - fake.listAgentDispatchesMutex.RLock() - defer fake.listAgentDispatchesMutex.RUnlock() - fake.storeAgentDispatchMutex.RLock() - defer fake.storeAgentDispatchMutex.RUnlock() - fake.storeAgentJobMutex.RLock() - defer fake.storeAgentJobMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_egress_store.go b/pkg/service/servicefakes/fake_egress_store.go index 37f13670f..b642eb9a8 100644 --- a/pkg/service/servicefakes/fake_egress_store.go +++ b/pkg/service/servicefakes/fake_egress_store.go @@ -325,14 +325,6 @@ func (fake *FakeEgressStore) UpdateEgressReturnsOnCall(i int, result1 error) { func (fake *FakeEgressStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.listEgressMutex.RLock() - defer fake.listEgressMutex.RUnlock() - fake.loadEgressMutex.RLock() - defer fake.loadEgressMutex.RUnlock() - fake.storeEgressMutex.RLock() - defer fake.storeEgressMutex.RUnlock() - fake.updateEgressMutex.RLock() - defer fake.updateEgressMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_ingress_store.go b/pkg/service/servicefakes/fake_ingress_store.go index 4265e1d5b..f959ad4bb 100644 --- a/pkg/service/servicefakes/fake_ingress_store.go +++ b/pkg/service/servicefakes/fake_ingress_store.go @@ -552,20 +552,6 @@ func (fake *FakeIngressStore) UpdateIngressStateReturnsOnCall(i int, result1 err func (fake *FakeIngressStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.deleteIngressMutex.RLock() - defer fake.deleteIngressMutex.RUnlock() - fake.listIngressMutex.RLock() - defer fake.listIngressMutex.RUnlock() - fake.loadIngressMutex.RLock() - defer fake.loadIngressMutex.RUnlock() - fake.loadIngressFromStreamKeyMutex.RLock() - defer fake.loadIngressFromStreamKeyMutex.RUnlock() - fake.storeIngressMutex.RLock() - defer fake.storeIngressMutex.RUnlock() - fake.updateIngressMutex.RLock() - defer fake.updateIngressMutex.RUnlock() - fake.updateIngressStateMutex.RLock() - defer fake.updateIngressStateMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_ioclient.go b/pkg/service/servicefakes/fake_ioclient.go index 0e1e22ac5..0cdda4127 100644 --- a/pkg/service/servicefakes/fake_ioclient.go +++ b/pkg/service/servicefakes/fake_ioclient.go @@ -414,16 +414,6 @@ func (fake *FakeIOClient) UpdateIngressStateReturnsOnCall(i int, result1 *emptyp func (fake *FakeIOClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.createEgressMutex.RLock() - defer fake.createEgressMutex.RUnlock() - fake.createIngressMutex.RLock() - defer fake.createIngressMutex.RUnlock() - fake.getEgressMutex.RLock() - defer fake.getEgressMutex.RUnlock() - fake.listEgressMutex.RLock() - defer fake.listEgressMutex.RUnlock() - fake.updateIngressStateMutex.RLock() - defer fake.updateIngressStateMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_object_store.go b/pkg/service/servicefakes/fake_object_store.go index 1c5259bf9..80ce6f470 100644 --- a/pkg/service/servicefakes/fake_object_store.go +++ b/pkg/service/servicefakes/fake_object_store.go @@ -807,26 +807,6 @@ func (fake *FakeObjectStore) UnlockRoomReturnsOnCall(i int, result1 error) { func (fake *FakeObjectStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.deleteParticipantMutex.RLock() - defer fake.deleteParticipantMutex.RUnlock() - fake.deleteRoomMutex.RLock() - defer fake.deleteRoomMutex.RUnlock() - fake.listParticipantsMutex.RLock() - defer fake.listParticipantsMutex.RUnlock() - fake.listRoomsMutex.RLock() - defer fake.listRoomsMutex.RUnlock() - fake.loadParticipantMutex.RLock() - defer fake.loadParticipantMutex.RUnlock() - fake.loadRoomMutex.RLock() - defer fake.loadRoomMutex.RUnlock() - fake.lockRoomMutex.RLock() - defer fake.lockRoomMutex.RUnlock() - fake.storeParticipantMutex.RLock() - defer fake.storeParticipantMutex.RUnlock() - fake.storeRoomMutex.RLock() - defer fake.storeRoomMutex.RUnlock() - fake.unlockRoomMutex.RLock() - defer fake.unlockRoomMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_room_allocator.go b/pkg/service/servicefakes/fake_room_allocator.go index 8cc11f637..b15ae5648 100644 --- a/pkg/service/servicefakes/fake_room_allocator.go +++ b/pkg/service/servicefakes/fake_room_allocator.go @@ -330,14 +330,6 @@ func (fake *FakeRoomAllocator) ValidateCreateRoomReturnsOnCall(i int, result1 er func (fake *FakeRoomAllocator) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.autoCreateEnabledMutex.RLock() - defer fake.autoCreateEnabledMutex.RUnlock() - fake.createRoomMutex.RLock() - defer fake.createRoomMutex.RUnlock() - fake.selectRoomNodeMutex.RLock() - defer fake.selectRoomNodeMutex.RUnlock() - fake.validateCreateRoomMutex.RLock() - defer fake.validateCreateRoomMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_service_store.go b/pkg/service/servicefakes/fake_service_store.go index 7ecf3e213..8b3f411a3 100644 --- a/pkg/service/servicefakes/fake_service_store.go +++ b/pkg/service/servicefakes/fake_service_store.go @@ -421,16 +421,6 @@ func (fake *FakeServiceStore) LoadRoomReturnsOnCall(i int, result1 *livekit.Room func (fake *FakeServiceStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.deleteRoomMutex.RLock() - defer fake.deleteRoomMutex.RUnlock() - fake.listParticipantsMutex.RLock() - defer fake.listParticipantsMutex.RUnlock() - fake.listRoomsMutex.RLock() - defer fake.listRoomsMutex.RUnlock() - fake.loadParticipantMutex.RLock() - defer fake.loadParticipantMutex.RUnlock() - fake.loadRoomMutex.RLock() - defer fake.loadRoomMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_session_handler.go b/pkg/service/servicefakes/fake_session_handler.go index a31c69dbe..e112e6774 100644 --- a/pkg/service/servicefakes/fake_session_handler.go +++ b/pkg/service/servicefakes/fake_session_handler.go @@ -171,10 +171,6 @@ func (fake *FakeSessionHandler) LoggerReturnsOnCall(i int, result1 logger.Logger func (fake *FakeSessionHandler) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.handleSessionMutex.RLock() - defer fake.handleSessionMutex.RUnlock() - fake.loggerMutex.RLock() - defer fake.loggerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/service/servicefakes/fake_sipstore.go b/pkg/service/servicefakes/fake_sipstore.go index bc914444c..ba88c8732 100644 --- a/pkg/service/servicefakes/fake_sipstore.go +++ b/pkg/service/servicefakes/fake_sipstore.go @@ -1093,34 +1093,6 @@ func (fake *FakeSIPStore) StoreSIPTrunkReturnsOnCall(i int, result1 error) { func (fake *FakeSIPStore) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.deleteSIPDispatchRuleMutex.RLock() - defer fake.deleteSIPDispatchRuleMutex.RUnlock() - fake.deleteSIPTrunkMutex.RLock() - defer fake.deleteSIPTrunkMutex.RUnlock() - fake.listSIPDispatchRuleMutex.RLock() - defer fake.listSIPDispatchRuleMutex.RUnlock() - fake.listSIPInboundTrunkMutex.RLock() - defer fake.listSIPInboundTrunkMutex.RUnlock() - fake.listSIPOutboundTrunkMutex.RLock() - defer fake.listSIPOutboundTrunkMutex.RUnlock() - fake.listSIPTrunkMutex.RLock() - defer fake.listSIPTrunkMutex.RUnlock() - fake.loadSIPDispatchRuleMutex.RLock() - defer fake.loadSIPDispatchRuleMutex.RUnlock() - fake.loadSIPInboundTrunkMutex.RLock() - defer fake.loadSIPInboundTrunkMutex.RUnlock() - fake.loadSIPOutboundTrunkMutex.RLock() - defer fake.loadSIPOutboundTrunkMutex.RUnlock() - fake.loadSIPTrunkMutex.RLock() - defer fake.loadSIPTrunkMutex.RUnlock() - fake.storeSIPDispatchRuleMutex.RLock() - defer fake.storeSIPDispatchRuleMutex.RUnlock() - fake.storeSIPInboundTrunkMutex.RLock() - defer fake.storeSIPInboundTrunkMutex.RUnlock() - fake.storeSIPOutboundTrunkMutex.RLock() - defer fake.storeSIPOutboundTrunkMutex.RUnlock() - fake.storeSIPTrunkMutex.RLock() - defer fake.storeSIPTrunkMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/sfu/mime/mimetype.go b/pkg/sfu/mime/mimetype.go index 78f4cecee..63ba28b9a 100644 --- a/pkg/sfu/mime/mimetype.go +++ b/pkg/sfu/mime/mimetype.go @@ -81,6 +81,41 @@ func (m MimeTypeCodec) String() string { return "MimeTypeCodecUnknown" } +func (m MimeTypeCodec) ToMimeType() MimeType { + switch m { + case MimeTypeCodecUnknown: + return MimeTypeUnknown + case MimeTypeCodecH264: + return MimeTypeH264 + case MimeTypeCodecH265: + return MimeTypeH265 + case MimeTypeCodecOpus: + return MimeTypeOpus + case MimeTypeCodecRED: + return MimeTypeRED + case MimeTypeCodecVP8: + return MimeTypeVP8 + case MimeTypeCodecVP9: + return MimeTypeVP9 + case MimeTypeCodecAV1: + return MimeTypeAV1 + case MimeTypeCodecG722: + return MimeTypeG722 + case MimeTypeCodecPCMU: + return MimeTypePCMU + case MimeTypeCodecPCMA: + return MimeTypePCMA + case MimeTypeCodecRTX: + return MimeTypeRTX + case MimeTypeCodecFlexFEC: + return MimeTypeFlexFEC + case MimeTypeCodecULPFEC: + return MimeTypeULPFEC + } + + return MimeTypeUnknown +} + func NormalizeMimeTypeCodec(codec string) MimeTypeCodec { switch { case strings.EqualFold(codec, "h264"): diff --git a/pkg/telemetry/telemetryfakes/fake_analytics_service.go b/pkg/telemetry/telemetryfakes/fake_analytics_service.go index e321ba46c..14c4dea72 100644 --- a/pkg/telemetry/telemetryfakes/fake_analytics_service.go +++ b/pkg/telemetry/telemetryfakes/fake_analytics_service.go @@ -212,14 +212,6 @@ func (fake *FakeAnalyticsService) SendStatsArgsForCall(i int) (context.Context, func (fake *FakeAnalyticsService) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.roomProjectReporterMutex.RLock() - defer fake.roomProjectReporterMutex.RUnlock() - fake.sendEventMutex.RLock() - defer fake.sendEventMutex.RUnlock() - fake.sendNodeRoomStatesMutex.RLock() - defer fake.sendNodeRoomStatesMutex.RUnlock() - fake.sendStatsMutex.RLock() - defer fake.sendStatsMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/telemetry/telemetryfakes/fake_telemetry_service.go b/pkg/telemetry/telemetryfakes/fake_telemetry_service.go index 40f577ab3..3a1ca747f 100644 --- a/pkg/telemetry/telemetryfakes/fake_telemetry_service.go +++ b/pkg/telemetry/telemetryfakes/fake_telemetry_service.go @@ -1612,82 +1612,6 @@ func (fake *FakeTelemetryService) WebhookArgsForCall(i int) (context.Context, *l func (fake *FakeTelemetryService) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.aPICallMutex.RLock() - defer fake.aPICallMutex.RUnlock() - fake.egressEndedMutex.RLock() - defer fake.egressEndedMutex.RUnlock() - fake.egressStartedMutex.RLock() - defer fake.egressStartedMutex.RUnlock() - fake.egressUpdatedMutex.RLock() - defer fake.egressUpdatedMutex.RUnlock() - fake.flushStatsMutex.RLock() - defer fake.flushStatsMutex.RUnlock() - fake.ingressCreatedMutex.RLock() - defer fake.ingressCreatedMutex.RUnlock() - fake.ingressDeletedMutex.RLock() - defer fake.ingressDeletedMutex.RUnlock() - fake.ingressEndedMutex.RLock() - defer fake.ingressEndedMutex.RUnlock() - fake.ingressStartedMutex.RLock() - defer fake.ingressStartedMutex.RUnlock() - fake.ingressUpdatedMutex.RLock() - defer fake.ingressUpdatedMutex.RUnlock() - fake.localRoomStateMutex.RLock() - defer fake.localRoomStateMutex.RUnlock() - fake.notifyEgressEventMutex.RLock() - defer fake.notifyEgressEventMutex.RUnlock() - fake.participantActiveMutex.RLock() - defer fake.participantActiveMutex.RUnlock() - fake.participantJoinedMutex.RLock() - defer fake.participantJoinedMutex.RUnlock() - fake.participantLeftMutex.RLock() - defer fake.participantLeftMutex.RUnlock() - fake.participantResumedMutex.RLock() - defer fake.participantResumedMutex.RUnlock() - fake.reportMutex.RLock() - defer fake.reportMutex.RUnlock() - fake.roomEndedMutex.RLock() - defer fake.roomEndedMutex.RUnlock() - fake.roomProjectReporterMutex.RLock() - defer fake.roomProjectReporterMutex.RUnlock() - fake.roomStartedMutex.RLock() - defer fake.roomStartedMutex.RUnlock() - fake.sendEventMutex.RLock() - defer fake.sendEventMutex.RUnlock() - fake.sendNodeRoomStatesMutex.RLock() - defer fake.sendNodeRoomStatesMutex.RUnlock() - fake.sendStatsMutex.RLock() - defer fake.sendStatsMutex.RUnlock() - fake.trackMaxSubscribedVideoQualityMutex.RLock() - defer fake.trackMaxSubscribedVideoQualityMutex.RUnlock() - fake.trackMutedMutex.RLock() - defer fake.trackMutedMutex.RUnlock() - fake.trackPublishRTPStatsMutex.RLock() - defer fake.trackPublishRTPStatsMutex.RUnlock() - fake.trackPublishRequestedMutex.RLock() - defer fake.trackPublishRequestedMutex.RUnlock() - fake.trackPublishedMutex.RLock() - defer fake.trackPublishedMutex.RUnlock() - fake.trackPublishedUpdateMutex.RLock() - defer fake.trackPublishedUpdateMutex.RUnlock() - fake.trackStatsMutex.RLock() - defer fake.trackStatsMutex.RUnlock() - fake.trackSubscribeFailedMutex.RLock() - defer fake.trackSubscribeFailedMutex.RUnlock() - fake.trackSubscribeRTPStatsMutex.RLock() - defer fake.trackSubscribeRTPStatsMutex.RUnlock() - fake.trackSubscribeRequestedMutex.RLock() - defer fake.trackSubscribeRequestedMutex.RUnlock() - fake.trackSubscribedMutex.RLock() - defer fake.trackSubscribedMutex.RUnlock() - fake.trackUnmutedMutex.RLock() - defer fake.trackUnmutedMutex.RUnlock() - fake.trackUnpublishedMutex.RLock() - defer fake.trackUnpublishedMutex.RUnlock() - fake.trackUnsubscribedMutex.RLock() - defer fake.trackUnsubscribedMutex.RUnlock() - fake.webhookMutex.RLock() - defer fake.webhookMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value