@webex/web-client-media-engine 1.40.5 → 1.40.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -5236,7 +5236,7 @@ function getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs) {
5236
5236
  return (Math.floor(Math.sqrt((requestedMaxFs * 16 * 16) / (minNumberRatiosForWidth * minNumberRatiosForHeight))) * minNumberRatiosForHeight);
5237
5237
  }
5238
5238
  function getScaleDownRatio(sourceAspectRatio, sourceHeight, requestedMaxFs) {
5239
- return sourceHeight / getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs);
5239
+ return Math.max(sourceHeight / getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs), 1.0);
5240
5240
  }
5241
5241
  function getRecommendedMaxBitrateForFrameSize(requestedMaxFs) {
5242
5242
  if (requestedMaxFs < 60) {
@@ -9079,9 +9079,9 @@ class SendOnlyTransceiver extends Transceiver {
9079
9079
  yield this.sender.setParameters(sendParameters);
9080
9080
  });
9081
9081
  }
9082
- getScaleDownRatio(expectedMaxFs) {
9082
+ getScaleDownRatio(maxFs, maxWidth, maxHeight) {
9083
9083
  var _a;
9084
- if (!expectedMaxFs) {
9084
+ if (!maxFs) {
9085
9085
  return -1;
9086
9086
  }
9087
9087
  if (!this.publishedTrack) {
@@ -9093,7 +9093,11 @@ class SendOnlyTransceiver extends Transceiver {
9093
9093
  if (!sourceWidth || !sourceHeight) {
9094
9094
  return -1;
9095
9095
  }
9096
- return Math.max(getScaleDownRatio([sourceWidth, sourceHeight], sourceHeight, expectedMaxFs), 1.0);
9096
+ let scaleDownRatio = getScaleDownRatio([sourceWidth, sourceHeight], sourceHeight, maxFs);
9097
+ if (maxWidth && maxHeight) {
9098
+ scaleDownRatio = Math.max(sourceWidth / maxWidth, sourceHeight / maxHeight, scaleDownRatio);
9099
+ }
9100
+ return scaleDownRatio;
9097
9101
  }
9098
9102
  publishTrack(track) {
9099
9103
  return this.replacePublishedTrack(track);
@@ -9210,7 +9214,9 @@ class SsrcIngressStreamSignaler {
9210
9214
  mLine.addLine(new SsrcLine(this.ssrc, 'cname', `${this.ssrc}-cname`));
9211
9215
  mLine.addLine(new SsrcLine(this.ssrc, 'msid', '-', '1'));
9212
9216
  if (hasCodec('rtx', mLine)) {
9213
- this.rtxSsrc = generateSsrc();
9217
+ if (!this.rtxSsrc) {
9218
+ this.rtxSsrc = generateSsrc();
9219
+ }
9214
9220
  mLine.addLine(new SsrcLine(this.rtxSsrc, 'cname', `${this.ssrc}-cname`));
9215
9221
  mLine.addLine(new SsrcLine(this.rtxSsrc, 'msid', '-', '1'));
9216
9222
  mLine.addLine(new SsrcGroupLine('FID', [this.ssrc, this.rtxSsrc]));
@@ -9957,7 +9963,7 @@ class MultistreamConnection extends EventEmitter {
9957
9963
  logger.warn('Ignoring non-receiver-selected requests');
9958
9964
  }
9959
9965
  rsRequests.forEach(({ ids, policySpecificInfo, codecInfos, maxPayloadBitsPerSecond }) => {
9960
- var _a;
9966
+ var _a, _b, _c;
9961
9967
  if (ids.length > 1) {
9962
9968
  throw new Error(`More than a single ID being unexpected/invalid ${ids}`);
9963
9969
  }
@@ -9977,7 +9983,7 @@ class MultistreamConnection extends EventEmitter {
9977
9983
  const encodingIndex = signaler.getEncodingIndexForStreamId(id);
9978
9984
  if (encodingIndex !== -1) {
9979
9985
  requestedIdEncodingParamsMap.set(encodingIndex, {
9980
- scaleDownRatio: sendTransceiver.getScaleDownRatio((_a = codecInfo === null || codecInfo === void 0 ? void 0 : codecInfo.h264) === null || _a === void 0 ? void 0 : _a.maxFs),
9986
+ scaleDownRatio: sendTransceiver.getScaleDownRatio((_a = codecInfo === null || codecInfo === void 0 ? void 0 : codecInfo.h264) === null || _a === void 0 ? void 0 : _a.maxFs, (_b = codecInfo === null || codecInfo === void 0 ? void 0 : codecInfo.h264) === null || _b === void 0 ? void 0 : _b.maxWidth, (_c = codecInfo === null || codecInfo === void 0 ? void 0 : codecInfo.h264) === null || _c === void 0 ? void 0 : _c.maxHeight),
9981
9987
  maxPayloadBitsPerSecond,
9982
9988
  });
9983
9989
  }