simulcast codecs support (#720)

simulcast codecs support 

Co-authored-by: David Zhao <dz@livekit.io>
This commit is contained in:
cnderrauber
2022-05-27 19:55:50 +08:00
committed by GitHub
co-authored by David Zhao
parent 3054f3eea3
commit f958fbcc1c
30 changed files with 1098 additions and 574 deletions
+3 -2
View File
@@ -240,14 +240,14 @@ func (u *UpTrackManager) UpdateVideoLayers(updateVideoLayers *livekit.UpdateVide
return nil
}
func (u *UpTrackManager) UpdateSubscribedQuality(nodeID livekit.NodeID, trackID livekit.TrackID, maxQuality livekit.VideoQuality) error {
func (u *UpTrackManager) UpdateSubscribedQuality(nodeID livekit.NodeID, trackID livekit.TrackID, maxQualities []types.SubscribedCodecQuality) error {
track := u.GetPublishedTrack(trackID)
if track == nil {
u.params.Logger.Warnw("could not find track", nil, "trackID", trackID)
return errors.New("could not find published track")
}
track.NotifySubscriberNodeMaxQuality(nodeID, maxQuality)
track.NotifySubscriberNodeMaxQuality(nodeID, maxQualities)
return nil
}
@@ -268,6 +268,7 @@ func (u *UpTrackManager) AddPublishedTrack(track types.MediaTrack) {
u.publishedTracks[track.ID()] = track
}
u.lock.Unlock()
u.params.Logger.Debugw("added published track", "trackID", track.ID(), "trackInfo", track.ToProto().String())
track.AddOnClose(func() {
notifyClose := false