@webex/web-client-media-engine 3.35.0 → 3.35.1

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
@@ -7158,6 +7158,29 @@ function isValidActiveSpeakerNotificationMsg(msg) {
7158
7158
  const maybeActiveSpeakerNotificationMsg = msg;
7159
7159
  return Boolean(maybeActiveSpeakerNotificationMsg.seqNum && maybeActiveSpeakerNotificationMsg.csis);
7160
7160
  }
7161
+ function isValidAV1Codec(msg) {
7162
+ if (typeof msg !== 'object' || msg === null) {
7163
+ return false;
7164
+ }
7165
+ const maybeAV1Codec = msg;
7166
+ return (maybeAV1Codec.levelIdx >= 0 &&
7167
+ maybeAV1Codec.tier >= 0 &&
7168
+ Boolean(maybeAV1Codec.maxWidth) &&
7169
+ Boolean(maybeAV1Codec.maxHeight) &&
7170
+ Boolean(maybeAV1Codec.maxPicSize) &&
7171
+ Boolean(maybeAV1Codec.maxDecodeRate));
7172
+ }
7173
+ function areAV1CodecsEqual(left, right) {
7174
+ if (left === undefined || right === undefined) {
7175
+ return left === right;
7176
+ }
7177
+ return (left.levelIdx === right.levelIdx &&
7178
+ left.tier === right.tier &&
7179
+ left.maxWidth === right.maxWidth &&
7180
+ left.maxHeight === right.maxHeight &&
7181
+ left.maxPicSize === right.maxPicSize &&
7182
+ left.maxDecodeRate === right.maxDecodeRate);
7183
+ }
7161
7184
 
7162
7185
  class H264Codec {
7163
7186
  constructor(maxFs, maxFps, maxMbps, maxWidth, maxHeight) {
@@ -7168,6 +7191,13 @@ class H264Codec {
7168
7191
  this.maxHeight = maxHeight;
7169
7192
  }
7170
7193
  }
7194
+ function isValidH264Codec(msg) {
7195
+ if (typeof msg !== 'object' || msg === null) {
7196
+ return false;
7197
+ }
7198
+ const maybeH264Codec = msg;
7199
+ return Boolean(maybeH264Codec.maxFs && maybeH264Codec.maxFps && maybeH264Codec.maxMbps);
7200
+ }
7171
7201
  function areH264CodecsEqual(left, right) {
7172
7202
  if (left === undefined || right === undefined) {
7173
7203
  return left === right;
@@ -7180,13 +7210,31 @@ function areH264CodecsEqual(left, right) {
7180
7210
  }
7181
7211
 
7182
7212
  class CodecInfo$1 {
7183
- constructor(payloadType, h264) {
7213
+ constructor(payloadType, codec) {
7184
7214
  this.payloadType = payloadType;
7185
- this.h264 = h264;
7215
+ if (isValidAV1Codec(codec))
7216
+ this.av1 = codec;
7217
+ if (isValidH264Codec(codec))
7218
+ this.h264 = codec;
7219
+ }
7220
+ static fromH264(payloadType, h264) {
7221
+ return new CodecInfo$1(payloadType, h264);
7222
+ }
7223
+ static fromAv1(payloadType, av1) {
7224
+ return new CodecInfo$1(payloadType, av1);
7186
7225
  }
7187
7226
  }
7188
7227
  function areCodecInfosEqual(left, right) {
7189
- return left.payloadType === right.payloadType && areH264CodecsEqual(left.h264, right.h264);
7228
+ if (left.payloadType !== right.payloadType) {
7229
+ return false;
7230
+ }
7231
+ if (isValidH264Codec(left.h264) && isValidH264Codec(right.h264)) {
7232
+ return areH264CodecsEqual(left.h264, right.h264);
7233
+ }
7234
+ if (isValidAV1Codec(left.av1) && isValidAV1Codec(right.av1)) {
7235
+ return areAV1CodecsEqual(left.av1, right.av1);
7236
+ }
7237
+ return false;
7190
7238
  }
7191
7239
 
7192
7240
  var JmpMsgType;