@stinkycomputing/sesame-api-client 1.4.1-alpha.1 → 1.4.1-alpha.11

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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/proto/api.js
2
- import * as $protobuf from "protobufjs/minimal";
2
+ import $protobuf from "protobufjs/minimal.js";
3
3
  var $Reader = $protobuf.Reader;
4
4
  var $Writer = $protobuf.Writer;
5
5
  var $util = $protobuf.util;
@@ -4448,7 +4448,6 @@ var sesame = $root.sesame = (() => {
4448
4448
  SourceCommonConfig.prototype.playState = 0;
4449
4449
  SourceCommonConfig.prototype.mipMap = false;
4450
4450
  SourceCommonConfig.prototype.textureSize = 0;
4451
- SourceCommonConfig.prototype.decoderType = 0;
4452
4451
  SourceCommonConfig.prototype.deinterlace = 0;
4453
4452
  SourceCommonConfig.prototype.videoProcessors = $util.emptyArray;
4454
4453
  SourceCommonConfig.create = function create(properties) {
@@ -4497,11 +4496,6 @@ var sesame = $root.sesame = (() => {
4497
4496
  /* id 8, wireType 0 =*/
4498
4497
  64
4499
4498
  ).int32(message.textureSize);
4500
- if (message.decoderType != null && Object.hasOwnProperty.call(message, "decoderType"))
4501
- writer.uint32(
4502
- /* id 9, wireType 0 =*/
4503
- 72
4504
- ).int32(message.decoderType);
4505
4499
  if (message.deinterlace != null && Object.hasOwnProperty.call(message, "deinterlace"))
4506
4500
  writer.uint32(
4507
4501
  /* id 10, wireType 0 =*/
@@ -4559,10 +4553,6 @@ var sesame = $root.sesame = (() => {
4559
4553
  message.textureSize = reader.int32();
4560
4554
  break;
4561
4555
  }
4562
- case 9: {
4563
- message.decoderType = reader.int32();
4564
- break;
4565
- }
4566
4556
  case 10: {
4567
4557
  message.deinterlace = reader.int32();
4568
4558
  break;
@@ -4632,16 +4622,6 @@ var sesame = $root.sesame = (() => {
4632
4622
  case 2:
4633
4623
  break;
4634
4624
  }
4635
- if (message.decoderType != null && message.hasOwnProperty("decoderType"))
4636
- switch (message.decoderType) {
4637
- default:
4638
- return "decoderType: enum value expected";
4639
- case 0:
4640
- case 1:
4641
- case 2:
4642
- case 3:
4643
- break;
4644
- }
4645
4625
  if (message.deinterlace != null && message.hasOwnProperty("deinterlace"))
4646
4626
  switch (message.deinterlace) {
4647
4627
  default:
@@ -4727,30 +4707,6 @@ var sesame = $root.sesame = (() => {
4727
4707
  message.textureSize = 2;
4728
4708
  break;
4729
4709
  }
4730
- switch (object.decoderType) {
4731
- default:
4732
- if (typeof object.decoderType === "number") {
4733
- message.decoderType = object.decoderType;
4734
- break;
4735
- }
4736
- break;
4737
- case "DECODER_TYPE_UNSPECIFIED":
4738
- case 0:
4739
- message.decoderType = 0;
4740
- break;
4741
- case "DECODER_TYPE_H264":
4742
- case 1:
4743
- message.decoderType = 1;
4744
- break;
4745
- case "DECODER_TYPE_HEVC":
4746
- case 2:
4747
- message.decoderType = 2;
4748
- break;
4749
- case "DECODER_TYPE_AV1":
4750
- case 3:
4751
- message.decoderType = 3;
4752
- break;
4753
- }
4754
4710
  switch (object.deinterlace) {
4755
4711
  default:
4756
4712
  if (typeof object.deinterlace === "number") {
@@ -4802,7 +4758,6 @@ var sesame = $root.sesame = (() => {
4802
4758
  object.playState = options.enums === String ? "SOURCE_TRANSPORT_STATE_STOPPED" : 0;
4803
4759
  object.mipMap = false;
4804
4760
  object.textureSize = options.enums === String ? "SOURCE_TEXTURE_SIZE_UNSPECIFIED" : 0;
4805
- object.decoderType = options.enums === String ? "DECODER_TYPE_UNSPECIFIED" : 0;
4806
4761
  object.deinterlace = options.enums === String ? "DEINTERLACE_TYPE_PROGRESSIVE" : 0;
4807
4762
  }
4808
4763
  if (message.userId != null && message.hasOwnProperty("userId"))
@@ -4821,8 +4776,6 @@ var sesame = $root.sesame = (() => {
4821
4776
  object.mipMap = message.mipMap;
4822
4777
  if (message.textureSize != null && message.hasOwnProperty("textureSize"))
4823
4778
  object.textureSize = options.enums === String ? $root.sesame.v1.sources.SourceTextureSize[message.textureSize] === void 0 ? message.textureSize : $root.sesame.v1.sources.SourceTextureSize[message.textureSize] : message.textureSize;
4824
- if (message.decoderType != null && message.hasOwnProperty("decoderType"))
4825
- object.decoderType = options.enums === String ? $root.sesame.v1.sources.DecoderType[message.decoderType] === void 0 ? message.decoderType : $root.sesame.v1.sources.DecoderType[message.decoderType] : message.decoderType;
4826
4779
  if (message.deinterlace != null && message.hasOwnProperty("deinterlace"))
4827
4780
  object.deinterlace = options.enums === String ? $root.sesame.v1.sources.DeinterlaceType[message.deinterlace] === void 0 ? message.deinterlace : $root.sesame.v1.sources.DeinterlaceType[message.deinterlace] : message.deinterlace;
4828
4781
  if (message.videoProcessors && message.videoProcessors.length) {
@@ -4940,6 +4893,7 @@ var sesame = $root.sesame = (() => {
4940
4893
  }
4941
4894
  }
4942
4895
  RecorderSourceConfig.prototype.recorderId = "";
4896
+ RecorderSourceConfig.prototype.decoderType = 0;
4943
4897
  RecorderSourceConfig.create = function create(properties) {
4944
4898
  return new RecorderSourceConfig(properties);
4945
4899
  };
@@ -4951,6 +4905,11 @@ var sesame = $root.sesame = (() => {
4951
4905
  /* id 1, wireType 2 =*/
4952
4906
  10
4953
4907
  ).string(message.recorderId);
4908
+ if (message.decoderType != null && Object.hasOwnProperty.call(message, "decoderType"))
4909
+ writer.uint32(
4910
+ /* id 2, wireType 0 =*/
4911
+ 16
4912
+ ).int32(message.decoderType);
4954
4913
  return writer;
4955
4914
  };
4956
4915
  RecorderSourceConfig.encodeDelimited = function encodeDelimited(message, writer) {
@@ -4969,6 +4928,10 @@ var sesame = $root.sesame = (() => {
4969
4928
  message.recorderId = reader.string();
4970
4929
  break;
4971
4930
  }
4931
+ case 2: {
4932
+ message.decoderType = reader.int32();
4933
+ break;
4934
+ }
4972
4935
  default:
4973
4936
  reader.skipType(tag & 7);
4974
4937
  break;
@@ -4988,6 +4951,16 @@ var sesame = $root.sesame = (() => {
4988
4951
  if (!$util.isString(message.recorderId))
4989
4952
  return "recorderId: string expected";
4990
4953
  }
4954
+ if (message.decoderType != null && message.hasOwnProperty("decoderType"))
4955
+ switch (message.decoderType) {
4956
+ default:
4957
+ return "decoderType: enum value expected";
4958
+ case 0:
4959
+ case 1:
4960
+ case 2:
4961
+ case 3:
4962
+ break;
4963
+ }
4991
4964
  return null;
4992
4965
  };
4993
4966
  RecorderSourceConfig.fromObject = function fromObject(object) {
@@ -4996,16 +4969,44 @@ var sesame = $root.sesame = (() => {
4996
4969
  let message = new $root.sesame.v1.sources.RecorderSourceConfig();
4997
4970
  if (object.recorderId != null)
4998
4971
  message.recorderId = String(object.recorderId);
4972
+ switch (object.decoderType) {
4973
+ default:
4974
+ if (typeof object.decoderType === "number") {
4975
+ message.decoderType = object.decoderType;
4976
+ break;
4977
+ }
4978
+ break;
4979
+ case "DECODER_TYPE_UNSPECIFIED":
4980
+ case 0:
4981
+ message.decoderType = 0;
4982
+ break;
4983
+ case "DECODER_TYPE_H264":
4984
+ case 1:
4985
+ message.decoderType = 1;
4986
+ break;
4987
+ case "DECODER_TYPE_HEVC":
4988
+ case 2:
4989
+ message.decoderType = 2;
4990
+ break;
4991
+ case "DECODER_TYPE_AV1":
4992
+ case 3:
4993
+ message.decoderType = 3;
4994
+ break;
4995
+ }
4999
4996
  return message;
5000
4997
  };
5001
4998
  RecorderSourceConfig.toObject = function toObject(message, options) {
5002
4999
  if (!options)
5003
5000
  options = {};
5004
5001
  let object = {};
5005
- if (options.defaults)
5002
+ if (options.defaults) {
5006
5003
  object.recorderId = "";
5004
+ object.decoderType = options.enums === String ? "DECODER_TYPE_UNSPECIFIED" : 0;
5005
+ }
5007
5006
  if (message.recorderId != null && message.hasOwnProperty("recorderId"))
5008
5007
  object.recorderId = message.recorderId;
5008
+ if (message.decoderType != null && message.hasOwnProperty("decoderType"))
5009
+ object.decoderType = options.enums === String ? $root.sesame.v1.sources.DecoderType[message.decoderType] === void 0 ? message.decoderType : $root.sesame.v1.sources.DecoderType[message.decoderType] : message.decoderType;
5009
5010
  return object;
5010
5011
  };
5011
5012
  RecorderSourceConfig.prototype.toJSON = function toJSON() {
@@ -8179,7 +8180,7 @@ var sesame = $root.sesame = (() => {
8179
8180
  RecorderClip.prototype.endTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
8180
8181
  RecorderClip.prototype.lockedStartUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
8181
8182
  RecorderClip.prototype.lockedEndUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
8182
- RecorderClip.prototype.userTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
8183
+ RecorderClip.prototype.userTimeMs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
8183
8184
  RecorderClip.create = function create(properties) {
8184
8185
  return new RecorderClip(properties);
8185
8186
  };
@@ -8226,11 +8227,11 @@ var sesame = $root.sesame = (() => {
8226
8227
  /* id 8, wireType 0 =*/
8227
8228
  64
8228
8229
  ).int64(message.lockedEndUs);
8229
- if (message.userTimeUs != null && Object.hasOwnProperty.call(message, "userTimeUs"))
8230
+ if (message.userTimeMs != null && Object.hasOwnProperty.call(message, "userTimeMs"))
8230
8231
  writer.uint32(
8231
8232
  /* id 9, wireType 0 =*/
8232
8233
  72
8233
- ).int64(message.userTimeUs);
8234
+ ).int64(message.userTimeMs);
8234
8235
  return writer;
8235
8236
  };
8236
8237
  RecorderClip.encodeDelimited = function encodeDelimited(message, writer) {
@@ -8278,7 +8279,7 @@ var sesame = $root.sesame = (() => {
8278
8279
  break;
8279
8280
  }
8280
8281
  case 9: {
8281
- message.userTimeUs = reader.int64();
8282
+ message.userTimeMs = reader.int64();
8282
8283
  break;
8283
8284
  }
8284
8285
  default:
@@ -8328,9 +8329,9 @@ var sesame = $root.sesame = (() => {
8328
8329
  if (!$util.isInteger(message.lockedEndUs) && !(message.lockedEndUs && $util.isInteger(message.lockedEndUs.low) && $util.isInteger(message.lockedEndUs.high)))
8329
8330
  return "lockedEndUs: integer|Long expected";
8330
8331
  }
8331
- if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs")) {
8332
- if (!$util.isInteger(message.userTimeUs) && !(message.userTimeUs && $util.isInteger(message.userTimeUs.low) && $util.isInteger(message.userTimeUs.high)))
8333
- return "userTimeUs: integer|Long expected";
8332
+ if (message.userTimeMs != null && message.hasOwnProperty("userTimeMs")) {
8333
+ if (!$util.isInteger(message.userTimeMs) && !(message.userTimeMs && $util.isInteger(message.userTimeMs.low) && $util.isInteger(message.userTimeMs.high)))
8334
+ return "userTimeMs: integer|Long expected";
8334
8335
  }
8335
8336
  return null;
8336
8337
  };
@@ -8402,15 +8403,15 @@ var sesame = $root.sesame = (() => {
8402
8403
  else if (typeof object.lockedEndUs === "object")
8403
8404
  message.lockedEndUs = new $util.LongBits(object.lockedEndUs.low >>> 0, object.lockedEndUs.high >>> 0).toNumber();
8404
8405
  }
8405
- if (object.userTimeUs != null) {
8406
+ if (object.userTimeMs != null) {
8406
8407
  if ($util.Long)
8407
- (message.userTimeUs = $util.Long.fromValue(object.userTimeUs)).unsigned = false;
8408
- else if (typeof object.userTimeUs === "string")
8409
- message.userTimeUs = parseInt(object.userTimeUs, 10);
8410
- else if (typeof object.userTimeUs === "number")
8411
- message.userTimeUs = object.userTimeUs;
8412
- else if (typeof object.userTimeUs === "object")
8413
- message.userTimeUs = new $util.LongBits(object.userTimeUs.low >>> 0, object.userTimeUs.high >>> 0).toNumber();
8408
+ (message.userTimeMs = $util.Long.fromValue(object.userTimeMs)).unsigned = false;
8409
+ else if (typeof object.userTimeMs === "string")
8410
+ message.userTimeMs = parseInt(object.userTimeMs, 10);
8411
+ else if (typeof object.userTimeMs === "number")
8412
+ message.userTimeMs = object.userTimeMs;
8413
+ else if (typeof object.userTimeMs === "object")
8414
+ message.userTimeMs = new $util.LongBits(object.userTimeMs.low >>> 0, object.userTimeMs.high >>> 0).toNumber();
8414
8415
  }
8415
8416
  return message;
8416
8417
  };
@@ -8453,9 +8454,9 @@ var sesame = $root.sesame = (() => {
8453
8454
  object.lockedEndUs = options.longs === String ? "0" : 0;
8454
8455
  if ($util.Long) {
8455
8456
  let long = new $util.Long(0, 0, false);
8456
- object.userTimeUs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
8457
+ object.userTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
8457
8458
  } else
8458
- object.userTimeUs = options.longs === String ? "0" : 0;
8459
+ object.userTimeMs = options.longs === String ? "0" : 0;
8459
8460
  }
8460
8461
  if (message.id != null && message.hasOwnProperty("id"))
8461
8462
  if (typeof message.id === "number")
@@ -8491,11 +8492,11 @@ var sesame = $root.sesame = (() => {
8491
8492
  object.lockedEndUs = options.longs === String ? String(message.lockedEndUs) : message.lockedEndUs;
8492
8493
  else
8493
8494
  object.lockedEndUs = options.longs === String ? $util.Long.prototype.toString.call(message.lockedEndUs) : options.longs === Number ? new $util.LongBits(message.lockedEndUs.low >>> 0, message.lockedEndUs.high >>> 0).toNumber() : message.lockedEndUs;
8494
- if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs"))
8495
- if (typeof message.userTimeUs === "number")
8496
- object.userTimeUs = options.longs === String ? String(message.userTimeUs) : message.userTimeUs;
8495
+ if (message.userTimeMs != null && message.hasOwnProperty("userTimeMs"))
8496
+ if (typeof message.userTimeMs === "number")
8497
+ object.userTimeMs = options.longs === String ? String(message.userTimeMs) : message.userTimeMs;
8497
8498
  else
8498
- object.userTimeUs = options.longs === String ? $util.Long.prototype.toString.call(message.userTimeUs) : options.longs === Number ? new $util.LongBits(message.userTimeUs.low >>> 0, message.userTimeUs.high >>> 0).toNumber() : message.userTimeUs;
8499
+ object.userTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.userTimeMs) : options.longs === Number ? new $util.LongBits(message.userTimeMs.low >>> 0, message.userTimeMs.high >>> 0).toNumber() : message.userTimeMs;
8499
8500
  return object;
8500
8501
  };
8501
8502
  RecorderClip.prototype.toJSON = function toJSON() {
@@ -14165,6 +14166,9 @@ var sesame = $root.sesame = (() => {
14165
14166
  EncoderConfig.prototype.preset = 0;
14166
14167
  EncoderConfig.prototype.bitrateKbps = 0;
14167
14168
  EncoderConfig.prototype.keyframeInterval = 0;
14169
+ EncoderConfig.prototype.width = 0;
14170
+ EncoderConfig.prototype.height = 0;
14171
+ EncoderConfig.prototype.fps = 0;
14168
14172
  EncoderConfig.create = function create(properties) {
14169
14173
  return new EncoderConfig(properties);
14170
14174
  };
@@ -14191,6 +14195,21 @@ var sesame = $root.sesame = (() => {
14191
14195
  /* id 4, wireType 0 =*/
14192
14196
  32
14193
14197
  ).uint32(message.keyframeInterval);
14198
+ if (message.width != null && Object.hasOwnProperty.call(message, "width"))
14199
+ writer.uint32(
14200
+ /* id 5, wireType 0 =*/
14201
+ 40
14202
+ ).uint32(message.width);
14203
+ if (message.height != null && Object.hasOwnProperty.call(message, "height"))
14204
+ writer.uint32(
14205
+ /* id 6, wireType 0 =*/
14206
+ 48
14207
+ ).uint32(message.height);
14208
+ if (message.fps != null && Object.hasOwnProperty.call(message, "fps"))
14209
+ writer.uint32(
14210
+ /* id 7, wireType 5 =*/
14211
+ 61
14212
+ ).float(message.fps);
14194
14213
  return writer;
14195
14214
  };
14196
14215
  EncoderConfig.encodeDelimited = function encodeDelimited(message, writer) {
@@ -14221,6 +14240,18 @@ var sesame = $root.sesame = (() => {
14221
14240
  message.keyframeInterval = reader.uint32();
14222
14241
  break;
14223
14242
  }
14243
+ case 5: {
14244
+ message.width = reader.uint32();
14245
+ break;
14246
+ }
14247
+ case 6: {
14248
+ message.height = reader.uint32();
14249
+ break;
14250
+ }
14251
+ case 7: {
14252
+ message.fps = reader.float();
14253
+ break;
14254
+ }
14224
14255
  default:
14225
14256
  reader.skipType(tag & 7);
14226
14257
  break;
@@ -14267,6 +14298,18 @@ var sesame = $root.sesame = (() => {
14267
14298
  if (!$util.isInteger(message.keyframeInterval))
14268
14299
  return "keyframeInterval: integer expected";
14269
14300
  }
14301
+ if (message.width != null && message.hasOwnProperty("width")) {
14302
+ if (!$util.isInteger(message.width))
14303
+ return "width: integer expected";
14304
+ }
14305
+ if (message.height != null && message.hasOwnProperty("height")) {
14306
+ if (!$util.isInteger(message.height))
14307
+ return "height: integer expected";
14308
+ }
14309
+ if (message.fps != null && message.hasOwnProperty("fps")) {
14310
+ if (typeof message.fps !== "number")
14311
+ return "fps: number expected";
14312
+ }
14270
14313
  return null;
14271
14314
  };
14272
14315
  EncoderConfig.fromObject = function fromObject(object) {
@@ -14337,6 +14380,12 @@ var sesame = $root.sesame = (() => {
14337
14380
  message.bitrateKbps = object.bitrateKbps >>> 0;
14338
14381
  if (object.keyframeInterval != null)
14339
14382
  message.keyframeInterval = object.keyframeInterval >>> 0;
14383
+ if (object.width != null)
14384
+ message.width = object.width >>> 0;
14385
+ if (object.height != null)
14386
+ message.height = object.height >>> 0;
14387
+ if (object.fps != null)
14388
+ message.fps = Number(object.fps);
14340
14389
  return message;
14341
14390
  };
14342
14391
  EncoderConfig.toObject = function toObject(message, options) {
@@ -14348,6 +14397,9 @@ var sesame = $root.sesame = (() => {
14348
14397
  object.preset = options.enums === String ? "ENCODER_PRESET_UNSPECIFIED" : 0;
14349
14398
  object.bitrateKbps = 0;
14350
14399
  object.keyframeInterval = 0;
14400
+ object.width = 0;
14401
+ object.height = 0;
14402
+ object.fps = 0;
14351
14403
  }
14352
14404
  if (message.codecId != null && message.hasOwnProperty("codecId"))
14353
14405
  object.codecId = options.enums === String ? $root.sesame.v1.common.CodecId[message.codecId] === void 0 ? message.codecId : $root.sesame.v1.common.CodecId[message.codecId] : message.codecId;
@@ -14357,6 +14409,12 @@ var sesame = $root.sesame = (() => {
14357
14409
  object.bitrateKbps = message.bitrateKbps;
14358
14410
  if (message.keyframeInterval != null && message.hasOwnProperty("keyframeInterval"))
14359
14411
  object.keyframeInterval = message.keyframeInterval;
14412
+ if (message.width != null && message.hasOwnProperty("width"))
14413
+ object.width = message.width;
14414
+ if (message.height != null && message.hasOwnProperty("height"))
14415
+ object.height = message.height;
14416
+ if (message.fps != null && message.hasOwnProperty("fps"))
14417
+ object.fps = options.json && !isFinite(message.fps) ? String(message.fps) : message.fps;
14360
14418
  return object;
14361
14419
  };
14362
14420
  EncoderConfig.prototype.toJSON = function toJSON() {
@@ -14370,72 +14428,62 @@ var sesame = $root.sesame = (() => {
14370
14428
  };
14371
14429
  return EncoderConfig;
14372
14430
  }();
14373
- outputs.OutputEncodedConfig = function() {
14374
- function OutputEncodedConfig(properties) {
14431
+ outputs.DecklinkOutputConfig = function() {
14432
+ function DecklinkOutputConfig(properties) {
14375
14433
  if (properties) {
14376
14434
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
14377
14435
  if (properties[keys[i]] != null)
14378
14436
  this[keys[i]] = properties[keys[i]];
14379
14437
  }
14380
14438
  }
14381
- OutputEncodedConfig.prototype.width = 0;
14382
- OutputEncodedConfig.prototype.height = 0;
14383
- OutputEncodedConfig.prototype.fps = 0;
14384
- OutputEncodedConfig.prototype.encoderConfig = null;
14385
- OutputEncodedConfig.create = function create(properties) {
14386
- return new OutputEncodedConfig(properties);
14387
- };
14388
- OutputEncodedConfig.encode = function encode(message, writer) {
14439
+ DecklinkOutputConfig.prototype.deviceIndex = 0;
14440
+ DecklinkOutputConfig.prototype.videoFormat = 0;
14441
+ DecklinkOutputConfig.prototype.keyAndFill = false;
14442
+ DecklinkOutputConfig.create = function create(properties) {
14443
+ return new DecklinkOutputConfig(properties);
14444
+ };
14445
+ DecklinkOutputConfig.encode = function encode(message, writer) {
14389
14446
  if (!writer)
14390
14447
  writer = $Writer.create();
14391
- if (message.width != null && Object.hasOwnProperty.call(message, "width"))
14448
+ if (message.deviceIndex != null && Object.hasOwnProperty.call(message, "deviceIndex"))
14392
14449
  writer.uint32(
14393
14450
  /* id 1, wireType 0 =*/
14394
14451
  8
14395
- ).uint32(message.width);
14396
- if (message.height != null && Object.hasOwnProperty.call(message, "height"))
14452
+ ).uint32(message.deviceIndex);
14453
+ if (message.videoFormat != null && Object.hasOwnProperty.call(message, "videoFormat"))
14397
14454
  writer.uint32(
14398
14455
  /* id 2, wireType 0 =*/
14399
14456
  16
14400
- ).uint32(message.height);
14401
- if (message.fps != null && Object.hasOwnProperty.call(message, "fps"))
14457
+ ).int32(message.videoFormat);
14458
+ if (message.keyAndFill != null && Object.hasOwnProperty.call(message, "keyAndFill"))
14402
14459
  writer.uint32(
14403
- /* id 3, wireType 5 =*/
14404
- 29
14405
- ).float(message.fps);
14406
- if (message.encoderConfig != null && Object.hasOwnProperty.call(message, "encoderConfig"))
14407
- $root.sesame.v1.outputs.EncoderConfig.encode(message.encoderConfig, writer.uint32(
14408
- /* id 4, wireType 2 =*/
14409
- 34
14410
- ).fork()).ldelim();
14460
+ /* id 3, wireType 0 =*/
14461
+ 24
14462
+ ).bool(message.keyAndFill);
14411
14463
  return writer;
14412
14464
  };
14413
- OutputEncodedConfig.encodeDelimited = function encodeDelimited(message, writer) {
14465
+ DecklinkOutputConfig.encodeDelimited = function encodeDelimited(message, writer) {
14414
14466
  return this.encode(message, writer).ldelim();
14415
14467
  };
14416
- OutputEncodedConfig.decode = function decode(reader, length, error) {
14468
+ DecklinkOutputConfig.decode = function decode(reader, length, error) {
14417
14469
  if (!(reader instanceof $Reader))
14418
14470
  reader = $Reader.create(reader);
14419
- let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.outputs.OutputEncodedConfig();
14471
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.outputs.DecklinkOutputConfig();
14420
14472
  while (reader.pos < end) {
14421
14473
  let tag = reader.uint32();
14422
14474
  if (tag === error)
14423
14475
  break;
14424
14476
  switch (tag >>> 3) {
14425
14477
  case 1: {
14426
- message.width = reader.uint32();
14478
+ message.deviceIndex = reader.uint32();
14427
14479
  break;
14428
14480
  }
14429
14481
  case 2: {
14430
- message.height = reader.uint32();
14482
+ message.videoFormat = reader.int32();
14431
14483
  break;
14432
14484
  }
14433
14485
  case 3: {
14434
- message.fps = reader.float();
14435
- break;
14436
- }
14437
- case 4: {
14438
- message.encoderConfig = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
14486
+ message.keyAndFill = reader.bool();
14439
14487
  break;
14440
14488
  }
14441
14489
  default:
@@ -14445,208 +14493,68 @@ var sesame = $root.sesame = (() => {
14445
14493
  }
14446
14494
  return message;
14447
14495
  };
14448
- OutputEncodedConfig.decodeDelimited = function decodeDelimited(reader) {
14496
+ DecklinkOutputConfig.decodeDelimited = function decodeDelimited(reader) {
14449
14497
  if (!(reader instanceof $Reader))
14450
14498
  reader = new $Reader(reader);
14451
14499
  return this.decode(reader, reader.uint32());
14452
14500
  };
14453
- OutputEncodedConfig.verify = function verify(message) {
14501
+ DecklinkOutputConfig.verify = function verify(message) {
14454
14502
  if (typeof message !== "object" || message === null)
14455
14503
  return "object expected";
14456
- if (message.width != null && message.hasOwnProperty("width")) {
14457
- if (!$util.isInteger(message.width))
14458
- return "width: integer expected";
14459
- }
14460
- if (message.height != null && message.hasOwnProperty("height")) {
14461
- if (!$util.isInteger(message.height))
14462
- return "height: integer expected";
14463
- }
14464
- if (message.fps != null && message.hasOwnProperty("fps")) {
14465
- if (typeof message.fps !== "number")
14466
- return "fps: number expected";
14504
+ if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) {
14505
+ if (!$util.isInteger(message.deviceIndex))
14506
+ return "deviceIndex: integer expected";
14467
14507
  }
14468
- if (message.encoderConfig != null && message.hasOwnProperty("encoderConfig")) {
14469
- let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoderConfig);
14470
- if (error)
14471
- return "encoderConfig." + error;
14508
+ if (message.videoFormat != null && message.hasOwnProperty("videoFormat"))
14509
+ switch (message.videoFormat) {
14510
+ default:
14511
+ return "videoFormat: enum value expected";
14512
+ case 0:
14513
+ case 1:
14514
+ case 2:
14515
+ case 3:
14516
+ case 4:
14517
+ break;
14518
+ }
14519
+ if (message.keyAndFill != null && message.hasOwnProperty("keyAndFill")) {
14520
+ if (typeof message.keyAndFill !== "boolean")
14521
+ return "keyAndFill: boolean expected";
14472
14522
  }
14473
14523
  return null;
14474
14524
  };
14475
- OutputEncodedConfig.fromObject = function fromObject(object) {
14476
- if (object instanceof $root.sesame.v1.outputs.OutputEncodedConfig)
14525
+ DecklinkOutputConfig.fromObject = function fromObject(object) {
14526
+ if (object instanceof $root.sesame.v1.outputs.DecklinkOutputConfig)
14477
14527
  return object;
14478
- let message = new $root.sesame.v1.outputs.OutputEncodedConfig();
14479
- if (object.width != null)
14480
- message.width = object.width >>> 0;
14481
- if (object.height != null)
14482
- message.height = object.height >>> 0;
14483
- if (object.fps != null)
14484
- message.fps = Number(object.fps);
14485
- if (object.encoderConfig != null) {
14486
- if (typeof object.encoderConfig !== "object")
14487
- throw TypeError(".sesame.v1.outputs.OutputEncodedConfig.encoderConfig: object expected");
14488
- message.encoderConfig = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoderConfig);
14489
- }
14490
- return message;
14491
- };
14492
- OutputEncodedConfig.toObject = function toObject(message, options) {
14493
- if (!options)
14494
- options = {};
14495
- let object = {};
14496
- if (options.defaults) {
14497
- object.width = 0;
14498
- object.height = 0;
14499
- object.fps = 0;
14500
- object.encoderConfig = null;
14501
- }
14502
- if (message.width != null && message.hasOwnProperty("width"))
14503
- object.width = message.width;
14504
- if (message.height != null && message.hasOwnProperty("height"))
14505
- object.height = message.height;
14506
- if (message.fps != null && message.hasOwnProperty("fps"))
14507
- object.fps = options.json && !isFinite(message.fps) ? String(message.fps) : message.fps;
14508
- if (message.encoderConfig != null && message.hasOwnProperty("encoderConfig"))
14509
- object.encoderConfig = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoderConfig, options);
14510
- return object;
14511
- };
14512
- OutputEncodedConfig.prototype.toJSON = function toJSON() {
14513
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
14514
- };
14515
- OutputEncodedConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
14516
- if (typeUrlPrefix === void 0) {
14517
- typeUrlPrefix = "type.googleapis.com";
14518
- }
14519
- return typeUrlPrefix + "/sesame.v1.outputs.OutputEncodedConfig";
14520
- };
14521
- return OutputEncodedConfig;
14522
- }();
14523
- outputs.DecklinkOutputConfig = function() {
14524
- function DecklinkOutputConfig(properties) {
14525
- if (properties) {
14526
- for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
14527
- if (properties[keys[i]] != null)
14528
- this[keys[i]] = properties[keys[i]];
14529
- }
14530
- }
14531
- DecklinkOutputConfig.prototype.deviceIndex = 0;
14532
- DecklinkOutputConfig.prototype.videoFormat = 0;
14533
- DecklinkOutputConfig.prototype.keyAndFill = false;
14534
- DecklinkOutputConfig.create = function create(properties) {
14535
- return new DecklinkOutputConfig(properties);
14536
- };
14537
- DecklinkOutputConfig.encode = function encode(message, writer) {
14538
- if (!writer)
14539
- writer = $Writer.create();
14540
- if (message.deviceIndex != null && Object.hasOwnProperty.call(message, "deviceIndex"))
14541
- writer.uint32(
14542
- /* id 1, wireType 0 =*/
14543
- 8
14544
- ).uint32(message.deviceIndex);
14545
- if (message.videoFormat != null && Object.hasOwnProperty.call(message, "videoFormat"))
14546
- writer.uint32(
14547
- /* id 2, wireType 0 =*/
14548
- 16
14549
- ).int32(message.videoFormat);
14550
- if (message.keyAndFill != null && Object.hasOwnProperty.call(message, "keyAndFill"))
14551
- writer.uint32(
14552
- /* id 3, wireType 0 =*/
14553
- 24
14554
- ).bool(message.keyAndFill);
14555
- return writer;
14556
- };
14557
- DecklinkOutputConfig.encodeDelimited = function encodeDelimited(message, writer) {
14558
- return this.encode(message, writer).ldelim();
14559
- };
14560
- DecklinkOutputConfig.decode = function decode(reader, length, error) {
14561
- if (!(reader instanceof $Reader))
14562
- reader = $Reader.create(reader);
14563
- let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.outputs.DecklinkOutputConfig();
14564
- while (reader.pos < end) {
14565
- let tag = reader.uint32();
14566
- if (tag === error)
14567
- break;
14568
- switch (tag >>> 3) {
14569
- case 1: {
14570
- message.deviceIndex = reader.uint32();
14571
- break;
14572
- }
14573
- case 2: {
14574
- message.videoFormat = reader.int32();
14575
- break;
14576
- }
14577
- case 3: {
14578
- message.keyAndFill = reader.bool();
14579
- break;
14580
- }
14581
- default:
14582
- reader.skipType(tag & 7);
14583
- break;
14584
- }
14585
- }
14586
- return message;
14587
- };
14588
- DecklinkOutputConfig.decodeDelimited = function decodeDelimited(reader) {
14589
- if (!(reader instanceof $Reader))
14590
- reader = new $Reader(reader);
14591
- return this.decode(reader, reader.uint32());
14592
- };
14593
- DecklinkOutputConfig.verify = function verify(message) {
14594
- if (typeof message !== "object" || message === null)
14595
- return "object expected";
14596
- if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) {
14597
- if (!$util.isInteger(message.deviceIndex))
14598
- return "deviceIndex: integer expected";
14599
- }
14600
- if (message.videoFormat != null && message.hasOwnProperty("videoFormat"))
14601
- switch (message.videoFormat) {
14602
- default:
14603
- return "videoFormat: enum value expected";
14604
- case 0:
14605
- case 1:
14606
- case 2:
14607
- case 3:
14608
- case 4:
14609
- break;
14610
- }
14611
- if (message.keyAndFill != null && message.hasOwnProperty("keyAndFill")) {
14612
- if (typeof message.keyAndFill !== "boolean")
14613
- return "keyAndFill: boolean expected";
14614
- }
14615
- return null;
14616
- };
14617
- DecklinkOutputConfig.fromObject = function fromObject(object) {
14618
- if (object instanceof $root.sesame.v1.outputs.DecklinkOutputConfig)
14619
- return object;
14620
- let message = new $root.sesame.v1.outputs.DecklinkOutputConfig();
14621
- if (object.deviceIndex != null)
14622
- message.deviceIndex = object.deviceIndex >>> 0;
14623
- switch (object.videoFormat) {
14624
- default:
14625
- if (typeof object.videoFormat === "number") {
14626
- message.videoFormat = object.videoFormat;
14627
- break;
14628
- }
14629
- break;
14630
- case "VIDEO_FORMAT_UNSPECIFIED":
14631
- case 0:
14632
- message.videoFormat = 0;
14633
- break;
14634
- case "VIDEO_FORMAT_1080_50I":
14635
- case 1:
14636
- message.videoFormat = 1;
14637
- break;
14638
- case "VIDEO_FORMAT_1080_50P":
14639
- case 2:
14640
- message.videoFormat = 2;
14641
- break;
14642
- case "VIDEO_FORMAT_1080_60I":
14643
- case 3:
14644
- message.videoFormat = 3;
14645
- break;
14646
- case "VIDEO_FORMAT_1080_60P":
14647
- case 4:
14648
- message.videoFormat = 4;
14649
- break;
14528
+ let message = new $root.sesame.v1.outputs.DecklinkOutputConfig();
14529
+ if (object.deviceIndex != null)
14530
+ message.deviceIndex = object.deviceIndex >>> 0;
14531
+ switch (object.videoFormat) {
14532
+ default:
14533
+ if (typeof object.videoFormat === "number") {
14534
+ message.videoFormat = object.videoFormat;
14535
+ break;
14536
+ }
14537
+ break;
14538
+ case "VIDEO_FORMAT_UNSPECIFIED":
14539
+ case 0:
14540
+ message.videoFormat = 0;
14541
+ break;
14542
+ case "VIDEO_FORMAT_1080_50I":
14543
+ case 1:
14544
+ message.videoFormat = 1;
14545
+ break;
14546
+ case "VIDEO_FORMAT_1080_50P":
14547
+ case 2:
14548
+ message.videoFormat = 2;
14549
+ break;
14550
+ case "VIDEO_FORMAT_1080_60I":
14551
+ case 3:
14552
+ message.videoFormat = 3;
14553
+ break;
14554
+ case "VIDEO_FORMAT_1080_60P":
14555
+ case 4:
14556
+ message.videoFormat = 4;
14557
+ break;
14650
14558
  }
14651
14559
  if (object.keyAndFill != null)
14652
14560
  message.keyAndFill = Boolean(object.keyAndFill);
@@ -14689,7 +14597,7 @@ var sesame = $root.sesame = (() => {
14689
14597
  }
14690
14598
  }
14691
14599
  EncodedWebSocketOutputConfig.prototype.channel = "";
14692
- EncodedWebSocketOutputConfig.prototype.encoded = null;
14600
+ EncodedWebSocketOutputConfig.prototype.encoder = null;
14693
14601
  EncodedWebSocketOutputConfig.create = function create(properties) {
14694
14602
  return new EncodedWebSocketOutputConfig(properties);
14695
14603
  };
@@ -14701,8 +14609,8 @@ var sesame = $root.sesame = (() => {
14701
14609
  /* id 1, wireType 2 =*/
14702
14610
  10
14703
14611
  ).string(message.channel);
14704
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
14705
- $root.sesame.v1.outputs.OutputEncodedConfig.encode(message.encoded, writer.uint32(
14612
+ if (message.encoder != null && Object.hasOwnProperty.call(message, "encoder"))
14613
+ $root.sesame.v1.outputs.EncoderConfig.encode(message.encoder, writer.uint32(
14706
14614
  /* id 2, wireType 2 =*/
14707
14615
  18
14708
14616
  ).fork()).ldelim();
@@ -14725,7 +14633,7 @@ var sesame = $root.sesame = (() => {
14725
14633
  break;
14726
14634
  }
14727
14635
  case 2: {
14728
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.decode(reader, reader.uint32());
14636
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
14729
14637
  break;
14730
14638
  }
14731
14639
  default:
@@ -14747,10 +14655,10 @@ var sesame = $root.sesame = (() => {
14747
14655
  if (!$util.isString(message.channel))
14748
14656
  return "channel: string expected";
14749
14657
  }
14750
- if (message.encoded != null && message.hasOwnProperty("encoded")) {
14751
- let error = $root.sesame.v1.outputs.OutputEncodedConfig.verify(message.encoded);
14658
+ if (message.encoder != null && message.hasOwnProperty("encoder")) {
14659
+ let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoder);
14752
14660
  if (error)
14753
- return "encoded." + error;
14661
+ return "encoder." + error;
14754
14662
  }
14755
14663
  return null;
14756
14664
  };
@@ -14760,10 +14668,10 @@ var sesame = $root.sesame = (() => {
14760
14668
  let message = new $root.sesame.v1.outputs.EncodedWebSocketOutputConfig();
14761
14669
  if (object.channel != null)
14762
14670
  message.channel = String(object.channel);
14763
- if (object.encoded != null) {
14764
- if (typeof object.encoded !== "object")
14765
- throw TypeError(".sesame.v1.outputs.EncodedWebSocketOutputConfig.encoded: object expected");
14766
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.fromObject(object.encoded);
14671
+ if (object.encoder != null) {
14672
+ if (typeof object.encoder !== "object")
14673
+ throw TypeError(".sesame.v1.outputs.EncodedWebSocketOutputConfig.encoder: object expected");
14674
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoder);
14767
14675
  }
14768
14676
  return message;
14769
14677
  };
@@ -14773,12 +14681,12 @@ var sesame = $root.sesame = (() => {
14773
14681
  let object = {};
14774
14682
  if (options.defaults) {
14775
14683
  object.channel = "";
14776
- object.encoded = null;
14684
+ object.encoder = null;
14777
14685
  }
14778
14686
  if (message.channel != null && message.hasOwnProperty("channel"))
14779
14687
  object.channel = message.channel;
14780
- if (message.encoded != null && message.hasOwnProperty("encoded"))
14781
- object.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.toObject(message.encoded, options);
14688
+ if (message.encoder != null && message.hasOwnProperty("encoder"))
14689
+ object.encoder = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoder, options);
14782
14690
  return object;
14783
14691
  };
14784
14692
  EncodedWebSocketOutputConfig.prototype.toJSON = function toJSON() {
@@ -14800,7 +14708,7 @@ var sesame = $root.sesame = (() => {
14800
14708
  this[keys[i]] = properties[keys[i]];
14801
14709
  }
14802
14710
  }
14803
- EncodedRecorderOutputConfig.prototype.encoded = null;
14711
+ EncodedRecorderOutputConfig.prototype.encoder = null;
14804
14712
  EncodedRecorderOutputConfig.prototype.filename = "";
14805
14713
  EncodedRecorderOutputConfig.prototype.sizeGb = 0;
14806
14714
  EncodedRecorderOutputConfig.prototype.groupId = "";
@@ -14811,8 +14719,8 @@ var sesame = $root.sesame = (() => {
14811
14719
  EncodedRecorderOutputConfig.encode = function encode(message, writer) {
14812
14720
  if (!writer)
14813
14721
  writer = $Writer.create();
14814
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
14815
- $root.sesame.v1.outputs.OutputEncodedConfig.encode(message.encoded, writer.uint32(
14722
+ if (message.encoder != null && Object.hasOwnProperty.call(message, "encoder"))
14723
+ $root.sesame.v1.outputs.EncoderConfig.encode(message.encoder, writer.uint32(
14816
14724
  /* id 1, wireType 2 =*/
14817
14725
  10
14818
14726
  ).fork()).ldelim();
@@ -14851,7 +14759,7 @@ var sesame = $root.sesame = (() => {
14851
14759
  break;
14852
14760
  switch (tag >>> 3) {
14853
14761
  case 1: {
14854
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.decode(reader, reader.uint32());
14762
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
14855
14763
  break;
14856
14764
  }
14857
14765
  case 2: {
@@ -14885,10 +14793,10 @@ var sesame = $root.sesame = (() => {
14885
14793
  EncodedRecorderOutputConfig.verify = function verify(message) {
14886
14794
  if (typeof message !== "object" || message === null)
14887
14795
  return "object expected";
14888
- if (message.encoded != null && message.hasOwnProperty("encoded")) {
14889
- let error = $root.sesame.v1.outputs.OutputEncodedConfig.verify(message.encoded);
14796
+ if (message.encoder != null && message.hasOwnProperty("encoder")) {
14797
+ let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoder);
14890
14798
  if (error)
14891
- return "encoded." + error;
14799
+ return "encoder." + error;
14892
14800
  }
14893
14801
  if (message.filename != null && message.hasOwnProperty("filename")) {
14894
14802
  if (!$util.isString(message.filename))
@@ -14917,10 +14825,10 @@ var sesame = $root.sesame = (() => {
14917
14825
  if (object instanceof $root.sesame.v1.outputs.EncodedRecorderOutputConfig)
14918
14826
  return object;
14919
14827
  let message = new $root.sesame.v1.outputs.EncodedRecorderOutputConfig();
14920
- if (object.encoded != null) {
14921
- if (typeof object.encoded !== "object")
14922
- throw TypeError(".sesame.v1.outputs.EncodedRecorderOutputConfig.encoded: object expected");
14923
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.fromObject(object.encoded);
14828
+ if (object.encoder != null) {
14829
+ if (typeof object.encoder !== "object")
14830
+ throw TypeError(".sesame.v1.outputs.EncodedRecorderOutputConfig.encoder: object expected");
14831
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoder);
14924
14832
  }
14925
14833
  if (object.filename != null)
14926
14834
  message.filename = String(object.filename);
@@ -14955,14 +14863,14 @@ var sesame = $root.sesame = (() => {
14955
14863
  options = {};
14956
14864
  let object = {};
14957
14865
  if (options.defaults) {
14958
- object.encoded = null;
14866
+ object.encoder = null;
14959
14867
  object.filename = "";
14960
14868
  object.sizeGb = 0;
14961
14869
  object.groupId = "";
14962
14870
  object.recorderType = options.enums === String ? "RECORDER_TYPE_UNSPECIFIED" : 0;
14963
14871
  }
14964
- if (message.encoded != null && message.hasOwnProperty("encoded"))
14965
- object.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.toObject(message.encoded, options);
14872
+ if (message.encoder != null && message.hasOwnProperty("encoder"))
14873
+ object.encoder = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoder, options);
14966
14874
  if (message.filename != null && message.hasOwnProperty("filename"))
14967
14875
  object.filename = message.filename;
14968
14876
  if (message.sizeGb != null && message.hasOwnProperty("sizeGb"))
@@ -14994,7 +14902,7 @@ var sesame = $root.sesame = (() => {
14994
14902
  this[keys[i]] = properties[keys[i]];
14995
14903
  }
14996
14904
  }
14997
- EncodedSuperSlowMoRecorderOutputConfig.prototype.encoded = null;
14905
+ EncodedSuperSlowMoRecorderOutputConfig.prototype.encoder = null;
14998
14906
  EncodedSuperSlowMoRecorderOutputConfig.prototype.filename = "";
14999
14907
  EncodedSuperSlowMoRecorderOutputConfig.prototype.sizeGb = 0;
15000
14908
  EncodedSuperSlowMoRecorderOutputConfig.prototype.groupId = "";
@@ -15007,8 +14915,8 @@ var sesame = $root.sesame = (() => {
15007
14915
  EncodedSuperSlowMoRecorderOutputConfig.encode = function encode(message, writer) {
15008
14916
  if (!writer)
15009
14917
  writer = $Writer.create();
15010
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
15011
- $root.sesame.v1.outputs.OutputEncodedConfig.encode(message.encoded, writer.uint32(
14918
+ if (message.encoder != null && Object.hasOwnProperty.call(message, "encoder"))
14919
+ $root.sesame.v1.outputs.EncoderConfig.encode(message.encoder, writer.uint32(
15012
14920
  /* id 1, wireType 2 =*/
15013
14921
  10
15014
14922
  ).fork()).ldelim();
@@ -15059,7 +14967,7 @@ var sesame = $root.sesame = (() => {
15059
14967
  break;
15060
14968
  switch (tag >>> 3) {
15061
14969
  case 1: {
15062
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.decode(reader, reader.uint32());
14970
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
15063
14971
  break;
15064
14972
  }
15065
14973
  case 2: {
@@ -15105,10 +15013,10 @@ var sesame = $root.sesame = (() => {
15105
15013
  EncodedSuperSlowMoRecorderOutputConfig.verify = function verify(message) {
15106
15014
  if (typeof message !== "object" || message === null)
15107
15015
  return "object expected";
15108
- if (message.encoded != null && message.hasOwnProperty("encoded")) {
15109
- let error = $root.sesame.v1.outputs.OutputEncodedConfig.verify(message.encoded);
15016
+ if (message.encoder != null && message.hasOwnProperty("encoder")) {
15017
+ let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoder);
15110
15018
  if (error)
15111
- return "encoded." + error;
15019
+ return "encoder." + error;
15112
15020
  }
15113
15021
  if (message.filename != null && message.hasOwnProperty("filename")) {
15114
15022
  if (!$util.isString(message.filename))
@@ -15151,10 +15059,10 @@ var sesame = $root.sesame = (() => {
15151
15059
  if (object instanceof $root.sesame.v1.outputs.EncodedSuperSlowMoRecorderOutputConfig)
15152
15060
  return object;
15153
15061
  let message = new $root.sesame.v1.outputs.EncodedSuperSlowMoRecorderOutputConfig();
15154
- if (object.encoded != null) {
15155
- if (typeof object.encoded !== "object")
15156
- throw TypeError(".sesame.v1.outputs.EncodedSuperSlowMoRecorderOutputConfig.encoded: object expected");
15157
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.fromObject(object.encoded);
15062
+ if (object.encoder != null) {
15063
+ if (typeof object.encoder !== "object")
15064
+ throw TypeError(".sesame.v1.outputs.EncodedSuperSlowMoRecorderOutputConfig.encoder: object expected");
15065
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoder);
15158
15066
  }
15159
15067
  if (object.filename != null)
15160
15068
  message.filename = String(object.filename);
@@ -15207,14 +15115,14 @@ var sesame = $root.sesame = (() => {
15207
15115
  object.sourceIds = [];
15208
15116
  }
15209
15117
  if (options.defaults) {
15210
- object.encoded = null;
15118
+ object.encoder = null;
15211
15119
  object.filename = "";
15212
15120
  object.sizeGb = 0;
15213
15121
  object.groupId = "";
15214
15122
  object.recorderType = options.enums === String ? "RECORDER_TYPE_UNSPECIFIED" : 0;
15215
15123
  }
15216
- if (message.encoded != null && message.hasOwnProperty("encoded"))
15217
- object.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.toObject(message.encoded, options);
15124
+ if (message.encoder != null && message.hasOwnProperty("encoder"))
15125
+ object.encoder = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoder, options);
15218
15126
  if (message.filename != null && message.hasOwnProperty("filename"))
15219
15127
  object.filename = message.filename;
15220
15128
  if (message.sizeGb != null && message.hasOwnProperty("sizeGb"))
@@ -15255,7 +15163,7 @@ var sesame = $root.sesame = (() => {
15255
15163
  }
15256
15164
  }
15257
15165
  EncodedSrtOutputConfig.prototype.url = "";
15258
- EncodedSrtOutputConfig.prototype.encoded = null;
15166
+ EncodedSrtOutputConfig.prototype.encoder = null;
15259
15167
  EncodedSrtOutputConfig.create = function create(properties) {
15260
15168
  return new EncodedSrtOutputConfig(properties);
15261
15169
  };
@@ -15267,8 +15175,8 @@ var sesame = $root.sesame = (() => {
15267
15175
  /* id 1, wireType 2 =*/
15268
15176
  10
15269
15177
  ).string(message.url);
15270
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
15271
- $root.sesame.v1.outputs.OutputEncodedConfig.encode(message.encoded, writer.uint32(
15178
+ if (message.encoder != null && Object.hasOwnProperty.call(message, "encoder"))
15179
+ $root.sesame.v1.outputs.EncoderConfig.encode(message.encoder, writer.uint32(
15272
15180
  /* id 2, wireType 2 =*/
15273
15181
  18
15274
15182
  ).fork()).ldelim();
@@ -15291,7 +15199,7 @@ var sesame = $root.sesame = (() => {
15291
15199
  break;
15292
15200
  }
15293
15201
  case 2: {
15294
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.decode(reader, reader.uint32());
15202
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
15295
15203
  break;
15296
15204
  }
15297
15205
  default:
@@ -15313,10 +15221,10 @@ var sesame = $root.sesame = (() => {
15313
15221
  if (!$util.isString(message.url))
15314
15222
  return "url: string expected";
15315
15223
  }
15316
- if (message.encoded != null && message.hasOwnProperty("encoded")) {
15317
- let error = $root.sesame.v1.outputs.OutputEncodedConfig.verify(message.encoded);
15224
+ if (message.encoder != null && message.hasOwnProperty("encoder")) {
15225
+ let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoder);
15318
15226
  if (error)
15319
- return "encoded." + error;
15227
+ return "encoder." + error;
15320
15228
  }
15321
15229
  return null;
15322
15230
  };
@@ -15326,10 +15234,10 @@ var sesame = $root.sesame = (() => {
15326
15234
  let message = new $root.sesame.v1.outputs.EncodedSrtOutputConfig();
15327
15235
  if (object.url != null)
15328
15236
  message.url = String(object.url);
15329
- if (object.encoded != null) {
15330
- if (typeof object.encoded !== "object")
15331
- throw TypeError(".sesame.v1.outputs.EncodedSrtOutputConfig.encoded: object expected");
15332
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.fromObject(object.encoded);
15237
+ if (object.encoder != null) {
15238
+ if (typeof object.encoder !== "object")
15239
+ throw TypeError(".sesame.v1.outputs.EncodedSrtOutputConfig.encoder: object expected");
15240
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoder);
15333
15241
  }
15334
15242
  return message;
15335
15243
  };
@@ -15339,12 +15247,12 @@ var sesame = $root.sesame = (() => {
15339
15247
  let object = {};
15340
15248
  if (options.defaults) {
15341
15249
  object.url = "";
15342
- object.encoded = null;
15250
+ object.encoder = null;
15343
15251
  }
15344
15252
  if (message.url != null && message.hasOwnProperty("url"))
15345
15253
  object.url = message.url;
15346
- if (message.encoded != null && message.hasOwnProperty("encoded"))
15347
- object.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.toObject(message.encoded, options);
15254
+ if (message.encoder != null && message.hasOwnProperty("encoder"))
15255
+ object.encoder = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoder, options);
15348
15256
  return object;
15349
15257
  };
15350
15258
  EncodedSrtOutputConfig.prototype.toJSON = function toJSON() {
@@ -15366,7 +15274,7 @@ var sesame = $root.sesame = (() => {
15366
15274
  this[keys[i]] = properties[keys[i]];
15367
15275
  }
15368
15276
  }
15369
- EncodedMoqOutputConfig.prototype.encoded = null;
15277
+ EncodedMoqOutputConfig.prototype.encoder = null;
15370
15278
  EncodedMoqOutputConfig.prototype.url = "";
15371
15279
  EncodedMoqOutputConfig.prototype.broadcast = "";
15372
15280
  EncodedMoqOutputConfig.prototype.key = "";
@@ -15376,8 +15284,8 @@ var sesame = $root.sesame = (() => {
15376
15284
  EncodedMoqOutputConfig.encode = function encode(message, writer) {
15377
15285
  if (!writer)
15378
15286
  writer = $Writer.create();
15379
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
15380
- $root.sesame.v1.outputs.OutputEncodedConfig.encode(message.encoded, writer.uint32(
15287
+ if (message.encoder != null && Object.hasOwnProperty.call(message, "encoder"))
15288
+ $root.sesame.v1.outputs.EncoderConfig.encode(message.encoder, writer.uint32(
15381
15289
  /* id 1, wireType 2 =*/
15382
15290
  10
15383
15291
  ).fork()).ldelim();
@@ -15411,7 +15319,7 @@ var sesame = $root.sesame = (() => {
15411
15319
  break;
15412
15320
  switch (tag >>> 3) {
15413
15321
  case 1: {
15414
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.decode(reader, reader.uint32());
15322
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.decode(reader, reader.uint32());
15415
15323
  break;
15416
15324
  }
15417
15325
  case 2: {
@@ -15441,10 +15349,10 @@ var sesame = $root.sesame = (() => {
15441
15349
  EncodedMoqOutputConfig.verify = function verify(message) {
15442
15350
  if (typeof message !== "object" || message === null)
15443
15351
  return "object expected";
15444
- if (message.encoded != null && message.hasOwnProperty("encoded")) {
15445
- let error = $root.sesame.v1.outputs.OutputEncodedConfig.verify(message.encoded);
15352
+ if (message.encoder != null && message.hasOwnProperty("encoder")) {
15353
+ let error = $root.sesame.v1.outputs.EncoderConfig.verify(message.encoder);
15446
15354
  if (error)
15447
- return "encoded." + error;
15355
+ return "encoder." + error;
15448
15356
  }
15449
15357
  if (message.url != null && message.hasOwnProperty("url")) {
15450
15358
  if (!$util.isString(message.url))
@@ -15464,10 +15372,10 @@ var sesame = $root.sesame = (() => {
15464
15372
  if (object instanceof $root.sesame.v1.outputs.EncodedMoqOutputConfig)
15465
15373
  return object;
15466
15374
  let message = new $root.sesame.v1.outputs.EncodedMoqOutputConfig();
15467
- if (object.encoded != null) {
15468
- if (typeof object.encoded !== "object")
15469
- throw TypeError(".sesame.v1.outputs.EncodedMoqOutputConfig.encoded: object expected");
15470
- message.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.fromObject(object.encoded);
15375
+ if (object.encoder != null) {
15376
+ if (typeof object.encoder !== "object")
15377
+ throw TypeError(".sesame.v1.outputs.EncodedMoqOutputConfig.encoder: object expected");
15378
+ message.encoder = $root.sesame.v1.outputs.EncoderConfig.fromObject(object.encoder);
15471
15379
  }
15472
15380
  if (object.url != null)
15473
15381
  message.url = String(object.url);
@@ -15482,13 +15390,13 @@ var sesame = $root.sesame = (() => {
15482
15390
  options = {};
15483
15391
  let object = {};
15484
15392
  if (options.defaults) {
15485
- object.encoded = null;
15393
+ object.encoder = null;
15486
15394
  object.url = "";
15487
15395
  object.broadcast = "";
15488
15396
  object.key = "";
15489
15397
  }
15490
- if (message.encoded != null && message.hasOwnProperty("encoded"))
15491
- object.encoded = $root.sesame.v1.outputs.OutputEncodedConfig.toObject(message.encoded, options);
15398
+ if (message.encoder != null && message.hasOwnProperty("encoder"))
15399
+ object.encoder = $root.sesame.v1.outputs.EncoderConfig.toObject(message.encoder, options);
15492
15400
  if (message.url != null && message.hasOwnProperty("url"))
15493
15401
  object.url = message.url;
15494
15402
  if (message.broadcast != null && message.hasOwnProperty("broadcast"))
@@ -20469,8 +20377,8 @@ var sesame = $root.sesame = (() => {
20469
20377
  return jobs;
20470
20378
  }();
20471
20379
  v1.rpc = function() {
20472
- const rpc2 = {};
20473
- rpc2.Message = function() {
20380
+ const rpc = {};
20381
+ rpc.Message = function() {
20474
20382
  function Message2(properties) {
20475
20383
  if (properties) {
20476
20384
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -20632,7 +20540,7 @@ var sesame = $root.sesame = (() => {
20632
20540
  };
20633
20541
  return Message2;
20634
20542
  }();
20635
- rpc2.Request = function() {
20543
+ rpc.Request = function() {
20636
20544
  function Request2(properties) {
20637
20545
  if (properties) {
20638
20546
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -20769,7 +20677,7 @@ var sesame = $root.sesame = (() => {
20769
20677
  };
20770
20678
  return Request2;
20771
20679
  }();
20772
- rpc2.Response = function() {
20680
+ rpc.Response = function() {
20773
20681
  function Response2(properties) {
20774
20682
  if (properties) {
20775
20683
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -20925,7 +20833,7 @@ var sesame = $root.sesame = (() => {
20925
20833
  };
20926
20834
  return Response2;
20927
20835
  }();
20928
- rpc2.Event = function() {
20836
+ rpc.Event = function() {
20929
20837
  function Event2(properties) {
20930
20838
  if (properties) {
20931
20839
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -21086,7 +20994,7 @@ var sesame = $root.sesame = (() => {
21086
20994
  };
21087
20995
  return Event2;
21088
20996
  }();
21089
- rpc2.SesameAPIService = function() {
20997
+ rpc.SesameAPIService = function() {
21090
20998
  function SesameAPIService(rpcImpl, requestDelimited, responseDelimited) {
21091
20999
  $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
21092
21000
  }
@@ -21144,229 +21052,689 @@ var sesame = $root.sesame = (() => {
21144
21052
  }, "name", { value: "RequestIODeviceList" });
21145
21053
  return SesameAPIService;
21146
21054
  }();
21147
- return rpc2;
21055
+ return rpc;
21148
21056
  }();
21149
- return v1;
21150
- }();
21151
- return sesame2;
21152
- })();
21153
-
21154
- // src/command-list.ts
21155
- var CommandList = class {
21156
- constructor() {
21157
- this.cl = new sesame.v1.commands.CommandList();
21158
- this.cl.commandList = [];
21159
- }
21160
- add(item, timeOffsetMs, transaction) {
21161
- item.timeOffsetUs = (timeOffsetMs || 0) * 1e3;
21162
- if (transaction) {
21163
- item.transactionDeps = (transaction == null ? void 0 : transaction.dependencies) || [];
21164
- item.transactionId = transaction.transactionId;
21165
- }
21166
- this.cl.commandList.push(item);
21167
- return item;
21168
- }
21169
- applyTransaction(transaction) {
21170
- this.cl.commandList.forEach((item) => {
21171
- if (transaction.transactionId !== void 0) {
21172
- item.transactionId = transaction.transactionId;
21173
- }
21174
- if (transaction.dependencies !== void 0) {
21175
- item.transactionDeps = item.transactionDeps ? item.transactionDeps.concat(transaction.dependencies) : transaction.dependencies;
21176
- }
21177
- });
21178
- }
21179
- getLength() {
21180
- return this.cl.commandList.length;
21181
- }
21182
- filterCreatedAndDestroyedSources() {
21183
- const created = /* @__PURE__ */ new Map();
21184
- const createdAndRemoved = [];
21185
- for (let i = 0; i < this.cl.commandList.length; i++) {
21186
- if (this.cl.commandList[i].addSource) {
21187
- created.set(this.cl.commandList[i].addSource.id, this.cl.commandList[i]);
21188
- } else if (this.cl.commandList[i].removeSource) {
21189
- const id = this.cl.commandList[i].removeSource.id;
21190
- if (created.has(id)) {
21191
- createdAndRemoved.push({ add: created.get(id), del: this.cl.commandList[i] });
21057
+ v1.wire = function() {
21058
+ const wire = {};
21059
+ wire.FrameType = function() {
21060
+ const valuesById = {}, values = Object.create(valuesById);
21061
+ values[valuesById[0] = "FRAME_TYPE_UNSPECIFIED"] = 0;
21062
+ values[valuesById[1] = "FRAME_TYPE_RPC"] = 1;
21063
+ values[valuesById[2] = "FRAME_TYPE_VIDEO"] = 2;
21064
+ values[valuesById[3] = "FRAME_TYPE_AUDIO"] = 3;
21065
+ values[valuesById[4] = "FRAME_TYPE_MUXED"] = 4;
21066
+ values[valuesById[5] = "FRAME_TYPE_DECODER_DATA"] = 5;
21067
+ return values;
21068
+ }();
21069
+ wire.CodecType = function() {
21070
+ const valuesById = {}, values = Object.create(valuesById);
21071
+ values[valuesById[0] = "CODEC_TYPE_UNSPECIFIED"] = 0;
21072
+ values[valuesById[1] = "CODEC_TYPE_VIDEO_VP8"] = 1;
21073
+ values[valuesById[2] = "CODEC_TYPE_VIDEO_VP9"] = 2;
21074
+ values[valuesById[3] = "CODEC_TYPE_VIDEO_AVC"] = 3;
21075
+ values[valuesById[4] = "CODEC_TYPE_VIDEO_HEVC"] = 4;
21076
+ values[valuesById[5] = "CODEC_TYPE_VIDEO_AV1"] = 5;
21077
+ values[valuesById[64] = "CODEC_TYPE_AUDIO_OPUS"] = 64;
21078
+ values[valuesById[65] = "CODEC_TYPE_AUDIO_AAC"] = 65;
21079
+ values[valuesById[66] = "CODEC_TYPE_AUDIO_PCM"] = 66;
21080
+ return values;
21081
+ }();
21082
+ wire.MediaCodecData = function() {
21083
+ function MediaCodecData2(properties) {
21084
+ if (properties) {
21085
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
21086
+ if (properties[keys[i]] != null)
21087
+ this[keys[i]] = properties[keys[i]];
21088
+ }
21192
21089
  }
21193
- }
21194
- }
21195
- createdAndRemoved.forEach((item) => {
21196
- this.cl.commandList.splice(this.cl.commandList.indexOf(item.add), 1);
21197
- this.cl.commandList.splice(this.cl.commandList.indexOf(item.del), 1);
21198
- });
21199
- }
21200
- get_command_list_msg() {
21201
- return this.cl;
21202
- }
21203
- buildSourceConfig(cfg) {
21204
- var _a;
21205
- const config = {
21206
- common: {
21207
- userId: cfg.userId,
21208
- useAsClock: cfg.useAsClock,
21209
- audioOnly: cfg.audioOnly,
21210
- audioChannels: cfg.audioChannels,
21211
- loop: cfg.loop,
21212
- playState: cfg.playState,
21213
- mipMap: cfg.mipMap,
21214
- textureSize: cfg.textureSize,
21215
- decoderType: cfg.decoderType,
21216
- deinterlace: cfg.deinterlace,
21217
- videoProcessors: cfg.videoProcessors || []
21218
- }
21219
- };
21220
- switch (cfg.sourceType) {
21221
- case sesame.v1.sources.SourceType.SOURCE_TYPE_FILE:
21222
- config.file = { url: ((_a = cfg.fileConfig) == null ? void 0 : _a.filename) || cfg.url || "" };
21223
- break;
21224
- case sesame.v1.sources.SourceType.SOURCE_TYPE_RECORDER:
21225
- if (cfg.recorderConfig == null) throw new Error("No recorder source config found");
21226
- config.recorder = cfg.recorderConfig;
21227
- break;
21228
- case sesame.v1.sources.SourceType.SOURCE_TYPE_BROWSER:
21229
- if (!cfg.url) throw new Error("No browser URL found");
21230
- config.browser = { url: cfg.url };
21231
- break;
21232
- case sesame.v1.sources.SourceType.SOURCE_TYPE_RTT:
21233
- if (cfg.rttConfig == null) throw new Error("No RTT config found");
21234
- config.rtt = cfg.rttConfig;
21235
- break;
21236
- case sesame.v1.sources.SourceType.SOURCE_TYPE_DECKLINK:
21237
- if (cfg.decklinkConfig == null) throw new Error("No decklink source config found");
21238
- config.decklink = cfg.decklinkConfig;
21239
- break;
21240
- case sesame.v1.sources.SourceType.SOURCE_TYPE_SIGNAL_GENERATOR:
21241
- config.signalGenerator = {};
21242
- break;
21243
- case sesame.v1.sources.SourceType.SOURCE_TYPE_SYSTEM_AUDIO:
21244
- config.systemAudio = { deviceName: cfg.url || "" };
21245
- break;
21246
- case sesame.v1.sources.SourceType.SOURCE_TYPE_SRT_STREAM:
21247
- config.srtStream = cfg.srtConfig || (cfg.url ? { url: cfg.url } : void 0);
21248
- if (config.srtStream == null) throw new Error("No SRT source config found");
21249
- if (cfg.decodeBufferFrames) config.srtStream.decodeBufferFrames = cfg.decodeBufferFrames;
21250
- break;
21251
- case sesame.v1.sources.SourceType.SOURCE_TYPE_WEBSOCKET:
21252
- if (!cfg.url) throw new Error("No websocket channel found");
21253
- config.websocket = { channel: cfg.url };
21254
- if (cfg.decodeBufferFrames) config.websocket.decodeBufferFrames = cfg.decodeBufferFrames;
21255
- break;
21256
- case sesame.v1.sources.SourceType.SOURCE_TYPE_MOQ:
21257
- if (cfg.moqConfig == null) throw new Error("No MoQ source config found");
21258
- config.moq = cfg.moqConfig;
21259
- if (cfg.decodeBufferFrames) config.moq.decodeBufferFrames = cfg.decodeBufferFrames;
21260
- break;
21261
- default:
21262
- throw new Error(`Unsupported source type: ${cfg.sourceType}`);
21263
- }
21264
- return config;
21265
- }
21266
- buildOutputEncodedConfig(cfg) {
21267
- return {
21268
- width: cfg.width,
21269
- height: cfg.height,
21270
- fps: cfg.fps,
21271
- encoderConfig: cfg.encoderConfig
21272
- };
21273
- }
21274
- buildOutputConfig(id, cfg) {
21275
- const outputConfig = {
21276
- id,
21277
- audioMixIds: cfg.audioMixIds,
21278
- compositionId: cfg.compositionId,
21279
- useAsClock: !!cfg.useAsClock
21280
- };
21281
- switch (cfg.outputType) {
21282
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_DECKLINK:
21283
- if (cfg.decklinkConfig == null) throw new Error("No decklink config found");
21284
- outputConfig.decklink = cfg.decklinkConfig;
21285
- break;
21286
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_RECORDER:
21287
- if (cfg.recorderConfig == null) throw new Error("No recorder config found");
21288
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21289
- outputConfig.recorder = {
21290
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
21291
- filename: cfg.recorderConfig.filename,
21292
- sizeGb: cfg.recorderConfig.sizeGb,
21293
- groupId: cfg.recorderConfig.groupId,
21294
- recorderType: cfg.recorderConfig.type
21295
- };
21296
- break;
21297
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
21298
- if (cfg.recorderConfig == null) throw new Error("No recorder config found");
21299
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21300
- outputConfig.superSlowmoRecorder = {
21301
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
21302
- filename: cfg.recorderConfig.filename,
21303
- sizeGb: cfg.recorderConfig.sizeGb,
21304
- groupId: cfg.recorderConfig.groupId,
21305
- recorderType: cfg.recorderConfig.type
21306
- };
21307
- break;
21308
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
21309
- if (cfg.systemAudioConfig == null) throw new Error("No system audio config found");
21310
- outputConfig.systemAudio = cfg.systemAudioConfig;
21311
- break;
21312
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SRT:
21313
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21314
- outputConfig.srt = {
21315
- url: cfg.encodedConfig.url,
21316
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21317
- };
21318
- break;
21319
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_WEBSOCKET:
21320
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21321
- outputConfig.websocket = {
21322
- channel: cfg.encodedConfig.url,
21323
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21324
- };
21325
- break;
21326
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_MOQ:
21327
- if (cfg.moqConfig == null) throw new Error("No MoQ config found");
21328
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21329
- outputConfig.moq = {
21330
- ...cfg.moqConfig,
21331
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21332
- };
21333
- break;
21334
- default:
21335
- throw new Error(`Unsupported output type: ${cfg.outputType}`);
21336
- }
21337
- return outputConfig;
21338
- }
21339
- callback(event, data, timeOffsetMs) {
21340
- let item = new sesame.v1.commands.CommandListItem();
21341
- item.callback = { event, data };
21342
- return this.add(item, timeOffsetMs);
21343
- }
21344
- add_compositor(id, width, height, multisample, timeOffsetMs) {
21345
- let item = new sesame.v1.commands.CommandListItem();
21346
- item.addCompositor = { id, multisample, width, height };
21347
- return this.add(item, timeOffsetMs);
21090
+ MediaCodecData2.prototype.codecType = 0;
21091
+ MediaCodecData2.prototype.sampleRate = 0;
21092
+ MediaCodecData2.prototype.timebaseNum = 0;
21093
+ MediaCodecData2.prototype.timebaseDen = 0;
21094
+ MediaCodecData2.prototype.codecProfile = 0;
21095
+ MediaCodecData2.prototype.codecLevel = 0;
21096
+ MediaCodecData2.prototype.width = 0;
21097
+ MediaCodecData2.prototype.height = 0;
21098
+ MediaCodecData2.prototype.channels = 0;
21099
+ MediaCodecData2.prototype.bitDepth = 0;
21100
+ MediaCodecData2.create = function create(properties) {
21101
+ return new MediaCodecData2(properties);
21102
+ };
21103
+ MediaCodecData2.encode = function encode(message, writer) {
21104
+ if (!writer)
21105
+ writer = $Writer.create();
21106
+ if (message.codecType != null && Object.hasOwnProperty.call(message, "codecType"))
21107
+ writer.uint32(
21108
+ /* id 1, wireType 0 =*/
21109
+ 8
21110
+ ).int32(message.codecType);
21111
+ if (message.sampleRate != null && Object.hasOwnProperty.call(message, "sampleRate"))
21112
+ writer.uint32(
21113
+ /* id 2, wireType 0 =*/
21114
+ 16
21115
+ ).uint32(message.sampleRate);
21116
+ if (message.timebaseNum != null && Object.hasOwnProperty.call(message, "timebaseNum"))
21117
+ writer.uint32(
21118
+ /* id 3, wireType 0 =*/
21119
+ 24
21120
+ ).uint32(message.timebaseNum);
21121
+ if (message.timebaseDen != null && Object.hasOwnProperty.call(message, "timebaseDen"))
21122
+ writer.uint32(
21123
+ /* id 4, wireType 0 =*/
21124
+ 32
21125
+ ).uint32(message.timebaseDen);
21126
+ if (message.codecProfile != null && Object.hasOwnProperty.call(message, "codecProfile"))
21127
+ writer.uint32(
21128
+ /* id 5, wireType 0 =*/
21129
+ 40
21130
+ ).uint32(message.codecProfile);
21131
+ if (message.codecLevel != null && Object.hasOwnProperty.call(message, "codecLevel"))
21132
+ writer.uint32(
21133
+ /* id 6, wireType 0 =*/
21134
+ 48
21135
+ ).uint32(message.codecLevel);
21136
+ if (message.width != null && Object.hasOwnProperty.call(message, "width"))
21137
+ writer.uint32(
21138
+ /* id 7, wireType 0 =*/
21139
+ 56
21140
+ ).uint32(message.width);
21141
+ if (message.height != null && Object.hasOwnProperty.call(message, "height"))
21142
+ writer.uint32(
21143
+ /* id 8, wireType 0 =*/
21144
+ 64
21145
+ ).uint32(message.height);
21146
+ if (message.channels != null && Object.hasOwnProperty.call(message, "channels"))
21147
+ writer.uint32(
21148
+ /* id 9, wireType 0 =*/
21149
+ 72
21150
+ ).uint32(message.channels);
21151
+ if (message.bitDepth != null && Object.hasOwnProperty.call(message, "bitDepth"))
21152
+ writer.uint32(
21153
+ /* id 10, wireType 0 =*/
21154
+ 80
21155
+ ).uint32(message.bitDepth);
21156
+ return writer;
21157
+ };
21158
+ MediaCodecData2.encodeDelimited = function encodeDelimited(message, writer) {
21159
+ return this.encode(message, writer).ldelim();
21160
+ };
21161
+ MediaCodecData2.decode = function decode(reader, length, error) {
21162
+ if (!(reader instanceof $Reader))
21163
+ reader = $Reader.create(reader);
21164
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.wire.MediaCodecData();
21165
+ while (reader.pos < end) {
21166
+ let tag = reader.uint32();
21167
+ if (tag === error)
21168
+ break;
21169
+ switch (tag >>> 3) {
21170
+ case 1: {
21171
+ message.codecType = reader.int32();
21172
+ break;
21173
+ }
21174
+ case 2: {
21175
+ message.sampleRate = reader.uint32();
21176
+ break;
21177
+ }
21178
+ case 3: {
21179
+ message.timebaseNum = reader.uint32();
21180
+ break;
21181
+ }
21182
+ case 4: {
21183
+ message.timebaseDen = reader.uint32();
21184
+ break;
21185
+ }
21186
+ case 5: {
21187
+ message.codecProfile = reader.uint32();
21188
+ break;
21189
+ }
21190
+ case 6: {
21191
+ message.codecLevel = reader.uint32();
21192
+ break;
21193
+ }
21194
+ case 7: {
21195
+ message.width = reader.uint32();
21196
+ break;
21197
+ }
21198
+ case 8: {
21199
+ message.height = reader.uint32();
21200
+ break;
21201
+ }
21202
+ case 9: {
21203
+ message.channels = reader.uint32();
21204
+ break;
21205
+ }
21206
+ case 10: {
21207
+ message.bitDepth = reader.uint32();
21208
+ break;
21209
+ }
21210
+ default:
21211
+ reader.skipType(tag & 7);
21212
+ break;
21213
+ }
21214
+ }
21215
+ return message;
21216
+ };
21217
+ MediaCodecData2.decodeDelimited = function decodeDelimited(reader) {
21218
+ if (!(reader instanceof $Reader))
21219
+ reader = new $Reader(reader);
21220
+ return this.decode(reader, reader.uint32());
21221
+ };
21222
+ MediaCodecData2.verify = function verify(message) {
21223
+ if (typeof message !== "object" || message === null)
21224
+ return "object expected";
21225
+ if (message.codecType != null && message.hasOwnProperty("codecType"))
21226
+ switch (message.codecType) {
21227
+ default:
21228
+ return "codecType: enum value expected";
21229
+ case 0:
21230
+ case 1:
21231
+ case 2:
21232
+ case 3:
21233
+ case 4:
21234
+ case 5:
21235
+ case 64:
21236
+ case 65:
21237
+ case 66:
21238
+ break;
21239
+ }
21240
+ if (message.sampleRate != null && message.hasOwnProperty("sampleRate")) {
21241
+ if (!$util.isInteger(message.sampleRate))
21242
+ return "sampleRate: integer expected";
21243
+ }
21244
+ if (message.timebaseNum != null && message.hasOwnProperty("timebaseNum")) {
21245
+ if (!$util.isInteger(message.timebaseNum))
21246
+ return "timebaseNum: integer expected";
21247
+ }
21248
+ if (message.timebaseDen != null && message.hasOwnProperty("timebaseDen")) {
21249
+ if (!$util.isInteger(message.timebaseDen))
21250
+ return "timebaseDen: integer expected";
21251
+ }
21252
+ if (message.codecProfile != null && message.hasOwnProperty("codecProfile")) {
21253
+ if (!$util.isInteger(message.codecProfile))
21254
+ return "codecProfile: integer expected";
21255
+ }
21256
+ if (message.codecLevel != null && message.hasOwnProperty("codecLevel")) {
21257
+ if (!$util.isInteger(message.codecLevel))
21258
+ return "codecLevel: integer expected";
21259
+ }
21260
+ if (message.width != null && message.hasOwnProperty("width")) {
21261
+ if (!$util.isInteger(message.width))
21262
+ return "width: integer expected";
21263
+ }
21264
+ if (message.height != null && message.hasOwnProperty("height")) {
21265
+ if (!$util.isInteger(message.height))
21266
+ return "height: integer expected";
21267
+ }
21268
+ if (message.channels != null && message.hasOwnProperty("channels")) {
21269
+ if (!$util.isInteger(message.channels))
21270
+ return "channels: integer expected";
21271
+ }
21272
+ if (message.bitDepth != null && message.hasOwnProperty("bitDepth")) {
21273
+ if (!$util.isInteger(message.bitDepth))
21274
+ return "bitDepth: integer expected";
21275
+ }
21276
+ return null;
21277
+ };
21278
+ MediaCodecData2.fromObject = function fromObject(object) {
21279
+ if (object instanceof $root.sesame.v1.wire.MediaCodecData)
21280
+ return object;
21281
+ let message = new $root.sesame.v1.wire.MediaCodecData();
21282
+ switch (object.codecType) {
21283
+ default:
21284
+ if (typeof object.codecType === "number") {
21285
+ message.codecType = object.codecType;
21286
+ break;
21287
+ }
21288
+ break;
21289
+ case "CODEC_TYPE_UNSPECIFIED":
21290
+ case 0:
21291
+ message.codecType = 0;
21292
+ break;
21293
+ case "CODEC_TYPE_VIDEO_VP8":
21294
+ case 1:
21295
+ message.codecType = 1;
21296
+ break;
21297
+ case "CODEC_TYPE_VIDEO_VP9":
21298
+ case 2:
21299
+ message.codecType = 2;
21300
+ break;
21301
+ case "CODEC_TYPE_VIDEO_AVC":
21302
+ case 3:
21303
+ message.codecType = 3;
21304
+ break;
21305
+ case "CODEC_TYPE_VIDEO_HEVC":
21306
+ case 4:
21307
+ message.codecType = 4;
21308
+ break;
21309
+ case "CODEC_TYPE_VIDEO_AV1":
21310
+ case 5:
21311
+ message.codecType = 5;
21312
+ break;
21313
+ case "CODEC_TYPE_AUDIO_OPUS":
21314
+ case 64:
21315
+ message.codecType = 64;
21316
+ break;
21317
+ case "CODEC_TYPE_AUDIO_AAC":
21318
+ case 65:
21319
+ message.codecType = 65;
21320
+ break;
21321
+ case "CODEC_TYPE_AUDIO_PCM":
21322
+ case 66:
21323
+ message.codecType = 66;
21324
+ break;
21325
+ }
21326
+ if (object.sampleRate != null)
21327
+ message.sampleRate = object.sampleRate >>> 0;
21328
+ if (object.timebaseNum != null)
21329
+ message.timebaseNum = object.timebaseNum >>> 0;
21330
+ if (object.timebaseDen != null)
21331
+ message.timebaseDen = object.timebaseDen >>> 0;
21332
+ if (object.codecProfile != null)
21333
+ message.codecProfile = object.codecProfile >>> 0;
21334
+ if (object.codecLevel != null)
21335
+ message.codecLevel = object.codecLevel >>> 0;
21336
+ if (object.width != null)
21337
+ message.width = object.width >>> 0;
21338
+ if (object.height != null)
21339
+ message.height = object.height >>> 0;
21340
+ if (object.channels != null)
21341
+ message.channels = object.channels >>> 0;
21342
+ if (object.bitDepth != null)
21343
+ message.bitDepth = object.bitDepth >>> 0;
21344
+ return message;
21345
+ };
21346
+ MediaCodecData2.toObject = function toObject(message, options) {
21347
+ if (!options)
21348
+ options = {};
21349
+ let object = {};
21350
+ if (options.defaults) {
21351
+ object.codecType = options.enums === String ? "CODEC_TYPE_UNSPECIFIED" : 0;
21352
+ object.sampleRate = 0;
21353
+ object.timebaseNum = 0;
21354
+ object.timebaseDen = 0;
21355
+ object.codecProfile = 0;
21356
+ object.codecLevel = 0;
21357
+ object.width = 0;
21358
+ object.height = 0;
21359
+ object.channels = 0;
21360
+ object.bitDepth = 0;
21361
+ }
21362
+ if (message.codecType != null && message.hasOwnProperty("codecType"))
21363
+ object.codecType = options.enums === String ? $root.sesame.v1.wire.CodecType[message.codecType] === void 0 ? message.codecType : $root.sesame.v1.wire.CodecType[message.codecType] : message.codecType;
21364
+ if (message.sampleRate != null && message.hasOwnProperty("sampleRate"))
21365
+ object.sampleRate = message.sampleRate;
21366
+ if (message.timebaseNum != null && message.hasOwnProperty("timebaseNum"))
21367
+ object.timebaseNum = message.timebaseNum;
21368
+ if (message.timebaseDen != null && message.hasOwnProperty("timebaseDen"))
21369
+ object.timebaseDen = message.timebaseDen;
21370
+ if (message.codecProfile != null && message.hasOwnProperty("codecProfile"))
21371
+ object.codecProfile = message.codecProfile;
21372
+ if (message.codecLevel != null && message.hasOwnProperty("codecLevel"))
21373
+ object.codecLevel = message.codecLevel;
21374
+ if (message.width != null && message.hasOwnProperty("width"))
21375
+ object.width = message.width;
21376
+ if (message.height != null && message.hasOwnProperty("height"))
21377
+ object.height = message.height;
21378
+ if (message.channels != null && message.hasOwnProperty("channels"))
21379
+ object.channels = message.channels;
21380
+ if (message.bitDepth != null && message.hasOwnProperty("bitDepth"))
21381
+ object.bitDepth = message.bitDepth;
21382
+ return object;
21383
+ };
21384
+ MediaCodecData2.prototype.toJSON = function toJSON() {
21385
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
21386
+ };
21387
+ MediaCodecData2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
21388
+ if (typeUrlPrefix === void 0) {
21389
+ typeUrlPrefix = "type.googleapis.com";
21390
+ }
21391
+ return typeUrlPrefix + "/sesame.v1.wire.MediaCodecData";
21392
+ };
21393
+ return MediaCodecData2;
21394
+ }();
21395
+ wire.FrameHeader = function() {
21396
+ function FrameHeader2(properties) {
21397
+ if (properties) {
21398
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
21399
+ if (properties[keys[i]] != null)
21400
+ this[keys[i]] = properties[keys[i]];
21401
+ }
21402
+ }
21403
+ FrameHeader2.prototype.type = 0;
21404
+ FrameHeader2.prototype.pts = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
21405
+ FrameHeader2.prototype.id = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
21406
+ FrameHeader2.prototype.keyframe = false;
21407
+ FrameHeader2.prototype.codecData = null;
21408
+ FrameHeader2.prototype.routingMetadata = "";
21409
+ FrameHeader2.create = function create(properties) {
21410
+ return new FrameHeader2(properties);
21411
+ };
21412
+ FrameHeader2.encode = function encode(message, writer) {
21413
+ if (!writer)
21414
+ writer = $Writer.create();
21415
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
21416
+ writer.uint32(
21417
+ /* id 1, wireType 0 =*/
21418
+ 8
21419
+ ).int32(message.type);
21420
+ if (message.pts != null && Object.hasOwnProperty.call(message, "pts"))
21421
+ writer.uint32(
21422
+ /* id 2, wireType 0 =*/
21423
+ 16
21424
+ ).uint64(message.pts);
21425
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
21426
+ writer.uint32(
21427
+ /* id 3, wireType 0 =*/
21428
+ 24
21429
+ ).uint64(message.id);
21430
+ if (message.keyframe != null && Object.hasOwnProperty.call(message, "keyframe"))
21431
+ writer.uint32(
21432
+ /* id 4, wireType 0 =*/
21433
+ 32
21434
+ ).bool(message.keyframe);
21435
+ if (message.codecData != null && Object.hasOwnProperty.call(message, "codecData"))
21436
+ $root.sesame.v1.wire.MediaCodecData.encode(message.codecData, writer.uint32(
21437
+ /* id 5, wireType 2 =*/
21438
+ 42
21439
+ ).fork()).ldelim();
21440
+ if (message.routingMetadata != null && Object.hasOwnProperty.call(message, "routingMetadata"))
21441
+ writer.uint32(
21442
+ /* id 6, wireType 2 =*/
21443
+ 50
21444
+ ).string(message.routingMetadata);
21445
+ return writer;
21446
+ };
21447
+ FrameHeader2.encodeDelimited = function encodeDelimited(message, writer) {
21448
+ return this.encode(message, writer).ldelim();
21449
+ };
21450
+ FrameHeader2.decode = function decode(reader, length, error) {
21451
+ if (!(reader instanceof $Reader))
21452
+ reader = $Reader.create(reader);
21453
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.wire.FrameHeader();
21454
+ while (reader.pos < end) {
21455
+ let tag = reader.uint32();
21456
+ if (tag === error)
21457
+ break;
21458
+ switch (tag >>> 3) {
21459
+ case 1: {
21460
+ message.type = reader.int32();
21461
+ break;
21462
+ }
21463
+ case 2: {
21464
+ message.pts = reader.uint64();
21465
+ break;
21466
+ }
21467
+ case 3: {
21468
+ message.id = reader.uint64();
21469
+ break;
21470
+ }
21471
+ case 4: {
21472
+ message.keyframe = reader.bool();
21473
+ break;
21474
+ }
21475
+ case 5: {
21476
+ message.codecData = $root.sesame.v1.wire.MediaCodecData.decode(reader, reader.uint32());
21477
+ break;
21478
+ }
21479
+ case 6: {
21480
+ message.routingMetadata = reader.string();
21481
+ break;
21482
+ }
21483
+ default:
21484
+ reader.skipType(tag & 7);
21485
+ break;
21486
+ }
21487
+ }
21488
+ return message;
21489
+ };
21490
+ FrameHeader2.decodeDelimited = function decodeDelimited(reader) {
21491
+ if (!(reader instanceof $Reader))
21492
+ reader = new $Reader(reader);
21493
+ return this.decode(reader, reader.uint32());
21494
+ };
21495
+ FrameHeader2.verify = function verify(message) {
21496
+ if (typeof message !== "object" || message === null)
21497
+ return "object expected";
21498
+ if (message.type != null && message.hasOwnProperty("type"))
21499
+ switch (message.type) {
21500
+ default:
21501
+ return "type: enum value expected";
21502
+ case 0:
21503
+ case 1:
21504
+ case 2:
21505
+ case 3:
21506
+ case 4:
21507
+ case 5:
21508
+ break;
21509
+ }
21510
+ if (message.pts != null && message.hasOwnProperty("pts")) {
21511
+ if (!$util.isInteger(message.pts) && !(message.pts && $util.isInteger(message.pts.low) && $util.isInteger(message.pts.high)))
21512
+ return "pts: integer|Long expected";
21513
+ }
21514
+ if (message.id != null && message.hasOwnProperty("id")) {
21515
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
21516
+ return "id: integer|Long expected";
21517
+ }
21518
+ if (message.keyframe != null && message.hasOwnProperty("keyframe")) {
21519
+ if (typeof message.keyframe !== "boolean")
21520
+ return "keyframe: boolean expected";
21521
+ }
21522
+ if (message.codecData != null && message.hasOwnProperty("codecData")) {
21523
+ let error = $root.sesame.v1.wire.MediaCodecData.verify(message.codecData);
21524
+ if (error)
21525
+ return "codecData." + error;
21526
+ }
21527
+ if (message.routingMetadata != null && message.hasOwnProperty("routingMetadata")) {
21528
+ if (!$util.isString(message.routingMetadata))
21529
+ return "routingMetadata: string expected";
21530
+ }
21531
+ return null;
21532
+ };
21533
+ FrameHeader2.fromObject = function fromObject(object) {
21534
+ if (object instanceof $root.sesame.v1.wire.FrameHeader)
21535
+ return object;
21536
+ let message = new $root.sesame.v1.wire.FrameHeader();
21537
+ switch (object.type) {
21538
+ default:
21539
+ if (typeof object.type === "number") {
21540
+ message.type = object.type;
21541
+ break;
21542
+ }
21543
+ break;
21544
+ case "FRAME_TYPE_UNSPECIFIED":
21545
+ case 0:
21546
+ message.type = 0;
21547
+ break;
21548
+ case "FRAME_TYPE_RPC":
21549
+ case 1:
21550
+ message.type = 1;
21551
+ break;
21552
+ case "FRAME_TYPE_VIDEO":
21553
+ case 2:
21554
+ message.type = 2;
21555
+ break;
21556
+ case "FRAME_TYPE_AUDIO":
21557
+ case 3:
21558
+ message.type = 3;
21559
+ break;
21560
+ case "FRAME_TYPE_MUXED":
21561
+ case 4:
21562
+ message.type = 4;
21563
+ break;
21564
+ case "FRAME_TYPE_DECODER_DATA":
21565
+ case 5:
21566
+ message.type = 5;
21567
+ break;
21568
+ }
21569
+ if (object.pts != null) {
21570
+ if ($util.Long)
21571
+ (message.pts = $util.Long.fromValue(object.pts)).unsigned = true;
21572
+ else if (typeof object.pts === "string")
21573
+ message.pts = parseInt(object.pts, 10);
21574
+ else if (typeof object.pts === "number")
21575
+ message.pts = object.pts;
21576
+ else if (typeof object.pts === "object")
21577
+ message.pts = new $util.LongBits(object.pts.low >>> 0, object.pts.high >>> 0).toNumber(true);
21578
+ }
21579
+ if (object.id != null) {
21580
+ if ($util.Long)
21581
+ (message.id = $util.Long.fromValue(object.id)).unsigned = true;
21582
+ else if (typeof object.id === "string")
21583
+ message.id = parseInt(object.id, 10);
21584
+ else if (typeof object.id === "number")
21585
+ message.id = object.id;
21586
+ else if (typeof object.id === "object")
21587
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true);
21588
+ }
21589
+ if (object.keyframe != null)
21590
+ message.keyframe = Boolean(object.keyframe);
21591
+ if (object.codecData != null) {
21592
+ if (typeof object.codecData !== "object")
21593
+ throw TypeError(".sesame.v1.wire.FrameHeader.codecData: object expected");
21594
+ message.codecData = $root.sesame.v1.wire.MediaCodecData.fromObject(object.codecData);
21595
+ }
21596
+ if (object.routingMetadata != null)
21597
+ message.routingMetadata = String(object.routingMetadata);
21598
+ return message;
21599
+ };
21600
+ FrameHeader2.toObject = function toObject(message, options) {
21601
+ if (!options)
21602
+ options = {};
21603
+ let object = {};
21604
+ if (options.defaults) {
21605
+ object.type = options.enums === String ? "FRAME_TYPE_UNSPECIFIED" : 0;
21606
+ if ($util.Long) {
21607
+ let long = new $util.Long(0, 0, true);
21608
+ object.pts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
21609
+ } else
21610
+ object.pts = options.longs === String ? "0" : 0;
21611
+ if ($util.Long) {
21612
+ let long = new $util.Long(0, 0, true);
21613
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
21614
+ } else
21615
+ object.id = options.longs === String ? "0" : 0;
21616
+ object.keyframe = false;
21617
+ object.codecData = null;
21618
+ object.routingMetadata = "";
21619
+ }
21620
+ if (message.type != null && message.hasOwnProperty("type"))
21621
+ object.type = options.enums === String ? $root.sesame.v1.wire.FrameType[message.type] === void 0 ? message.type : $root.sesame.v1.wire.FrameType[message.type] : message.type;
21622
+ if (message.pts != null && message.hasOwnProperty("pts"))
21623
+ if (typeof message.pts === "number")
21624
+ object.pts = options.longs === String ? String(message.pts) : message.pts;
21625
+ else
21626
+ object.pts = options.longs === String ? $util.Long.prototype.toString.call(message.pts) : options.longs === Number ? new $util.LongBits(message.pts.low >>> 0, message.pts.high >>> 0).toNumber(true) : message.pts;
21627
+ if (message.id != null && message.hasOwnProperty("id"))
21628
+ if (typeof message.id === "number")
21629
+ object.id = options.longs === String ? String(message.id) : message.id;
21630
+ else
21631
+ object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id;
21632
+ if (message.keyframe != null && message.hasOwnProperty("keyframe"))
21633
+ object.keyframe = message.keyframe;
21634
+ if (message.codecData != null && message.hasOwnProperty("codecData"))
21635
+ object.codecData = $root.sesame.v1.wire.MediaCodecData.toObject(message.codecData, options);
21636
+ if (message.routingMetadata != null && message.hasOwnProperty("routingMetadata"))
21637
+ object.routingMetadata = message.routingMetadata;
21638
+ return object;
21639
+ };
21640
+ FrameHeader2.prototype.toJSON = function toJSON() {
21641
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
21642
+ };
21643
+ FrameHeader2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
21644
+ if (typeUrlPrefix === void 0) {
21645
+ typeUrlPrefix = "type.googleapis.com";
21646
+ }
21647
+ return typeUrlPrefix + "/sesame.v1.wire.FrameHeader";
21648
+ };
21649
+ return FrameHeader2;
21650
+ }();
21651
+ return wire;
21652
+ }();
21653
+ return v1;
21654
+ }();
21655
+ return sesame2;
21656
+ })();
21657
+
21658
+ // src/command-list.ts
21659
+ var CommandList = class {
21660
+ constructor() {
21661
+ this.cl = new sesame.v1.commands.CommandList();
21662
+ this.cl.commandList = [];
21663
+ }
21664
+ add(item, timeOffsetMs, transaction) {
21665
+ item.timeOffsetUs = (timeOffsetMs || 0) * 1e3;
21666
+ if (transaction) {
21667
+ item.transactionDeps = transaction?.dependencies || [];
21668
+ item.transactionId = transaction.transactionId;
21669
+ }
21670
+ this.cl.commandList.push(item);
21671
+ return item;
21672
+ }
21673
+ applyTransaction(transaction) {
21674
+ this.cl.commandList.forEach((item) => {
21675
+ if (transaction.transactionId !== void 0) {
21676
+ item.transactionId = transaction.transactionId;
21677
+ }
21678
+ if (transaction.dependencies !== void 0) {
21679
+ item.transactionDeps = item.transactionDeps ? item.transactionDeps.concat(transaction.dependencies) : transaction.dependencies;
21680
+ }
21681
+ });
21682
+ }
21683
+ getLength() {
21684
+ return this.cl.commandList.length;
21685
+ }
21686
+ filterCreatedAndDestroyedSources() {
21687
+ const created = /* @__PURE__ */ new Map();
21688
+ const createdAndRemoved = [];
21689
+ for (let i = 0; i < this.cl.commandList.length; i++) {
21690
+ if (this.cl.commandList[i].addSource) {
21691
+ created.set(this.cl.commandList[i].addSource.id, this.cl.commandList[i]);
21692
+ } else if (this.cl.commandList[i].removeSource) {
21693
+ const id = this.cl.commandList[i].removeSource.id;
21694
+ if (created.has(id)) {
21695
+ createdAndRemoved.push({ add: created.get(id), del: this.cl.commandList[i] });
21696
+ }
21697
+ }
21698
+ }
21699
+ createdAndRemoved.forEach((item) => {
21700
+ this.cl.commandList.splice(this.cl.commandList.indexOf(item.add), 1);
21701
+ this.cl.commandList.splice(this.cl.commandList.indexOf(item.del), 1);
21702
+ });
21703
+ }
21704
+ getCommandListMsg() {
21705
+ return this.cl;
21706
+ }
21707
+ callback(event, data, timeOffsetMs) {
21708
+ let item = new sesame.v1.commands.CommandListItem();
21709
+ item.callback = { event, data };
21710
+ return this.add(item, timeOffsetMs);
21711
+ }
21712
+ compositorAdd(id, width, height, multisample, timeOffsetMs) {
21713
+ let item = new sesame.v1.commands.CommandListItem();
21714
+ item.addCompositor = { id, multisample, width, height };
21715
+ return this.add(item, timeOffsetMs);
21348
21716
  }
21349
- remove_compositor(id, timeOffsetMs) {
21717
+ compositorRemove(id, timeOffsetMs) {
21350
21718
  let item = new sesame.v1.commands.CommandListItem();
21351
21719
  item.removeCompositor = { id };
21352
21720
  return this.add(item, timeOffsetMs);
21353
21721
  }
21354
- clear_compositor(id, timeOffsetMs) {
21722
+ compositorClear(id, timeOffsetMs) {
21355
21723
  let item = new sesame.v1.commands.CommandListItem();
21356
21724
  item.clearCompositor = { id };
21357
21725
  return this.add(item, timeOffsetMs);
21358
21726
  }
21359
- add_source(id, cfg, timeOffsetMs) {
21727
+ sourceAdd(id, cfg, timeOffsetMs) {
21360
21728
  let item = new sesame.v1.commands.CommandListItem();
21361
- item.addSource = { id, config: this.buildSourceConfig(cfg) };
21729
+ item.addSource = { id, config: cfg };
21362
21730
  return this.add(item, timeOffsetMs);
21363
21731
  }
21364
- remove_source(id, timeOffsetMs) {
21732
+ sourceRemove(id, timeOffsetMs) {
21365
21733
  let item = new sesame.v1.commands.CommandListItem();
21366
21734
  item.removeSource = { id };
21367
21735
  return this.add(item, timeOffsetMs);
21368
21736
  }
21369
- add_node(id, cfg, timeOffsetMs) {
21737
+ nodeAdd(id, cfg, timeOffsetMs) {
21370
21738
  let item = new sesame.v1.commands.CommandListItem();
21371
21739
  item.addNode = {
21372
21740
  compositorId: cfg.compositorId,
@@ -21376,12 +21744,12 @@ var CommandList = class {
21376
21744
  };
21377
21745
  return this.add(item, timeOffsetMs);
21378
21746
  }
21379
- remove_node(compositorId, address, timeOffsetMs) {
21747
+ nodeRemove(compositorId, address, timeOffsetMs) {
21380
21748
  let item = new sesame.v1.commands.CommandListItem();
21381
21749
  item.removeNode = { compositorId, address };
21382
21750
  return this.add(item, timeOffsetMs);
21383
21751
  }
21384
- set_property(propertyDomain, addr, prop, val, timeOffsetMs) {
21752
+ propertySet(propertyDomain, addr, prop, val, timeOffsetMs) {
21385
21753
  let item = new sesame.v1.commands.CommandListItem();
21386
21754
  item.setProperty = {
21387
21755
  address: addr,
@@ -21391,17 +21759,17 @@ var CommandList = class {
21391
21759
  };
21392
21760
  return this.add(item, timeOffsetMs);
21393
21761
  }
21394
- add_load_playlist_command(sourceId, playlist) {
21762
+ playlistLoad(sourceId, playlist) {
21395
21763
  const item = new sesame.v1.commands.CommandListItem();
21396
21764
  const loadPlaylistCmd = {
21397
21765
  items: playlist.clips.map((clip) => ({
21398
21766
  id: clip.id,
21399
21767
  recorderId: clip.recorderId,
21400
- transitionTimeUs: (clip.transitionTime || 0) * 1e3,
21768
+ transitionTimeUs: clip.transitionTimeUs,
21401
21769
  speed: clip.speed || 1,
21402
21770
  audioRouting: clip.audioRouting,
21403
- startTimeUs: clip.startTime,
21404
- endTimeUs: clip.endTime,
21771
+ startTimeUs: clip.startTimeUs,
21772
+ endTimeUs: clip.endTimeUs,
21405
21773
  transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
21406
21774
  transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
21407
21775
  })),
@@ -21414,13 +21782,13 @@ var CommandList = class {
21414
21782
  item.loadPlaylist = loadPlaylistCmd;
21415
21783
  return this.add(item, 0);
21416
21784
  }
21417
- add_eject_playlist_command(sourceId) {
21785
+ playlistEject(sourceId) {
21418
21786
  const item = new sesame.v1.commands.CommandListItem();
21419
21787
  const ejectPlaylistCmd = { sourceId };
21420
21788
  item.ejectPlaylist = ejectPlaylistCmd;
21421
21789
  return this.add(item, 0);
21422
21790
  }
21423
- add_transport_command(id, msg, timeOffsetMs) {
21791
+ transportCommand(id, msg, timeOffsetMs) {
21424
21792
  let item = new sesame.v1.commands.CommandListItem();
21425
21793
  let transportCmd = { sourceId: id };
21426
21794
  let cmd;
@@ -21493,17 +21861,17 @@ var CommandList = class {
21493
21861
  item.updateSourceTransport = transportCmd;
21494
21862
  return this.add(item, timeOffsetMs, { transactionId: msg.transactionId, dependencies: [] });
21495
21863
  }
21496
- update_source(id, cfg, timeOffsetMs) {
21864
+ sourceUpdate(id, cfg, timeOffsetMs) {
21497
21865
  let item = new sesame.v1.commands.CommandListItem();
21498
- item.updateSource = { id, config: this.buildSourceConfig(cfg) };
21866
+ item.updateSource = { id, config: cfg };
21499
21867
  return this.add(item, timeOffsetMs);
21500
21868
  }
21501
- update_source_metadata(id, metadata, timeOffsetMs) {
21869
+ sourceUpdateMetadata(id, metadata, timeOffsetMs) {
21502
21870
  let item = new sesame.v1.commands.CommandListItem();
21503
21871
  item.setSourceMetadata = { sourceId: id, metadata };
21504
21872
  return this.add(item, timeOffsetMs);
21505
21873
  }
21506
- update_source_transport(id, cfg, timeOffsetMs) {
21874
+ sourceUpdateTransport(id, cfg, timeOffsetMs) {
21507
21875
  let item = new sesame.v1.commands.CommandListItem();
21508
21876
  item.updateSourceTransport = {
21509
21877
  sourceId: id,
@@ -21512,47 +21880,47 @@ var CommandList = class {
21512
21880
  };
21513
21881
  return this.add(item, timeOffsetMs);
21514
21882
  }
21515
- add_output(id, cfg, timeOffsetMs) {
21883
+ outputAdd(id, cfg, timeOffsetMs) {
21516
21884
  let item = new sesame.v1.commands.CommandListItem();
21517
- item.addOutput = this.buildOutputConfig(id, cfg);
21885
+ item.addOutput = { id, ...cfg };
21518
21886
  return this.add(item, timeOffsetMs);
21519
21887
  }
21520
- update_output(id, cfg, timeOffsetMs) {
21888
+ outputUpdate(id, cfg, timeOffsetMs) {
21521
21889
  let item = new sesame.v1.commands.CommandListItem();
21522
- item.updateOutput = this.buildOutputConfig(id, cfg);
21890
+ item.updateOutput = { id, ...cfg };
21523
21891
  return this.add(item, timeOffsetMs);
21524
21892
  }
21525
- remove_output(id, timeOffsetMs) {
21893
+ outputRemove(id, timeOffsetMs) {
21526
21894
  let item = new sesame.v1.commands.CommandListItem();
21527
21895
  item.removeOutput = { id };
21528
21896
  return this.add(item, timeOffsetMs);
21529
21897
  }
21530
- add_audio_mixer(id, cfg, timeOffsetMs) {
21898
+ audioMixerAdd(id, cfg, timeOffsetMs) {
21531
21899
  let item = new sesame.v1.commands.CommandListItem();
21532
21900
  item.addAudioMixer = { id, config: cfg };
21533
21901
  return this.add(item, timeOffsetMs);
21534
21902
  }
21535
- update_audio_mixer(id, cfg, timeOffsetMs) {
21903
+ audioMixerUpdate(id, cfg, timeOffsetMs) {
21536
21904
  let item = new sesame.v1.commands.CommandListItem();
21537
21905
  item.updateAudioMixer = { id, config: cfg };
21538
21906
  return this.add(item, timeOffsetMs);
21539
21907
  }
21540
- add_audio_mixer_channel(mixerId, cfg, timeOffsetMs) {
21908
+ audioMixerChannelAdd(mixerId, cfg, timeOffsetMs) {
21541
21909
  let item = new sesame.v1.commands.CommandListItem();
21542
21910
  item.addAudioChannel = { mixerId, channelConfig: cfg };
21543
21911
  return this.add(item, timeOffsetMs);
21544
21912
  }
21545
- remove_audio_mixer(mixerId, timeOffsetMs) {
21913
+ audioMixerRemove(mixerId, timeOffsetMs) {
21546
21914
  let item = new sesame.v1.commands.CommandListItem();
21547
21915
  item.removeAudioMixer = { id: mixerId };
21548
21916
  return this.add(item, timeOffsetMs);
21549
21917
  }
21550
- remove_audio_mixer_channel(mixerId, channelId, timeOffsetMs) {
21918
+ audioMixerChannelRemove(mixerId, channelId, timeOffsetMs) {
21551
21919
  let item = new sesame.v1.commands.CommandListItem();
21552
21920
  item.removeAudioChannel = { mixerId, channelId };
21553
21921
  return this.add(item, timeOffsetMs);
21554
21922
  }
21555
- animate_property(propertyDomain, addr, prop, before, after, keyframes, timeOffsetMs) {
21923
+ propertyAnimate(propertyDomain, addr, prop, before, after, keyframes, timeOffsetMs) {
21556
21924
  let item = new sesame.v1.commands.CommandListItem();
21557
21925
  item.animateProperty = {
21558
21926
  address: addr,
@@ -21568,7 +21936,6 @@ var CommandList = class {
21568
21936
 
21569
21937
  // src/rpc-client.ts
21570
21938
  import { EventEmitter } from "events";
21571
- import * as WebSocket from "ws";
21572
21939
 
21573
21940
  // src/logger.ts
21574
21941
  var ConsoleLogger = class {
@@ -21747,257 +22114,59 @@ var RPCClient = class extends EventEmitter {
21747
22114
 
21748
22115
  // src/sesame-connection.ts
21749
22116
  import { EventEmitter as EventEmitter2 } from "events";
21750
- import WebSocket2 from "ws";
21751
22117
 
21752
- // src/sesame-binary-protocol.ts
21753
- var PROTOCOL_MAGIC = 1297302867;
21754
- var PROTOCOL_VERSION = 1;
21755
- var HEADER_DATA_SIZE = 32;
21756
- var HEADER_CODEC_DATA_SIZE = 24;
21757
- var HEADER_METADATA_SIZE = 64;
21758
- var FLAG_HAS_CODEC_DATA = 1 << 0;
21759
- var FLAG_HAS_METADATA = 1 << 1;
21760
- var FLAG_IS_KEYFRAME = 1 << 2;
21761
- var PacketType = /* @__PURE__ */ ((PacketType2) => {
21762
- PacketType2[PacketType2["VIDEO_FRAME"] = 1] = "VIDEO_FRAME";
21763
- PacketType2[PacketType2["AUDIO_FRAME"] = 2] = "AUDIO_FRAME";
21764
- PacketType2[PacketType2["RPC"] = 3] = "RPC";
21765
- PacketType2[PacketType2["MUXED_DATA"] = 4] = "MUXED_DATA";
21766
- PacketType2[PacketType2["DECODER_DATA"] = 5] = "DECODER_DATA";
21767
- return PacketType2;
21768
- })(PacketType || {});
21769
- var CodecType = /* @__PURE__ */ ((CodecType2) => {
21770
- CodecType2[CodecType2["VIDEO_VP8"] = 1] = "VIDEO_VP8";
21771
- CodecType2[CodecType2["VIDEO_VP9"] = 2] = "VIDEO_VP9";
21772
- CodecType2[CodecType2["VIDEO_AVC"] = 3] = "VIDEO_AVC";
21773
- CodecType2[CodecType2["VIDEO_HEVC"] = 4] = "VIDEO_HEVC";
21774
- CodecType2[CodecType2["VIDEO_AV1"] = 5] = "VIDEO_AV1";
21775
- CodecType2[CodecType2["AUDIO_OPUS"] = 64] = "AUDIO_OPUS";
21776
- CodecType2[CodecType2["AUDIO_AAC"] = 65] = "AUDIO_AAC";
21777
- CodecType2[CodecType2["AUDIO_PCM"] = 66] = "AUDIO_PCM";
21778
- return CodecType2;
21779
- })(CodecType || {});
21780
- var SesameBinaryProtocol = class {
21781
- /**
21782
- * Initialize a header data structure with proper defaults
21783
- */
21784
- static initHeader(type, flags, pts, id) {
21785
- return {
21786
- magic: PROTOCOL_MAGIC,
21787
- version: PROTOCOL_VERSION,
21788
- header_size: this.calculateHeaderSize(flags),
21789
- type,
21790
- flags,
21791
- pts,
21792
- id,
21793
- reserved: 0
21794
- // Always zero reserved fields
21795
- };
21796
- }
21797
- /**
21798
- * Calculate the total header size based on flags
21799
- */
21800
- static calculateHeaderSize(flags) {
21801
- let size = HEADER_DATA_SIZE;
21802
- if (flags & FLAG_HAS_METADATA) {
21803
- size += HEADER_METADATA_SIZE;
21804
- }
21805
- if (flags & FLAG_HAS_CODEC_DATA) {
21806
- size += HEADER_CODEC_DATA_SIZE;
21807
- }
21808
- return size;
21809
- }
21810
- /**
21811
- * Validate a header structure
21812
- */
21813
- static validateHeader(header, totalSize) {
21814
- if (header.magic !== PROTOCOL_MAGIC) {
21815
- return false;
21816
- }
21817
- if (header.version !== PROTOCOL_VERSION) {
21818
- return false;
21819
- }
21820
- const expectedHeaderSize = this.calculateHeaderSize(header.flags);
21821
- if (header.header_size !== expectedHeaderSize) {
21822
- return false;
21823
- }
21824
- if (totalSize < header.header_size) {
21825
- return false;
21826
- }
21827
- return true;
21828
- }
22118
+ // src/sesame-wire-protocol.ts
22119
+ var FrameType = sesame.v1.wire.FrameType;
22120
+ var FrameHeader = sesame.v1.wire.FrameHeader;
22121
+ var MediaCodecData = sesame.v1.wire.MediaCodecData;
22122
+ var CodecType = sesame.v1.wire.CodecType;
22123
+ var PREFIX_SIZE = 4;
22124
+ var WireProtocol = class {
21829
22125
  /**
21830
- * Serialize data into a Uint8Array buffer
22126
+ * Serialize a wire frame: 4-byte LE header_size + protobuf FrameHeader + payload.
21831
22127
  */
21832
- static serialize(header, metadata = null, codecData = null, payload = null) {
21833
- const includeMetadata = metadata !== null && header.flags & FLAG_HAS_METADATA;
21834
- const includeCodec = codecData !== null && header.flags & FLAG_HAS_CODEC_DATA;
21835
- let totalSize = HEADER_DATA_SIZE;
21836
- if (includeMetadata) totalSize += HEADER_METADATA_SIZE;
21837
- if (includeCodec) totalSize += HEADER_CODEC_DATA_SIZE;
21838
- if (payload) totalSize += payload.length;
21839
- header.header_size = totalSize - (payload ? payload.length : 0);
21840
- const buffer = new ArrayBuffer(totalSize);
21841
- const view = new DataView(buffer);
21842
- let offset = 0;
21843
- view.setUint32(offset, header.magic, true);
21844
- offset += 4;
21845
- view.setUint32(offset, header.flags, true);
21846
- offset += 4;
21847
- view.setBigUint64(offset, header.pts, true);
21848
- offset += 8;
21849
- view.setBigUint64(offset, header.id, true);
21850
- offset += 8;
21851
- view.setUint16(offset, header.version, true);
21852
- offset += 2;
21853
- view.setUint16(offset, header.header_size, true);
21854
- offset += 2;
21855
- view.setUint16(offset, header.type, true);
21856
- offset += 2;
21857
- view.setUint16(offset, header.reserved, true);
21858
- offset += 2;
21859
- if (includeMetadata && metadata) {
21860
- const metadataBytes = this.stringToFixedBytes(metadata.metadata, 64);
21861
- new Uint8Array(buffer, offset, 64).set(metadataBytes);
21862
- offset += 64;
21863
- }
21864
- if (includeCodec && codecData) {
21865
- view.setUint32(offset, codecData.sample_rate, true);
21866
- offset += 4;
21867
- view.setUint32(offset, codecData.timebase_num, true);
21868
- offset += 4;
21869
- view.setUint32(offset, codecData.timebase_den, true);
21870
- offset += 4;
21871
- view.setUint16(offset, codecData.codec_profile, true);
21872
- offset += 2;
21873
- view.setUint16(offset, codecData.codec_level, true);
21874
- offset += 2;
21875
- view.setUint16(offset, codecData.width, true);
21876
- offset += 2;
21877
- view.setUint16(offset, codecData.height, true);
21878
- offset += 2;
21879
- view.setUint8(offset, codecData.codec_type);
21880
- offset += 1;
21881
- view.setUint8(offset, codecData.channels);
21882
- offset += 1;
21883
- view.setUint8(offset, codecData.bit_depth);
21884
- offset += 1;
21885
- view.setUint8(offset, codecData.reserved);
21886
- offset += 1;
21887
- }
21888
- if (payload && payload.length > 0) {
21889
- new Uint8Array(buffer, offset).set(payload);
22128
+ static serialize(header, payload) {
22129
+ const headerBytes = sesame.v1.wire.FrameHeader.encode(header).finish();
22130
+ const headerSize = headerBytes.length;
22131
+ const payloadSize = payload ? payload.length : 0;
22132
+ const total = PREFIX_SIZE + headerSize + payloadSize;
22133
+ const buffer = new Uint8Array(total);
22134
+ const view = new DataView(buffer.buffer);
22135
+ view.setUint32(0, headerSize, true);
22136
+ buffer.set(headerBytes, PREFIX_SIZE);
22137
+ if (payload && payloadSize > 0) {
22138
+ buffer.set(payload, PREFIX_SIZE + headerSize);
21890
22139
  }
21891
- return new Uint8Array(buffer);
22140
+ return buffer;
21892
22141
  }
21893
22142
  /**
21894
- * Parse incoming binary data
22143
+ * Parse an incoming wire frame.
21895
22144
  */
21896
- static parseData(data) {
21897
- const result = {
21898
- valid: false,
21899
- header: null,
21900
- metadata: null,
21901
- codec_data: null,
21902
- payload: null,
21903
- payload_size: 0
21904
- };
21905
- if (!data || data.length < 36) {
21906
- return result;
21907
- }
21908
- const view = new DataView(data.buffer, data.byteOffset);
21909
- let offset = 0;
21910
- const header = {
21911
- magic: view.getUint32(offset, true),
21912
- flags: view.getUint32(offset + 4, true),
21913
- pts: view.getBigUint64(offset + 8, true),
21914
- id: view.getBigUint64(offset + 16, true),
21915
- version: view.getUint16(offset + 24, true),
21916
- header_size: view.getUint16(offset + 26, true),
21917
- type: view.getUint16(offset + 28, true),
21918
- reserved: view.getUint16(offset + 30, true)
21919
- };
21920
- offset += HEADER_DATA_SIZE;
21921
- if (!this.validateHeader(header, data.length)) {
21922
- return result;
21923
- }
21924
- result.header = header;
21925
- if (header.flags & FLAG_HAS_METADATA) {
21926
- if (data.length < offset + HEADER_METADATA_SIZE) {
21927
- return result;
21928
- }
21929
- const metadataBytes = data.slice(offset, offset + HEADER_METADATA_SIZE);
21930
- const metadataStr = this.fixedBytesToString(metadataBytes);
21931
- result.metadata = { metadata: metadataStr };
21932
- offset += HEADER_METADATA_SIZE;
21933
- }
21934
- if (header.flags & FLAG_HAS_CODEC_DATA) {
21935
- if (data.length < offset + HEADER_CODEC_DATA_SIZE) {
21936
- return result;
21937
- }
21938
- result.codec_data = {
21939
- sample_rate: view.getUint32(offset, true),
21940
- timebase_num: view.getUint32(offset + 4, true),
21941
- timebase_den: view.getUint32(offset + 8, true),
21942
- codec_profile: view.getUint16(offset + 12, true),
21943
- codec_level: view.getUint16(offset + 14, true),
21944
- width: view.getUint16(offset + 16, true),
21945
- height: view.getUint16(offset + 18, true),
21946
- codec_type: view.getUint8(offset + 20),
21947
- channels: view.getUint8(offset + 21),
21948
- bit_depth: view.getUint8(offset + 22),
21949
- reserved: view.getUint8(offset + 23)
21950
- };
21951
- offset += HEADER_CODEC_DATA_SIZE;
22145
+ static parse(data) {
22146
+ const result = { valid: false, header: null, payload: null };
22147
+ if (!data || data.length < PREFIX_SIZE) return result;
22148
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
22149
+ const headerSize = view.getUint32(0, true);
22150
+ if (data.length < PREFIX_SIZE + headerSize) return result;
22151
+ try {
22152
+ const headerBytes = data.subarray(PREFIX_SIZE, PREFIX_SIZE + headerSize);
22153
+ result.header = sesame.v1.wire.FrameHeader.decode(headerBytes);
22154
+ result.payload = data.subarray(PREFIX_SIZE + headerSize);
22155
+ result.valid = true;
22156
+ } catch {
21952
22157
  }
21953
- if (offset < data.length) {
21954
- result.payload = data.slice(offset);
21955
- result.payload_size = result.payload.length;
21956
- } else {
21957
- result.payload = new Uint8Array(0);
21958
- result.payload_size = 0;
21959
- }
21960
- result.valid = true;
21961
22158
  return result;
21962
22159
  }
21963
- /**
21964
- * Helper: Convert string to fixed-size byte array (null-terminated)
21965
- */
21966
- static stringToFixedBytes(str, size) {
21967
- const bytes = new Uint8Array(size);
21968
- let encoded;
21969
- if (typeof TextEncoder !== "undefined") {
21970
- const encoder = new TextEncoder();
21971
- encoded = encoder.encode(str);
21972
- } else {
21973
- encoded = new Uint8Array(Buffer.from(str, "utf8"));
21974
- }
21975
- const copyLen = Math.min(encoded.length, size - 1);
21976
- bytes.set(encoded.slice(0, copyLen));
21977
- bytes[copyLen] = 0;
21978
- return bytes;
21979
- }
21980
- /**
21981
- * Helper: Convert fixed-size byte array to string (null-terminated)
21982
- */
21983
- static fixedBytesToString(bytes) {
21984
- let len = bytes.length;
21985
- for (let i = 0; i < bytes.length; i++) {
21986
- if (bytes[i] === 0) {
21987
- len = i;
21988
- break;
21989
- }
21990
- }
21991
- if (typeof TextDecoder !== "undefined") {
21992
- const decoder = new TextDecoder();
21993
- return decoder.decode(bytes.slice(0, len));
21994
- } else {
21995
- return Buffer.from(bytes.slice(0, len)).toString("utf8");
21996
- }
21997
- }
21998
22160
  };
21999
22161
 
22000
22162
  // src/sesame-connection.ts
22163
+ var ConnectionState = /* @__PURE__ */ ((ConnectionState2) => {
22164
+ ConnectionState2["Disconnected"] = "disconnected";
22165
+ ConnectionState2["Connecting"] = "connecting";
22166
+ ConnectionState2["Connected"] = "connected";
22167
+ ConnectionState2["Reconnecting"] = "reconnecting";
22168
+ return ConnectionState2;
22169
+ })(ConnectionState || {});
22001
22170
  function waitForEvent(emitter, eventName) {
22002
22171
  return new Promise((resolve) => {
22003
22172
  emitter.once(eventName, resolve);
@@ -22010,46 +22179,81 @@ var SesameConnection = class extends EventEmitter2 {
22010
22179
  this.numRetries = 0;
22011
22180
  this.url = "";
22012
22181
  this.autoReconnect = true;
22182
+ this._state = "disconnected" /* Disconnected */;
22183
+ /* Bound listeners so we can removeEventListener later */
22184
+ this.boundMessageHandler = (event) => this.messageHandler(event);
22185
+ this.boundOpenHandler = () => this.openHandler();
22186
+ this.boundCloseHandler = () => this.closeHandler();
22187
+ this.boundErrorHandler = (event) => this.errorHandler(event);
22013
22188
  this.openHandler = () => {
22014
22189
  this.numRetries = 0;
22190
+ this.setState("connected" /* Connected */);
22015
22191
  this.emit("open");
22016
22192
  };
22017
22193
  this.messageHandler = (event) => {
22018
- var _a, _b, _c;
22019
22194
  if (event.data instanceof ArrayBuffer) {
22020
- const parsed = SesameBinaryProtocol.parseData(new Uint8Array(event.data));
22021
- if (!parsed.valid) this.emit("error", new Error("Invalid packet received"));
22022
- if (((_a = parsed.header) == null ? void 0 : _a.type) == 1 /* VIDEO_FRAME */) {
22023
- this.emit("video-packet", event.data);
22024
- } else if (((_b = parsed.header) == null ? void 0 : _b.type) == 2 /* AUDIO_FRAME */) {
22025
- this.emit("audio-packet", event.data);
22026
- } else if (((_c = parsed.header) == null ? void 0 : _c.type) == 3 /* RPC */) {
22195
+ const parsed = WireProtocol.parse(new Uint8Array(event.data));
22196
+ if (!parsed.valid) {
22197
+ this.emit("error", new Error("Invalid packet received"));
22198
+ return;
22199
+ }
22200
+ const frameType = parsed.header?.type;
22201
+ if (frameType === FrameType.FRAME_TYPE_RPC) {
22027
22202
  this.emit("rpc", parsed.payload);
22203
+ } else {
22204
+ this.emit("media-packet", parsed);
22028
22205
  }
22029
22206
  }
22030
22207
  };
22031
22208
  this.url = options.url;
22032
22209
  this.autoReconnect = options.autoReconnect;
22033
- if (options.autoConnect) this.connect().catch(() => log.debug("failed connect"));
22210
+ if (options.autoConnect) this.connect().catch(() => {
22211
+ });
22212
+ }
22213
+ get state() {
22214
+ return this._state;
22215
+ }
22216
+ setState(newState) {
22217
+ if (this._state === newState) return;
22218
+ const prev = this._state;
22219
+ this._state = newState;
22220
+ switch (newState) {
22221
+ case "connected" /* Connected */:
22222
+ log.info("Connected to Sesame");
22223
+ break;
22224
+ case "reconnecting" /* Reconnecting */:
22225
+ if (prev === "connected" /* Connected */) {
22226
+ log.warn("Lost connection to Sesame, will try reconnect..");
22227
+ } else {
22228
+ log.warn("Failed to connect to Sesame, will try reconnect..");
22229
+ }
22230
+ break;
22231
+ case "disconnected" /* Disconnected */:
22232
+ log.info("Disconnected from Sesame");
22233
+ break;
22234
+ }
22235
+ this.emit("state", newState, prev);
22034
22236
  }
22035
22237
  isConnected() {
22036
- return this.socket !== void 0 && this.socket.readyState === WebSocket2.OPEN;
22238
+ return this.socket !== void 0 && this.socket.readyState === WebSocket.OPEN;
22037
22239
  }
22038
22240
  async send(data) {
22039
22241
  if (!this.isConnected()) throw new Error("Not connected");
22040
- const header = SesameBinaryProtocol.initHeader(3 /* RPC */, 0, BigInt(0), BigInt(0));
22041
- const data_to_send = SesameBinaryProtocol.serialize(header, null, null, data);
22042
- if (!data_to_send) throw new Error("Failed to serialize data");
22043
- this.socket.send(data_to_send);
22242
+ const header = { type: sesame.v1.wire.FrameType.FRAME_TYPE_RPC };
22243
+ const frame = WireProtocol.serialize(header, data);
22244
+ this.socket.send(frame);
22044
22245
  return Promise.resolve();
22045
22246
  }
22046
22247
  async connect() {
22047
22248
  this.active = true;
22048
- this.socket = new WebSocket2(this.url);
22049
- this.socket.addEventListener("message", (event) => this.messageHandler(event));
22050
- this.socket.addEventListener("open", () => this.openHandler());
22051
- this.socket.addEventListener("close", () => this.closeHandler());
22052
- this.socket.addEventListener("error", (error) => this.errorHandler(error));
22249
+ if (this._state === "disconnected" /* Disconnected */) {
22250
+ this.setState("connecting" /* Connecting */);
22251
+ }
22252
+ this.socket = new WebSocket(this.url);
22253
+ this.socket.addEventListener("message", this.boundMessageHandler);
22254
+ this.socket.addEventListener("open", this.boundOpenHandler);
22255
+ this.socket.addEventListener("close", this.boundCloseHandler);
22256
+ this.socket.addEventListener("error", this.boundErrorHandler);
22053
22257
  this.socket.binaryType = "arraybuffer";
22054
22258
  await new Promise((resolve) => {
22055
22259
  const done = () => {
@@ -22067,34 +22271,41 @@ var SesameConnection = class extends EventEmitter2 {
22067
22271
  async disconnect() {
22068
22272
  this.active = false;
22069
22273
  if (!this.socket) {
22274
+ this.setState("disconnected" /* Disconnected */);
22070
22275
  return;
22071
22276
  }
22072
22277
  const sock = this.socket;
22073
- if (sock.readyState !== WebSocket2.CLOSED) {
22278
+ if (sock.readyState !== WebSocket.CLOSED) {
22074
22279
  sock.close();
22075
22280
  await waitForEvent(this, "close");
22076
22281
  }
22077
- sock.removeAllListeners();
22282
+ this.removeSocketListeners(sock);
22283
+ }
22284
+ removeSocketListeners(sock) {
22285
+ sock.removeEventListener("message", this.boundMessageHandler);
22286
+ sock.removeEventListener("open", this.boundOpenHandler);
22287
+ sock.removeEventListener("close", this.boundCloseHandler);
22288
+ sock.removeEventListener("error", this.boundErrorHandler);
22078
22289
  }
22079
22290
  retryHandler() {
22080
22291
  if (this.active && this.autoReconnect) {
22081
- this.connect().catch((err) => log.error("Retry failed", err));
22292
+ this.connect().catch(() => {
22293
+ });
22082
22294
  }
22083
22295
  }
22084
22296
  closeHandler() {
22085
22297
  this.emit("close");
22086
22298
  if (this.socket) {
22087
- this.socket.removeAllListeners();
22299
+ this.removeSocketListeners(this.socket);
22088
22300
  }
22089
22301
  this.socket = void 0;
22090
22302
  if (this.active) {
22091
- try {
22092
- setTimeout(() => {
22093
- this.retryHandler();
22094
- }, defaultBackoff(++this.numRetries));
22095
- } catch (err) {
22096
- log.error("Connection error", err);
22097
- }
22303
+ this.setState("reconnecting" /* Reconnecting */);
22304
+ setTimeout(() => {
22305
+ this.retryHandler();
22306
+ }, defaultBackoff(++this.numRetries));
22307
+ } else {
22308
+ this.setState("disconnected" /* Disconnected */);
22098
22309
  }
22099
22310
  }
22100
22311
  errorHandler(error) {
@@ -22107,6 +22318,131 @@ var defaultBackoff = (tries) => {
22107
22318
 
22108
22319
  // src/sesame-api-client.ts
22109
22320
  import { EventEmitter as EventEmitter3 } from "events";
22321
+
22322
+ // src/status-api.ts
22323
+ var StatusApi = class {
22324
+ /** @internal */
22325
+ constructor(rpc) {
22326
+ this.rpc = rpc;
22327
+ }
22328
+ async getStatus() {
22329
+ return this.rpc.service.requestStatus(new sesame.v1.common.Empty());
22330
+ }
22331
+ async getIODevices() {
22332
+ return this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
22333
+ }
22334
+ async requestKeyframe(outputId) {
22335
+ await this.rpc.service.requestKeyframe({ id: outputId });
22336
+ }
22337
+ };
22338
+
22339
+ // src/recorder-api.ts
22340
+ var RecorderApi = class {
22341
+ /** @internal */
22342
+ constructor(rpc) {
22343
+ this.rpc = rpc;
22344
+ }
22345
+ async addClip(recorderId, clip) {
22346
+ const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
22347
+ await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
22348
+ }
22349
+ async copyClip(recorderId, clipId, newClipId) {
22350
+ const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
22351
+ await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
22352
+ }
22353
+ async removeClip(recorderId, id) {
22354
+ const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
22355
+ await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
22356
+ }
22357
+ async removeAllClips(recorderId, protect) {
22358
+ const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
22359
+ if (protect) msg.protectedRanges = protect;
22360
+ await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
22361
+ }
22362
+ async verifyClips(recorderId) {
22363
+ const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
22364
+ const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
22365
+ return reply.verifyClipsResponse?.errors || [];
22366
+ }
22367
+ async getClips(recorderId) {
22368
+ const msg = sesame.v1.recorder.RecorderClipsGetRequest.create();
22369
+ const reply = await this.rpc.service.requestRecorderOperation({ recorderId, getClips: msg });
22370
+ if (reply.getClipsResponse?.clips) {
22371
+ return reply.getClipsResponse.clips;
22372
+ } else {
22373
+ throw new Error(`No clips returned: ${JSON.stringify(reply)}`);
22374
+ }
22375
+ }
22376
+ async setLockedDuration(frames) {
22377
+ const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
22378
+ await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
22379
+ }
22380
+ async setMetadata(recorderId, metadata) {
22381
+ const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
22382
+ await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
22383
+ }
22384
+ };
22385
+
22386
+ // src/jobs-api.ts
22387
+ var JobsApi = class {
22388
+ /** @internal */
22389
+ constructor(rpc) {
22390
+ this.rpc = rpc;
22391
+ }
22392
+ async importClip(config) {
22393
+ const msg = sesame.v1.jobs.ImportStartRequest.create();
22394
+ msg.config = config;
22395
+ const res = await this.rpc.service.requestClipImportStart(msg);
22396
+ if (res.error) {
22397
+ throw new Error(res.error);
22398
+ }
22399
+ return res;
22400
+ }
22401
+ async getImportStatus() {
22402
+ const msg = sesame.v1.jobs.ImportListRequest.create();
22403
+ return this.rpc.service.requestClipImportList(msg);
22404
+ }
22405
+ async abortImport(jobId) {
22406
+ const msg = { jobId };
22407
+ return this.rpc.service.requestClipImportAbort(msg);
22408
+ }
22409
+ async exportPlaylist(playlist, config) {
22410
+ const msg = sesame.v1.jobs.ExportStartRequest.create();
22411
+ if (!config.filename) throw new Error("Filename is required");
22412
+ msg.config = {
22413
+ ...config,
22414
+ filename: config.filename,
22415
+ videoCodec: config.videoCodec ?? sesame.v1.common.CodecId.CODEC_ID_H264,
22416
+ videoBitrateKbps: config.videoBitrateKbps ?? 1024,
22417
+ audioCodec: config.audioCodec ?? sesame.v1.jobs.AudioCodecId.AUDIO_CODEC_ID_AAC,
22418
+ audioBitrateKbps: config.audioBitrateKbps ?? 128,
22419
+ audioChannels: config.audioChannels ?? 4,
22420
+ audioRouting: config.audioRouting ?? [0, 1, 2, 3]
22421
+ };
22422
+ msg.items = playlist.clips.map((clip) => ({
22423
+ id: clip.id,
22424
+ recorderId: clip.recorderId,
22425
+ transitionTimeUs: clip.transitionTimeUs ?? 0,
22426
+ transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
22427
+ transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
22428
+ speed: clip.speed ?? 1,
22429
+ audioRouting: clip.audioRouting,
22430
+ startTimeUs: clip.startTimeUs,
22431
+ endTimeUs: clip.endTimeUs
22432
+ }));
22433
+ await this.rpc.service.requestPlaylistExportStart(msg);
22434
+ }
22435
+ async getExportStatus() {
22436
+ const msg = sesame.v1.jobs.ExportListRequest.create();
22437
+ return this.rpc.service.requestPlaylistExportList(msg);
22438
+ }
22439
+ async abortExport(jobId) {
22440
+ const msg = { jobId };
22441
+ return this.rpc.service.requestPlaylistExportAbort(msg);
22442
+ }
22443
+ };
22444
+
22445
+ // src/sesame-api-client.ts
22110
22446
  var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
22111
22447
  EaseKind2["STEPPED"] = "stepped";
22112
22448
  EaseKind2["LINEAR"] = "linear";
@@ -22146,10 +22482,7 @@ var SesameClient = class extends EventEmitter3 {
22146
22482
  constructor(portOrUrl) {
22147
22483
  super();
22148
22484
  this.subscriptions = [];
22149
- this.errorIsLogged = false;
22150
- this.onVideoPacket = () => {
22151
- };
22152
- this.onAudioPacket = () => {
22485
+ this.onMediaPacket = () => {
22153
22486
  };
22154
22487
  this.onCallbackMessage = () => {
22155
22488
  };
@@ -22160,10 +22493,6 @@ var SesameClient = class extends EventEmitter3 {
22160
22493
  autoReconnect: true
22161
22494
  });
22162
22495
  this.conn.on("error", () => {
22163
- if (!this.errorIsLogged) {
22164
- log.warn("Could not connect to Sesame Engine, will keep trying..");
22165
- this.errorIsLogged = true;
22166
- }
22167
22496
  });
22168
22497
  let events = {
22169
22498
  [sesame.v1.common.EventTopic.EVENT_TOPIC_ERROR]: sesame.v1.status.Event,
@@ -22177,6 +22506,9 @@ var SesameClient = class extends EventEmitter3 {
22177
22506
  eventTypes: events
22178
22507
  };
22179
22508
  this.rpc = new RPCClient(this.conn, sesame.v1.rpc.SesameAPIService, options);
22509
+ this.status = new StatusApi(this.rpc);
22510
+ this.recorder = new RecorderApi(this.rpc);
22511
+ this.jobs = new JobsApi(this.rpc);
22180
22512
  this.rpc.on("event", (topic, msg) => {
22181
22513
  for (const subscription of this.subscriptions) {
22182
22514
  if (subscription.topic === topic) {
@@ -22185,173 +22517,59 @@ var SesameClient = class extends EventEmitter3 {
22185
22517
  }
22186
22518
  });
22187
22519
  this.rpc.on("error", (err) => {
22188
- log.error(`RPC error: ${err.message}`);
22520
+ if (this.isConnected()) {
22521
+ log.error(`RPC error: ${err.message}`);
22522
+ }
22189
22523
  });
22190
22524
  this.conn.on("open", async () => {
22191
- this.send_subscriptions();
22192
- this.errorIsLogged = false;
22525
+ this.sendSubscriptions();
22193
22526
  this.emit("connected");
22194
22527
  });
22195
22528
  this.conn.on("close", () => {
22196
22529
  this.emit("disconnected");
22197
22530
  });
22198
- this.conn.on("video-packet", (data) => this.onVideoPacket(this.video_subscription, data));
22199
- this.conn.on("audio-packet", (data) => this.onAudioPacket(this.video_subscription, data));
22531
+ this.conn.on("media-packet", (frame) => this.onMediaPacket(this.mediaSubscriptionId, frame));
22200
22532
  this.subscriptions = [];
22201
22533
  }
22202
22534
  isConnected() {
22203
22535
  return this.conn.isConnected();
22204
22536
  }
22205
- send_subscriptions() {
22537
+ sendSubscriptions() {
22206
22538
  if (!this.isConnected()) return;
22207
22539
  const eventTopics = this.subscriptions.map((subscription) => subscription.topic);
22208
22540
  const channels = [];
22209
- if (this.video_subscription) channels.push(`video/${this.video_subscription}`);
22541
+ if (this.mediaSubscriptionId) channels.push(`media-stream/${this.mediaSubscriptionId}`);
22210
22542
  let subs = { eventTopics, channels };
22211
22543
  this.rpc.service.updateSubscriptions(subs).catch((err) => {
22212
22544
  log.error(`Failed to update subscriptions: ${err.message}`);
22213
22545
  });
22214
22546
  }
22215
- async get_status() {
22216
- const status = await this.rpc.service.requestStatus(new sesame.v1.common.Empty());
22217
- return status;
22218
- }
22219
- async get_io_devices() {
22220
- const reply = await this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
22221
- return reply;
22222
- }
22223
- async request_keyframe(outputId) {
22224
- await this.rpc.service.requestKeyframe({ id: outputId });
22225
- }
22226
- add_video_subscription(id) {
22227
- this.video_subscription = id;
22228
- this.send_subscriptions();
22547
+ addMediaSubscription(id) {
22548
+ this.mediaSubscriptionId = id;
22549
+ this.sendSubscriptions();
22229
22550
  }
22230
- add_subscription(topic, callback) {
22551
+ addSubscription(topic, callback) {
22231
22552
  for (let i = 0; i < this.subscriptions.length; i++) {
22232
22553
  if (this.subscriptions[i].callback === callback && this.subscriptions[i].topic === topic) {
22233
22554
  return;
22234
22555
  }
22235
22556
  }
22236
22557
  this.subscriptions.push({ topic, callback });
22237
- this.send_subscriptions();
22558
+ this.sendSubscriptions();
22238
22559
  }
22239
- remove_subscription(topic, callback) {
22560
+ removeSubscription(topic, callback) {
22240
22561
  this.subscriptions = this.subscriptions.filter((s) => !(s.topic === topic && s.callback === callback));
22241
- this.send_subscriptions();
22562
+ this.sendSubscriptions();
22242
22563
  }
22243
22564
  getService() {
22244
22565
  return this.rpc;
22245
22566
  }
22246
22567
  async execute(cl) {
22247
22568
  cl.filterCreatedAndDestroyedSources();
22248
- if (cl.get_command_list_msg().commandList.length > 0) {
22249
- await this.rpc.service.executeCommandList(cl.get_command_list_msg());
22250
- }
22251
- }
22252
- async addClip(recorderId, clip) {
22253
- const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
22254
- await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
22255
- }
22256
- async copyClip(recorderId, clipId, newClipId) {
22257
- const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
22258
- await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
22259
- }
22260
- async removeClip(recorderId, id) {
22261
- const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
22262
- await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
22263
- }
22264
- async removeAllClips(recorderId, protect) {
22265
- const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
22266
- if (protect) msg.protectedRanges = protect;
22267
- await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
22268
- }
22269
- async verifyClips(recorderId) {
22270
- var _a;
22271
- const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
22272
- const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
22273
- return ((_a = reply.verifyClipsResponse) == null ? void 0 : _a.errors) || [];
22274
- }
22275
- async setLockedDuration(frames) {
22276
- const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
22277
- await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
22278
- }
22279
- async setMetadata(recorderId, metadata) {
22280
- const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
22281
- await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
22282
- }
22283
- async getClips(recorderId) {
22284
- const msg = sesame.v1.recorder.RecorderClipsGetRequest.create();
22285
- const reply = await this.rpc.service.requestRecorderOperation({ recorderId, getClips: msg });
22286
- if (reply.getClipsResponse && reply.getClipsResponse.clips) {
22287
- return reply.getClipsResponse.clips.map((c) => {
22288
- return {
22289
- id: Number(c.id),
22290
- startTime: Number(c.startTimeUs),
22291
- endTime: Number(c.endTimeUs),
22292
- lockedStart: Number(c.lockedStartUs),
22293
- lockedEnd: Number(c.lockedEndUs),
22294
- userTime: c.userTimeUs ? Number(c.userTimeUs) : void 0,
22295
- name: c.name ?? "",
22296
- userData: c.userData
22297
- };
22298
- });
22299
- } else {
22300
- throw new Error(`No clips returned: ${JSON.stringify(reply)}`);
22301
- }
22302
- }
22303
- async getImportClipStatus() {
22304
- const msg = sesame.v1.jobs.ImportListRequest.create();
22305
- return await this.rpc.service.requestClipImportList(msg);
22306
- }
22307
- async getExportPlaylistStatus() {
22308
- const msg = sesame.v1.jobs.ExportListRequest.create();
22309
- return await this.rpc.service.requestPlaylistExportList(msg);
22310
- }
22311
- async exportPlaylist(playlist, config) {
22312
- const msg = sesame.v1.jobs.ExportStartRequest.create();
22313
- if (!config.filename) throw new Error("Filename is required");
22314
- msg.config = {
22315
- ...config,
22316
- filename: config.filename,
22317
- videoCodec: config.videoCodec ?? sesame.v1.common.CodecId.CODEC_ID_H264,
22318
- videoBitrateKbps: config.videoBitrateKbps ?? 1024,
22319
- audioCodec: config.audioCodec ?? sesame.v1.jobs.AudioCodecId.AUDIO_CODEC_ID_AAC,
22320
- audioBitrateKbps: config.audioBitrateKbps ?? 128,
22321
- audioChannels: config.audioChannels ?? 4,
22322
- audioRouting: config.audioRouting ?? [0, 1, 2, 3]
22323
- };
22324
- msg.items = playlist.clips.map((clip) => ({
22325
- id: clip.id,
22326
- recorderId: clip.recorderId,
22327
- transitionTimeUs: (clip.transitionTime ?? 0) * 1e3,
22328
- transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
22329
- transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
22330
- speed: clip.speed ?? 1,
22331
- audioRouting: clip.audioRouting,
22332
- startTimeUs: clip.startTime,
22333
- endTimeUs: clip.endTime
22334
- }));
22335
- await this.rpc.service.requestPlaylistExportStart(msg);
22336
- }
22337
- async importClip(config) {
22338
- const msg = sesame.v1.jobs.ImportStartRequest.create();
22339
- msg.config = config;
22340
- const res = await this.rpc.service.requestClipImportStart(msg);
22341
- if (res.error) {
22342
- throw new Error(res.error);
22343
- } else {
22344
- return res;
22569
+ if (cl.getCommandListMsg().commandList.length > 0) {
22570
+ await this.rpc.service.executeCommandList(cl.getCommandListMsg());
22345
22571
  }
22346
22572
  }
22347
- async abortExportJob(jobId) {
22348
- const msg = { jobId };
22349
- return this.rpc.service.requestPlaylistExportAbort(msg);
22350
- }
22351
- async abortImportJob(jobId) {
22352
- const msg = { jobId };
22353
- return this.rpc.service.requestClipImportAbort(msg);
22354
- }
22355
22573
  disconnect() {
22356
22574
  this.conn.disconnect();
22357
22575
  }
@@ -22365,16 +22583,21 @@ var Event = sesame.v1.rpc.Event;
22365
22583
  export {
22366
22584
  CodecType,
22367
22585
  CommandList,
22586
+ ConnectionState,
22368
22587
  EaseKind,
22369
22588
  Event,
22589
+ FrameHeader,
22590
+ FrameType,
22591
+ JobsApi,
22370
22592
  Message,
22371
- PacketType,
22372
22593
  RPCClient,
22594
+ RecorderApi,
22373
22595
  Request,
22374
22596
  Response,
22375
- SesameBinaryProtocol,
22376
22597
  SesameClient,
22377
22598
  SesameConnection,
22599
+ StatusApi,
22600
+ WireProtocol,
22378
22601
  getLogger,
22379
22602
  log,
22380
22603
  sesame,