Set DtxDisabled from TrackInfo in score calculation. (#770)

* Set DtxDisabled from TrackInfo in score calculation.

Also, fix sending connection quality upate on a new subscription.

* comments tweaks

* Move TrackInfo into StreamTrackerManager as this is used by cloud as well
This commit is contained in:
Raja Subramanian
2022-06-19 21:12:09 +05:30
committed by GitHub
parent 227247b012
commit 62943f2096
6 changed files with 109 additions and 83 deletions
+4 -2
View File
@@ -22,9 +22,9 @@ type ConnectionStatsParams struct {
UpdateInterval time.Duration
CodecType webrtc.RTPCodecType
CodecName string
DtxDisabled bool // RAJA-TODO - fix this
MimeType string
GetDeltaStats func() map[uint32]*buffer.StreamStatsWithLayers
IsDtxDisabled func() bool
GetLayerDimension func(int32) (uint32, uint32)
GetMaxExpectedLayer func() *livekit.VideoLayer
Logger logger.Logger
@@ -110,7 +110,9 @@ func (cs *ConnectionStats) updateScore(streams map[uint32]*buffer.StreamStatsWit
switch cs.params.CodecType {
case webrtc.RTPCodecTypeAudio:
// RAJA-TODO - need to set DTX in params
if cs.params.IsDtxDisabled != nil {
params.DtxDisabled = cs.params.IsDtxDisabled()
}
cs.score = AudioTrackScore(params)
case webrtc.RTPCodecTypeVideo: