Adjust interfaces to better work with cloud (#349)
* Adjust interfaces to better work with cloud * force argument to quality update
This commit is contained in:
+2
-30
@@ -848,34 +848,6 @@ func (p *ParticipantImpl) SubscriptionPermissionUpdate(publisherID livekit.Parti
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) UpdateSubscribedQuality(nodeID string, trackID livekit.TrackID, maxQuality livekit.VideoQuality) error {
|
||||
track := p.GetPublishedTrack(trackID)
|
||||
if track == nil {
|
||||
p.params.Logger.Warnw("could not find track", nil, "trackID", trackID)
|
||||
return errors.New("could not find track")
|
||||
}
|
||||
|
||||
if mt, ok := track.(*MediaTrack); ok {
|
||||
mt.NotifySubscriberNodeMaxQuality(nodeID, maxQuality)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) UpdateMediaLoss(nodeID string, trackID livekit.TrackID, fractionalLoss uint32) error {
|
||||
track := p.GetPublishedTrack(trackID)
|
||||
if track == nil {
|
||||
p.params.Logger.Warnw("could not find track", nil, "trackID", trackID)
|
||||
return errors.New("could not find track")
|
||||
}
|
||||
|
||||
if mt, ok := track.(*MediaTrack); ok {
|
||||
mt.NotifySubscriberNodeMediaLoss(nodeID, uint8(fractionalLoss))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) setupUptrackManager() {
|
||||
p.UptrackManager = NewUptrackManager(UptrackManagerParams{
|
||||
SID: p.params.SID,
|
||||
@@ -892,8 +864,6 @@ func (p *ParticipantImpl) setupUptrackManager() {
|
||||
}
|
||||
})
|
||||
|
||||
p.UptrackManager.OnSubscribedMaxQualityChange(p.onSubscribedMaxQualityChange)
|
||||
|
||||
p.UptrackManager.OnUptrackManagerClose(p.onUptrackManagerClose)
|
||||
}
|
||||
|
||||
@@ -1375,6 +1345,8 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
|
||||
}
|
||||
}
|
||||
|
||||
mt.OnSubscribedMaxQualityChange(p.onSubscribedMaxQualityChange)
|
||||
|
||||
// add to published and clean up pending
|
||||
p.UptrackManager.AddPublishedTrack(mt)
|
||||
delete(p.pendingTracks, signalCid)
|
||||
|
||||
Reference in New Issue
Block a user