Skip to content

Commit

Permalink
fix(quality-control) Check only for cpu limitation
Browse files Browse the repository at this point in the history
Checking for send resolution vs expected resolution was unnecessarily limiting lastN and receive resolution when local camera has issues and stops sending video. Also, do not send redundant receiver constraints on the bridge channel
  • Loading branch information
jallamsetty1 committed Sep 4, 2024
1 parent 6771b69 commit 9ff77a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion modules/RTC/RTC.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getLogger } from '@jitsi/logger';
import { cloneDeep } from 'lodash-es';
import { cloneDeep, isEqual } from 'lodash-es';

import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
import { MediaType } from '../../service/RTC/MediaType';
Expand Down Expand Up @@ -301,6 +301,10 @@ export default class RTC extends Listenable {
* @param {*} constraints
*/
setReceiverVideoConstraints(constraints) {
if (isEqual(this._receiverVideoConstraints, constraints)) {
return;
}

this._receiverVideoConstraints = constraints;

if (this._channel && this._channel.isOpen()) {
Expand Down
5 changes: 1 addition & 4 deletions modules/qualitycontrol/QualityController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,7 @@ export class QualityController {
// 2. Switch to a lower lastN value, cutting the receive videos by half in every iteration until
// MIN_LAST_N value is reached.
// 3. Lower the receive resolution of individual streams up to 180p.
if (qualityLimitationReason === QualityLimitationReason.CPU
|| (encodeResolution < tpc.calculateExpectedSendResolution(localTrack)
&& qualityLimitationReason !== QualityLimitationReason.BANDWIDTH)) {

if (qualityLimitationReason === QualityLimitationReason.CPU) {
if (this._lastNRampupTimeout) {
window.clearTimeout(this._lastNRampupTimeout);
this._lastNRampupTimeout = undefined;
Expand Down

0 comments on commit 9ff77a9

Please sign in to comment.