Skip to content

Commit

Permalink
fix(quality) Sends updated receiver constraints.
Browse files Browse the repository at this point in the history
Fixes a regression for JitsiConference::setReceiverVideoConstraint and JitsiConference::setAssumedBandwidthBps.
  • Loading branch information
jallamsetty1 committed Nov 5, 2024
1 parent c280c0e commit 0ef8314
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/RTC/RTC.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export default class RTC extends Listenable {
return;
}

this._receiverVideoConstraints = constraints;
this._receiverVideoConstraints = cloneDeep(constraints);

if (this._channel && this._channel.isOpen()) {
this._channel.sendReceiverVideoConstraintsMessage(constraints);
Expand Down
7 changes: 4 additions & 3 deletions modules/qualitycontrol/ReceiveVideoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ export default class ReceiveVideoController {
/**
* Updates the source based constraints based on the maxHeight set.
*
* @param {number} maxFrameHeight - the height to be requested for remote sources.
* @returns {void}
*/
_updateIndividualConstraints() {
_updateIndividualConstraints(maxFrameHeight) {
const individualConstraints = this._receiverVideoConstraints.constraints;

if (individualConstraints && Object.keys(individualConstraints).length) {
for (const value of Object.values(individualConstraints)) {
value.maxHeight = Math.min(value.maxHeight, this._maxFrameHeight);
value.maxHeight = maxFrameHeight ?? Math.min(value.maxHeight, this._maxFrameHeight);
}
} else {
this._receiverVideoConstraints.defaultConstraints = { 'maxHeight': this._maxFrameHeight };
Expand Down Expand Up @@ -184,7 +185,7 @@ export default class ReceiveVideoController {
if (session.isP2P) {
session.setReceiverVideoConstraint(this._getDefaultSourceReceiverConstraints(session, maxFrameHeight));
} else {
this._updateIndividualConstraints();
this._updateIndividualConstraints(maxFrameHeight);
this._rtc.setReceiverVideoConstraints(this._receiverVideoConstraints);
}
}
Expand Down

0 comments on commit 0ef8314

Please sign in to comment.