@camstack/addon-pipeline 1.2.83 → 1.2.84

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.
@@ -15280,7 +15280,8 @@ var StreamBrokerManager = class StreamBrokerManager {
15280
15280
  * is byte-identical everywhere it used to be right.
15281
15281
  */
15282
15282
  async wakeBatteryDeviceOnPlay(deviceId, brokerId, camStreamId) {
15283
- if (this.hasRegisteredBroker(brokerId)) return;
15283
+ const demandHasBroker = camStreamId === void 0 ? () => this.hasAnyRegisteredBrokerForDevice(deviceId) : () => this.hasRegisteredBroker(brokerId);
15284
+ if (demandHasBroker()) return;
15284
15285
  if (this.disabledDevices.has(deviceId)) return;
15285
15286
  const api = this.api;
15286
15287
  if (!api) return;
@@ -15309,9 +15310,18 @@ var StreamBrokerManager = class StreamBrokerManager {
15309
15310
  }),
15310
15311
  reconcileCatalog: (id) => this.reconcileDeviceCatalog(id),
15311
15312
  ensureBroker: () => this.ensureBrokerForWebrtcSession(deviceId, brokerId, camStreamId),
15312
- hasBroker: () => this.hasRegisteredBroker(brokerId)
15313
+ hasBroker: demandHasBroker
15313
15314
  });
15314
15315
  }
15316
+ /** Any broker (local or remote-adapter) registered for this device? The
15317
+ * wake-on-play answer for `adaptive` targets — see the comment in
15318
+ * {@link wakeBatteryDeviceOnPlay}. */
15319
+ hasAnyRegisteredBrokerForDevice(deviceId) {
15320
+ const prefix = `${String(deviceId)}/`;
15321
+ for (const id of this.brokers.keys()) if (id.startsWith(prefix)) return true;
15322
+ for (const id of this.remoteBrokerAdapters.keys()) if (id.startsWith(prefix)) return true;
15323
+ return false;
15324
+ }
15315
15325
  /**
15316
15326
  * Single-flight body for `ensureBrokerForWebrtcSession`'s remote-adapter
15317
15327
  * get-or-create — resolves the ingest owner, and for `remote-adapter` mode
@@ -15275,7 +15275,8 @@ var StreamBrokerManager = class StreamBrokerManager {
15275
15275
  * is byte-identical everywhere it used to be right.
15276
15276
  */
15277
15277
  async wakeBatteryDeviceOnPlay(deviceId, brokerId, camStreamId) {
15278
- if (this.hasRegisteredBroker(brokerId)) return;
15278
+ const demandHasBroker = camStreamId === void 0 ? () => this.hasAnyRegisteredBrokerForDevice(deviceId) : () => this.hasRegisteredBroker(brokerId);
15279
+ if (demandHasBroker()) return;
15279
15280
  if (this.disabledDevices.has(deviceId)) return;
15280
15281
  const api = this.api;
15281
15282
  if (!api) return;
@@ -15304,9 +15305,18 @@ var StreamBrokerManager = class StreamBrokerManager {
15304
15305
  }),
15305
15306
  reconcileCatalog: (id) => this.reconcileDeviceCatalog(id),
15306
15307
  ensureBroker: () => this.ensureBrokerForWebrtcSession(deviceId, brokerId, camStreamId),
15307
- hasBroker: () => this.hasRegisteredBroker(brokerId)
15308
+ hasBroker: demandHasBroker
15308
15309
  });
15309
15310
  }
15311
+ /** Any broker (local or remote-adapter) registered for this device? The
15312
+ * wake-on-play answer for `adaptive` targets — see the comment in
15313
+ * {@link wakeBatteryDeviceOnPlay}. */
15314
+ hasAnyRegisteredBrokerForDevice(deviceId) {
15315
+ const prefix = `${String(deviceId)}/`;
15316
+ for (const id of this.brokers.keys()) if (id.startsWith(prefix)) return true;
15317
+ for (const id of this.remoteBrokerAdapters.keys()) if (id.startsWith(prefix)) return true;
15318
+ return false;
15319
+ }
15310
15320
  /**
15311
15321
  * Single-flight body for `ensureBrokerForWebrtcSession`'s remote-adapter
15312
15322
  * get-or-create — resolves the ingest owner, and for `remote-adapter` mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline",
3
- "version": "1.2.83",
3
+ "version": "1.2.84",
4
4
  "description": "Pipeline bundle — runner, detection, motion, audio + stream broker. Multi-entry npm package shipping pipeline addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",