Skip to content

Commit

Permalink
fix(qualitycontrol) SenderVideoConstraintsV2 changed to SenderSourceC…
Browse files Browse the repository at this point in the history
…onstraints.

The colibri class name for the source name sender constraints changed from SenderVideoConstraintsV2 to SenderSourceConstraints.
The new format is {colibriClass: 'SenderSourceConstraints', sourceName: 'b6746083-v0', maxHeight: 180}
  • Loading branch information
jallamsetty1 committed Feb 16, 2022
1 parent 55131be commit 9eb93e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions modules/RTC/BridgeChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,21 @@ export default class BridgeChannel {
}
break;
}
case 'SenderVideoConstraintsV2': {
case 'SenderSourceConstraints': {
if (FeatureFlags.isSourceNameSignalingEnabled()) {
const { sourceName, idealHeight } = obj;
const { sourceName, maxHeight } = obj;

if (typeof sourceName === 'string' && typeof idealHeight === 'number') {
if (typeof sourceName === 'string' && typeof maxHeight === 'number') {
// eslint-disable-next-line object-property-newline
logger.info(`SenderVideoConstraintsV2: ${JSON.stringify({ sourceName, idealHeight })}`);
logger.info(`SenderSourceConstraints: ${JSON.stringify({ sourceName, maxHeight })}`);
emitter.emit(
RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED, {
sourceName,
idealHeight
maxHeight
}
);
} else {
logger.error(`Invalid SenderVideoConstraintsV2: ${JSON.stringify(obj)}`);
logger.error(`Invalid SenderSourceConstraints: ${JSON.stringify(obj)}`);
}
}
break;
Expand Down
8 changes: 4 additions & 4 deletions modules/qualitycontrol/SendVideoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ export default class SendVideoController {
*/
_onSenderConstraintsReceived(videoConstraints) {
if (FeatureFlags.isSourceNameSignalingEnabled()) {
const { idealHeight, sourceName } = videoConstraints;
const { maxHeight, sourceName } = videoConstraints;
const localVideoTracks = this._conference.getLocalVideoTracks() ?? [];

for (const track of localVideoTracks) {
// Propagate the sender constraint only if it has changed.
if (track.getSourceName() === sourceName
&& (!this._sourceSenderConstraints.has(sourceName)
|| this._sourceSenderConstraints.get(sourceName) !== idealHeight)) {
this._sourceSenderConstraints.set(sourceName, idealHeight);
logger.debug(`Sender constraints for source:${sourceName} changed to idealHeight:${idealHeight}`);
|| this._sourceSenderConstraints.get(sourceName) !== maxHeight)) {
this._sourceSenderConstraints.set(sourceName, maxHeight);
logger.debug(`Sender constraints for source:${sourceName} changed to maxHeight:${maxHeight}`);
this._propagateSendMaxFrameHeight(sourceName);
}
}
Expand Down

0 comments on commit 9eb93e0

Please sign in to comment.