@norskvideo/norsk-studio-built-ins 1.11.6 → 1.12.0-2025-01-28-397642d6
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 +16 -0
- package/client/info.js +1402 -782
- package/client/output.whep/styles.css +9 -0
- package/client/style.css +520 -858
- package/lib/info.js +4 -8
- package/lib/info.js.map +1 -1
- package/lib/input.rtmp/info.js +2 -1
- package/lib/input.rtmp/info.js.map +1 -1
- package/lib/input.rtmp/runtime.d.ts +24 -5
- package/lib/input.rtmp/runtime.js +166 -60
- package/lib/input.rtmp/runtime.js.map +1 -1
- package/lib/input.rtmp/summary-view.d.ts +3 -5
- package/lib/input.rtmp/summary-view.js +26 -6
- package/lib/input.rtmp/summary-view.js.map +1 -1
- package/lib/input.rtmp/types.d.ts +133 -0
- package/lib/input.rtmp/types.js +3 -0
- package/lib/input.rtmp/types.js.map +1 -0
- package/lib/input.rtmp/types.yaml +99 -0
- package/lib/input.silence/info.js +3 -2
- package/lib/input.silence/info.js.map +1 -1
- package/lib/input.srt-caller/info.js +6 -5
- package/lib/input.srt-caller/info.js.map +1 -1
- package/lib/input.srt-caller/runtime.d.ts +1 -1
- package/lib/input.srt-listener/info.js +14 -6
- package/lib/input.srt-listener/info.js.map +1 -1
- package/lib/input.srt-listener/runtime.d.ts +42 -6
- package/lib/input.srt-listener/runtime.js +237 -57
- package/lib/input.srt-listener/runtime.js.map +1 -1
- package/lib/input.srt-listener/summary-view.d.ts +3 -5
- package/lib/input.srt-listener/summary-view.js +81 -5
- package/lib/input.srt-listener/summary-view.js.map +1 -1
- package/lib/input.srt-listener/types.d.ts +193 -0
- package/lib/input.srt-listener/types.js +3 -0
- package/lib/input.srt-listener/types.js.map +1 -0
- package/lib/input.srt-listener/types.yaml +145 -0
- package/lib/input.udp-ts/info.d.ts +1 -1
- package/lib/input.udp-ts/info.js +5 -4
- package/lib/input.udp-ts/info.js.map +1 -1
- package/lib/input.udp-ts/runtime.d.ts +1 -1
- package/lib/input.videoTestCard/info.d.ts +1 -1
- package/lib/input.videoTestCard/info.js +14 -4
- package/lib/input.videoTestCard/info.js.map +1 -1
- package/lib/output.autoCmaf/info.d.ts +2 -2
- package/lib/output.autoCmaf/info.js +65 -7
- package/lib/output.autoCmaf/info.js.map +1 -1
- package/lib/output.autoCmaf/runtime.d.ts +29 -9
- package/lib/output.autoCmaf/runtime.js +198 -60
- package/lib/output.autoCmaf/runtime.js.map +1 -1
- package/lib/output.autoCmaf/summary.js +26 -1
- package/lib/output.autoCmaf/summary.js.map +1 -1
- package/lib/output.autoCmaf/types.d.ts +101 -0
- package/lib/output.autoCmaf/types.js +3 -0
- package/lib/output.autoCmaf/types.js.map +1 -0
- package/lib/output.autoCmaf/types.yaml +28 -0
- package/lib/output.preview/info.js +5 -2
- package/lib/output.preview/info.js.map +1 -1
- package/lib/output.preview/inline-view.d.ts +2 -4
- package/lib/output.preview/inline-view.js +41 -7
- package/lib/output.preview/inline-view.js.map +1 -1
- package/lib/output.preview/runtime.d.ts +5 -3
- package/lib/output.preview/runtime.js +29 -18
- package/lib/output.preview/runtime.js.map +1 -1
- package/lib/output.rtmp/info.js +1 -0
- package/lib/output.rtmp/info.js.map +1 -1
- package/lib/output.rtmp/inline-view.js +2 -2
- package/lib/output.rtmp/runtime.d.ts +2 -2
- package/lib/output.rtmp/runtime.js.map +1 -1
- package/lib/output.srt/info.d.ts +2 -2
- package/lib/output.srt/info.js +26 -5
- package/lib/output.srt/info.js.map +1 -1
- package/lib/output.srt/runtime.d.ts +30 -5
- package/lib/output.srt/runtime.js +139 -5
- package/lib/output.srt/runtime.js.map +1 -1
- package/lib/output.srt/types.d.ts +101 -0
- package/lib/output.srt/types.js +3 -0
- package/lib/output.srt/types.js.map +1 -0
- package/lib/output.srt/types.yaml +31 -0
- package/lib/output.statistics/info.js +1 -0
- package/lib/output.statistics/info.js.map +1 -1
- package/lib/output.statistics/inline-view.js +3 -2
- package/lib/output.statistics/inline-view.js.map +1 -1
- package/lib/output.statistics/runtime.d.ts +1 -1
- package/lib/output.statistics/runtime.js.map +1 -1
- package/lib/output.udpTs/info.d.ts +1 -1
- package/lib/output.udpTs/info.js +4 -3
- package/lib/output.udpTs/info.js.map +1 -1
- package/lib/output.udpTs/runtime.d.ts +1 -1
- package/lib/output.whep/info.d.ts +2 -2
- package/lib/output.whep/info.js +50 -1
- package/lib/output.whep/info.js.map +1 -1
- package/lib/output.whep/inline-view.d.ts +4 -0
- package/lib/output.whep/inline-view.js +57 -0
- package/lib/output.whep/inline-view.js.map +1 -0
- package/lib/output.whep/runtime.d.ts +27 -5
- package/lib/output.whep/runtime.js +64 -13
- package/lib/output.whep/runtime.js.map +1 -1
- package/lib/output.whep/types.d.ts +101 -0
- package/lib/output.whep/types.js +3 -0
- package/lib/output.whep/types.js.map +1 -0
- package/lib/output.whep/types.yaml +30 -0
- package/lib/processor.browserOverlay/info.d.ts +2 -2
- package/lib/processor.browserOverlay/info.js +56 -2
- package/lib/processor.browserOverlay/info.js.map +1 -1
- package/lib/processor.browserOverlay/inline-view.d.ts +6 -0
- package/lib/processor.browserOverlay/inline-view.js +8 -0
- package/lib/processor.browserOverlay/inline-view.js.map +1 -0
- package/lib/processor.browserOverlay/runtime.d.ts +40 -6
- package/lib/processor.browserOverlay/runtime.js +151 -23
- package/lib/processor.browserOverlay/runtime.js.map +1 -1
- package/lib/processor.browserOverlay/summary-view.d.ts +4 -0
- package/lib/processor.browserOverlay/summary-view.js +27 -0
- package/lib/processor.browserOverlay/summary-view.js.map +1 -0
- package/lib/processor.browserOverlay/types.d.ts +174 -0
- package/lib/processor.browserOverlay/types.js +3 -0
- package/lib/processor.browserOverlay/types.js.map +1 -0
- package/lib/processor.browserOverlay/types.yaml +65 -0
- package/lib/processor.cascadingSwitch/info.js +4 -3
- package/lib/processor.cascadingSwitch/info.js.map +1 -1
- package/lib/processor.cascadingSwitch/inline-view.js +3 -3
- package/lib/processor.cascadingSwitch/runtime.d.ts +1 -1
- package/lib/processor.cascadingSwitch/runtime.js +2 -2
- package/lib/processor.cascadingSwitch/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/codec-editor.js +1 -1
- package/lib/processor.fixedLadder/codec-editor.js.map +1 -1
- package/lib/processor.fixedLadder/codec-view.js +1 -1
- package/lib/processor.fixedLadder/codec-view.js.map +1 -1
- package/lib/processor.fixedLadder/info.js +4 -2
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/rung-view.js +1 -1
- package/lib/processor.fixedLadder/rung-view.js.map +1 -1
- package/lib/processor.onscreenGraphic/image-selection.d.ts +9 -0
- package/lib/{processor.dynamicBug/bug-selection.js → processor.onscreenGraphic/image-selection.js} +10 -10
- package/lib/processor.onscreenGraphic/image-selection.js.map +1 -0
- package/lib/processor.onscreenGraphic/info.d.ts +3 -0
- package/lib/{processor.dynamicBug → processor.onscreenGraphic}/info.js +23 -16
- package/lib/processor.onscreenGraphic/info.js.map +1 -0
- package/lib/processor.onscreenGraphic/runtime.d.ts +91 -0
- package/lib/processor.onscreenGraphic/runtime.js +503 -0
- package/lib/processor.onscreenGraphic/runtime.js.map +1 -0
- package/lib/processor.onscreenGraphic/summary-view.d.ts +4 -0
- package/lib/processor.onscreenGraphic/summary-view.js +343 -0
- package/lib/processor.onscreenGraphic/summary-view.js.map +1 -0
- package/lib/processor.onscreenGraphic/types.d.ts +271 -0
- package/lib/processor.onscreenGraphic/types.js +3 -0
- package/lib/processor.onscreenGraphic/types.js.map +1 -0
- package/lib/processor.onscreenGraphic/types.yaml +211 -0
- package/lib/processor.streamKeyOverride/info.d.ts +3 -0
- package/lib/processor.streamKeyOverride/info.js +150 -0
- package/lib/processor.streamKeyOverride/info.js.map +1 -0
- package/lib/processor.streamKeyOverride/runtime.d.ts +54 -0
- package/lib/processor.streamKeyOverride/runtime.js +226 -0
- package/lib/processor.streamKeyOverride/runtime.js.map +1 -0
- package/lib/shared/drm/axinom.d.ts +2 -0
- package/lib/shared/drm/axinom.js +120 -0
- package/lib/shared/drm/axinom.js.map +1 -0
- package/lib/shared/drm/cpix.d.ts +24 -0
- package/lib/shared/drm/cpix.js +97 -0
- package/lib/shared/drm/cpix.js.map +1 -0
- package/lib/shared/drm/ezdrm.d.ts +2 -0
- package/lib/shared/drm/ezdrm.js +26 -0
- package/lib/shared/drm/ezdrm.js.map +1 -0
- package/lib/shared/srt-socket-options.js +6 -6
- package/lib/shared/srt-socket-options.js.map +1 -1
- package/lib/test/auto-cmaf.js +25 -17
- package/lib/test/auto-cmaf.js.map +1 -1
- package/lib/test/browser-overlay.js +1 -0
- package/lib/test/browser-overlay.js.map +1 -1
- package/lib/test/{dynamic-bug.js → onscreen-graphic.js} +139 -106
- package/lib/test/onscreen-graphic.js.map +1 -0
- package/lib/test/preview.js +3 -3
- package/lib/test/preview.js.map +1 -1
- package/lib/test/rtmp-input.js +6 -3
- package/lib/test/rtmp-input.js.map +1 -1
- package/lib/test/srt-input-caller.js +5 -5
- package/lib/test/srt-input-caller.js.map +1 -1
- package/lib/test/srt-input-listener.js +99 -18
- package/lib/test/srt-input-listener.js.map +1 -1
- package/lib/test/srt-output.js +2 -2
- package/lib/test/srt-output.js.map +1 -1
- package/lib/test/udp-output.js +2 -2
- package/lib/test/udp-output.js.map +1 -1
- package/lib/test/udp-ts-input.js +2 -2
- package/lib/test/udp-ts-input.js.map +1 -1
- package/lib/test/whep-output.js +8 -2
- package/lib/test/whep-output.js.map +1 -1
- package/lib/{util.latency → util.stats.latency}/info.js +2 -1
- package/lib/util.stats.latency/info.js.map +1 -0
- package/lib/util.stats.latency/inline-view.js.map +1 -0
- package/lib/{util.latency → util.stats.latency}/runtime.d.ts +1 -1
- package/lib/{util.latency → util.stats.latency}/runtime.js +2 -2
- package/lib/util.stats.latency/runtime.js.map +1 -0
- package/lib/util.stats.latency/source-node-selection.js.map +1 -0
- package/package.json +12 -5
- package/lib/processor.dynamicBug/bug-selection.d.ts +0 -9
- package/lib/processor.dynamicBug/bug-selection.js.map +0 -1
- package/lib/processor.dynamicBug/info.d.ts +0 -3
- package/lib/processor.dynamicBug/info.js.map +0 -1
- package/lib/processor.dynamicBug/runtime.d.ts +0 -64
- package/lib/processor.dynamicBug/runtime.js +0 -297
- package/lib/processor.dynamicBug/runtime.js.map +0 -1
- package/lib/processor.dynamicBug/summary-view.d.ts +0 -4
- package/lib/processor.dynamicBug/summary-view.js +0 -60
- package/lib/processor.dynamicBug/summary-view.js.map +0 -1
- package/lib/processor.whisper-transcribe/info.d.ts +0 -3
- package/lib/processor.whisper-transcribe/info.js +0 -43
- package/lib/processor.whisper-transcribe/info.js.map +0 -1
- package/lib/processor.whisper-transcribe/runtime.d.ts +0 -29
- package/lib/processor.whisper-transcribe/runtime.js +0 -83
- package/lib/processor.whisper-transcribe/runtime.js.map +0 -1
- package/lib/test/dynamic-bug.js.map +0 -1
- package/lib/util.latency/info.js.map +0 -1
- package/lib/util.latency/inline-view.js.map +0 -1
- package/lib/util.latency/runtime.js.map +0 -1
- package/lib/util.latency/source-node-selection.js.map +0 -1
- package/lib/util.ma35d/info.d.ts +0 -3
- package/lib/util.ma35d/info.js +0 -78
- package/lib/util.ma35d/info.js.map +0 -1
- package/lib/util.ma35d/inline-view.d.ts +0 -6
- package/lib/util.ma35d/inline-view.js +0 -76
- package/lib/util.ma35d/inline-view.js.map +0 -1
- package/lib/util.ma35d/runtime.d.ts +0 -21
- package/lib/util.ma35d/runtime.js +0 -49
- package/lib/util.ma35d/runtime.js.map +0 -1
- package/lib/util.timestamps/info.d.ts +0 -5
- package/lib/util.timestamps/info.js +0 -86
- package/lib/util.timestamps/info.js.map +0 -1
- package/lib/util.timestamps/inline-view.d.ts +0 -6
- package/lib/util.timestamps/inline-view.js +0 -94
- package/lib/util.timestamps/inline-view.js.map +0 -1
- package/lib/util.timestamps/runtime.d.ts +0 -29
- package/lib/util.timestamps/runtime.js +0 -40
- package/lib/util.timestamps/runtime.js.map +0 -1
- /package/lib/test/{dynamic-bug.d.ts → onscreen-graphic.d.ts} +0 -0
- /package/lib/{util.latency → util.stats.latency}/info.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/inline-view.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/inline-view.js +0 -0
- /package/lib/{util.latency → util.stats.latency}/source-node-selection.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/source-node-selection.js +0 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: RTMP Input Component
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
paths:
|
7
|
+
/disconnect:
|
8
|
+
post:
|
9
|
+
summary: Disconnect an RTMP stream
|
10
|
+
description: Disconnects an active RTMP stream by stream name
|
11
|
+
x-route-type: instance
|
12
|
+
requestBody:
|
13
|
+
description: The stream to disconnect
|
14
|
+
content:
|
15
|
+
application/json:
|
16
|
+
schema:
|
17
|
+
type: object
|
18
|
+
required: ['streamName']
|
19
|
+
properties:
|
20
|
+
streamName:
|
21
|
+
type: string
|
22
|
+
description: The name of the stream to disconnect
|
23
|
+
example: camera1
|
24
|
+
responses:
|
25
|
+
204:
|
26
|
+
description: The stream was successfully disconnected
|
27
|
+
404:
|
28
|
+
description: The specified stream was not found
|
29
|
+
content:
|
30
|
+
application/json:
|
31
|
+
schema:
|
32
|
+
type: object
|
33
|
+
properties:
|
34
|
+
error:
|
35
|
+
type: string
|
36
|
+
description: A description of the error
|
37
|
+
details:
|
38
|
+
type: string
|
39
|
+
description: Additional error details
|
40
|
+
500:
|
41
|
+
description: Failed to disconnect the stream
|
42
|
+
content:
|
43
|
+
application/json:
|
44
|
+
schema:
|
45
|
+
type: object
|
46
|
+
properties:
|
47
|
+
error:
|
48
|
+
type: string
|
49
|
+
description: A description of the error
|
50
|
+
details:
|
51
|
+
type: string
|
52
|
+
description: Additional error details
|
53
|
+
|
54
|
+
/reconnect:
|
55
|
+
post:
|
56
|
+
summary: Reconnect to an RTMP stream
|
57
|
+
description: Reconnects a previously disconnected RTMP stream
|
58
|
+
x-route-type: instance
|
59
|
+
requestBody:
|
60
|
+
description: The stream to reconnect
|
61
|
+
content:
|
62
|
+
application/json:
|
63
|
+
schema:
|
64
|
+
type: object
|
65
|
+
required: ['streamName']
|
66
|
+
properties:
|
67
|
+
streamName:
|
68
|
+
type: string
|
69
|
+
description: The name of the stream to reconnect
|
70
|
+
example: camera1
|
71
|
+
responses:
|
72
|
+
204:
|
73
|
+
description: The stream was successfully reconnected
|
74
|
+
400:
|
75
|
+
description: Stream is already connected or invalid request
|
76
|
+
content:
|
77
|
+
application/json:
|
78
|
+
schema:
|
79
|
+
type: object
|
80
|
+
properties:
|
81
|
+
error:
|
82
|
+
type: string
|
83
|
+
description: A description of the error
|
84
|
+
details:
|
85
|
+
type: string
|
86
|
+
description: Additional error details
|
87
|
+
500:
|
88
|
+
description: Failed to reconnect stream
|
89
|
+
content:
|
90
|
+
application/json:
|
91
|
+
schema:
|
92
|
+
type: object
|
93
|
+
properties:
|
94
|
+
error:
|
95
|
+
type: string
|
96
|
+
description: A description of the error
|
97
|
+
details:
|
98
|
+
type: string
|
99
|
+
description: Additional error details
|
@@ -6,6 +6,7 @@ function default_1({ defineComponent, Audio }) {
|
|
6
6
|
identifier: 'input.silence',
|
7
7
|
category: 'input',
|
8
8
|
name: "Silence Generator",
|
9
|
+
description: "A component that produces silent audio streams with configurable sample rate and channel layout.",
|
9
10
|
subscription: {
|
10
11
|
produces: {
|
11
12
|
type: "single-stream",
|
@@ -14,14 +15,14 @@ function default_1({ defineComponent, Audio }) {
|
|
14
15
|
},
|
15
16
|
display: (desc) => {
|
16
17
|
return {
|
17
|
-
sampleRate: desc.config.sampleRate.toString() + "
|
18
|
+
sampleRate: desc.config.sampleRate.toString() + "Hz",
|
18
19
|
channelLayout: desc.config.channelLayout.toString()
|
19
20
|
};
|
20
21
|
},
|
21
22
|
configForm: {
|
22
23
|
form: {
|
23
24
|
sampleRate: {
|
24
|
-
help: "Samplerate in
|
25
|
+
help: "Samplerate in Hz of the generated audio",
|
25
26
|
hint: {
|
26
27
|
type: 'select', options: [
|
27
28
|
{ value: 48000, display: "48000" },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.silence/info.ts"],"names":[],"mappings":";;AAGA,
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.silence/info.ts"],"names":[],"mappings":";;AAGA,4BA2CC;AA3CD,mBAAwB,EAAE,eAAe,EAAE,KAAK,EAAgB;IAC9D,OAAO,eAAe,CAAgB;QACpC,UAAU,EAAE,eAAe;QAC3B,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,kGAAkG;QAC/G,YAAY,EAAE;YACZ,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,KAAK;aACb;SACF;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO;gBACL,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,IAAI;gBACpD,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE;aACpD,CAAA;QACH,CAAC;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,UAAU,EAAE;oBACV,IAAI,EAAE,yCAAyC;oBAC/C,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;4BACvB,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;4BAClC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;yBACnC;wBACD,YAAY,EAAE,KAAK;qBACpB;iBACF;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,uCAAuC;oBAC7C,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;4BACvB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;4BAClC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;yBACvC;wBACD,YAAY,EAAE,QAAQ;qBACvB;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -30,7 +30,7 @@ exports.default = default_1;
|
|
30
30
|
const srt_socket_options_1 = __importDefault(require("../shared/srt-socket-options"));
|
31
31
|
const react_1 = __importDefault(require("react"));
|
32
32
|
function default_1({ defineComponent, Av, validation: validation }) {
|
33
|
-
const { Port,
|
33
|
+
const { Port, Hostname, SourceName, SrtPassphrase, SrtStreamId } = validation;
|
34
34
|
const SocketConfiguration = react_1.default.lazy(async () => {
|
35
35
|
const views = await Promise.resolve().then(() => __importStar(require('../shared/srt-form-views')));
|
36
36
|
return { default: views.SocketConfiguration };
|
@@ -39,6 +39,7 @@ function default_1({ defineComponent, Av, validation: validation }) {
|
|
39
39
|
identifier: 'input.srt-caller',
|
40
40
|
category: 'input',
|
41
41
|
name: "SRT Ingest (Caller)",
|
42
|
+
description: "This component allows you to receive Secure Reliable Transport (SRT) streams by calling a remote SRT listener.",
|
42
43
|
subscription: {
|
43
44
|
accepts: undefined,
|
44
45
|
produces: {
|
@@ -49,16 +50,16 @@ function default_1({ defineComponent, Av, validation: validation }) {
|
|
49
50
|
display: (desc) => {
|
50
51
|
return {
|
51
52
|
port: desc.config.port.toString(),
|
52
|
-
ip: desc.config.
|
53
|
+
ip: desc.config.host
|
53
54
|
};
|
54
55
|
},
|
55
56
|
configForm: {
|
56
57
|
form: {
|
57
58
|
port: { help: "The port this SRT input will connect to", hint: { type: 'numeric', validation: Port, defaultValue: 5001 } },
|
58
|
-
|
59
|
+
host: { help: "The IP address/hostname this SRT input will connect to", hint: { type: 'text', validation: Hostname, defaultValue: "0.0.0.0" } },
|
59
60
|
sourceName: { help: "Source name to identify this by", hint: { type: 'text', validation: SourceName, defaultValue: "camera1" } },
|
60
|
-
passphrase: { help: "Optional: Authentication for this SRT input", hint: { type: 'text', validation: SrtPassphrase } },
|
61
|
-
streamId: { help: "Optional: StreamId to use when calling the remote listener", hint: { type: 'text', validation: SrtStreamId } },
|
61
|
+
passphrase: { help: "Optional: Authentication for this SRT input", hint: { type: 'text', optional: true, validation: SrtPassphrase } },
|
62
|
+
streamId: { help: "Optional: StreamId to use when calling the remote listener", hint: { type: 'text', optional: true, validation: SrtStreamId } },
|
62
63
|
socketOptions: {
|
63
64
|
help: "Socket Options",
|
64
65
|
hint: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.srt-caller/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.srt-caller/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4BA+CC;AAnDD,sFAA4D;AAE5D,kDAA0B;AAE1B,mBAAwB,EACtB,eAAe,EACf,EAAE,EACF,UAAU,EAAE,UAAU,EACT;IACb,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;IAC9E,MAAM,mBAAmB,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QAChD,MAAM,KAAK,GAAG,wDAAa,0BAA0B,GAAC,CAAA;QACtD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,mBAAmB,EAAE,CAAA;IAC/C,CAAC,CAAC,CAAC;IACH,OAAO,eAAe,CACpB;QACE,UAAU,EAAE,kBAAkB;QAC9B,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,gHAAgH;QAC7H,YAAY,EAAE;YACZ,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;aACV;SACF;QACD,OAAO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Settings } from '@norskvideo/norsk-sdk';
|
|
2
2
|
import { SocketOptions } from '../shared/srt-types';
|
3
3
|
import { SimpleInputWrapper } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
4
|
import { OnCreated, ServerComponentDefinition, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
5
|
-
export type SrtInputSettings = Pick<SdkSettings, 'port' | '
|
5
|
+
export type SrtInputSettings = Pick<SdkSettings, 'port' | 'host' | 'sourceName' | 'passphrase' | 'streamId'> & {
|
6
6
|
id: string;
|
7
7
|
displayName: string;
|
8
8
|
socketOptions: SocketOptions;
|
@@ -32,7 +32,7 @@ const InlineView = react_1.default.lazy(async () => Promise.resolve().then(() =>
|
|
32
32
|
const SummaryView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./summary-view'))));
|
33
33
|
const srt_socket_options_1 = __importDefault(require("../shared/srt-socket-options"));
|
34
34
|
function default_1({ defineComponent, Av, validation }) {
|
35
|
-
const { Z, Port,
|
35
|
+
const { Z, Port, Hostname, SourceName, SrtPassphrase, unique } = validation;
|
36
36
|
const SocketConfiguration = react_1.default.lazy(async () => {
|
37
37
|
const views = await Promise.resolve().then(() => __importStar(require('../shared/srt-form-views')));
|
38
38
|
return { default: views.SocketConfiguration };
|
@@ -41,6 +41,7 @@ function default_1({ defineComponent, Av, validation }) {
|
|
41
41
|
identifier: 'input.srt-listener',
|
42
42
|
category: 'input',
|
43
43
|
name: "SRT Ingest (Listener)",
|
44
|
+
description: "This component handles media ingest via the SRT(Secure Reliable Transport) protocol. It acts as a listener, receiving media streams from remote SRT sources and is highly configurable, allowing for custom IP addresses, ports, and stream handling behaviours.",
|
44
45
|
subscription: {
|
45
46
|
accepts: undefined,
|
46
47
|
produces: {
|
@@ -61,11 +62,11 @@ function default_1({ defineComponent, Av, validation }) {
|
|
61
62
|
display: (desc) => {
|
62
63
|
return {
|
63
64
|
port: desc.config.port.toString(),
|
64
|
-
ip: desc.config.
|
65
|
+
ip: desc.config.host
|
65
66
|
};
|
66
67
|
},
|
67
68
|
runtime: {
|
68
|
-
initialState: () => ({ connectedStreams: [] }),
|
69
|
+
initialState: () => ({ connectedStreams: [], disabledStreams: [] }),
|
69
70
|
handleEvent(ev, state) {
|
70
71
|
const evType = ev.type;
|
71
72
|
switch (evType) {
|
@@ -75,6 +76,12 @@ function default_1({ defineComponent, Av, validation }) {
|
|
75
76
|
case "source-disconnected":
|
76
77
|
state.connectedStreams = state.connectedStreams.filter((streamId) => streamId !== ev.streamId);
|
77
78
|
break;
|
79
|
+
case "source-enabled":
|
80
|
+
state.disabledStreams = state.disabledStreams.filter((streamId) => streamId !== ev.streamId);
|
81
|
+
break;
|
82
|
+
case "source-disabled":
|
83
|
+
state.disabledStreams.push(ev.streamId);
|
84
|
+
break;
|
78
85
|
default:
|
79
86
|
assertUnreachable(evType);
|
80
87
|
}
|
@@ -94,11 +101,11 @@ function default_1({ defineComponent, Av, validation }) {
|
|
94
101
|
envOverride: true
|
95
102
|
}
|
96
103
|
},
|
97
|
-
|
98
|
-
help: "The IP address this SRT input will listen on",
|
104
|
+
host: {
|
105
|
+
help: "The IP address/hostname this SRT input will listen on",
|
99
106
|
hint: {
|
100
107
|
type: 'text',
|
101
|
-
validation:
|
108
|
+
validation: Hostname,
|
102
109
|
defaultValue: "0.0.0.0",
|
103
110
|
envOverride: true
|
104
111
|
}
|
@@ -107,6 +114,7 @@ function default_1({ defineComponent, Av, validation }) {
|
|
107
114
|
help: "Optional: Authentication for this SRT input",
|
108
115
|
hint: {
|
109
116
|
type: 'text',
|
117
|
+
optional: true,
|
110
118
|
validation: SrtPassphrase,
|
111
119
|
envOverride: true,
|
112
120
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.srt-listener/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.srt-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C3B;iBACF;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,sDAAsD;oBAC5D,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,YAAY,EAAE,CAAC,SAAS,CAAC;wBACzB,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;wBAC/B,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC;qBAC7B;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACP,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { Norsk, SrtInputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
|
1
|
+
import { Norsk, SrtInputSettings as SdkSettings, SrtInputNode } from '@norskvideo/norsk-sdk';
|
2
2
|
import { SocketOptions } from '../shared/srt-types';
|
3
|
-
import {
|
4
|
-
|
5
|
-
export type SrtInputSettings = Pick<SdkSettings, 'port' | 'ip' | 'passphrase'> & {
|
3
|
+
import { CreatedMediaNode, InstanceRouteInfo, OnCreated, RelatedMediaNodes, RuntimeUpdates, ServerComponentDefinition, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
4
|
+
export type SrtInputSettings = Pick<SdkSettings, 'port' | 'host' | 'passphrase'> & {
|
6
5
|
id: string;
|
7
6
|
displayName: string;
|
8
7
|
sourceNames: 'permissive' | 'strict';
|
@@ -11,6 +10,7 @@ export type SrtInputSettings = Pick<SdkSettings, 'port' | 'ip' | 'passphrase'> &
|
|
11
10
|
};
|
12
11
|
export type SrtInputState = {
|
13
12
|
connectedStreams: string[];
|
13
|
+
disabledStreams: string[];
|
14
14
|
};
|
15
15
|
export type SrtInputEvent = {
|
16
16
|
type: "source-connected";
|
@@ -18,7 +18,43 @@ export type SrtInputEvent = {
|
|
18
18
|
} | {
|
19
19
|
type: "source-disconnected";
|
20
20
|
streamId: string;
|
21
|
+
} | {
|
22
|
+
type: "source-enabled";
|
23
|
+
streamId: string;
|
24
|
+
} | {
|
25
|
+
type: "source-disabled";
|
26
|
+
streamId: string;
|
27
|
+
};
|
28
|
+
export type SrtInputCommand = {
|
29
|
+
type: "disable-source";
|
30
|
+
streamId: string;
|
31
|
+
} | {
|
32
|
+
type: "enable-source";
|
33
|
+
streamId: string;
|
34
|
+
} | {
|
35
|
+
type: "reset-source";
|
36
|
+
streamId: string;
|
21
37
|
};
|
22
|
-
export
|
23
|
-
|
38
|
+
export declare class SrtInput implements CreatedMediaNode {
|
39
|
+
id: string;
|
40
|
+
relatedMediaNodes: RelatedMediaNodes;
|
41
|
+
norsk: Norsk;
|
42
|
+
cfg: SrtInputSettings;
|
43
|
+
activeStreams: Map<string, number>;
|
44
|
+
disabledStreams: Set<string>;
|
45
|
+
initialised: Promise<void>;
|
46
|
+
srtServer: SrtInputNode | null;
|
47
|
+
updates: RuntimeUpdates<SrtInputState, SrtInputCommand, SrtInputEvent>;
|
48
|
+
nodeCounter: number;
|
49
|
+
static create(norsk: Norsk, cfg: SrtInputSettings, updates: RuntimeUpdates<SrtInputState, SrtInputCommand, SrtInputEvent>): Promise<SrtInput>;
|
50
|
+
constructor(norsk: Norsk, cfg: SrtInputSettings, updates: RuntimeUpdates<SrtInputState, SrtInputCommand, SrtInputEvent>);
|
51
|
+
initialise(): Promise<void>;
|
52
|
+
enableSource(streamId: string): Promise<void>;
|
53
|
+
disableSource(streamId: string): Promise<void>;
|
54
|
+
resetSource(streamId: string): Promise<void>;
|
55
|
+
}
|
56
|
+
export default class SrtInputDefinition implements ServerComponentDefinition<SrtInputSettings, SrtInput, SrtInputState, SrtInputCommand> {
|
57
|
+
create(norsk: Norsk, cfg: SrtInputSettings, cb: OnCreated<SrtInput>, runtime: StudioRuntime<SrtInputState, SrtInputCommand, SrtInputEvent>): Promise<void>;
|
58
|
+
handleCommand(node: SrtInput, command: SrtInputCommand): Promise<void>;
|
59
|
+
instanceRoutes(): Promise<InstanceRouteInfo<SrtInputSettings, SrtInput, SrtInputState, SrtInputCommand>[]>;
|
24
60
|
}
|
@@ -1,74 +1,254 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
6
|
+
exports.SrtInput = void 0;
|
7
|
+
const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
|
4
8
|
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
5
9
|
const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
10
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
11
|
+
const json_refs_1 = require("json-refs");
|
12
|
+
const path_1 = __importDefault(require("path"));
|
13
|
+
const yaml_1 = __importDefault(require("yaml"));
|
14
|
+
class SrtInput {
|
15
|
+
id;
|
16
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
17
|
+
norsk;
|
18
|
+
cfg;
|
19
|
+
activeStreams = new Map();
|
20
|
+
disabledStreams = new Set();
|
21
|
+
initialised;
|
22
|
+
srtServer = null;
|
23
|
+
updates;
|
24
|
+
nodeCounter = 0;
|
25
|
+
static async create(norsk, cfg, updates) {
|
26
|
+
const node = new SrtInput(norsk, cfg, updates);
|
27
|
+
await node.initialised;
|
28
|
+
return node;
|
29
|
+
}
|
30
|
+
constructor(norsk, cfg, updates) {
|
31
|
+
this.cfg = cfg;
|
32
|
+
this.id = cfg.id;
|
33
|
+
this.norsk = norsk;
|
34
|
+
this.updates = updates;
|
35
|
+
this.initialised = this.initialise();
|
36
|
+
}
|
37
|
+
async initialise() {
|
38
|
+
this.srtServer = await this.norsk.input.srt({
|
39
|
+
mode: 'listener',
|
40
|
+
sourceName: 'unused',
|
41
|
+
id: `${this.cfg.id}-srt-listener`,
|
42
|
+
port: this.cfg.port,
|
43
|
+
host: this.cfg.host,
|
44
|
+
passphrase: this.cfg.passphrase,
|
45
|
+
onConnectionStatusChange: (status, sourceName) => {
|
46
|
+
switch (status) {
|
47
|
+
case 'disconnected':
|
48
|
+
if (sourceName) {
|
49
|
+
(0, logging_1.debuglog)("Stream with source name has disconnected, clearing it ", { sourceName });
|
50
|
+
this.activeStreams.delete(sourceName);
|
51
|
+
this.updates.raiseEvent({ type: "source-disconnected", streamId: sourceName });
|
43
52
|
}
|
44
|
-
|
45
|
-
|
46
|
-
|
53
|
+
break;
|
54
|
+
default:
|
55
|
+
(0, util_1.assertUnreachable)(status);
|
56
|
+
}
|
57
|
+
},
|
58
|
+
onConnection: (streamId, index, remoteHost) => {
|
59
|
+
if (this.disabledStreams.has(streamId)) {
|
60
|
+
(0, logging_1.debuglog)("Rejecting connection as stream is presently disabled", { count: index, remoteHost });
|
61
|
+
return {
|
62
|
+
accept: false
|
63
|
+
};
|
64
|
+
}
|
65
|
+
if (this.cfg.sourceNames == 'permissive') {
|
66
|
+
if (this.cfg.streamIds.includes(streamId) && !this.activeStreams.has(streamId)) {
|
67
|
+
(0, logging_1.debuglog)("Accepting SRT connection", { streamId, remoteHost });
|
68
|
+
this.activeStreams.set(streamId, index);
|
69
|
+
this.updates.raiseEvent({ type: "source-connected", streamId });
|
47
70
|
return {
|
48
71
|
accept: true,
|
49
|
-
sourceName:
|
72
|
+
sourceName: streamId
|
50
73
|
};
|
51
74
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
activeStreams.set(streamId, index);
|
56
|
-
return {
|
57
|
-
accept: true,
|
58
|
-
sourceName: streamId
|
59
|
-
};
|
60
|
-
}
|
61
|
-
(0, logging_1.debuglog)("Rejecting connection with unknown streamId", { streamId, remoteHost });
|
75
|
+
const streamName = this.cfg.streamIds.find((s) => !this.activeStreams.has(s));
|
76
|
+
if (!streamName) {
|
77
|
+
(0, logging_1.debuglog)("Rejecting connection as no stream ids left to assign", { count: index, remoteHost });
|
62
78
|
return {
|
63
79
|
accept: false
|
64
80
|
};
|
65
81
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
82
|
+
(0, logging_1.debuglog)("Accepting SRT connection", { streamName, remoteHost });
|
83
|
+
this.updates.raiseEvent({ type: "source-connected", streamId: streamName });
|
84
|
+
this.activeStreams.set(streamName, index);
|
85
|
+
return {
|
86
|
+
accept: true,
|
87
|
+
sourceName: streamName
|
88
|
+
};
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
if (this.activeStreams.has(streamId)) {
|
92
|
+
(0, logging_1.debuglog)("Rejecting SRT connection because streamId already is connected", { streamId, remoteHost });
|
93
|
+
return {
|
94
|
+
accept: false,
|
95
|
+
};
|
96
|
+
}
|
97
|
+
if (this.cfg.streamIds.includes(streamId)) {
|
98
|
+
(0, logging_1.debuglog)("Accepting SRT connection", { streamId, remoteHost });
|
99
|
+
this.updates.raiseEvent({ type: "source-connected", streamId });
|
100
|
+
this.activeStreams.set(streamId, index);
|
101
|
+
return {
|
102
|
+
accept: true,
|
103
|
+
sourceName: streamId
|
104
|
+
};
|
105
|
+
}
|
106
|
+
(0, logging_1.debuglog)("Rejecting connection with unknown streamId", { streamId, remoteHost });
|
107
|
+
return {
|
108
|
+
accept: false
|
109
|
+
};
|
110
|
+
}
|
111
|
+
},
|
112
|
+
onClose: () => {
|
113
|
+
},
|
114
|
+
onCreate: (node) => {
|
115
|
+
this.relatedMediaNodes.addOutput(node);
|
116
|
+
}
|
69
117
|
});
|
70
|
-
|
71
|
-
|
118
|
+
}
|
119
|
+
async enableSource(streamId) {
|
120
|
+
this.disabledStreams.delete(streamId);
|
121
|
+
this.updates.raiseEvent({
|
122
|
+
type: 'source-enabled',
|
123
|
+
streamId
|
124
|
+
});
|
125
|
+
}
|
126
|
+
async disableSource(streamId) {
|
127
|
+
this.disabledStreams.add(streamId);
|
128
|
+
await this.resetSource(streamId);
|
129
|
+
this.updates.raiseEvent({
|
130
|
+
type: 'source-disabled',
|
131
|
+
streamId
|
132
|
+
});
|
133
|
+
}
|
134
|
+
async resetSource(streamId) {
|
135
|
+
if (this.srtServer) {
|
136
|
+
const index = this.activeStreams.get(streamId);
|
137
|
+
if (index !== undefined) {
|
138
|
+
this.srtServer.closeStream(index);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
exports.SrtInput = SrtInput;
|
144
|
+
function coreInfo(path, op) {
|
145
|
+
return {
|
146
|
+
url: path,
|
147
|
+
summary: op.summary,
|
148
|
+
description: op.description,
|
149
|
+
requestBody: op.requestBody,
|
150
|
+
responses: op.responses,
|
151
|
+
};
|
152
|
+
}
|
153
|
+
function post(path, paths) {
|
154
|
+
return {
|
155
|
+
...coreInfo(path, paths[path]['post']),
|
156
|
+
method: 'POST',
|
157
|
+
};
|
158
|
+
}
|
159
|
+
class SrtInputDefinition {
|
160
|
+
async create(norsk, cfg, cb, runtime) {
|
161
|
+
const node = await SrtInput.create(norsk, cfg, runtime.updates);
|
162
|
+
cb(node);
|
163
|
+
}
|
164
|
+
async handleCommand(node, command) {
|
165
|
+
const commandType = command.type;
|
166
|
+
switch (commandType) {
|
167
|
+
case 'disable-source':
|
168
|
+
await node.disableSource(command.streamId);
|
169
|
+
break;
|
170
|
+
case 'enable-source':
|
171
|
+
await node.enableSource(command.streamId);
|
172
|
+
break;
|
173
|
+
case 'reset-source':
|
174
|
+
await node.resetSource(command.streamId);
|
175
|
+
break;
|
176
|
+
default:
|
177
|
+
(0, util_1.assertUnreachable)(commandType);
|
178
|
+
}
|
179
|
+
}
|
180
|
+
async instanceRoutes() {
|
181
|
+
const types = await promises_1.default.readFile(path_1.default.join(__dirname, 'types.yaml'));
|
182
|
+
const root = yaml_1.default.parse(types.toString());
|
183
|
+
const resolved = await (0, json_refs_1.resolveRefs)(root, {}).then((r) => r.resolved);
|
184
|
+
const paths = resolved.paths;
|
185
|
+
return [
|
186
|
+
{
|
187
|
+
...post('/disconnect', paths),
|
188
|
+
handler: ({ runtime }) => async (req, res) => {
|
189
|
+
try {
|
190
|
+
const { streamId } = req.body;
|
191
|
+
if (!streamId) {
|
192
|
+
return res.status(400).json({ error: 'Stream name is required' });
|
193
|
+
}
|
194
|
+
const state = runtime.updates.latest();
|
195
|
+
(0, logging_1.infolog)("Current state during disconnect:", state);
|
196
|
+
if (!state.connectedStreams.includes(streamId)) {
|
197
|
+
return res.status(404).json({ error: 'Stream not found or not connected' });
|
198
|
+
}
|
199
|
+
runtime.updates.sendCommand({
|
200
|
+
type: 'reset-source',
|
201
|
+
streamId
|
202
|
+
});
|
203
|
+
res.status(204).send();
|
204
|
+
}
|
205
|
+
catch (error) {
|
206
|
+
(0, logging_1.errorlog)('Error in disconnect handler:', error);
|
207
|
+
res.status(500).json({ error: 'Failed to disconnect stream' });
|
208
|
+
}
|
209
|
+
}
|
210
|
+
},
|
211
|
+
{
|
212
|
+
...post('/enable', paths),
|
213
|
+
handler: ({ runtime }) => async (req, res) => {
|
214
|
+
try {
|
215
|
+
const { streamId } = req.body;
|
216
|
+
if (!streamId) {
|
217
|
+
return res.status(400).json({ error: 'Stream name is required' });
|
218
|
+
}
|
219
|
+
runtime.updates.sendCommand({
|
220
|
+
type: 'enable-source',
|
221
|
+
streamId
|
222
|
+
});
|
223
|
+
res.status(204).send();
|
224
|
+
}
|
225
|
+
catch (error) {
|
226
|
+
console.error('Error in disconnect handler:', error);
|
227
|
+
res.status(500).json({ error: 'Failed to disconnect stream' });
|
228
|
+
}
|
229
|
+
}
|
230
|
+
},
|
231
|
+
{
|
232
|
+
...post('/disable', paths),
|
233
|
+
handler: ({ runtime }) => async (req, res) => {
|
234
|
+
try {
|
235
|
+
const { streamId } = req.body;
|
236
|
+
if (!streamId) {
|
237
|
+
return res.status(400).json({ error: 'Stream name is required' });
|
238
|
+
}
|
239
|
+
runtime.updates.sendCommand({
|
240
|
+
type: 'disable-source',
|
241
|
+
streamId
|
242
|
+
});
|
243
|
+
res.status(204).send();
|
244
|
+
}
|
245
|
+
catch (error) {
|
246
|
+
console.error('Error in disconnect handler:', error);
|
247
|
+
res.status(500).json({ error: 'Failed to disconnect stream' });
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
];
|
72
252
|
}
|
73
253
|
}
|
74
254
|
exports.default = SrtInputDefinition;
|