Add fps calculator for VP8 and DependencyDescriptor (#1110)

* Add fps calculator for VP8 and DependencyDescriptor

* clean code

* unit test

* clean code

* solve comment
This commit is contained in:
cnderrauber
2022-10-26 09:28:28 +08:00
committed by GitHub
parent 96a058b503
commit 7a7fc09372
17 changed files with 1040 additions and 35 deletions
+7 -1
View File
@@ -133,6 +133,7 @@ func (t *SubscribedTrack) UpdateVideoLayer() {
if t.DownTrack().Kind() != webrtc.RTPCodecTypeVideo {
return
}
t.Subscriber().GetLogger().Debugw("updating video layer")
settings, ok := t.settings.Load().(*livekit.UpdateTrackSettings)
if !ok {
@@ -143,7 +144,12 @@ func (t *SubscribedTrack) UpdateVideoLayer() {
if settings.Width > 0 {
quality = t.MediaTrack().GetQualityForDimension(settings.Width, settings.Height)
}
t.DownTrack().SetMaxSpatialLayer(buffer.VideoQualityToSpatialLayer(quality, t.params.MediaTrack.ToProto()))
spatial := buffer.VideoQualityToSpatialLayer(quality, t.params.MediaTrack.ToProto())
t.DownTrack().SetMaxSpatialLayer(spatial)
if settings.Fps > 0 {
t.DownTrack().SetMaxTemporalLayer(t.MediaTrack().GetTemporalLayerForSpatialFps(spatial, settings.Fps, t.DownTrack().Codec().MimeType))
}
}
func (t *SubscribedTrack) updateDownTrackMute() {