Switching to layer based quality for camera tracks also. (#1520)
There are cases where the layer bit rate configuration is such that the expected bitrate difference is very high. For example, setting up layer 2 (f) layer for 1.7 Mbps and layer 1 (h) for 180 kbps. With bitrate based quality, a layer drop results in going to `POOR` quality rating. With layer based, it will drop one level only. Also, cleaning up the distance to desired calculation a bit.
This commit is contained in:
@@ -310,14 +310,10 @@ done:
|
||||
return 0.0
|
||||
}
|
||||
|
||||
distance := float64(0.0)
|
||||
for sp := maxLayers.Spatial; sp <= s.getMaxExpectedLayerLocked(); sp++ {
|
||||
for t := maxLayers.Temporal; t <= s.maxTemporalLayerSeen; t++ {
|
||||
distance++
|
||||
}
|
||||
}
|
||||
|
||||
return distance / float64(s.maxTemporalLayerSeen+1)
|
||||
distance :=
|
||||
((s.getMaxExpectedLayerLocked() - maxLayers.Spatial) * (s.maxTemporalLayerSeen + 1)) +
|
||||
(s.maxTemporalLayerSeen - maxLayers.Temporal)
|
||||
return float64(distance) / float64(s.maxTemporalLayerSeen+1)
|
||||
}
|
||||
|
||||
func (s *StreamTrackerManager) getMaxExpectedLayerLocked() int32 {
|
||||
|
||||
Reference in New Issue
Block a user