@blockcast/mmt-container 0.3.0-main.3f0b3688e8b7 → 0.3.0-main.5bb7058c73ff

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.
@@ -17137,6 +17137,8 @@ var MmtpRouter = class {
17137
17137
  */
17138
17138
  #onPublisherRestart;
17139
17139
  #publisherRestarts = 0;
17140
+ /** Inits delivered with no onTrackInit handler for their packetId (MOQT-01). */
17141
+ #unmappedInitDeliveries = 0;
17140
17142
  // FEC Payload IDs left unread because their (owner) packetId had no
17141
17143
  // configured fec.blockProfile (see #noteUnreadableFecPayloadId).
17142
17144
  #fecPayloadIdsWithoutProfile = 0;
@@ -17342,6 +17344,16 @@ var MmtpRouter = class {
17342
17344
  })
17343
17345
  };
17344
17346
  }
17347
+ /**
17348
+ * Init segments delivered for a packetId with no `onTrackInit` handler
17349
+ * since construction, whether the deprecated aggregate `onInitSegment`
17350
+ * callback then received them or nothing did. A supported deployment reads
17351
+ * 0 here; a non-zero value is the evidence that blocks removing the
17352
+ * aggregate callback (MOQT-01, BLO-21181).
17353
+ */
17354
+ get unmappedInitDeliveryCount() {
17355
+ return this.#unmappedInitDeliveries;
17356
+ }
17345
17357
  /** Publisher restarts detected on the multicast leg since construction. */
17346
17358
  get publisherRestartCount() {
17347
17359
  return this.#publisherRestarts;
@@ -17499,7 +17511,15 @@ var MmtpRouter = class {
17499
17511
  onTrackPacket(packetId, cb) {
17500
17512
  this.#trackPacketCallbacks.set(packetId, cb);
17501
17513
  }
17502
- /** Register an init segment callback (ftyp+moov from MMTP MPU metadata). */
17514
+ /**
17515
+ * Register an init segment callback (ftyp+moov from MMTP MPU metadata).
17516
+ * Receives an init only for a packetId with no `onTrackInit` handler.
17517
+ *
17518
+ * @deprecated Use onTrackInit(packetId, cb). Still delivered as a fallback;
17519
+ * removed in the 1.0.0 major, no earlier than one minor release after this
17520
+ * deprecation reaches the `latest` dist-tag (BLO-21181). Count fallback
17521
+ * deliveries with `unmappedInitDeliveryCount`.
17522
+ */
17503
17523
  onInitSegment(cb) {
17504
17524
  this.#onInitSegment = cb;
17505
17525
  }
@@ -18598,8 +18618,9 @@ var MmtpRouter = class {
18598
18618
  const cb = this.#trackInitCallbacks.get(packetId);
18599
18619
  if (cb) {
18600
18620
  cb(data);
18601
- } else if (this.#onInitSegment) {
18602
- this.#onInitSegment(data);
18621
+ } else {
18622
+ this.#unmappedInitDeliveries++;
18623
+ this.#onInitSegment?.(data);
18603
18624
  }
18604
18625
  console.log(
18605
18626
  `[MmtpRouter] Init delivered for packetId=${packetId}${catalogTrackName === void 0 ? "" : ` track=${catalogTrackName}`} (${data.byteLength}B)`
@@ -23322,6 +23343,7 @@ var MulticastManager = class {
23322
23343
  onTrackPacket(packetId, cb) {
23323
23344
  this.#router.onTrackPacket(packetId, cb);
23324
23345
  }
23346
+ /** @deprecated Use onTrackInit(packetId, cb); see MmtpRouter.onInitSegment. */
23325
23347
  onInitSegment(cb) {
23326
23348
  this.#router.onInitSegment(cb);
23327
23349
  }