Indicate if track is expectd to be resumed in onClose callback. (#2800)

That is the main change. Changed variable name to `isExpectedToResume`
everywhere to be consistent.

Planning to use the callback value in relays to determine if the down
track should be closed or switched to a different up track.
This commit is contained in:
Raja Subramanian
2024-06-17 23:51:00 +05:30
committed by GitHub
parent aa72466ac8
commit ef838e4fa2
13 changed files with 99 additions and 97 deletions
+3 -3
View File
@@ -296,7 +296,7 @@ type DownTrack struct {
onStatsUpdate func(dt *DownTrack, stat *livekit.AnalyticsStat)
onMaxSubscribedLayerChanged func(dt *DownTrack, layer int32)
onRttUpdate func(dt *DownTrack, rtt uint32)
onCloseHandler func(willBeResumed bool)
onCloseHandler func(isExpectedToResume bool)
createdAt int64
}
@@ -1169,14 +1169,14 @@ func (d *DownTrack) UpTrackBitrateReport(availableLayers []int32, bitrates Bitra
}
// OnCloseHandler method to be called on remote tracked removed
func (d *DownTrack) OnCloseHandler(fn func(willBeResumed bool)) {
func (d *DownTrack) OnCloseHandler(fn func(isExpectedToResume bool)) {
d.cbMu.Lock()
defer d.cbMu.Unlock()
d.onCloseHandler = fn
}
func (d *DownTrack) getOnCloseHandler() func(willBeResumed bool) {
func (d *DownTrack) getOnCloseHandler() func(isExpectedToResume bool) {
d.cbMu.RLock()
defer d.cbMu.RUnlock()