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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user