homebridge-plugin-utils 1.35.0 → 2.0.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/README.md +130 -2
- package/build/eslint-plugin/README.md +164 -0
- package/build/eslint-plugin/config.mjs +308 -0
- package/build/eslint-plugin/index.mjs +7 -0
- package/build/eslint-plugin/plugin.mjs +46 -0
- package/build/eslint-plugin/rules/blank-line-after-open-brace.mjs +137 -0
- package/build/eslint-plugin/rules/blank-line-after-open-brace.test.mjs +112 -0
- package/build/eslint-plugin/rules/comment-style.mjs +190 -0
- package/build/eslint-plugin/rules/comment-style.test.mjs +190 -0
- package/build/eslint-plugin/rules/enforce-node-protocol.mjs +114 -0
- package/build/eslint-plugin/rules/enforce-node-protocol.test.mjs +116 -0
- package/build/eslint-plugin/rules/paren-comparisons-in-logical.mjs +94 -0
- package/build/eslint-plugin/rules/paren-comparisons-in-logical.test.mjs +107 -0
- package/build/eslint-plugin/rules/split-type-imports.mjs +354 -0
- package/build/eslint-plugin/rules/split-type-imports.test.mjs +268 -0
- package/build/eslint-plugin/test-setup.mjs +21 -0
- package/build/fs-ops.mjs +184 -0
- package/build/tsconfig.json +18 -3
- package/dist/backpressure.d.ts +94 -45
- package/dist/backpressure.js +229 -93
- package/dist/backpressure.js.map +1 -1
- package/dist/cli/index.d.ts +95 -0
- package/dist/cli/index.js +355 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/clock-double.d.ts +93 -0
- package/dist/clock-double.js +141 -0
- package/dist/clock-double.js.map +1 -0
- package/dist/clock.d.ts +39 -0
- package/dist/clock.js +34 -0
- package/dist/clock.js.map +1 -0
- package/dist/eslint-plugin/config.d.mts +193 -0
- package/dist/eslint-plugin/index.d.mts +2 -0
- package/dist/eslint-plugin/plugin.d.mts +87 -0
- package/dist/eslint-plugin/rules/blank-line-after-open-brace.d.mts +19 -0
- package/dist/eslint-plugin/rules/comment-style.d.mts +15 -0
- package/dist/eslint-plugin/rules/enforce-node-protocol.d.mts +18 -0
- package/dist/eslint-plugin/rules/paren-comparisons-in-logical.d.mts +15 -0
- package/dist/eslint-plugin/rules/split-type-imports.d.mts +16 -0
- package/dist/featureOptions-docs.d.ts +96 -0
- package/dist/featureOptions-docs.js +193 -0
- package/dist/featureOptions-docs.js.map +1 -0
- package/dist/featureOptions.d.ts +674 -0
- package/dist/featureOptions.js +870 -0
- package/dist/featureOptions.js.map +1 -0
- package/dist/ffmpeg/codecs.d.ts +256 -72
- package/dist/ffmpeg/codecs.js +477 -262
- package/dist/ffmpeg/codecs.js.map +1 -1
- package/dist/ffmpeg/dgram-util.d.ts +46 -0
- package/dist/ffmpeg/dgram-util.js +38 -0
- package/dist/ffmpeg/dgram-util.js.map +1 -0
- package/dist/ffmpeg/exec.d.ts +83 -64
- package/dist/ffmpeg/exec.js +77 -86
- package/dist/ffmpeg/exec.js.map +1 -1
- package/dist/ffmpeg/fmp4.d.ts +49 -2
- package/dist/ffmpeg/fmp4.js +47 -11
- package/dist/ffmpeg/fmp4.js.map +1 -1
- package/dist/ffmpeg/hap-enums.d.ts +214 -0
- package/dist/ffmpeg/hap-enums.js +92 -0
- package/dist/ffmpeg/hap-enums.js.map +1 -0
- package/dist/ffmpeg/index.d.ts +16 -9
- package/dist/ffmpeg/index.js +6 -0
- package/dist/ffmpeg/index.js.map +1 -1
- package/dist/ffmpeg/mp4-assembler.d.ts +120 -0
- package/dist/ffmpeg/mp4-assembler.js +387 -0
- package/dist/ffmpeg/mp4-assembler.js.map +1 -0
- package/dist/ffmpeg/mp4-parser.d.ts +94 -0
- package/dist/ffmpeg/mp4-parser.js +130 -0
- package/dist/ffmpeg/mp4-parser.js.map +1 -0
- package/dist/ffmpeg/options.d.ts +62 -149
- package/dist/ffmpeg/options.js +608 -499
- package/dist/ffmpeg/options.js.map +1 -1
- package/dist/ffmpeg/process.d.ts +142 -96
- package/dist/ffmpeg/process.js +406 -278
- package/dist/ffmpeg/process.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +302 -188
- package/dist/ffmpeg/record.js +408 -567
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/ffmpeg/recording-process-double.d.ts +144 -0
- package/dist/ffmpeg/recording-process-double.js +168 -0
- package/dist/ffmpeg/recording-process-double.js.map +1 -0
- package/dist/ffmpeg/rtp-parser.d.ts +70 -0
- package/dist/ffmpeg/rtp-parser.js +77 -0
- package/dist/ffmpeg/rtp-parser.js.map +1 -0
- package/dist/ffmpeg/rtp.d.ts +198 -141
- package/dist/ffmpeg/rtp.js +473 -251
- package/dist/ffmpeg/rtp.js.map +1 -1
- package/dist/ffmpeg/settings.d.ts +5 -2
- package/dist/ffmpeg/settings.js +20 -5
- package/dist/ffmpeg/settings.js.map +1 -1
- package/dist/ffmpeg/stream.d.ts +57 -107
- package/dist/ffmpeg/stream.js +121 -150
- package/dist/ffmpeg/stream.js.map +1 -1
- package/dist/formatters.d.ts +106 -0
- package/dist/formatters.js +174 -0
- package/dist/formatters.js.map +1 -0
- package/dist/homebridge-enums.d.ts +30 -0
- package/dist/homebridge-enums.js +17 -0
- package/dist/homebridge-enums.js.map +1 -0
- package/dist/index.d.ts +12 -6
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/logclient/auth.d.ts +114 -0
- package/dist/logclient/auth.js +199 -0
- package/dist/logclient/auth.js.map +1 -0
- package/dist/logclient/cli-run.d.ts +76 -0
- package/dist/logclient/cli-run.js +639 -0
- package/dist/logclient/cli-run.js.map +1 -0
- package/dist/logclient/cli.d.ts +3 -0
- package/dist/logclient/cli.js +97 -0
- package/dist/logclient/cli.js.map +1 -0
- package/dist/logclient/client.d.ts +145 -0
- package/dist/logclient/client.js +600 -0
- package/dist/logclient/client.js.map +1 -0
- package/dist/logclient/config.d.ts +173 -0
- package/dist/logclient/config.js +199 -0
- package/dist/logclient/config.js.map +1 -0
- package/dist/logclient/endpoints.d.ts +54 -0
- package/dist/logclient/endpoints.js +73 -0
- package/dist/logclient/endpoints.js.map +1 -0
- package/dist/logclient/filter.d.ts +45 -0
- package/dist/logclient/filter.js +51 -0
- package/dist/logclient/filter.js.map +1 -0
- package/dist/logclient/frame.d.ts +93 -0
- package/dist/logclient/frame.js +203 -0
- package/dist/logclient/frame.js.map +1 -0
- package/dist/logclient/index.d.ts +31 -0
- package/dist/logclient/index.js +12 -0
- package/dist/logclient/index.js.map +1 -0
- package/dist/logclient/parser.d.ts +211 -0
- package/dist/logclient/parser.js +393 -0
- package/dist/logclient/parser.js.map +1 -0
- package/dist/logclient/rest.d.ts +41 -0
- package/dist/logclient/rest.js +111 -0
- package/dist/logclient/rest.js.map +1 -0
- package/dist/logclient/settings.d.ts +15 -0
- package/dist/logclient/settings.js +64 -0
- package/dist/logclient/settings.js.map +1 -0
- package/dist/logclient/socket-double.d.ts +201 -0
- package/dist/logclient/socket-double.js +384 -0
- package/dist/logclient/socket-double.js.map +1 -0
- package/dist/logclient/socket.d.ts +257 -0
- package/dist/logclient/socket.js +620 -0
- package/dist/logclient/socket.js.map +1 -0
- package/dist/logclient/stitch.d.ts +83 -0
- package/dist/logclient/stitch.js +146 -0
- package/dist/logclient/stitch.js.map +1 -0
- package/dist/logclient/time-expression.d.ts +42 -0
- package/dist/logclient/time-expression.js +181 -0
- package/dist/logclient/time-expression.js.map +1 -0
- package/dist/logclient/time-window.d.ts +38 -0
- package/dist/logclient/time-window.js +53 -0
- package/dist/logclient/time-window.js.map +1 -0
- package/dist/logclient/types.d.ts +107 -0
- package/dist/logclient/types.js +6 -0
- package/dist/logclient/types.js.map +1 -0
- package/dist/mqttClient.d.ts +287 -0
- package/dist/mqttClient.js +433 -0
- package/dist/mqttClient.js.map +1 -0
- package/dist/service.d.ts +64 -15
- package/dist/service.js +93 -66
- package/dist/service.js.map +1 -1
- package/dist/ui/featureOptions.js +870 -0
- package/dist/ui/featureOptions.js.map +1 -0
- package/dist/ui/formatters.js +174 -0
- package/dist/ui/formatters.js.map +1 -0
- package/dist/ui/pluginConfigSession.mjs +141 -0
- package/dist/ui/webUi-featureOptions/categoryState.mjs +135 -0
- package/dist/ui/webUi-featureOptions/effects/keyboard.mjs +61 -0
- package/dist/ui/webUi-featureOptions/effects/persist.mjs +226 -0
- package/dist/ui/webUi-featureOptions/effects/theme.mjs +398 -0
- package/dist/ui/webUi-featureOptions/effects/tokens.mjs +152 -0
- package/dist/ui/webUi-featureOptions/rendering.mjs +431 -0
- package/dist/ui/webUi-featureOptions/selectors.mjs +360 -0
- package/dist/ui/webUi-featureOptions/state.mjs +319 -0
- package/dist/ui/webUi-featureOptions/store.mjs +181 -0
- package/dist/ui/webUi-featureOptions/utils.mjs +200 -0
- package/dist/ui/webUi-featureOptions/views/connectionError.mjs +152 -0
- package/dist/ui/webUi-featureOptions/views/deviceInfo.mjs +80 -0
- package/dist/ui/webUi-featureOptions/views/header.mjs +77 -0
- package/dist/ui/webUi-featureOptions/views/nav.mjs +327 -0
- package/dist/ui/webUi-featureOptions/views/options.mjs +521 -0
- package/dist/ui/webUi-featureOptions/views/search.mjs +395 -0
- package/dist/ui/webUi-featureOptions.mjs +677 -0
- package/dist/ui/webUi.mjs +192 -87
- package/dist/util.d.ts +602 -45
- package/dist/util.js +783 -78
- package/dist/util.js.map +1 -1
- package/package.json +33 -15
- package/build/eslint-rules.mjs +0 -511
- package/dist/featureoptions.d.ts +0 -264
- package/dist/featureoptions.js +0 -480
- package/dist/featureoptions.js.map +0 -1
- package/dist/mqttclient.d.ts +0 -178
- package/dist/mqttclient.js +0 -310
- package/dist/mqttclient.js.map +0 -1
- package/dist/ui/featureoptions.js +0 -480
- package/dist/ui/featureoptions.js.map +0 -1
- package/dist/ui/webUi-featureoptions.mjs +0 -3765
package/dist/ffmpeg/fmp4.d.ts
CHANGED
|
@@ -9,13 +9,57 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import type { Nullable } from "../util.
|
|
12
|
+
import type { Nullable } from "../util.ts";
|
|
13
13
|
/**
|
|
14
14
|
* ISO BMFF box header size in bytes: 4 bytes big-endian size + 4 bytes ASCII type.
|
|
15
15
|
*
|
|
16
16
|
* @category FFmpeg
|
|
17
17
|
*/
|
|
18
18
|
export declare const BOX_HEADER_SIZE = 8;
|
|
19
|
+
/**
|
|
20
|
+
* TRUN fullbox flags bit indicating that a `data_offset` field follows the sample_count in the box header.
|
|
21
|
+
*
|
|
22
|
+
* @category FFmpeg
|
|
23
|
+
*/
|
|
24
|
+
export declare const TRUN_FLAG_DATA_OFFSET = 1;
|
|
25
|
+
/**
|
|
26
|
+
* TRUN fullbox flags bit indicating that a `first_sample_flags` field follows (after `data_offset` if present). When this flag is set, the first sample's flags are
|
|
27
|
+
* stored in a dedicated header field rather than in the per-sample entries - the common arrangement for fragments emitted with FFmpeg's `frag_keyframe` movflag.
|
|
28
|
+
*
|
|
29
|
+
* @category FFmpeg
|
|
30
|
+
*/
|
|
31
|
+
export declare const TRUN_FLAG_FIRST_SAMPLE_FLAGS = 4;
|
|
32
|
+
/**
|
|
33
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte duration field.
|
|
34
|
+
*
|
|
35
|
+
* @category FFmpeg
|
|
36
|
+
*/
|
|
37
|
+
export declare const TRUN_FLAG_SAMPLE_DURATION = 256;
|
|
38
|
+
/**
|
|
39
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte size field.
|
|
40
|
+
*
|
|
41
|
+
* @category FFmpeg
|
|
42
|
+
*/
|
|
43
|
+
export declare const TRUN_FLAG_SAMPLE_SIZE = 512;
|
|
44
|
+
/**
|
|
45
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte sample_flags field.
|
|
46
|
+
*
|
|
47
|
+
* @category FFmpeg
|
|
48
|
+
*/
|
|
49
|
+
export declare const TRUN_FLAG_SAMPLE_FLAGS = 1024;
|
|
50
|
+
/**
|
|
51
|
+
* Sample-flags bit indicating a non-sync (non-keyframe) sample. When this bit is clear (0), the sample is a sync sample / IDR frame / keyframe.
|
|
52
|
+
*
|
|
53
|
+
* @category FFmpeg
|
|
54
|
+
*/
|
|
55
|
+
export declare const SAMPLE_FLAG_NON_SYNC = 65536;
|
|
56
|
+
/**
|
|
57
|
+
* Handler-type code for audio tracks in ISO BMFF `hdlr` boxes: ASCII `"soun"` encoded as a 32-bit big-endian integer. Compared against the `handler_type` field of
|
|
58
|
+
* each track's `hdlr` fullbox to identify the audio track during init-segment inspection.
|
|
59
|
+
*
|
|
60
|
+
* @category FFmpeg
|
|
61
|
+
*/
|
|
62
|
+
export declare const HDLR_TYPE_SOUN = 1936684398;
|
|
19
63
|
/**
|
|
20
64
|
* Describes the location of an ISO BMFF box within a buffer.
|
|
21
65
|
*
|
|
@@ -32,7 +76,9 @@ export interface FMp4Box {
|
|
|
32
76
|
* Locates the first ISO BMFF box of a given type within a byte range.
|
|
33
77
|
*
|
|
34
78
|
* Walks the standard box headers (4-byte big-endian size + 4-byte ASCII type) starting at `start` and ending at `end`. Returns the offset and size of the first
|
|
35
|
-
* matching box
|
|
79
|
+
* matching box. Returns `null` when no box of the requested type is found in range, and also when the walk encounters a box whose declared size is invalid - below
|
|
80
|
+
* the header size, extending past the search range, or an extended/open-ended size (64-bit size field, uncommon in fMP4 livestream contexts and unsupported here) -
|
|
81
|
+
* since a malformed size makes it unsafe to keep walking; the two cases are indistinguishable from the return value alone.
|
|
36
82
|
*
|
|
37
83
|
* @param buffer - The buffer containing ISO BMFF box data.
|
|
38
84
|
* @param type - The 4-character ASCII box type to search for (e.g. "moof", "traf", "trun"). Must be exactly 4 characters.
|
|
@@ -88,3 +134,4 @@ export declare function splitMoofMdat(fragment: Buffer): Nullable<{
|
|
|
88
134
|
mdat: Buffer;
|
|
89
135
|
moof: Buffer;
|
|
90
136
|
}>;
|
|
137
|
+
//# sourceMappingURL=fmp4.d.ts.map
|
package/dist/ffmpeg/fmp4.js
CHANGED
|
@@ -10,23 +10,59 @@
|
|
|
10
10
|
export const BOX_HEADER_SIZE = 8;
|
|
11
11
|
// TRUN fullbox header size: standard box header + 4 bytes version/flags + 4 bytes sample_count.
|
|
12
12
|
const TRUN_HEADER_SIZE = BOX_HEADER_SIZE + 8;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
/**
|
|
14
|
+
* TRUN fullbox flags bit indicating that a `data_offset` field follows the sample_count in the box header.
|
|
15
|
+
*
|
|
16
|
+
* @category FFmpeg
|
|
17
|
+
*/
|
|
18
|
+
export const TRUN_FLAG_DATA_OFFSET = 0x000001;
|
|
19
|
+
/**
|
|
20
|
+
* TRUN fullbox flags bit indicating that a `first_sample_flags` field follows (after `data_offset` if present). When this flag is set, the first sample's flags are
|
|
21
|
+
* stored in a dedicated header field rather than in the per-sample entries - the common arrangement for fragments emitted with FFmpeg's `frag_keyframe` movflag.
|
|
22
|
+
*
|
|
23
|
+
* @category FFmpeg
|
|
24
|
+
*/
|
|
25
|
+
export const TRUN_FLAG_FIRST_SAMPLE_FLAGS = 0x000004;
|
|
26
|
+
/**
|
|
27
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte duration field.
|
|
28
|
+
*
|
|
29
|
+
* @category FFmpeg
|
|
30
|
+
*/
|
|
31
|
+
export const TRUN_FLAG_SAMPLE_DURATION = 0x000100;
|
|
32
|
+
/**
|
|
33
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte size field.
|
|
34
|
+
*
|
|
35
|
+
* @category FFmpeg
|
|
36
|
+
*/
|
|
37
|
+
export const TRUN_FLAG_SAMPLE_SIZE = 0x000200;
|
|
38
|
+
/**
|
|
39
|
+
* TRUN fullbox flags bit indicating that each sample entry carries a 4-byte sample_flags field.
|
|
40
|
+
*
|
|
41
|
+
* @category FFmpeg
|
|
42
|
+
*/
|
|
43
|
+
export const TRUN_FLAG_SAMPLE_FLAGS = 0x000400;
|
|
44
|
+
/**
|
|
45
|
+
* Sample-flags bit indicating a non-sync (non-keyframe) sample. When this bit is clear (0), the sample is a sync sample / IDR frame / keyframe.
|
|
46
|
+
*
|
|
47
|
+
* @category FFmpeg
|
|
48
|
+
*/
|
|
49
|
+
export const SAMPLE_FLAG_NON_SYNC = 0x00010000;
|
|
50
|
+
/**
|
|
51
|
+
* Handler-type code for audio tracks in ISO BMFF `hdlr` boxes: ASCII `"soun"` encoded as a 32-bit big-endian integer. Compared against the `handler_type` field of
|
|
52
|
+
* each track's `hdlr` fullbox to identify the audio track during init-segment inspection.
|
|
53
|
+
*
|
|
54
|
+
* @category FFmpeg
|
|
55
|
+
*/
|
|
56
|
+
export const HDLR_TYPE_SOUN = 0x736F756E;
|
|
23
57
|
// Offset from the start of an hdlr fullbox to the handler_type field: standard box header (8 bytes) + version/flags (4 bytes) + pre_defined (4 bytes).
|
|
24
58
|
const HDLR_TYPE_OFFSET = BOX_HEADER_SIZE + 8;
|
|
25
59
|
/**
|
|
26
60
|
* Locates the first ISO BMFF box of a given type within a byte range.
|
|
27
61
|
*
|
|
28
62
|
* Walks the standard box headers (4-byte big-endian size + 4-byte ASCII type) starting at `start` and ending at `end`. Returns the offset and size of the first
|
|
29
|
-
* matching box
|
|
63
|
+
* matching box. Returns `null` when no box of the requested type is found in range, and also when the walk encounters a box whose declared size is invalid - below
|
|
64
|
+
* the header size, extending past the search range, or an extended/open-ended size (64-bit size field, uncommon in fMP4 livestream contexts and unsupported here) -
|
|
65
|
+
* since a malformed size makes it unsafe to keep walking; the two cases are indistinguishable from the return value alone.
|
|
30
66
|
*
|
|
31
67
|
* @param buffer - The buffer containing ISO BMFF box data.
|
|
32
68
|
* @param type - The 4-character ASCII box type to search for (e.g. "moof", "traf", "trun"). Must be exactly 4 characters.
|
package/dist/ffmpeg/fmp4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fmp4.js","sourceRoot":"","sources":["../../src/ffmpeg/fmp4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;;GA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eAAe,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YAElG,8JAA8J;YAC9J,wFAAwF;YACxF,IAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEjD,IAAG,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,KAAK,cAAc,EAAE,CAAC;oBAE/E,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAE5C,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvC,IAAG,CAAC,IAAI,EAAE,CAAC;QAET,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirrors HAP protocol const enum values that HomeKit camera plugins need at value-side runtime. `verbatimModuleSyntax` disallows value imports of ambient const
|
|
3
|
+
* enums, so the numeric and string contracts from hap-nodejs must be re-declared at value-side. Centralizing the mirrors here gives every consumer a single import
|
|
4
|
+
* path and a single update point if upstream `hap-nodejs` ever changes a value.
|
|
5
|
+
*
|
|
6
|
+
* Values MUST stay in lockstep with the upstream definitions in `hap-nodejs/.../RecordingManagement.d.ts`, `hap-nodejs/.../RTPStreamManagement.d.ts`, and
|
|
7
|
+
* `hap-nodejs/.../DataStreamServer.d.ts`. The matching type aliases let consumers import the canonical names from one place rather than re-declaring them.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { AudioRecordingCodecType as AudioRecordingCodecTypeEnum, AudioRecordingSamplerate as AudioRecordingSamplerateEnum, AudioStreamingCodecType as AudioStreamingCodecTypeEnum, AudioStreamingSamplerate as AudioStreamingSamplerateEnum, H264Level as H264LevelEnum, H264Profile as H264ProfileEnum, HDSProtocolSpecificErrorReason as HDSProtocolSpecificErrorReasonEnum, MediaContainerType as MediaContainerTypeEnum, SRTPCryptoSuites as SRTPCryptoSuitesEnum, StreamRequestTypes as StreamRequestTypesEnum } from "homebridge";
|
|
12
|
+
import type { VideoCodecType as VideoCodecTypeEnum } from "@homebridge/hap-nodejs";
|
|
13
|
+
/**
|
|
14
|
+
* Numeric mirror of HAP's `AudioRecordingCodecType` const enum, suitable for runtime indexing into translation tables.
|
|
15
|
+
*
|
|
16
|
+
* @category FFmpeg
|
|
17
|
+
*/
|
|
18
|
+
export declare const AudioRecordingCodecType: {
|
|
19
|
+
readonly AAC_ELD: AudioRecordingCodecTypeEnum.AAC_ELD;
|
|
20
|
+
readonly AAC_LC: AudioRecordingCodecTypeEnum.AAC_LC;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `codec?: AudioRecordingCodecType` annotations resolve through the shared module rather than
|
|
24
|
+
* a local redeclaration in each consumer.
|
|
25
|
+
*
|
|
26
|
+
* @category FFmpeg
|
|
27
|
+
*/
|
|
28
|
+
export type AudioRecordingCodecType = AudioRecordingCodecTypeEnum;
|
|
29
|
+
/**
|
|
30
|
+
* Numeric mirror of HAP's `AudioRecordingSamplerate` const enum, suitable for runtime indexing into translation tables and for constructing recording configurations
|
|
31
|
+
* by enum name rather than by raw numeric value.
|
|
32
|
+
*
|
|
33
|
+
* @category FFmpeg
|
|
34
|
+
*/
|
|
35
|
+
export declare const AudioRecordingSamplerate: {
|
|
36
|
+
readonly KHZ_8: AudioRecordingSamplerateEnum.KHZ_8;
|
|
37
|
+
readonly KHZ_16: AudioRecordingSamplerateEnum.KHZ_16;
|
|
38
|
+
readonly KHZ_24: AudioRecordingSamplerateEnum.KHZ_24;
|
|
39
|
+
readonly KHZ_32: AudioRecordingSamplerateEnum.KHZ_32;
|
|
40
|
+
readonly KHZ_44_1: AudioRecordingSamplerateEnum.KHZ_44_1;
|
|
41
|
+
readonly KHZ_48: AudioRecordingSamplerateEnum.KHZ_48;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `samplerate: AudioRecordingSamplerate` annotations resolve through the shared module rather
|
|
45
|
+
* than a local redeclaration in each consumer.
|
|
46
|
+
*
|
|
47
|
+
* @category FFmpeg
|
|
48
|
+
*/
|
|
49
|
+
export type AudioRecordingSamplerate = AudioRecordingSamplerateEnum;
|
|
50
|
+
/**
|
|
51
|
+
* String mirror of HAP's `AudioStreamingCodecType` const enum, surfaced to HomeKit camera streaming delegates when declaring the audio codecs supported on live-stream
|
|
52
|
+
* sessions.
|
|
53
|
+
*
|
|
54
|
+
* @category FFmpeg
|
|
55
|
+
*/
|
|
56
|
+
export declare const AudioStreamingCodecType: {
|
|
57
|
+
readonly AAC_ELD: AudioStreamingCodecTypeEnum.AAC_ELD;
|
|
58
|
+
readonly AMR: AudioStreamingCodecTypeEnum.AMR;
|
|
59
|
+
readonly AMR_WB: AudioStreamingCodecTypeEnum.AMR_WB;
|
|
60
|
+
readonly MSBC: AudioStreamingCodecTypeEnum.MSBC;
|
|
61
|
+
readonly OPUS: AudioStreamingCodecTypeEnum.OPUS;
|
|
62
|
+
readonly PCMA: AudioStreamingCodecTypeEnum.PCMA;
|
|
63
|
+
readonly PCMU: AudioStreamingCodecTypeEnum.PCMU;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `type: AudioStreamingCodecType` annotations resolve through the shared module rather than a
|
|
67
|
+
* local redeclaration in each consumer.
|
|
68
|
+
*
|
|
69
|
+
* @category FFmpeg
|
|
70
|
+
*/
|
|
71
|
+
export type AudioStreamingCodecType = AudioStreamingCodecTypeEnum;
|
|
72
|
+
/**
|
|
73
|
+
* Numeric mirror of HAP's `AudioStreamingSamplerate` const enum, surfaced to HomeKit camera streaming delegates when declaring the audio sample rates supported on
|
|
74
|
+
* live-stream sessions.
|
|
75
|
+
*
|
|
76
|
+
* @category FFmpeg
|
|
77
|
+
*/
|
|
78
|
+
export declare const AudioStreamingSamplerate: {
|
|
79
|
+
readonly KHZ_8: AudioStreamingSamplerateEnum.KHZ_8;
|
|
80
|
+
readonly KHZ_16: AudioStreamingSamplerateEnum.KHZ_16;
|
|
81
|
+
readonly KHZ_24: AudioStreamingSamplerateEnum.KHZ_24;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `samplerate: AudioStreamingSamplerate` annotations resolve through the shared module rather
|
|
85
|
+
* than a local redeclaration in each consumer.
|
|
86
|
+
*
|
|
87
|
+
* @category FFmpeg
|
|
88
|
+
*/
|
|
89
|
+
export type AudioStreamingSamplerate = AudioStreamingSamplerateEnum;
|
|
90
|
+
/**
|
|
91
|
+
* Numeric mirror of HAP's `H264Level` const enum, surfaced when declaring the H.264 levels a camera codec configuration advertises to HomeKit.
|
|
92
|
+
*
|
|
93
|
+
* @category FFmpeg
|
|
94
|
+
*/
|
|
95
|
+
export declare const H264Level: {
|
|
96
|
+
readonly LEVEL3_1: H264LevelEnum.LEVEL3_1;
|
|
97
|
+
readonly LEVEL3_2: H264LevelEnum.LEVEL3_2;
|
|
98
|
+
readonly LEVEL4_0: H264LevelEnum.LEVEL4_0;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `levels: H264Level[]` annotations resolve through the shared module rather than a local
|
|
102
|
+
* redeclaration in each consumer.
|
|
103
|
+
*
|
|
104
|
+
* @category FFmpeg
|
|
105
|
+
*/
|
|
106
|
+
export type H264Level = H264LevelEnum;
|
|
107
|
+
/**
|
|
108
|
+
* Numeric mirror of HAP's `H264Profile` const enum, surfaced when declaring the H.264 profiles a camera codec configuration advertises to HomeKit.
|
|
109
|
+
*
|
|
110
|
+
* @category FFmpeg
|
|
111
|
+
*/
|
|
112
|
+
export declare const H264Profile: {
|
|
113
|
+
readonly BASELINE: H264ProfileEnum.BASELINE;
|
|
114
|
+
readonly HIGH: H264ProfileEnum.HIGH;
|
|
115
|
+
readonly MAIN: H264ProfileEnum.MAIN;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `profiles: H264Profile[]` annotations resolve through the shared module rather than a local
|
|
119
|
+
* redeclaration in each consumer.
|
|
120
|
+
*
|
|
121
|
+
* @category FFmpeg
|
|
122
|
+
*/
|
|
123
|
+
export type H264Profile = H264ProfileEnum;
|
|
124
|
+
/**
|
|
125
|
+
* Numeric mirror of HAP's `HDSProtocolSpecificErrorReason` const enum, surfaced to HKSV recording delegates as the categorical reason a HomeKit data stream session
|
|
126
|
+
* terminated. Recording delegates compare the value they receive in `close(reason)` against these names rather than against opaque numeric constants.
|
|
127
|
+
*
|
|
128
|
+
* @category FFmpeg
|
|
129
|
+
*/
|
|
130
|
+
export declare const HDSProtocolSpecificErrorReason: {
|
|
131
|
+
readonly NORMAL: HDSProtocolSpecificErrorReasonEnum.NORMAL;
|
|
132
|
+
readonly NOT_ALLOWED: HDSProtocolSpecificErrorReasonEnum.NOT_ALLOWED;
|
|
133
|
+
readonly BUSY: HDSProtocolSpecificErrorReasonEnum.BUSY;
|
|
134
|
+
readonly CANCELLED: HDSProtocolSpecificErrorReasonEnum.CANCELLED;
|
|
135
|
+
readonly UNSUPPORTED: HDSProtocolSpecificErrorReasonEnum.UNSUPPORTED;
|
|
136
|
+
readonly UNEXPECTED_FAILURE: HDSProtocolSpecificErrorReasonEnum.UNEXPECTED_FAILURE;
|
|
137
|
+
readonly TIMEOUT: HDSProtocolSpecificErrorReasonEnum.TIMEOUT;
|
|
138
|
+
readonly BAD_DATA: HDSProtocolSpecificErrorReasonEnum.BAD_DATA;
|
|
139
|
+
readonly PROTOCOL_ERROR: HDSProtocolSpecificErrorReasonEnum.PROTOCOL_ERROR;
|
|
140
|
+
readonly INVALID_CONFIGURATION: HDSProtocolSpecificErrorReasonEnum.INVALID_CONFIGURATION;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `reason: HDSProtocolSpecificErrorReason` annotations resolve through the shared module
|
|
144
|
+
* rather than a local redeclaration in each consumer.
|
|
145
|
+
*
|
|
146
|
+
* @category FFmpeg
|
|
147
|
+
*/
|
|
148
|
+
export type HDSProtocolSpecificErrorReason = HDSProtocolSpecificErrorReasonEnum;
|
|
149
|
+
/**
|
|
150
|
+
* Numeric mirror of HAP's `SRTPCryptoSuites` const enum, surfaced when negotiating the SRTP cipher suite for HomeKit camera streaming sessions.
|
|
151
|
+
*
|
|
152
|
+
* @category FFmpeg
|
|
153
|
+
*/
|
|
154
|
+
export declare const SRTPCryptoSuites: {
|
|
155
|
+
readonly AES_CM_128_HMAC_SHA1_80: SRTPCryptoSuitesEnum.AES_CM_128_HMAC_SHA1_80;
|
|
156
|
+
readonly AES_CM_256_HMAC_SHA1_80: SRTPCryptoSuitesEnum.AES_CM_256_HMAC_SHA1_80;
|
|
157
|
+
readonly NONE: SRTPCryptoSuitesEnum.NONE;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `suite: SRTPCryptoSuites` annotations resolve through the shared module rather than a local
|
|
161
|
+
* redeclaration in each consumer.
|
|
162
|
+
*
|
|
163
|
+
* @category FFmpeg
|
|
164
|
+
*/
|
|
165
|
+
export type SRTPCryptoSuites = SRTPCryptoSuitesEnum;
|
|
166
|
+
/**
|
|
167
|
+
* Numeric mirror of HAP's `VideoCodecType` const enum, surfaced when declaring the video codec a camera advertises to HomeKit.
|
|
168
|
+
*
|
|
169
|
+
* @category FFmpeg
|
|
170
|
+
*/
|
|
171
|
+
export declare const VideoCodecType: {
|
|
172
|
+
readonly H264: VideoCodecTypeEnum.H264;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `type: VideoCodecType` annotations resolve through the shared module rather than a local
|
|
176
|
+
* redeclaration in each consumer.
|
|
177
|
+
*
|
|
178
|
+
* @category FFmpeg
|
|
179
|
+
*/
|
|
180
|
+
export type VideoCodecType = VideoCodecTypeEnum;
|
|
181
|
+
/**
|
|
182
|
+
* Numeric mirror of HAP's `MediaContainerType` const enum, surfaced when declaring the container format of HKSV recording fragments.
|
|
183
|
+
*
|
|
184
|
+
* @category FFmpeg
|
|
185
|
+
*/
|
|
186
|
+
export declare const MediaContainerType: {
|
|
187
|
+
readonly FRAGMENTED_MP4: MediaContainerTypeEnum.FRAGMENTED_MP4;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `type: MediaContainerType` annotations resolve through the shared module rather than a
|
|
191
|
+
* local redeclaration in each consumer.
|
|
192
|
+
*
|
|
193
|
+
* @category FFmpeg
|
|
194
|
+
*/
|
|
195
|
+
export type MediaContainerType = MediaContainerTypeEnum;
|
|
196
|
+
/**
|
|
197
|
+
* String mirror of HAP's `StreamRequestTypes` const enum, used by HomeKit camera streaming delegates to dispatch on the `type` field of incoming streaming-control
|
|
198
|
+
* requests.
|
|
199
|
+
*
|
|
200
|
+
* @category FFmpeg
|
|
201
|
+
*/
|
|
202
|
+
export declare const StreamRequestTypes: {
|
|
203
|
+
readonly RECONFIGURE: StreamRequestTypesEnum.RECONFIGURE;
|
|
204
|
+
readonly START: StreamRequestTypesEnum.START;
|
|
205
|
+
readonly STOP: StreamRequestTypesEnum.STOP;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Type alias re-exposing the HAP enum under its canonical name so existing `type: StreamRequestTypes` annotations resolve through the shared module rather than a
|
|
209
|
+
* local redeclaration in each consumer.
|
|
210
|
+
*
|
|
211
|
+
* @category FFmpeg
|
|
212
|
+
*/
|
|
213
|
+
export type StreamRequestTypes = StreamRequestTypesEnum;
|
|
214
|
+
//# sourceMappingURL=hap-enums.d.ts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* Copyright(C) 2017-2026, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* ffmpeg/hap-enums.ts: Single source of truth for the HAP protocol const enum mirrors that HomeKit camera plugins need at runtime.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Numeric mirror of HAP's `AudioRecordingCodecType` const enum, suitable for runtime indexing into translation tables.
|
|
7
|
+
*
|
|
8
|
+
* @category FFmpeg
|
|
9
|
+
*/
|
|
10
|
+
export const AudioRecordingCodecType = { AAC_ELD: 1, AAC_LC: 0 };
|
|
11
|
+
/**
|
|
12
|
+
* Numeric mirror of HAP's `AudioRecordingSamplerate` const enum, suitable for runtime indexing into translation tables and for constructing recording configurations
|
|
13
|
+
* by enum name rather than by raw numeric value.
|
|
14
|
+
*
|
|
15
|
+
* @category FFmpeg
|
|
16
|
+
*/
|
|
17
|
+
export const AudioRecordingSamplerate = { KHZ_16: 1, KHZ_24: 2, KHZ_32: 3, KHZ_44_1: 4, KHZ_48: 5, KHZ_8: 0 };
|
|
18
|
+
/**
|
|
19
|
+
* String mirror of HAP's `AudioStreamingCodecType` const enum, surfaced to HomeKit camera streaming delegates when declaring the audio codecs supported on live-stream
|
|
20
|
+
* sessions.
|
|
21
|
+
*
|
|
22
|
+
* @category FFmpeg
|
|
23
|
+
*/
|
|
24
|
+
export const AudioStreamingCodecType = {
|
|
25
|
+
// String const enum members are nominal in TypeScript: a raw string literal is not assignable to the enum member type without an explicit brand. The per-property
|
|
26
|
+
// assertions make the intent visible at each value, and the assertion fails fast if the upstream string ever changes out from under us.
|
|
27
|
+
AAC_ELD: "AAC-eld",
|
|
28
|
+
AMR: "AMR",
|
|
29
|
+
AMR_WB: "AMR-WB",
|
|
30
|
+
MSBC: "mSBC",
|
|
31
|
+
OPUS: "OPUS",
|
|
32
|
+
PCMA: "PCMA",
|
|
33
|
+
PCMU: "PCMU"
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Numeric mirror of HAP's `AudioStreamingSamplerate` const enum, surfaced to HomeKit camera streaming delegates when declaring the audio sample rates supported on
|
|
37
|
+
* live-stream sessions.
|
|
38
|
+
*
|
|
39
|
+
* @category FFmpeg
|
|
40
|
+
*/
|
|
41
|
+
export const AudioStreamingSamplerate = { KHZ_16: 16, KHZ_24: 24, KHZ_8: 8 };
|
|
42
|
+
/**
|
|
43
|
+
* Numeric mirror of HAP's `H264Level` const enum, surfaced when declaring the H.264 levels a camera codec configuration advertises to HomeKit.
|
|
44
|
+
*
|
|
45
|
+
* @category FFmpeg
|
|
46
|
+
*/
|
|
47
|
+
export const H264Level = { LEVEL3_1: 0, LEVEL3_2: 1, LEVEL4_0: 2 };
|
|
48
|
+
/**
|
|
49
|
+
* Numeric mirror of HAP's `H264Profile` const enum, surfaced when declaring the H.264 profiles a camera codec configuration advertises to HomeKit.
|
|
50
|
+
*
|
|
51
|
+
* @category FFmpeg
|
|
52
|
+
*/
|
|
53
|
+
export const H264Profile = { BASELINE: 0, HIGH: 2, MAIN: 1 };
|
|
54
|
+
/**
|
|
55
|
+
* Numeric mirror of HAP's `HDSProtocolSpecificErrorReason` const enum, surfaced to HKSV recording delegates as the categorical reason a HomeKit data stream session
|
|
56
|
+
* terminated. Recording delegates compare the value they receive in `close(reason)` against these names rather than against opaque numeric constants.
|
|
57
|
+
*
|
|
58
|
+
* @category FFmpeg
|
|
59
|
+
*/
|
|
60
|
+
export const HDSProtocolSpecificErrorReason = { BAD_DATA: 7, BUSY: 2, CANCELLED: 3, INVALID_CONFIGURATION: 9, NORMAL: 0, NOT_ALLOWED: 1, PROTOCOL_ERROR: 8, TIMEOUT: 6, UNEXPECTED_FAILURE: 5, UNSUPPORTED: 4 };
|
|
61
|
+
/**
|
|
62
|
+
* Numeric mirror of HAP's `SRTPCryptoSuites` const enum, surfaced when negotiating the SRTP cipher suite for HomeKit camera streaming sessions.
|
|
63
|
+
*
|
|
64
|
+
* @category FFmpeg
|
|
65
|
+
*/
|
|
66
|
+
export const SRTPCryptoSuites = { AES_CM_128_HMAC_SHA1_80: 0, AES_CM_256_HMAC_SHA1_80: 1, NONE: 2 };
|
|
67
|
+
/**
|
|
68
|
+
* Numeric mirror of HAP's `VideoCodecType` const enum, surfaced when declaring the video codec a camera advertises to HomeKit.
|
|
69
|
+
*
|
|
70
|
+
* @category FFmpeg
|
|
71
|
+
*/
|
|
72
|
+
export const VideoCodecType = { H264: 0 };
|
|
73
|
+
/**
|
|
74
|
+
* Numeric mirror of HAP's `MediaContainerType` const enum, surfaced when declaring the container format of HKSV recording fragments.
|
|
75
|
+
*
|
|
76
|
+
* @category FFmpeg
|
|
77
|
+
*/
|
|
78
|
+
export const MediaContainerType = { FRAGMENTED_MP4: 0 };
|
|
79
|
+
/**
|
|
80
|
+
* String mirror of HAP's `StreamRequestTypes` const enum, used by HomeKit camera streaming delegates to dispatch on the `type` field of incoming streaming-control
|
|
81
|
+
* requests.
|
|
82
|
+
*
|
|
83
|
+
* @category FFmpeg
|
|
84
|
+
*/
|
|
85
|
+
export const StreamRequestTypes = {
|
|
86
|
+
// String const enum members are nominal in TypeScript: a raw string literal is not assignable to the enum member type without an explicit brand. The per-property
|
|
87
|
+
// assertions make the intent visible at each value, and the assertion fails fast if the upstream string ever changes out from under us.
|
|
88
|
+
RECONFIGURE: "reconfigure",
|
|
89
|
+
START: "start",
|
|
90
|
+
STOP: "stop"
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=hap-enums.js.map
|
|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AAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,qBAAqB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;AAUtK;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAIzB,EAAE,uBAAuB,EAAE,CAAC,EAAE,uBAAuB,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAUxE;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAA+C,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAUtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAuE,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC;AAU5H;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAI3B;IAEF,kKAAkK;IAClK,wIAAwI;IACxI,WAAW,EAAE,aAAmD;IAChE,KAAK,EAAE,OAAuC;IAC9C,IAAI,EAAE,MAAqC;CAC5C,CAAC"}
|
package/dist/ffmpeg/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
export * from "./codecs.
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
1
|
+
export * from "./codecs.ts";
|
|
2
|
+
export * from "./dgram-util.ts";
|
|
3
|
+
export * from "./exec.ts";
|
|
4
|
+
export * from "./fmp4.ts";
|
|
5
|
+
export * from "./hap-enums.ts";
|
|
6
|
+
export * from "./mp4-assembler.ts";
|
|
7
|
+
export * from "./mp4-parser.ts";
|
|
8
|
+
export * from "./options.ts";
|
|
9
|
+
export * from "./process.ts";
|
|
10
|
+
export * from "./record.ts";
|
|
11
|
+
export * from "./recording-process-double.ts";
|
|
12
|
+
export * from "./rtp-parser.ts";
|
|
13
|
+
export * from "./rtp.ts";
|
|
14
|
+
export * from "./settings.ts";
|
|
15
|
+
export * from "./stream.ts";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/ffmpeg/index.js
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
* ffmpeg/index.ts: FFmpeg classes.
|
|
4
4
|
*/
|
|
5
5
|
export * from "./codecs.js";
|
|
6
|
+
export * from "./dgram-util.js";
|
|
6
7
|
export * from "./exec.js";
|
|
7
8
|
export * from "./fmp4.js";
|
|
9
|
+
export * from "./hap-enums.js";
|
|
10
|
+
export * from "./mp4-assembler.js";
|
|
11
|
+
export * from "./mp4-parser.js";
|
|
8
12
|
export * from "./options.js";
|
|
9
13
|
export * from "./process.js";
|
|
10
14
|
export * from "./record.js";
|
|
15
|
+
export * from "./recording-process-double.js";
|
|
16
|
+
export * from "./rtp-parser.js";
|
|
11
17
|
export * from "./rtp.js";
|
|
12
18
|
export * from "./settings.js";
|
|
13
19
|
export * from "./stream.js";
|
package/dist/ffmpeg/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { Readable } from "node:stream";
|
|
2
|
+
/**
|
|
3
|
+
* Construction-time options for {@link Mp4SegmentAssembler}.
|
|
4
|
+
*
|
|
5
|
+
* @property segmentTimeout - Optional watchdog window, in milliseconds. The timer arms when the initialization segment resolves (we begin expecting media segments)
|
|
6
|
+
* and re-arms on each completed media segment. If no segment arrives within the window, the assembler aborts with
|
|
7
|
+
* `HbpuAbortError("timeout")` and the generator terminates cleanly. Typical value for HKSV is a little under five seconds.
|
|
8
|
+
* @property signal - Optional parent {@link AbortSignal} to compose with the assembler's internal controller. When the parent aborts, the assembler tears
|
|
9
|
+
* down and the segment generator exits.
|
|
10
|
+
*
|
|
11
|
+
* @category FFmpeg
|
|
12
|
+
*/
|
|
13
|
+
export interface Mp4SegmentAssemblerInit {
|
|
14
|
+
segmentTimeout?: number;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* AsyncDisposable fMP4 segment assembler that converts a Readable byte source into an init segment promise and a media-segment async generator.
|
|
19
|
+
*
|
|
20
|
+
* Construction kicks off a background drain loop that feeds {@link Mp4BoxParser} from the source's `data` events and routes each parsed box through a small state
|
|
21
|
+
* machine: everything before the first `moof` accumulates into the initialization segment; from the first `moof` onward, boxes accumulate into the current media
|
|
22
|
+
* segment until an `mdat` flushes the accumulated pair to the output queue.
|
|
23
|
+
*
|
|
24
|
+
* The single public teardown verb is {@link Mp4SegmentAssembler.abort}, mirroring `AbortController.abort()`. `Symbol.asyncDispose` is implemented in terms of it and
|
|
25
|
+
* awaits the drain loop's completion before returning, so `await using` guarantees the assembler has fully unwound by the time the surrounding scope exits.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { Mp4SegmentAssembler } from "homebridge-plugin-utils";
|
|
31
|
+
*
|
|
32
|
+
* await using assembler = new Mp4SegmentAssembler(ffmpegStdout, { segmentTimeout: 4500, signal: session.signal });
|
|
33
|
+
*
|
|
34
|
+
* const initSegment = await assembler.initSegment;
|
|
35
|
+
*
|
|
36
|
+
* for await (const segment of assembler.segments()) {
|
|
37
|
+
*
|
|
38
|
+
* // Forward segment bytes to HomeKit.
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see Mp4BoxParser
|
|
43
|
+
*
|
|
44
|
+
* @category FFmpeg
|
|
45
|
+
*/
|
|
46
|
+
export declare class Mp4SegmentAssembler implements AsyncDisposable {
|
|
47
|
+
#private;
|
|
48
|
+
/**
|
|
49
|
+
* The composed abort signal representing this assembler's lifetime. Aborts exactly once when the source ends, the source errors, the parent signal fires, the
|
|
50
|
+
* watchdog timeout expires, or {@link Mp4SegmentAssembler.abort} is called; the reason encoded on `signal.reason` names the cause.
|
|
51
|
+
*/
|
|
52
|
+
readonly signal: AbortSignal;
|
|
53
|
+
/**
|
|
54
|
+
* Promise that resolves with the concatenated initialization-segment bytes (typically `ftyp` + `moov`) once the first `moof` box arrives on the source. Rejects with
|
|
55
|
+
* `this.signal.reason` if the assembler is aborted before the initialization segment completes.
|
|
56
|
+
*/
|
|
57
|
+
readonly initSegment: Promise<Buffer>;
|
|
58
|
+
/**
|
|
59
|
+
* Construct and start a new fMP4 segment assembler.
|
|
60
|
+
*
|
|
61
|
+
* The drain loop starts synchronously as part of construction: by the time the constructor returns, the source's `data` events are being observed and the parser is
|
|
62
|
+
* ready to emit boxes. There is no separate `start()` step.
|
|
63
|
+
*
|
|
64
|
+
* @param source - Any {@link Readable} producing fMP4 byte chunks. Typically an FFmpeg process's stdout; any Readable works, which keeps the class testable in
|
|
65
|
+
* isolation with in-memory fixture streams.
|
|
66
|
+
* @param init - Optional init options. See {@link Mp4SegmentAssemblerInit}.
|
|
67
|
+
*/
|
|
68
|
+
constructor(source: Readable, init?: Mp4SegmentAssemblerInit);
|
|
69
|
+
/**
|
|
70
|
+
* Abort the assembler and tear it down. Defaults to `HbpuAbortError("shutdown")` when no reason is supplied; explicit reasons pass through unchanged.
|
|
71
|
+
*
|
|
72
|
+
* Safe to call more than once: subsequent calls are no-ops because the underlying signal only aborts once. Calling `abort()` after natural completion is also safe
|
|
73
|
+
* for the same reason.
|
|
74
|
+
*
|
|
75
|
+
* @param reason - Optional abort reason. Typically an {@link HbpuAbortError}; platform errors (`TimeoutError`, `AbortError`) also interoperate by convention.
|
|
76
|
+
*/
|
|
77
|
+
abort(reason?: unknown): void;
|
|
78
|
+
/**
|
|
79
|
+
* `AsyncDisposable` implementation. Aborts the assembler (defaulting to `"shutdown"`) and awaits actual drain-loop completion before returning, so callers using
|
|
80
|
+
* `await using` are guaranteed every internal listener has been detached by the time the block exits.
|
|
81
|
+
*
|
|
82
|
+
* @returns A promise that resolves once the drain loop has fully exited.
|
|
83
|
+
*/
|
|
84
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* `true` once `this.signal` has aborted. Derived from the signal; no independent state.
|
|
87
|
+
*/
|
|
88
|
+
get aborted(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* `true` when the abort reason indicates a timeout. Matches both the canonical `HbpuAbortError("timeout")` emitted by the inter-segment watchdog and the platform
|
|
91
|
+
* `TimeoutError` emitted by `AbortSignal.timeout()`. The discrimination lives in {@link isTimeoutReason} so this getter stays a one-line delegation and every
|
|
92
|
+
* resource class in the library shares one definition of "timeout."
|
|
93
|
+
*/
|
|
94
|
+
get isTimedOut(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The number of completed media segments buffered between the drain loop and the {@link Mp4SegmentAssembler.segments} consumer - the segments the producer has
|
|
97
|
+
* assembled but the consumer has not yet pulled. A consumer pacing its reads slower than the source produces accrues a reserve here, and that reserve is what
|
|
98
|
+
* absorbs an upstream stall: the consumer keeps pulling buffered segments while no new ones arrive. It is zero in steady state when the consumer keeps pace.
|
|
99
|
+
*/
|
|
100
|
+
get bufferedSegments(): number;
|
|
101
|
+
/**
|
|
102
|
+
* Async generator yielding each completed media segment (concatenated `moof` + `mdat` pair) as a single Buffer.
|
|
103
|
+
*
|
|
104
|
+
* Yields only after {@link Mp4SegmentAssembler.initSegment} has resolved - the init segment is not surfaced through this stream. Terminates cleanly when the source
|
|
105
|
+
* ends, the assembler aborts, or the optional caller signal aborts; in every case the queue is drained before the generator returns, so a consumer never loses a
|
|
106
|
+
* segment that was already assembled before teardown.
|
|
107
|
+
*
|
|
108
|
+
* **Single-consumer only.** The internal parked-waiter slot is single-writer; calling `segments()` concurrently with another consumer on the same assembler is
|
|
109
|
+
* unsupported and will hang one of the consumers when the producer's wake-up resolves only the later parker. If fan-out is needed, tee at the consumer side by
|
|
110
|
+
* replicating each yielded Buffer into per-consumer queues external to the assembler.
|
|
111
|
+
*
|
|
112
|
+
* @param init - Optional init options. `signal` composes with the assembler's own signal - aborting it terminates only this generator call, not the assembler.
|
|
113
|
+
*
|
|
114
|
+
* @returns An async generator yielding concatenated `moof` + `mdat` pair buffers in stream order.
|
|
115
|
+
*/
|
|
116
|
+
segments(init?: {
|
|
117
|
+
signal?: AbortSignal;
|
|
118
|
+
}): AsyncGenerator<Buffer>;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=mp4-assembler.d.ts.map
|