@camstack/types 1.2.222 → 1.2.223
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/capabilities/camera-grid-layout.cap.d.ts +14 -0
- package/dist/ffmpeg/process.d.ts +12 -0
- package/dist/index.js +16 -1
- package/dist/index.mjs +16 -1
- package/dist/node.js +7 -2
- package/dist/node.mjs +7 -2
- package/package.json +1 -1
|
@@ -90,6 +90,7 @@ declare const GridProfileOfferSchema: z.ZodObject<{
|
|
|
90
90
|
offered: z.ZodBoolean;
|
|
91
91
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
92
92
|
canvas: z.ZodString;
|
|
93
|
+
published: z.ZodBoolean;
|
|
93
94
|
}, z.core.$strip>;
|
|
94
95
|
export declare const GridLayoutViewSchema: z.ZodObject<{
|
|
95
96
|
instanceId: z.ZodString;
|
|
@@ -120,6 +121,7 @@ export declare const GridLayoutViewSchema: z.ZodObject<{
|
|
|
120
121
|
offered: z.ZodBoolean;
|
|
121
122
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
122
123
|
canvas: z.ZodString;
|
|
124
|
+
published: z.ZodBoolean;
|
|
123
125
|
}, z.core.$strip>>;
|
|
124
126
|
}, z.core.$strip>;
|
|
125
127
|
export type GridNormalizedRect = z.infer<typeof GridNormalizedRectSchema>;
|
|
@@ -130,6 +132,11 @@ export declare const GridLayoutPatchSchema: z.ZodObject<{
|
|
|
130
132
|
deviceId: z.ZodNumber;
|
|
131
133
|
name: z.ZodOptional<z.ZodString>;
|
|
132
134
|
fps: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
publishedProfiles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
136
|
+
high: "high";
|
|
137
|
+
mid: "mid";
|
|
138
|
+
low: "low";
|
|
139
|
+
}>>>;
|
|
133
140
|
cells: z.ZodArray<z.ZodObject<{
|
|
134
141
|
deviceId: z.ZodNumber;
|
|
135
142
|
source: z.ZodObject<{
|
|
@@ -210,6 +217,7 @@ export declare const cameraGridLayoutCapability: {
|
|
|
210
217
|
offered: z.ZodBoolean;
|
|
211
218
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
212
219
|
canvas: z.ZodString;
|
|
220
|
+
published: z.ZodBoolean;
|
|
213
221
|
}, z.core.$strip>>;
|
|
214
222
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
215
223
|
/** Write the geometry back. Returns the grid as it now stands, profiles included. */
|
|
@@ -217,6 +225,11 @@ export declare const cameraGridLayoutCapability: {
|
|
|
217
225
|
deviceId: z.ZodNumber;
|
|
218
226
|
name: z.ZodOptional<z.ZodString>;
|
|
219
227
|
fps: z.ZodOptional<z.ZodNumber>;
|
|
228
|
+
publishedProfiles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
229
|
+
high: "high";
|
|
230
|
+
mid: "mid";
|
|
231
|
+
low: "low";
|
|
232
|
+
}>>>;
|
|
220
233
|
cells: z.ZodArray<z.ZodObject<{
|
|
221
234
|
deviceId: z.ZodNumber;
|
|
222
235
|
source: z.ZodObject<{
|
|
@@ -261,6 +274,7 @@ export declare const cameraGridLayoutCapability: {
|
|
|
261
274
|
offered: z.ZodBoolean;
|
|
262
275
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
263
276
|
canvas: z.ZodString;
|
|
277
|
+
published: z.ZodBoolean;
|
|
264
278
|
}, z.core.$strip>>;
|
|
265
279
|
}, z.core.$strip>, "mutation">;
|
|
266
280
|
};
|
package/dist/ffmpeg/process.d.ts
CHANGED
|
@@ -81,6 +81,18 @@ export interface FfmpegProcessOptions {
|
|
|
81
81
|
* it is bounded by {@link maxRestarts} regardless of what this returns.
|
|
82
82
|
*/
|
|
83
83
|
readonly onExit?: (exit: FfmpegExit) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Called ONCE, when the wrapper stops restarting and the child is gone for
|
|
86
|
+
* good.
|
|
87
|
+
*
|
|
88
|
+
* `onExit` cannot answer this: it fires on every exit, including the ones
|
|
89
|
+
* that are about to be respawned, so a caller using it to tear down would
|
|
90
|
+
* tear down on the first hiccup. And the `start()` promise cannot answer it
|
|
91
|
+
* either — its `reject` is spent the moment the child first goes live, so a
|
|
92
|
+
* give-up AFTER that reached nobody at all. A camera-grid tile that died an
|
|
93
|
+
* hour in was indistinguishable, to its owner, from one that never started.
|
|
94
|
+
*/
|
|
95
|
+
readonly onGiveUp?: (error: Error) => void;
|
|
84
96
|
/** Wall-clock budget for the first output byte. `0` disables the deadline. */
|
|
85
97
|
readonly firstDataTimeoutMs?: number;
|
|
86
98
|
/** `0` ⇒ never restart (a run-to-completion job). */
|
package/dist/index.js
CHANGED
|
@@ -32559,7 +32559,16 @@ var GridProfileOfferSchema = zod.z.object({
|
|
|
32559
32559
|
* grid came out as, and because it is the number an operator would otherwise
|
|
32560
32560
|
* expect to type.
|
|
32561
32561
|
*/
|
|
32562
|
-
canvas: zod.z.string()
|
|
32562
|
+
canvas: zod.z.string(),
|
|
32563
|
+
/**
|
|
32564
|
+
* Whether this profile is PUBLISHED, of the ones the grid could serve.
|
|
32565
|
+
*
|
|
32566
|
+
* A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
|
|
32567
|
+
* a 4K canvas built from 4K decodes — something to opt into, not something a
|
|
32568
|
+
* viewer's adaptive should be handed by climbing to the top rung it can see.
|
|
32569
|
+
* Default is `mid` + `low`.
|
|
32570
|
+
*/
|
|
32571
|
+
published: zod.z.boolean()
|
|
32563
32572
|
});
|
|
32564
32573
|
var GridLayoutViewSchema = zod.z.object({
|
|
32565
32574
|
/** The persisted grid row this camera was declared from. */
|
|
@@ -32582,6 +32591,12 @@ var GridLayoutPatchSchema = zod.z.object({
|
|
|
32582
32591
|
deviceId: zod.z.number().int().nonnegative(),
|
|
32583
32592
|
name: zod.z.string().min(1).max(160).optional(),
|
|
32584
32593
|
fps: zod.z.number().int().min(1).max(60).optional(),
|
|
32594
|
+
/** Which profiles to publish. See `GridProfileOffer.published`. */
|
|
32595
|
+
publishedProfiles: zod.z.array(zod.z.enum([
|
|
32596
|
+
"high",
|
|
32597
|
+
"mid",
|
|
32598
|
+
"low"
|
|
32599
|
+
])).max(3).optional(),
|
|
32585
32600
|
/**
|
|
32586
32601
|
* The whole cell list at once. A per-cell patch would need an ordering the
|
|
32587
32602
|
* editor does not have, and a half-applied layout is a picture nobody asked
|
package/dist/index.mjs
CHANGED
|
@@ -32558,7 +32558,16 @@ var GridProfileOfferSchema = z.object({
|
|
|
32558
32558
|
* grid came out as, and because it is the number an operator would otherwise
|
|
32559
32559
|
* expect to type.
|
|
32560
32560
|
*/
|
|
32561
|
-
canvas: z.string()
|
|
32561
|
+
canvas: z.string(),
|
|
32562
|
+
/**
|
|
32563
|
+
* Whether this profile is PUBLISHED, of the ones the grid could serve.
|
|
32564
|
+
*
|
|
32565
|
+
* A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
|
|
32566
|
+
* a 4K canvas built from 4K decodes — something to opt into, not something a
|
|
32567
|
+
* viewer's adaptive should be handed by climbing to the top rung it can see.
|
|
32568
|
+
* Default is `mid` + `low`.
|
|
32569
|
+
*/
|
|
32570
|
+
published: z.boolean()
|
|
32562
32571
|
});
|
|
32563
32572
|
var GridLayoutViewSchema = z.object({
|
|
32564
32573
|
/** The persisted grid row this camera was declared from. */
|
|
@@ -32581,6 +32590,12 @@ var GridLayoutPatchSchema = z.object({
|
|
|
32581
32590
|
deviceId: z.number().int().nonnegative(),
|
|
32582
32591
|
name: z.string().min(1).max(160).optional(),
|
|
32583
32592
|
fps: z.number().int().min(1).max(60).optional(),
|
|
32593
|
+
/** Which profiles to publish. See `GridProfileOffer.published`. */
|
|
32594
|
+
publishedProfiles: z.array(z.enum([
|
|
32595
|
+
"high",
|
|
32596
|
+
"mid",
|
|
32597
|
+
"low"
|
|
32598
|
+
])).max(3).optional(),
|
|
32584
32599
|
/**
|
|
32585
32600
|
* The whole cell list at once. A per-cell patch would need an ordering the
|
|
32586
32601
|
* editor does not have, and a half-applied layout is a picture nobody asked
|
package/dist/node.js
CHANGED
|
@@ -1158,7 +1158,9 @@ var FfmpegProcess = class {
|
|
|
1158
1158
|
tags: this.logTags,
|
|
1159
1159
|
meta: { stderrTail: this.stderrTail }
|
|
1160
1160
|
});
|
|
1161
|
-
|
|
1161
|
+
const error = new Error(reason);
|
|
1162
|
+
onDead(error);
|
|
1163
|
+
this.opts.onGiveUp?.(error);
|
|
1162
1164
|
return;
|
|
1163
1165
|
}
|
|
1164
1166
|
this.scheduleRestart(onLive, onDead);
|
|
@@ -1166,7 +1168,10 @@ var FfmpegProcess = class {
|
|
|
1166
1168
|
scheduleRestart(onLive, onDead) {
|
|
1167
1169
|
if (this.stopped) return;
|
|
1168
1170
|
const maxRestarts = this.opts.maxRestarts ?? 0;
|
|
1169
|
-
if (maxRestarts === 0)
|
|
1171
|
+
if (maxRestarts === 0) {
|
|
1172
|
+
this.opts.onGiveUp?.(/* @__PURE__ */ new Error(`ffmpeg ${this.opts.role} ended and restarts are disabled`));
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1170
1175
|
if (this.producedOutput && this.now - this.startedAtMs >= (this.opts.stableRunMs ?? DEFAULT_STABLE_RUN_MS)) this.consecutiveFailures = 0;
|
|
1171
1176
|
if (this.consecutiveFailures > maxRestarts) return;
|
|
1172
1177
|
(this.opts.setTimeoutFn ?? setTimeout)(() => {
|
package/dist/node.mjs
CHANGED
|
@@ -1135,7 +1135,9 @@ var FfmpegProcess = class {
|
|
|
1135
1135
|
tags: this.logTags,
|
|
1136
1136
|
meta: { stderrTail: this.stderrTail }
|
|
1137
1137
|
});
|
|
1138
|
-
|
|
1138
|
+
const error = new Error(reason);
|
|
1139
|
+
onDead(error);
|
|
1140
|
+
this.opts.onGiveUp?.(error);
|
|
1139
1141
|
return;
|
|
1140
1142
|
}
|
|
1141
1143
|
this.scheduleRestart(onLive, onDead);
|
|
@@ -1143,7 +1145,10 @@ var FfmpegProcess = class {
|
|
|
1143
1145
|
scheduleRestart(onLive, onDead) {
|
|
1144
1146
|
if (this.stopped) return;
|
|
1145
1147
|
const maxRestarts = this.opts.maxRestarts ?? 0;
|
|
1146
|
-
if (maxRestarts === 0)
|
|
1148
|
+
if (maxRestarts === 0) {
|
|
1149
|
+
this.opts.onGiveUp?.(/* @__PURE__ */ new Error(`ffmpeg ${this.opts.role} ended and restarts are disabled`));
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1147
1152
|
if (this.producedOutput && this.now - this.startedAtMs >= (this.opts.stableRunMs ?? DEFAULT_STABLE_RUN_MS)) this.consecutiveFailures = 0;
|
|
1148
1153
|
if (this.consecutiveFailures > maxRestarts) return;
|
|
1149
1154
|
(this.opts.setTimeoutFn ?? setTimeout)(() => {
|