@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 +13 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +13 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -5232,7 +5232,7 @@ function getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs) {
|
|
|
5232
5232
|
return (Math.floor(Math.sqrt((requestedMaxFs * 16 * 16) / (minNumberRatiosForWidth * minNumberRatiosForHeight))) * minNumberRatiosForHeight);
|
|
5233
5233
|
}
|
|
5234
5234
|
function getScaleDownRatio(sourceAspectRatio, sourceHeight, requestedMaxFs) {
|
|
5235
|
-
return sourceHeight / getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs);
|
|
5235
|
+
return Math.max(sourceHeight / getFrameHeightByMaxFs(sourceAspectRatio, requestedMaxFs), 1.0);
|
|
5236
5236
|
}
|
|
5237
5237
|
function getRecommendedMaxBitrateForFrameSize(requestedMaxFs) {
|
|
5238
5238
|
if (requestedMaxFs < 60) {
|
|
@@ -9075,9 +9075,9 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9075
9075
|
yield this.sender.setParameters(sendParameters);
|
|
9076
9076
|
});
|
|
9077
9077
|
}
|
|
9078
|
-
getScaleDownRatio(
|
|
9078
|
+
getScaleDownRatio(maxFs, maxWidth, maxHeight) {
|
|
9079
9079
|
var _a;
|
|
9080
|
-
if (!
|
|
9080
|
+
if (!maxFs) {
|
|
9081
9081
|
return -1;
|
|
9082
9082
|
}
|
|
9083
9083
|
if (!this.publishedTrack) {
|
|
@@ -9089,7 +9089,11 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9089
9089
|
if (!sourceWidth || !sourceHeight) {
|
|
9090
9090
|
return -1;
|
|
9091
9091
|
}
|
|
9092
|
-
|
|
9092
|
+
let scaleDownRatio = getScaleDownRatio([sourceWidth, sourceHeight], sourceHeight, maxFs);
|
|
9093
|
+
if (maxWidth && maxHeight) {
|
|
9094
|
+
scaleDownRatio = Math.max(sourceWidth / maxWidth, sourceHeight / maxHeight, scaleDownRatio);
|
|
9095
|
+
}
|
|
9096
|
+
return scaleDownRatio;
|
|
9093
9097
|
}
|
|
9094
9098
|
publishTrack(track) {
|
|
9095
9099
|
return this.replacePublishedTrack(track);
|
|
@@ -9206,7 +9210,9 @@ class SsrcIngressStreamSignaler {
|
|
|
9206
9210
|
mLine.addLine(new SsrcLine(this.ssrc, 'cname', `${this.ssrc}-cname`));
|
|
9207
9211
|
mLine.addLine(new SsrcLine(this.ssrc, 'msid', '-', '1'));
|
|
9208
9212
|
if (hasCodec('rtx', mLine)) {
|
|
9209
|
-
this.rtxSsrc
|
|
9213
|
+
if (!this.rtxSsrc) {
|
|
9214
|
+
this.rtxSsrc = generateSsrc();
|
|
9215
|
+
}
|
|
9210
9216
|
mLine.addLine(new SsrcLine(this.rtxSsrc, 'cname', `${this.ssrc}-cname`));
|
|
9211
9217
|
mLine.addLine(new SsrcLine(this.rtxSsrc, 'msid', '-', '1'));
|
|
9212
9218
|
mLine.addLine(new SsrcGroupLine('FID', [this.ssrc, this.rtxSsrc]));
|
|
@@ -9953,7 +9959,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
9953
9959
|
logger.warn('Ignoring non-receiver-selected requests');
|
|
9954
9960
|
}
|
|
9955
9961
|
rsRequests.forEach(({ ids, policySpecificInfo, codecInfos, maxPayloadBitsPerSecond }) => {
|
|
9956
|
-
var _a;
|
|
9962
|
+
var _a, _b, _c;
|
|
9957
9963
|
if (ids.length > 1) {
|
|
9958
9964
|
throw new Error(`More than a single ID being unexpected/invalid ${ids}`);
|
|
9959
9965
|
}
|
|
@@ -9973,7 +9979,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
9973
9979
|
const encodingIndex = signaler.getEncodingIndexForStreamId(id);
|
|
9974
9980
|
if (encodingIndex !== -1) {
|
|
9975
9981
|
requestedIdEncodingParamsMap.set(encodingIndex, {
|
|
9976
|
-
scaleDownRatio: sendTransceiver.getScaleDownRatio((_a = codecInfo === null || codecInfo === void 0 ? void 0 : codecInfo.h264) === null || _a === void 0 ? void 0 : _a.maxFs),
|
|
9982
|
+
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),
|
|
9977
9983
|
maxPayloadBitsPerSecond,
|
|
9978
9984
|
});
|
|
9979
9985
|
}
|