-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement target connection bandwidth #1736
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ class Client extends EventEmitter { | |
this.ioThreadPool = ioThreadPool; | ||
this.singlePc = singlePc; | ||
this.streamPriorityStrategy = Client._getStreamPriorityStrategy(streamPriorityStrategy); | ||
this.connectionTargetBw = options.connectionTargetBw || 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I like this third way of adding it. Shouldn't we obtain the value from the streamPriorityStrategy? this.connectionTargetBw = this.streamPriorityStrategy.connectionTargetBw; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value may have been updated, erizoController sends the last version with every addPublisher or addSubscriber. Here we're accounting for the case where this client was not present in this erizoJS |
||
this.connectionClientId = 0; | ||
this.options = options; | ||
} | ||
|
@@ -61,6 +62,7 @@ class Client extends EventEmitter { | |
configuration.isRemote = options.isRemote; | ||
configuration.encryptTransport = options.encryptTransport; | ||
configuration.streamPriorityStrategy = this.streamPriorityStrategy; | ||
configuration.connectionTargetBw = this.connectionTargetBw; | ||
const connection = new RtcPeerConnection(configuration); | ||
connection.on('status_event', (...args) => { | ||
this.emit('status_event', ...args); | ||
|
@@ -189,8 +191,16 @@ class Client extends EventEmitter { | |
return Array.from(this.connections.values()); | ||
} | ||
|
||
setConnectionTargetBw(connectionTargetBw) { | ||
this.connectionTargetBw = connectionTargetBw; | ||
this.connections.forEach((connection) => { | ||
connection.setConnectionTargetBw(connectionTargetBw); | ||
}); | ||
} | ||
|
||
setStreamPriorityStrategy(streamPriorityStrategy) { | ||
this.streamPriorityStrategy = Client._getStreamPriorityStrategy(streamPriorityStrategy); | ||
this.connectionTargetBw = this.streamPriorityStrategy.connectionTargetBw; | ||
this.connections.forEach((connection) => { | ||
connection.setStreamPriorityStrategy(this.streamPriorityStrategy); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍