Stream allocator - v0.2 (#216)

* Use protocol friendly StreamedTracksUpdate

* WIP commit

* Stream allocator update

* subtract the requested bandwidth as delta from Allocate could be adding to bandwidth

* Calculate delta correctly

* correct comment

* Simplify eventCh per David's suggestion
This commit is contained in:
Raja Subramanian
2021-12-01 01:05:19 +05:30
committed by GitHub
parent a799069392
commit 5e7f93c954
7 changed files with 1091 additions and 1027 deletions
+2 -2
View File
@@ -256,7 +256,7 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
return nil
}
func (t *PCTransport) OnStreamedTracksChange(f func(paused map[string][]string, resumed map[string][]string) error) {
func (t *PCTransport) OnStreamedTracksChange(f func(update *sfu.StreamedTracksUpdate) error) {
if t.streamAllocator == nil {
return
}
@@ -269,7 +269,7 @@ func (t *PCTransport) AddTrack(subTrack types.SubscribedTrack) {
return
}
t.streamAllocator.AddTrack(subTrack.DownTrack(), subTrack.PublisherIdentity())
t.streamAllocator.AddTrack(subTrack.DownTrack())
}
func (t *PCTransport) RemoveTrack(subTrack types.SubscribedTrack) {