@camstack/types 1.2.225 → 1.2.227
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{canonical-hash-CvL03d3i.mjs → canonical-hash-CPK2Dy60.mjs} +31 -8
- package/dist/{canonical-hash-DYsYm8is.js → canonical-hash-CSE4ioRi.js} +31 -8
- package/dist/capabilities/index.d.ts +3 -3
- package/dist/capabilities/pipeline-analytics.cap.d.ts +21 -0
- package/dist/capabilities/pipeline-runner.cap.d.ts +10 -0
- package/dist/capabilities/schemas/streaming-shared.d.ts +16 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +189 -0
- package/dist/deps/ffmpeg-downloader.d.ts +31 -5
- package/dist/deps/index.d.ts +1 -1
- package/dist/ffmpeg/invocation.d.ts +34 -24
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/index.js +149 -3
- package/dist/index.mjs +146 -4
- package/dist/interfaces/pipeline-runner-capability.d.ts +9 -0
- package/dist/interfaces/stream-broker.d.ts +15 -2
- package/dist/node.d.ts +2 -1
- package/dist/node.js +51 -35
- package/dist/node.mjs +49 -36
- package/dist/{sleep-GU_us3DG.mjs → sleep-CiR4z7r9.mjs} +14 -2
- package/dist/{sleep-VlZxDyXq.js → sleep-D7DPSeiv.js} +19 -1
- package/package.json +1 -1
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Fmp4BoxSplitter, o as buildFfmpegArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-
|
|
1
|
+
import { n as Fmp4BoxSplitter, o as buildFfmpegArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-CPK2Dy60.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import * as fs from "node:fs";
|
|
@@ -365,40 +365,42 @@ function bundledFfmpegPath(platform) {
|
|
|
365
365
|
* - Linux: https://johnvansickle.com/ffmpeg/ (static builds)
|
|
366
366
|
* - macOS: https://www.osxexperts.net/
|
|
367
367
|
*/
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
368
|
+
/**
|
|
369
|
+
* johnvansickle for linux (unversioned "release" URLs, so no version appears
|
|
370
|
+
* here), osxexperts for macOS — two different builds, and the Intel one is a
|
|
371
|
+
* different file at a different version from the arm one.
|
|
372
|
+
*/
|
|
373
|
+
var FFMPEG_ARTIFACTS = {
|
|
374
|
+
"linux-x64": {
|
|
375
|
+
url: "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz",
|
|
376
|
+
archiveFormat: "tar.xz",
|
|
377
|
+
expectedHwaccels: []
|
|
378
|
+
},
|
|
379
|
+
"linux-arm64": {
|
|
380
|
+
url: "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz",
|
|
381
|
+
archiveFormat: "tar.xz",
|
|
382
|
+
expectedHwaccels: []
|
|
383
|
+
},
|
|
384
|
+
"darwin-arm64": {
|
|
385
|
+
url: "https://www.osxexperts.net/ffmpeg71arm.zip",
|
|
386
|
+
archiveFormat: "zip",
|
|
387
|
+
expectedHwaccels: ["videotoolbox"]
|
|
388
|
+
},
|
|
389
|
+
"darwin-x64": {
|
|
390
|
+
url: "https://www.osxexperts.net/ffmpeg80intel.zip",
|
|
391
|
+
archiveFormat: "zip",
|
|
392
|
+
expectedHwaccels: ["videotoolbox"]
|
|
386
393
|
}
|
|
394
|
+
};
|
|
395
|
+
/** The artifact for this node, or a refusal naming what was asked for. */
|
|
396
|
+
function getFfmpegArtifact(platform, arch) {
|
|
397
|
+
const artifact = FFMPEG_ARTIFACTS[`${platform}-${arch}`];
|
|
398
|
+
if (!artifact) throw new Error(`Unsupported platform/architecture for ffmpeg: ${platform}-${arch}`);
|
|
399
|
+
return artifact;
|
|
387
400
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
isArchive: true,
|
|
392
|
-
archiveFormat: "tar.xz",
|
|
393
|
-
archiveInnerPath: `ffmpeg-${FFMPEG_VERSION}-amd64-static/ffmpeg`
|
|
394
|
-
};
|
|
395
|
-
case "darwin": return {
|
|
396
|
-
isArchive: true,
|
|
397
|
-
archiveFormat: "zip",
|
|
398
|
-
archiveInnerPath: "ffmpeg"
|
|
399
|
-
};
|
|
400
|
-
default: throw new Error(`Unsupported platform: ${platform}`);
|
|
401
|
-
}
|
|
401
|
+
/** The URL alone, for a caller that wants nothing else. */
|
|
402
|
+
function getFfmpegDownloadUrl(platform, arch) {
|
|
403
|
+
return getFfmpegArtifact(platform, arch).url;
|
|
402
404
|
}
|
|
403
405
|
/**
|
|
404
406
|
* Ensure an ffmpeg binary WE provide is available on this node, and report
|
|
@@ -427,13 +429,15 @@ async function ensureFfmpeg(dataDir, logger) {
|
|
|
427
429
|
exists: existsSync
|
|
428
430
|
});
|
|
429
431
|
if (override !== void 0 && override.trim().length > 0 && chosen?.origin !== "override") logger.error(`${FFMPEG_PATH_ENV} names a binary that does not exist — ignoring it`, { meta: { [FFMPEG_PATH_ENV]: override } });
|
|
432
|
+
const artifact = chosen === null ? getFfmpegArtifact(platform, arch) : null;
|
|
430
433
|
const path = chosen?.path ?? await downloadBinary({
|
|
431
434
|
name: "ffmpeg",
|
|
432
|
-
url: getFfmpegDownloadUrl(platform, arch),
|
|
435
|
+
url: artifact?.url ?? getFfmpegDownloadUrl(platform, arch),
|
|
433
436
|
targetDir: depsDir,
|
|
434
437
|
targetName: `ffmpeg${ext}`,
|
|
435
438
|
logger,
|
|
436
|
-
|
|
439
|
+
isArchive: true,
|
|
440
|
+
archiveFormat: artifact?.archiveFormat ?? "tar.xz"
|
|
437
441
|
});
|
|
438
442
|
const capabilities = await probeFfmpegBinary(path);
|
|
439
443
|
logger.info("ffmpeg binary resolved", { meta: {
|
|
@@ -442,6 +446,15 @@ async function ensureFfmpeg(dataDir, logger) {
|
|
|
442
446
|
version: capabilities.version,
|
|
443
447
|
hwaccels: [...capabilities.hwaccels].join(",") || "none"
|
|
444
448
|
} });
|
|
449
|
+
if (artifact !== null) {
|
|
450
|
+
const missing = artifact.expectedHwaccels.filter((name) => !capabilities.hwaccels.has(name));
|
|
451
|
+
if (missing.length > 0) logger.error("the ffmpeg we downloaded cannot do what this artifact is supposed to — the source changed under us", { meta: {
|
|
452
|
+
url: artifact.url,
|
|
453
|
+
expected: artifact.expectedHwaccels.join(","),
|
|
454
|
+
missing: missing.join(","),
|
|
455
|
+
got: [...capabilities.hwaccels].join(",") || "none"
|
|
456
|
+
} });
|
|
457
|
+
}
|
|
445
458
|
return path;
|
|
446
459
|
}
|
|
447
460
|
//#endregion
|
|
@@ -1924,4 +1937,4 @@ function resolveExportFingerprint(input) {
|
|
|
1924
1937
|
return input.persisted ?? input.fresh;
|
|
1925
1938
|
}
|
|
1926
1939
|
//#endregion
|
|
1927
|
-
export { ChildCostRegistry, FfmpegProcess, FilesystemStorageProvider, Fmp4FragmentChild, Fmp4FragmentPlane, NO_COST_CLAIM, PYTHON_VERSION, buildBinaryPath, canonicalDeviceFingerprint, canonicalHash, containsOrEquals, diffExportTargets, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements, nodeProcStatReader, parseProcCpuSeconds, parseProcRssBytes, physicalRootOf, readProcessCost, resolveExportFingerprint, signExpiringUrl, verifyExpiringUrl };
|
|
1940
|
+
export { ChildCostRegistry, FfmpegProcess, FilesystemStorageProvider, Fmp4FragmentChild, Fmp4FragmentPlane, NO_COST_CLAIM, PYTHON_VERSION, buildBinaryPath, canonicalDeviceFingerprint, canonicalHash, containsOrEquals, diffExportTargets, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegArtifact, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements, nodeProcStatReader, parseFfmpegCapabilities, parseProcCpuSeconds, parseProcRssBytes, physicalRootOf, probeFfmpegBinary, readProcessCost, resolveExportFingerprint, signExpiringUrl, verifyExpiringUrl };
|
|
@@ -1362,6 +1362,17 @@ var CAM_PROFILE_ORDER = [
|
|
|
1362
1362
|
"mid",
|
|
1363
1363
|
"low"
|
|
1364
1364
|
];
|
|
1365
|
+
/**
|
|
1366
|
+
* Which rung a per-camera consumer listens on: an explicit profile, or `auto`.
|
|
1367
|
+
*
|
|
1368
|
+
* `auto` is a REAL value, not an absent one — it means "resolve it by the rule
|
|
1369
|
+
* that consumer owns". It lives beside `CamProfile` because a rung is the only
|
|
1370
|
+
* operator-facing way to name a stream: a cam-stream id is broker-internal and
|
|
1371
|
+
* moves when a slot is reassigned, so a stored id silently stops meaning what
|
|
1372
|
+
* the operator picked. Today's one user is the audio analyser, whose rule is
|
|
1373
|
+
* "the lowest AVAILABLE native rung" (D537).
|
|
1374
|
+
*/
|
|
1375
|
+
var AudioStreamPickSchema = z.union([CamProfileSchema, z.literal("auto")]);
|
|
1365
1376
|
var CamStreamKindSchema = z.enum([
|
|
1366
1377
|
"pull-rtsp",
|
|
1367
1378
|
"pull-rtmp",
|
|
@@ -3880,7 +3891,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3880
3891
|
getIceCandidates: (input) => dispatch("webrtc-session", "webrtcSession", "getIceCandidates", "query", input),
|
|
3881
3892
|
closeSession: (input) => dispatch("webrtc-session", "webrtcSession", "closeSession", "mutation", input),
|
|
3882
3893
|
hasAdaptiveBitrate: (input) => dispatch("webrtc-session", "webrtcSession", "hasAdaptiveBitrate", "query", input),
|
|
3883
|
-
getSessionState: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionState", "query", input)
|
|
3894
|
+
getSessionState: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionState", "query", input),
|
|
3895
|
+
getSessionDebug: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionDebug", "query", input)
|
|
3884
3896
|
},
|
|
3885
3897
|
zoneAnalytics: {
|
|
3886
3898
|
getCurrentSnapshot: (input) => dispatch("zone-analytics", "zoneAnalytics", "getCurrentSnapshot", "query", input),
|
|
@@ -4320,4 +4332,4 @@ function sleepCancellable(ms, signal) {
|
|
|
4320
4332
|
});
|
|
4321
4333
|
}
|
|
4322
4334
|
//#endregion
|
|
4323
|
-
export {
|
|
4335
|
+
export { BrokerStatusSchema as $, DeviceType as A, emitReadiness as At, systemMethod as B, expandAudioChunkToF32le as Bt, customAction as C, DATAPLANE_SECRET_HEADER as Ct, ChargingStatus as D, normalizeAddonInitResult as Dt, deviceCustomAction as E, BaseAddon as Et, event as F, collectHydratedFieldValues as Ft, ReadinessRegistry as G, nodePin as H, expandCapMethods as I, hydrateSchema as It, readinessKey as J, ReadinessTimeoutError as K, isDeviceConfigCap as L, resolveHydratedFieldValue as Lt, DEFAULT_RUNTIME_STATE_DURABILITY as M, WELL_KNOWN_TABS as Mt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as N, WELL_KNOWN_TAB_MAP as Nt, DeviceFeature as O, createDurableState as Ot, DEVICE_STATUS_METHOD as P, collectHydratedFieldEntries as Pt, BrokerStatsSchema as Q, method as R, AUDIO_CHUNK_FORMATS as Rt, DEVICE_CHILDREN_BATCH_MAX as S, selectAssignedProfileSlots as St, describeCustomActions as T, DisposerChain as Tt, readNodePin as U, CAP_NODE_PIN_CONTEXT_KEY as V, isAudioChunkFormat as Vt, toNodeId as W, AudioChunkFormatSchema as X, scopeKey as Y, AudioStreamPickSchema as Z, createMirrorSource as _, SubscribeFramesInputSchema as _t, asJsonObject as a, DecodedAudioChunkSchema as at, deviceOpsCapability as b, makeSourceBrokerId as bt, parseJsonArray as c, FrameHandleFormatSchema as ct, BOOT_RECOVERY_BACKOFF_MS as d, ProfileSlotSchema as dt, CAM_PROFILE_ORDER as et, DEVICE_SCOPED_CAPS as f, ProfileSlotStatusSchema as ft, createLazyTrpcSource as g, SubscribeAudioChunksResultSchema as gt, createEventBusSliceSource as h, SubscribeAudioChunksInputSchema as ht, asJsonArray as i, CameraStreamSchema as it, adminUiCapability as j, isEvent as jt, DeviceRole as k, createEvent as kt, parseJsonObject as l, FrameHandleSchema as lt, createDeviceProxy as m, StreamSourceSchema as mt, sleepCancellable as n, CamStreamKindSchema as nt, asNumber as o, DecodedFrameSchema as ot, isDeviceScopedCap as p, StreamSourceEntrySchema$1 as pt, emitDownForOwnedCaps as q, asBoolean as r, CamStreamResolutionSchema as rt, asString as s, EncodedPacketSchema as st, sleep as t, CamProfileSchema as tt, parseJsonUnknown as u, ProfileRtspEntrySchema as ut, createSliceHandle as v, SubscribeFramesResultSchema as vt, defineCustomActions as w, SHARE_VIEW_KINDS as wt, viewerUiCapability as x, parseProfileBrokerId as xt, RawStateResultSchema as y, makeProfileBrokerId as yt, resolveCapMount as z, audioChunkBytesPerSample as zt };
|
|
@@ -1362,6 +1362,17 @@ var CAM_PROFILE_ORDER = [
|
|
|
1362
1362
|
"mid",
|
|
1363
1363
|
"low"
|
|
1364
1364
|
];
|
|
1365
|
+
/**
|
|
1366
|
+
* Which rung a per-camera consumer listens on: an explicit profile, or `auto`.
|
|
1367
|
+
*
|
|
1368
|
+
* `auto` is a REAL value, not an absent one — it means "resolve it by the rule
|
|
1369
|
+
* that consumer owns". It lives beside `CamProfile` because a rung is the only
|
|
1370
|
+
* operator-facing way to name a stream: a cam-stream id is broker-internal and
|
|
1371
|
+
* moves when a slot is reassigned, so a stored id silently stops meaning what
|
|
1372
|
+
* the operator picked. Today's one user is the audio analyser, whose rule is
|
|
1373
|
+
* "the lowest AVAILABLE native rung" (D537).
|
|
1374
|
+
*/
|
|
1375
|
+
var AudioStreamPickSchema = zod.z.union([CamProfileSchema, zod.z.literal("auto")]);
|
|
1365
1376
|
var CamStreamKindSchema = zod.z.enum([
|
|
1366
1377
|
"pull-rtsp",
|
|
1367
1378
|
"pull-rtmp",
|
|
@@ -3880,7 +3891,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3880
3891
|
getIceCandidates: (input) => dispatch("webrtc-session", "webrtcSession", "getIceCandidates", "query", input),
|
|
3881
3892
|
closeSession: (input) => dispatch("webrtc-session", "webrtcSession", "closeSession", "mutation", input),
|
|
3882
3893
|
hasAdaptiveBitrate: (input) => dispatch("webrtc-session", "webrtcSession", "hasAdaptiveBitrate", "query", input),
|
|
3883
|
-
getSessionState: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionState", "query", input)
|
|
3894
|
+
getSessionState: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionState", "query", input),
|
|
3895
|
+
getSessionDebug: (input) => dispatch("webrtc-session", "webrtcSession", "getSessionDebug", "query", input)
|
|
3884
3896
|
},
|
|
3885
3897
|
zoneAnalytics: {
|
|
3886
3898
|
getCurrentSnapshot: (input) => dispatch("zone-analytics", "zoneAnalytics", "getCurrentSnapshot", "query", input),
|
|
@@ -4332,6 +4344,12 @@ Object.defineProperty(exports, "AudioChunkFormatSchema", {
|
|
|
4332
4344
|
return AudioChunkFormatSchema;
|
|
4333
4345
|
}
|
|
4334
4346
|
});
|
|
4347
|
+
Object.defineProperty(exports, "AudioStreamPickSchema", {
|
|
4348
|
+
enumerable: true,
|
|
4349
|
+
get: function() {
|
|
4350
|
+
return AudioStreamPickSchema;
|
|
4351
|
+
}
|
|
4352
|
+
});
|
|
4335
4353
|
Object.defineProperty(exports, "BOOT_RECOVERY_BACKOFF_MS", {
|
|
4336
4354
|
enumerable: true,
|
|
4337
4355
|
get: function() {
|