homebridge-plugin-utils 1.33.0 → 1.34.0
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/build/tsconfig.json +6 -4
- package/dist/featureoptions.d.ts +3 -3
- package/dist/featureoptions.js +122 -97
- package/dist/featureoptions.js.map +1 -1
- package/dist/ffmpeg/codecs.js +20 -19
- package/dist/ffmpeg/codecs.js.map +1 -1
- package/dist/ffmpeg/exec.d.ts +1 -1
- package/dist/ffmpeg/exec.js.map +1 -1
- package/dist/ffmpeg/options.d.ts +5 -0
- package/dist/ffmpeg/options.js +12 -13
- package/dist/ffmpeg/options.js.map +1 -1
- package/dist/ffmpeg/process.d.ts +8 -2
- package/dist/ffmpeg/process.js +20 -9
- package/dist/ffmpeg/process.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +121 -122
- package/dist/ffmpeg/record.js +346 -275
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/ffmpeg/rtp.js +1 -1
- package/dist/ffmpeg/rtp.js.map +1 -1
- package/dist/ffmpeg/stream.d.ts +1 -1
- package/dist/ffmpeg/stream.js +1 -1
- package/dist/ffmpeg/stream.js.map +1 -1
- package/dist/mqttclient.js +5 -4
- package/dist/mqttclient.js.map +1 -1
- package/dist/service.js +9 -3
- package/dist/service.js.map +1 -1
- package/dist/ui/featureoptions.js +122 -97
- package/dist/ui/featureoptions.js.map +1 -1
- package/dist/util.d.ts +18 -14
- package/dist/util.js +19 -11
- package/dist/util.js.map +1 -1
- package/package.json +7 -8
package/build/tsconfig.json
CHANGED
|
@@ -13,14 +13,16 @@
|
|
|
13
13
|
"lib": [
|
|
14
14
|
|
|
15
15
|
"DOM",
|
|
16
|
-
"
|
|
16
|
+
"ES2024",
|
|
17
|
+
"ESNext.Array",
|
|
18
|
+
"ESNext.Collection",
|
|
19
|
+
"ESNext.Iterator"
|
|
17
20
|
],
|
|
18
21
|
|
|
19
|
-
"module": "
|
|
20
|
-
"moduleResolution":"node",
|
|
22
|
+
"module": "nodenext",
|
|
21
23
|
"sourceMap": true,
|
|
22
24
|
"strict": true,
|
|
23
|
-
"target": "
|
|
25
|
+
"target": "ES2024"
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/* When creating your own tsconfig.json, use the following as a starting point to inherit these defaults:
|
package/dist/featureoptions.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export declare class FeatureOptions {
|
|
|
85
85
|
private _configuredOptions;
|
|
86
86
|
private _groups;
|
|
87
87
|
private _options;
|
|
88
|
+
private configLookup;
|
|
88
89
|
private defaults;
|
|
89
90
|
private valueOptions;
|
|
90
91
|
/**
|
|
@@ -256,9 +257,8 @@ export declare class FeatureOptions {
|
|
|
256
257
|
*/
|
|
257
258
|
set options(options: Record<string, FeatureOptionEntry[]>);
|
|
258
259
|
private generateDefaults;
|
|
260
|
+
private resolveScope;
|
|
259
261
|
private optionInfo;
|
|
260
|
-
private isOptionEnabled;
|
|
261
|
-
private optionRegex;
|
|
262
262
|
private parseOptionNumeric;
|
|
263
|
-
private
|
|
263
|
+
private buildConfigIndex;
|
|
264
264
|
}
|
package/dist/featureoptions.js
CHANGED
|
@@ -51,6 +51,7 @@ export class FeatureOptions {
|
|
|
51
51
|
_configuredOptions;
|
|
52
52
|
_groups;
|
|
53
53
|
_options;
|
|
54
|
+
configLookup;
|
|
54
55
|
defaults;
|
|
55
56
|
valueOptions;
|
|
56
57
|
/**
|
|
@@ -72,6 +73,7 @@ export class FeatureOptions {
|
|
|
72
73
|
this._configuredOptions = [];
|
|
73
74
|
this._groups = {};
|
|
74
75
|
this._options = {};
|
|
76
|
+
this.configLookup = new Map();
|
|
75
77
|
this.defaultReturnValue = false;
|
|
76
78
|
this.defaults = {};
|
|
77
79
|
this.valueOptions = {};
|
|
@@ -121,8 +123,7 @@ export class FeatureOptions {
|
|
|
121
123
|
* @returns Returns true if the option has been explicitly configured, false otherwise.
|
|
122
124
|
*/
|
|
123
125
|
exists(option, id) {
|
|
124
|
-
|
|
125
|
-
return this.configuredOptions.some(x => regex.test(x));
|
|
126
|
+
return this.configLookup.has(option.toLowerCase() + (id ? "." + id.toLowerCase() : ""));
|
|
126
127
|
}
|
|
127
128
|
/**
|
|
128
129
|
* Return a fully formed feature option string.
|
|
@@ -238,53 +239,22 @@ export class FeatureOptions {
|
|
|
238
239
|
if (!this.isValue(option)) {
|
|
239
240
|
return null;
|
|
240
241
|
}
|
|
241
|
-
//
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
for (const entry of this.configuredOptions) {
|
|
247
|
-
const regexMatch = regex.exec(entry);
|
|
248
|
-
if (regexMatch) {
|
|
249
|
-
// If the option is enabled, return the value. Otherwise, we have nothing.
|
|
250
|
-
return (regexMatch[1].toLowerCase() === "enable") ? regexMatch[2] : null;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return undefined;
|
|
254
|
-
};
|
|
255
|
-
// Check to see if we have a device-level value first.
|
|
256
|
-
if (device) {
|
|
257
|
-
const value = getValue(option, device);
|
|
258
|
-
// The option's been explicitly disabled.
|
|
259
|
-
if (value === null) {
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
262
|
-
if (value) {
|
|
263
|
-
return value;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
// Now check to see if we have an controller-level value.
|
|
267
|
-
if (controller) {
|
|
268
|
-
const value = getValue(option, controller);
|
|
269
|
-
// The option's been explicitly disabled.
|
|
270
|
-
if (value === null) {
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
if (value) {
|
|
274
|
-
return value;
|
|
275
|
-
}
|
|
242
|
+
// Resolve the option through the scope hierarchy in a single traversal. This gives us the scope, enabled state, and raw value in one pass.
|
|
243
|
+
const resolved = this.resolveScope(option, device, controller);
|
|
244
|
+
// If the option has been explicitly disabled at any scope, or wasn't configured and its default is disabled, there's no value.
|
|
245
|
+
if (!resolved.enabled) {
|
|
246
|
+
return null;
|
|
276
247
|
}
|
|
277
|
-
//
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
return value;
|
|
248
|
+
// If we found an explicit value in the index, return it.
|
|
249
|
+
if (resolved.optionValue) {
|
|
250
|
+
return resolved.optionValue;
|
|
281
251
|
}
|
|
282
|
-
// The option'
|
|
283
|
-
if (
|
|
284
|
-
return null;
|
|
252
|
+
// The option is enabled but has no explicit value. If it wasn't configured at any scope (scope is "none"), fall back to the registered default value.
|
|
253
|
+
if (resolved.scope === "none") {
|
|
254
|
+
return this.valueOptions[option.toLowerCase()]?.toString() ?? null;
|
|
285
255
|
}
|
|
286
|
-
//
|
|
287
|
-
return
|
|
256
|
+
// The option is enabled at an explicit scope but no value was provided...return undefined to indicate "enabled, no value."
|
|
257
|
+
return undefined;
|
|
288
258
|
}
|
|
289
259
|
/**
|
|
290
260
|
* Return the list of available feature option categories.
|
|
@@ -301,6 +271,8 @@ export class FeatureOptions {
|
|
|
301
271
|
*/
|
|
302
272
|
set categories(category) {
|
|
303
273
|
this._categories = category;
|
|
274
|
+
// Regenerate defaults and the lookup index.
|
|
275
|
+
this.generateDefaults();
|
|
304
276
|
}
|
|
305
277
|
/**
|
|
306
278
|
* Return the list of currently configured feature options.
|
|
@@ -318,6 +290,8 @@ export class FeatureOptions {
|
|
|
318
290
|
set configuredOptions(options) {
|
|
319
291
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
320
292
|
this._configuredOptions = options ?? [];
|
|
293
|
+
// Regenerate defaults and the lookup index.
|
|
294
|
+
this.generateDefaults();
|
|
321
295
|
}
|
|
322
296
|
/**
|
|
323
297
|
* Return the list of available feature option groups.
|
|
@@ -343,10 +317,11 @@ export class FeatureOptions {
|
|
|
343
317
|
set options(options) {
|
|
344
318
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
345
319
|
this._options = options ?? {};
|
|
346
|
-
// Regenerate
|
|
320
|
+
// Regenerate defaults and the lookup index.
|
|
347
321
|
this.generateDefaults();
|
|
348
322
|
}
|
|
349
|
-
//
|
|
323
|
+
// Rebuild the defaults, groups, value options, and lookup index from the current categories, options, and configured options. All three property setters call this so
|
|
324
|
+
// that state is always consistent regardless of which setter is called or in what order.
|
|
350
325
|
generateDefaults() {
|
|
351
326
|
this.defaults = {};
|
|
352
327
|
this._groups = {};
|
|
@@ -375,58 +350,47 @@ export class FeatureOptions {
|
|
|
375
350
|
}
|
|
376
351
|
}
|
|
377
352
|
}
|
|
353
|
+
// Rebuild the lookup index now that we know which options are value-centric.
|
|
354
|
+
this.buildConfigIndex();
|
|
378
355
|
}
|
|
379
|
-
//
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
356
|
+
// Resolves a feature option through the scope hierarchy in a single traversal. Returns the scope where the option was found, whether it's enabled, and the raw string
|
|
357
|
+
// value for value-centric options. This is the core resolution method that both test()/scope() and value() build on, eliminating the need for separate traversals.
|
|
358
|
+
//
|
|
359
|
+
// There are a couple of ways to enable and disable options. The rules of the road are:
|
|
360
|
+
//
|
|
361
|
+
// 1. Explicitly disabling or enabling an option on the controller propagates to all the devices that are managed by that controller.
|
|
362
|
+
//
|
|
363
|
+
// 2. Explicitly disabling or enabling an option on a device always overrides the above. This means that it's possible to disable an option for a controller, and all
|
|
364
|
+
// the devices that are managed by it, and then override that behavior on a single device that it's managing.
|
|
365
|
+
resolveScope(option, device, controller) {
|
|
366
|
+
const normalizedOption = option.toLowerCase();
|
|
367
|
+
let entry;
|
|
388
368
|
// Check to see if we have a device-level option first.
|
|
389
|
-
if (device
|
|
390
|
-
|
|
391
|
-
if (
|
|
392
|
-
return {
|
|
369
|
+
if (device) {
|
|
370
|
+
entry = this.configLookup.get(normalizedOption + "." + device.toLowerCase());
|
|
371
|
+
if (entry) {
|
|
372
|
+
return { enabled: entry.enabled, optionValue: entry.value, scope: "device" };
|
|
393
373
|
}
|
|
394
374
|
}
|
|
395
|
-
// Now check to see if we have
|
|
396
|
-
if (controller
|
|
397
|
-
|
|
398
|
-
if (
|
|
399
|
-
return {
|
|
375
|
+
// Now check to see if we have a controller-level option.
|
|
376
|
+
if (controller) {
|
|
377
|
+
entry = this.configLookup.get(normalizedOption + "." + controller.toLowerCase());
|
|
378
|
+
if (entry) {
|
|
379
|
+
return { enabled: entry.enabled, optionValue: entry.value, scope: "controller" };
|
|
400
380
|
}
|
|
401
381
|
}
|
|
402
382
|
// Finally, we check for a global-level value.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return { scope: "global", value: value };
|
|
407
|
-
}
|
|
383
|
+
entry = this.configLookup.get(normalizedOption);
|
|
384
|
+
if (entry) {
|
|
385
|
+
return { enabled: entry.enabled, optionValue: entry.value, scope: "global" };
|
|
408
386
|
}
|
|
409
387
|
// The option hasn't been set at any scope, return our default value.
|
|
410
|
-
return {
|
|
388
|
+
return { enabled: this.defaultValue(option), scope: "none" };
|
|
411
389
|
}
|
|
412
|
-
//
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
// Get the option value, if we have one.
|
|
417
|
-
for (const entry of this.configuredOptions) {
|
|
418
|
-
const regexMatch = regex.exec(entry);
|
|
419
|
-
if (regexMatch) {
|
|
420
|
-
return regexMatch[1].toLowerCase() === "enable";
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
return undefined;
|
|
424
|
-
}
|
|
425
|
-
// Regular expression test for feature options.
|
|
426
|
-
optionRegex(option, id) {
|
|
427
|
-
// This regular expression is a bit more intricate than you might think it should be due to the need to ensure we capture values at the very end of the option. We
|
|
428
|
-
// also need to escape out our option to ensure we have no inadvertent issues in matching the regular expression.
|
|
429
|
-
return new RegExp("^(Enable|Disable)\\." + option.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + (!id ? "" : "\\." + id) + "$", "gi");
|
|
390
|
+
// Thin wrapper over resolveScope() that returns the OptionInfoEntry shape expected by test() and scope().
|
|
391
|
+
optionInfo(option, device, controller) {
|
|
392
|
+
const resolved = this.resolveScope(option, device, controller);
|
|
393
|
+
return { scope: resolved.scope, value: resolved.enabled };
|
|
430
394
|
}
|
|
431
395
|
// Utility function to parse and return a numeric configuration parameter.
|
|
432
396
|
parseOptionNumeric(option, convert) {
|
|
@@ -443,13 +407,74 @@ export class FeatureOptions {
|
|
|
443
407
|
// Return the value.
|
|
444
408
|
return convertedValue;
|
|
445
409
|
}
|
|
446
|
-
//
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
//
|
|
452
|
-
|
|
410
|
+
// Build a lookup index from the configured option strings. Each entry is keyed by its normalized lookup path (option name, or option name + scope id) and stores
|
|
411
|
+
// whether the option is enabled along with the extracted value for value-centric options. The index is built once when configured options or option definitions change,
|
|
412
|
+
// and all subsequent lookups are O(1).
|
|
413
|
+
buildConfigIndex() {
|
|
414
|
+
this.configLookup = new Map();
|
|
415
|
+
// Collect known value option names, sorted longest first for greedy prefix matching. This ensures that when option names overlap (e.g., a category "audio" and an
|
|
416
|
+
// option "audio.volume"), the more specific name matches first.
|
|
417
|
+
const valueOptionNames = Object.keys(this.valueOptions).sort((a, b) => b.length - a.length);
|
|
418
|
+
for (const rawEntry of this._configuredOptions) {
|
|
419
|
+
// Parse the action prefix (Enable or Disable).
|
|
420
|
+
const dotIndex = rawEntry.indexOf(".");
|
|
421
|
+
if (dotIndex === -1) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
const action = rawEntry.slice(0, dotIndex).toLowerCase();
|
|
425
|
+
if ((action !== "enable") && (action !== "disable")) {
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
const enabled = action === "enable";
|
|
429
|
+
const tailOriginal = rawEntry.slice(dotIndex + 1);
|
|
430
|
+
const tail = tailOriginal.toLowerCase();
|
|
431
|
+
// Register the exact tail as a lookup key. First-write-wins...if the same option appears multiple times, the earliest entry in the array takes precedence.
|
|
432
|
+
if (!this.configLookup.has(tail)) {
|
|
433
|
+
this.configLookup.set(tail, { enabled });
|
|
434
|
+
}
|
|
435
|
+
// For Enable entries on value-centric options, extract the trailing value segment and register under the base key (option or option.id) so that value lookups
|
|
436
|
+
// resolve in O(1) instead of requiring regex matching and array scanning.
|
|
437
|
+
if (!enabled) {
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
for (const optName of valueOptionNames) {
|
|
441
|
+
if (!tail.startsWith(optName)) {
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
const remainder = tail.slice(optName.length);
|
|
445
|
+
// Exact match on the option name with no trailing segments...there's no value to extract.
|
|
446
|
+
if (!remainder.length) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
// The next character must be a dot separator. If not, this option name is merely a prefix of a longer unrelated token.
|
|
450
|
+
if (!remainder.startsWith(".")) {
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
const extra = remainder.slice(1);
|
|
454
|
+
const extraOriginal = tailOriginal.slice(optName.length + 1);
|
|
455
|
+
const separatorIndex = extra.indexOf(".");
|
|
456
|
+
if (separatorIndex === -1) {
|
|
457
|
+
// Single trailing segment after the option name. At global scope this is the value; at scoped scope it's the id. Register under the option name as the
|
|
458
|
+
// base key so that global value lookups find it.
|
|
459
|
+
if (!this.configLookup.has(optName)) {
|
|
460
|
+
this.configLookup.set(optName, { enabled: true, value: extraOriginal });
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
// Two trailing segments: the first is the scope id and the second is the value.
|
|
465
|
+
const idLower = extra.slice(0, separatorIndex);
|
|
466
|
+
const valueOriginal = extraOriginal.slice(separatorIndex + 1);
|
|
467
|
+
// Only register if the value portion is a single segment (no additional dots).
|
|
468
|
+
if (!valueOriginal.includes(".")) {
|
|
469
|
+
const baseKey = optName + "." + idLower;
|
|
470
|
+
if (!this.configLookup.has(baseKey)) {
|
|
471
|
+
this.configLookup.set(baseKey, { enabled: true, value: valueOriginal });
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
453
478
|
}
|
|
454
479
|
}
|
|
455
480
|
//# sourceMappingURL=featureoptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureoptions.js","sourceRoot":"","sources":["../src/featureoptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"featureoptions.js","sourceRoot":"","sources":["../src/featureoptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,cAAc;IAEzB;;OAEG;IACI,kBAAkB,CAAU;IAE3B,WAAW,CAAyB;IACpC,kBAAkB,CAAW;IAC7B,OAAO,CAA2B;IAClC,QAAQ,CAAuC;IAC/C,YAAY,CAAoD;IAChE,QAAQ,CAA0B;IAClC,YAAY,CAA8C;IAElE;;;;;;;;;;;;OAYG;IACH,YAAY,UAAkC,EAAE,OAA6C,EAAE,oBAA8B,EAAE;QAE7H,2BAA2B;QAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QAEvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;;;OASG;IACI,KAA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AE9D,+EAA+E;oBAC/E,IAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;wBAEhC,MAAM,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,OAAO,CAAC;wBAExC,IAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;4BAEnC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;wBAC1E,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/dist/ffmpeg/codecs.js
CHANGED
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
import { EOL, cpus } from "node:os";
|
|
26
26
|
import { execFile } from "node:child_process";
|
|
27
27
|
import { env, platform } from "node:process";
|
|
28
|
+
import { promisify } from "node:util";
|
|
28
29
|
import { readFileSync } from "node:fs";
|
|
29
|
-
|
|
30
|
+
// Promisified execFile, created once at module level rather than per-invocation.
|
|
31
|
+
const execFileAsync = promisify(execFile);
|
|
30
32
|
/**
|
|
31
33
|
* Probe FFmpeg capabilities and codecs on the host system.
|
|
32
34
|
*
|
|
@@ -151,7 +153,7 @@ export class FfmpegCodecs {
|
|
|
151
153
|
codec = codec.toLowerCase();
|
|
152
154
|
decoder = decoder.toLowerCase();
|
|
153
155
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
154
|
-
return this.ffmpegCodecs[codec]?.decoders.
|
|
156
|
+
return this.ffmpegCodecs[codec]?.decoders.has(decoder) ?? false;
|
|
155
157
|
}
|
|
156
158
|
/**
|
|
157
159
|
* Checks whether a specific encoder is available for a given codec.
|
|
@@ -176,7 +178,7 @@ export class FfmpegCodecs {
|
|
|
176
178
|
codec = codec.toLowerCase();
|
|
177
179
|
encoder = encoder.toLowerCase();
|
|
178
180
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
179
|
-
return this.ffmpegCodecs[codec]?.encoders.
|
|
181
|
+
return this.ffmpegCodecs[codec]?.encoders.has(encoder) ?? false;
|
|
180
182
|
}
|
|
181
183
|
/**
|
|
182
184
|
* Checks whether a given hardware acceleration method is available and validated on the host, as provided by the output of `ffmpeg -hwaccels`.
|
|
@@ -277,9 +279,9 @@ export class FfmpegCodecs {
|
|
|
277
279
|
// Probe our video processor's encoding and decoding capabilities.
|
|
278
280
|
async probeFfmpegCodecs() {
|
|
279
281
|
return this.probeCmd(this.ffmpegExec, ["-hide_banner", "-codecs"], (stdout) => {
|
|
280
|
-
// A regular expression to parse out the codec and
|
|
282
|
+
// A regular expression to parse out the codec and its supported decoders.
|
|
281
283
|
const decodersRegex = /\S+\s+(\S+).+\(decoders: (.*?)\s*\)/;
|
|
282
|
-
// A regular expression to parse out the codec and
|
|
284
|
+
// A regular expression to parse out the codec and its supported encoders.
|
|
283
285
|
const encodersRegex = /\S+\s+(\S+).+\(encoders: (.*?)\s*\)/;
|
|
284
286
|
// Iterate through each line, and a build a list of encoders.
|
|
285
287
|
for (const codecLine of stdout.split(EOL)) {
|
|
@@ -289,29 +291,30 @@ export class FfmpegCodecs {
|
|
|
289
291
|
const encodersMatch = encodersRegex.exec(codecLine);
|
|
290
292
|
// If we found decoders, add them to our list of supported decoders for this format.
|
|
291
293
|
if (decodersMatch) {
|
|
292
|
-
this.ffmpegCodecs[decodersMatch[1]]
|
|
293
|
-
this.ffmpegCodecs[decodersMatch[1]].decoders = decodersMatch[2].split(" ").map(x => x.toLowerCase());
|
|
294
|
+
this.ffmpegCodecs[decodersMatch[1]] ??= { decoders: new Set(), encoders: new Set() };
|
|
295
|
+
this.ffmpegCodecs[decodersMatch[1]].decoders = new Set(decodersMatch[2].split(" ").map(x => x.toLowerCase()));
|
|
294
296
|
}
|
|
295
|
-
// If we found
|
|
297
|
+
// If we found encoders, add them to our list of supported encoders for this format.
|
|
296
298
|
if (encodersMatch) {
|
|
297
|
-
|
|
298
|
-
this.ffmpegCodecs[encodersMatch[1]]
|
|
299
|
-
this.ffmpegCodecs[encodersMatch[1]].encoders = encodersMatch[2].split(" ").map(x => x.toLowerCase());
|
|
299
|
+
this.ffmpegCodecs[encodersMatch[1]] ??= { decoders: new Set(), encoders: new Set() };
|
|
300
|
+
this.ffmpegCodecs[encodersMatch[1]].encoders = new Set(encodersMatch[2].split(" ").map(x => x.toLowerCase()));
|
|
300
301
|
}
|
|
301
302
|
}
|
|
302
303
|
});
|
|
303
304
|
}
|
|
304
305
|
// Identify what hardware and operating system environment we're actually running on.
|
|
305
306
|
probeHwOs() {
|
|
307
|
+
// Retrieve the CPU model string once to avoid repeated allocations from cpus().
|
|
308
|
+
const cpuModelString = cpus()[0].model;
|
|
306
309
|
// Take a look at the platform we're on for an initial hint of what we are.
|
|
307
310
|
switch (platform) {
|
|
308
311
|
// The beloved macOS.
|
|
309
312
|
case "darwin":
|
|
310
|
-
this._hostSystem = "macOS." + (
|
|
313
|
+
this._hostSystem = "macOS." + (cpuModelString.includes("Apple") ? "Apple" : "Intel");
|
|
311
314
|
// Identify what generation of Apple Silicon we have.
|
|
312
|
-
if (
|
|
315
|
+
if (cpuModelString.includes("Apple")) {
|
|
313
316
|
// Extract the CPU model.
|
|
314
|
-
const cpuModel = /Apple M(\d+) .*/i.exec(
|
|
317
|
+
const cpuModel = /Apple M(\d+) .*/i.exec(cpuModelString);
|
|
315
318
|
this._cpuGeneration = 0;
|
|
316
319
|
if (cpuModel?.[1]) {
|
|
317
320
|
this._cpuGeneration = Number(cpuModel[1]);
|
|
@@ -333,9 +336,9 @@ export class FfmpegCodecs {
|
|
|
333
336
|
// We aren't especially concerned with errors here, given we're just trying to ascertain the system information through hints.
|
|
334
337
|
}
|
|
335
338
|
// Identify what generation of Intel CPU we have if we're on Intel.
|
|
336
|
-
if (
|
|
339
|
+
if (cpuModelString.includes("Intel")) {
|
|
337
340
|
// Extract the CPU model.
|
|
338
|
-
const cpuModel = /Intel.*Core.*i\d+-(\d{3,5})/i.exec(
|
|
341
|
+
const cpuModel = /Intel.*Core.*i\d+-(\d{3,5})/i.exec(cpuModelString);
|
|
339
342
|
this._cpuGeneration = 0;
|
|
340
343
|
if (cpuModel?.[1]) {
|
|
341
344
|
// Grab the individual SKU as both a number and string.
|
|
@@ -376,10 +379,8 @@ export class FfmpegCodecs {
|
|
|
376
379
|
// Utility to probe the capabilities of FFmpeg and the host platform.
|
|
377
380
|
async probeCmd(command, commandLineArgs, processOutput, quietRunErrors = false) {
|
|
378
381
|
try {
|
|
379
|
-
// Promisify exec to allow us to wait for it asynchronously.
|
|
380
|
-
const execAsync = util.promisify(execFile);
|
|
381
382
|
// Check for the codecs in our video processor.
|
|
382
|
-
const { stdout } = await
|
|
383
|
+
const { stdout } = await execFileAsync(command, commandLineArgs);
|
|
383
384
|
processOutput(stdout);
|
|
384
385
|
return true;
|
|
385
386
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../src/ffmpeg/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAA0B,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../src/ffmpeg/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAA0B,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,cAAc,C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H,+CAA+C;YAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;YAEjE,aAAa,CAAC,MAAM,CAAC,CAAC;YAEtB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAM,KAAK,EAAE,CAAC;YAEd,MAAM,SAAS,GAAG,KAA0B,CAAC;YAE7C,IAAG,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAE/B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1E,CAAC;iBAAM,IAAG,cAAc,EAAE,CAAC;gBAEzB,OAAO,KAAK,CAAC;YACf,CAAC;iBAAM,CAAC;gBAEN,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;YACrE,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kJAAkJ,EAC/J,OAAO,CAAC,CAAC;YAEX,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
package/dist/ffmpeg/exec.d.ts
CHANGED
|
@@ -104,5 +104,5 @@ export declare class FfmpegExec extends FfmpegProcess {
|
|
|
104
104
|
* @param exitCode - The exit code returned by the FFmpeg process.
|
|
105
105
|
* @param signal - The signal used to terminate the process, if any.
|
|
106
106
|
*/
|
|
107
|
-
protected logFfmpegError(exitCode: number
|
|
107
|
+
protected logFfmpegError(exitCode: Nullable<number>, signal: Nullable<NodeJS.Signals>): void;
|
|
108
108
|
}
|
package/dist/ffmpeg/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/ffmpeg/exec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAmB7C;;;;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CAAC,CAAC;IACzC,CAAC;CAEF"}
|
package/dist/ffmpeg/options.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ import type { HomebridgePluginLogging } from "../util.js";
|
|
|
31
31
|
* @property log - Logging interface for output and errors.
|
|
32
32
|
* @property name - Function returning the name or label for this options set.
|
|
33
33
|
*
|
|
34
|
+
* @remarks The `hardwareDecoding` and `hardwareTranscoding` flags are bidirectional. On input, they express the caller's desired hardware acceleration state. During
|
|
35
|
+
* `FfmpegOptions` construction, the flags are resolved against the host's actual capabilities and the config object is mutated in place to reflect what is available.
|
|
36
|
+
* After construction, these flags represent the resolved state...`hardwareDecoding` or `hardwareTranscoding` may be set to `false` if the required codecs or
|
|
37
|
+
* accelerators are absent, or `hardwareDecoding` may be set to `true` if Intel Quick Sync Video is detected even when not explicitly requested.
|
|
38
|
+
*
|
|
34
39
|
* @example
|
|
35
40
|
*
|
|
36
41
|
* ```ts
|