@webex/internal-media-core 0.0.15-beta → 0.0.16-beta

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
@@ -3796,7 +3796,7 @@ function appendToH264fmtpParams(sdp, paramsToAppend) {
3796
3796
  }
3797
3797
  });
3798
3798
  }
3799
- function setH264MaxFs(sdp, maxFsValue) {
3799
+ function adjustH264Profile(sdp, maxFsValue) {
3800
3800
  var maxFsForProfileLevel = {
3801
3801
  10: 99,
3802
3802
  11: 396,
@@ -3818,6 +3818,7 @@ function setH264MaxFs(sdp, maxFsValue) {
3818
3818
  61: 139264,
3819
3819
  62: 139264
3820
3820
  };
3821
+ var framesPerSecond = 30;
3821
3822
  sdp.avMedia.forEach(media => {
3822
3823
  if (media.type === 'video') {
3823
3824
  media.codecs.forEach(codec => {
@@ -3837,12 +3838,13 @@ function setH264MaxFs(sdp, maxFsValue) {
3837
3838
  return fmtp;
3838
3839
  }
3839
3840
  if (maxFsForProfileLevel[levelId] < maxFsValue) {
3840
- return "".concat(fmtp, ";max-fs=").concat(maxFsValue);
3841
+ return "".concat(fmtp, ";max-fs=").concat(maxFsValue, ";max-mbps=").concat(maxFsValue * framesPerSecond);
3841
3842
  }
3842
3843
  var newLevelId = Object.keys(maxFsForProfileLevel).reverse().find(key => maxFsForProfileLevel[key] === maxFsValue);
3843
3844
  if (newLevelId) {
3844
3845
  var newLevelIdHex = parseInt(newLevelId, 10).toString(16);
3845
- return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex).concat(stuffAfterProfileLevelId);
3846
+ var maxMbps = "max-mbps=".concat(maxFsValue * framesPerSecond);
3847
+ return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex, ";").concat(maxMbps).concat(stuffAfterProfileLevelId);
3846
3848
  }
3847
3849
  throw new Error("unsupported maxFsValue: ".concat(maxFsValue));
3848
3850
  }
@@ -3893,7 +3895,7 @@ function mungeLocalSdp(config, sdp) {
3893
3895
  disableExtmap(parsedSdp);
3894
3896
  }
3895
3897
  if (config.h264MaxFs) {
3896
- setH264MaxFs(parsedSdp, config.h264MaxFs);
3898
+ adjustH264Profile(parsedSdp, config.h264MaxFs);
3897
3899
  }
3898
3900
  return parsedSdp.toString();
3899
3901
  }
package/dist/esm/index.js CHANGED
@@ -3785,7 +3785,7 @@ function appendToH264fmtpParams(sdp, paramsToAppend) {
3785
3785
  }
3786
3786
  });
3787
3787
  }
3788
- function setH264MaxFs(sdp, maxFsValue) {
3788
+ function adjustH264Profile(sdp, maxFsValue) {
3789
3789
  var maxFsForProfileLevel = {
3790
3790
  10: 99,
3791
3791
  11: 396,
@@ -3807,6 +3807,7 @@ function setH264MaxFs(sdp, maxFsValue) {
3807
3807
  61: 139264,
3808
3808
  62: 139264
3809
3809
  };
3810
+ var framesPerSecond = 30;
3810
3811
  sdp.avMedia.forEach(media => {
3811
3812
  if (media.type === 'video') {
3812
3813
  media.codecs.forEach(codec => {
@@ -3826,12 +3827,13 @@ function setH264MaxFs(sdp, maxFsValue) {
3826
3827
  return fmtp;
3827
3828
  }
3828
3829
  if (maxFsForProfileLevel[levelId] < maxFsValue) {
3829
- return "".concat(fmtp, ";max-fs=").concat(maxFsValue);
3830
+ return "".concat(fmtp, ";max-fs=").concat(maxFsValue, ";max-mbps=").concat(maxFsValue * framesPerSecond);
3830
3831
  }
3831
3832
  var newLevelId = Object.keys(maxFsForProfileLevel).reverse().find(key => maxFsForProfileLevel[key] === maxFsValue);
3832
3833
  if (newLevelId) {
3833
3834
  var newLevelIdHex = parseInt(newLevelId, 10).toString(16);
3834
- return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex).concat(stuffAfterProfileLevelId);
3835
+ var maxMbps = "max-mbps=".concat(maxFsValue * framesPerSecond);
3836
+ return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex, ";").concat(maxMbps).concat(stuffAfterProfileLevelId);
3835
3837
  }
3836
3838
  throw new Error("unsupported maxFsValue: ".concat(maxFsValue));
3837
3839
  }
@@ -3882,7 +3884,7 @@ function mungeLocalSdp(config, sdp) {
3882
3884
  disableExtmap(parsedSdp);
3883
3885
  }
3884
3886
  if (config.h264MaxFs) {
3885
- setH264MaxFs(parsedSdp, config.h264MaxFs);
3887
+ adjustH264Profile(parsedSdp, config.h264MaxFs);
3886
3888
  }
3887
3889
  return parsedSdp.toString();
3888
3890
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/MediaConnection/utils.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAI1C,oBAAY,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,GACnC;IAAC,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAAC,SAAS,EAAE,0BAA0B,CAAA;CAAC,CAYpF;AAmBD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE;IACP,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB,EACD,GAAG,CAAC,EAAE,MAAM,GACX,KAAK,GAAG,KAAK,CA6Bf;AAkND,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQrF;AASD,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA2B3E;AAaD,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAc5E"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/MediaConnection/ut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CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/internal-media-core",
3
- "version": "0.0.15-beta",
3
+ "version": "0.0.16-beta",
4
4
  "files": [
5
5
  "dist/cjs",
6
6
  "dist/esm",