From 478eb48a50fbaa3937f10569dae69c715bf3549f Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Tue, 5 Nov 2024 15:11:32 -0500 Subject: [PATCH] fix(quality) Sends updated receiver constraints. Fixes a regression for JitsiConference::setReceiverVideoConstraint and JitsiConference::setAssumedBandwidthBps. --- modules/RTC/RTC.js | 2 +- modules/qualitycontrol/ReceiveVideoController.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.js index 20e00073de..e4fd348078 100644 --- a/modules/RTC/RTC.js +++ b/modules/RTC/RTC.js @@ -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); diff --git a/modules/qualitycontrol/ReceiveVideoController.js b/modules/qualitycontrol/ReceiveVideoController.js index 07e3f578a9..b3622f8ab1 100644 --- a/modules/qualitycontrol/ReceiveVideoController.js +++ b/modules/qualitycontrol/ReceiveVideoController.js @@ -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 }; @@ -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); } }