@norskvideo/norsk-studio-built-ins 1.12.0-2025-02-13-2521ce04 → 1.12.0-2025-02-14-b31b432d
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/client/info.js +48 -8
- package/client/output.preview/styles.css +69 -69
- package/client/style.css +28 -0
- package/lib/output.preview/info.d.ts +5 -2
- package/lib/output.preview/info.js +16 -2
- package/lib/output.preview/info.js.map +1 -1
- package/lib/output.preview/inline-view.js +29 -5
- package/lib/output.preview/inline-view.js.map +1 -1
- package/lib/output.preview/runtime.d.ts +16 -13
- package/lib/output.preview/runtime.js +112 -30
- package/lib/output.preview/runtime.js.map +1 -1
- package/lib/output.preview/types.d.ts +56 -0
- package/lib/output.preview/types.js +3 -0
- package/lib/output.preview/types.js.map +1 -0
- package/lib/output.preview/types.yaml +37 -0
- package/lib/processor.browserOverlay/runtime.js +6 -26
- package/lib/processor.browserOverlay/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/info.d.ts +32 -6
- package/lib/processor.fixedLadder/info.js +4 -1
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/runtime.d.ts +12 -30
- package/lib/processor.fixedLadder/runtime.js +1 -1
- package/lib/processor.fixedLadder/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/types.d.ts +114 -0
- package/lib/processor.fixedLadder/types.js +3 -0
- package/lib/processor.fixedLadder/types.js.map +1 -0
- package/lib/processor.fixedLadder/types.yaml +244 -0
- package/lib/processor.onscreenGraphic/runtime.js +7 -33
- package/lib/processor.onscreenGraphic/runtime.js.map +1 -1
- package/lib/shared/api.d.ts +35 -0
- package/lib/shared/api.js +34 -0
- package/lib/shared/api.js.map +1 -0
- package/lib/test/preview.js +69 -64
- package/lib/test/preview.js.map +1 -1
- package/package.json +3 -3
package/client/info.js
CHANGED
@@ -642,6 +642,16 @@ function InlineView6({ state, config, raise }) {
|
|
642
642
|
video.remove();
|
643
643
|
});
|
644
644
|
};
|
645
|
+
const [loadedImage, setLoadedImage] = (0, import_react6.useState)(void 0);
|
646
|
+
(0, import_react6.useEffect)(() => {
|
647
|
+
const container = document.getElementById(`preview-${id}`) ?? void 0;
|
648
|
+
if (!container)
|
649
|
+
return;
|
650
|
+
container.innerHTML = "";
|
651
|
+
if (loadedImage) {
|
652
|
+
container.appendChild(loadedImage);
|
653
|
+
}
|
654
|
+
}, [loadedImage]);
|
645
655
|
(0, import_react6.useEffect)(() => {
|
646
656
|
if (!url || !showPreview) {
|
647
657
|
if (client) {
|
@@ -650,11 +660,24 @@ function InlineView6({ state, config, raise }) {
|
|
650
660
|
}
|
651
661
|
return;
|
652
662
|
}
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
663
|
+
if (config.previewMode == "image") {
|
664
|
+
const container = document.getElementById(`preview-${id}`) ?? void 0;
|
665
|
+
if (!container)
|
666
|
+
return;
|
667
|
+
const img = document.createElement("img");
|
668
|
+
img.width = 420;
|
669
|
+
img.height = 236;
|
670
|
+
img.onload = () => {
|
671
|
+
setLoadedImage(img);
|
672
|
+
};
|
673
|
+
img.src = url;
|
674
|
+
} else {
|
675
|
+
const newClient = createClient(url);
|
676
|
+
setClient(newClient);
|
677
|
+
return () => {
|
678
|
+
cleanupClient(newClient);
|
679
|
+
};
|
680
|
+
}
|
658
681
|
}, [state.url, showPreview]);
|
659
682
|
(0, import_react6.useEffect)(() => {
|
660
683
|
setShowPreview(config.showPreview ?? true);
|
@@ -16824,6 +16847,9 @@ function info_default9(R) {
|
|
16824
16847
|
case "audio-levels":
|
16825
16848
|
state.levels = ev.levels;
|
16826
16849
|
break;
|
16850
|
+
case "source-lost":
|
16851
|
+
state = {};
|
16852
|
+
break;
|
16827
16853
|
default:
|
16828
16854
|
assertUnreachable4(evType);
|
16829
16855
|
}
|
@@ -16837,9 +16863,20 @@ function info_default9(R) {
|
|
16837
16863
|
hardware: (0, import_config2.HardwareSelection)()
|
16838
16864
|
},
|
16839
16865
|
form: {
|
16840
|
-
|
16841
|
-
|
16866
|
+
previewMode: {
|
16867
|
+
help: "How to display the video",
|
16868
|
+
hint: {
|
16869
|
+
type: "select",
|
16870
|
+
defaultValue: "image",
|
16871
|
+
options: [
|
16872
|
+
{ value: "video_encode", display: "WebRTC (Re-Encode)" },
|
16873
|
+
{ value: "video_passthrough", display: "WebRTC (Passthrough)" },
|
16874
|
+
{ value: "images", display: "JPEG Only" }
|
16875
|
+
]
|
16876
|
+
}
|
16877
|
+
},
|
16842
16878
|
showPreview: { help: "Show video preview", hint: { type: "boolean", defaultValue: true } },
|
16879
|
+
bufferDelayMs: { help: "How many milliseconds in the jitter buffer (WebRTC only)", hint: { type: "numeric", validation: JitterBuffer, defaultValue: 500 } },
|
16843
16880
|
notes: {
|
16844
16881
|
help: "Additional notes about this component",
|
16845
16882
|
hint: { type: "text", optional: true }
|
@@ -17576,7 +17613,10 @@ function createLoganRung(rung) {
|
|
17576
17613
|
function createRungImpl({ name, threads, bitrate }) {
|
17577
17614
|
const codec = {
|
17578
17615
|
type: "x264",
|
17579
|
-
bitrateMode: {
|
17616
|
+
bitrateMode: {
|
17617
|
+
value: bitrate,
|
17618
|
+
mode: "abr"
|
17619
|
+
},
|
17580
17620
|
keyFrameIntervalMax: 50,
|
17581
17621
|
keyFrameIntervalMin: 50,
|
17582
17622
|
sceneCut: 0,
|
@@ -1,128 +1,128 @@
|
|
1
1
|
.preview-outer-container {
|
2
|
-
|
3
|
-
|
2
|
+
height: 237px;
|
3
|
+
width: 450px;
|
4
4
|
}
|
5
5
|
|
6
6
|
.preview-video {
|
7
|
-
|
7
|
+
width: 420px;
|
8
8
|
}
|
9
9
|
|
10
10
|
.preview-outer-container div {
|
11
|
-
|
11
|
+
float: left;
|
12
12
|
}
|
13
13
|
|
14
14
|
.preview-levels {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
height: 100%;
|
16
|
+
width: 30px;
|
17
|
+
background-color: #333;
|
18
|
+
border-radius: 2px;
|
19
|
+
display: flex;
|
20
|
+
flex-direction: row;
|
21
|
+
padding: 4px 3px;
|
22
|
+
margin: auto;
|
23
|
+
margin-top: 0px;
|
24
24
|
}
|
25
25
|
|
26
26
|
/* paint not glowing LEDs */
|
27
27
|
.preview-level {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
position: relative;
|
29
|
+
margin: 0 2px;
|
30
|
+
flex-grow: 1;
|
31
|
+
z-index: 3;
|
32
|
+
background-color: transparent;
|
33
|
+
background-repeat: repeat-y;
|
34
|
+
background-image: linear-gradient(to bottom, #666 3px, transparent 1px);
|
35
|
+
background-size: 100% 4px;
|
36
36
|
}
|
37
37
|
|
38
38
|
/* paint glowing LEDs */
|
39
39
|
.preview-level:before {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
width: 100%;
|
41
|
+
height: 100%;
|
42
|
+
content: ' ';
|
43
|
+
position: absolute;
|
44
|
+
top: 0px;
|
45
|
+
left: 0px;
|
46
|
+
z-index: 1;
|
47
|
+
background-repeat: no-repeat;
|
48
|
+
background-image: linear-gradient(to top, green 0%, yellow 80%, red 100%);
|
49
|
+
background-size: 100% 100%;
|
50
50
|
}
|
51
51
|
|
52
52
|
.clip-0-preview:before {
|
53
|
-
|
54
|
-
|
53
|
+
clip-path: inset(100% 0 0 0);
|
54
|
+
-webkit-clip-path: inset(100% 0 0 0);
|
55
55
|
}
|
56
56
|
|
57
57
|
.clip-10-preview:before {
|
58
|
-
|
59
|
-
|
58
|
+
clip-path: inset(90% 0 0 0);
|
59
|
+
-webkit-clip-path: inset(90% 0 0 0);
|
60
60
|
}
|
61
61
|
|
62
62
|
.clip-20-preview:before {
|
63
|
-
|
64
|
-
|
63
|
+
clip-path: inset(80% 0 0 0);
|
64
|
+
-webkit-clip-path: inset(80% 0 0 0);
|
65
65
|
}
|
66
66
|
|
67
67
|
.clip-30-preview:before {
|
68
|
-
|
69
|
-
|
68
|
+
clip-path: inset(70% 0 0 0);
|
69
|
+
-webkit-clip-path: inset(70% 0 0 0);
|
70
70
|
}
|
71
71
|
|
72
72
|
|
73
73
|
.clip-40-preview:before {
|
74
|
-
|
75
|
-
|
74
|
+
clip-path: inset(60% 0 0 0);
|
75
|
+
-webkit-clip-path: inset(60% 0 0 0);
|
76
76
|
}
|
77
77
|
|
78
78
|
.clip-50-preview:before {
|
79
|
-
|
80
|
-
|
79
|
+
clip-path: inset(50% 0 0 0);
|
80
|
+
-webkit-clip-path: inset(50% 0 0 0);
|
81
81
|
}
|
82
82
|
|
83
83
|
.clip-60-preview:before {
|
84
|
-
|
85
|
-
|
84
|
+
clip-path: inset(40% 0 0 0);
|
85
|
+
-webkit-clip-path: inset(40% 0 0 0);
|
86
86
|
}
|
87
87
|
|
88
88
|
.clip-70-preview:before {
|
89
|
-
|
90
|
-
|
89
|
+
clip-path: inset(30% 0 0 0);
|
90
|
+
-webkit-clip-path: inset(30% 0 0 0);
|
91
91
|
}
|
92
92
|
|
93
93
|
|
94
94
|
.clip-80-preview:before {
|
95
|
-
|
96
|
-
|
95
|
+
clip-path: inset(20% 0 0 0);
|
96
|
+
-webkit-clip-path: inset(20% 0 0 0);
|
97
97
|
}
|
98
98
|
|
99
99
|
.clip-90-preview:before {
|
100
|
-
|
101
|
-
|
100
|
+
clip-path: inset(10% 0 0 0);
|
101
|
+
-webkit-clip-path: inset(10% 0 0 0);
|
102
102
|
}
|
103
103
|
|
104
104
|
.clip-100-preview:before {
|
105
|
-
|
106
|
-
|
105
|
+
clip-path: inset(0% 0 0 0);
|
106
|
+
-webkit-clip-path: inset(0% 0 0 0);
|
107
107
|
}
|
108
108
|
|
109
109
|
|
110
110
|
|
111
111
|
/* paint gap lines of LEDs */
|
112
112
|
.preview-level::after {
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
}
|
113
|
+
width: 100%;
|
114
|
+
height: 100%;
|
115
|
+
content: ' ';
|
116
|
+
position: absolute;
|
117
|
+
top: 0px;
|
118
|
+
left: 0px;
|
119
|
+
z-index: 2;
|
120
|
+
margin-top: 3px;
|
121
|
+
background-image: linear-gradient(to bottom, #333 1px
|
122
|
+
/* space between leds*/
|
123
|
+
, transparent 1px);
|
124
|
+
background-repeat: repeat-y;
|
125
|
+
background-size: 100% 4px;
|
126
|
+
/* 4px LED height */
|
127
|
+
background-color: transparent;
|
128
|
+
}
|
package/client/style.css
CHANGED
@@ -48,41 +48,69 @@
|
|
48
48
|
--tw-drop-shadow: ;
|
49
49
|
}
|
50
50
|
|
51
|
+
.\!container {
|
52
|
+
width: 100% !important;
|
53
|
+
}
|
54
|
+
|
51
55
|
.container {
|
52
56
|
width: 100%;
|
53
57
|
}
|
54
58
|
|
55
59
|
@media (min-width: 300px) {
|
60
|
+
.\!container {
|
61
|
+
max-width: 300px !important;
|
62
|
+
}
|
63
|
+
|
56
64
|
.container {
|
57
65
|
max-width: 300px;
|
58
66
|
}
|
59
67
|
}
|
60
68
|
|
61
69
|
@media (min-width: 640px) {
|
70
|
+
.\!container {
|
71
|
+
max-width: 640px !important;
|
72
|
+
}
|
73
|
+
|
62
74
|
.container {
|
63
75
|
max-width: 640px;
|
64
76
|
}
|
65
77
|
}
|
66
78
|
|
67
79
|
@media (min-width: 768px) {
|
80
|
+
.\!container {
|
81
|
+
max-width: 768px !important;
|
82
|
+
}
|
83
|
+
|
68
84
|
.container {
|
69
85
|
max-width: 768px;
|
70
86
|
}
|
71
87
|
}
|
72
88
|
|
73
89
|
@media (min-width: 1024px) {
|
90
|
+
.\!container {
|
91
|
+
max-width: 1024px !important;
|
92
|
+
}
|
93
|
+
|
74
94
|
.container {
|
75
95
|
max-width: 1024px;
|
76
96
|
}
|
77
97
|
}
|
78
98
|
|
79
99
|
@media (min-width: 1280px) {
|
100
|
+
.\!container {
|
101
|
+
max-width: 1280px !important;
|
102
|
+
}
|
103
|
+
|
80
104
|
.container {
|
81
105
|
max-width: 1280px;
|
82
106
|
}
|
83
107
|
}
|
84
108
|
|
85
109
|
@media (min-width: 1536px) {
|
110
|
+
.\!container {
|
111
|
+
max-width: 1536px !important;
|
112
|
+
}
|
113
|
+
|
86
114
|
.container {
|
87
115
|
max-width: 1536px;
|
88
116
|
}
|
@@ -1,5 +1,8 @@
|
|
1
|
-
import type { PreviewOutputEvent, PreviewOutputSettings
|
1
|
+
import type { PreviewOutputEvent, PreviewOutputSettings } from "./runtime";
|
2
2
|
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
3
|
-
export default function (R: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<PreviewOutputSettings,
|
3
|
+
export default function (R: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<PreviewOutputSettings, {
|
4
|
+
url?: string;
|
5
|
+
levels?: import("./types").components["schemas"]["audio_level"];
|
6
|
+
}, object, PreviewOutputEvent>;
|
4
7
|
export declare const hardwareNames: readonly ["quadra", "nvidia"];
|
5
8
|
export type HardwareName = typeof hardwareNames[number];
|
@@ -76,6 +76,9 @@ function default_1(R) {
|
|
76
76
|
case 'audio-levels':
|
77
77
|
state.levels = ev.levels;
|
78
78
|
break;
|
79
|
+
case 'source-lost':
|
80
|
+
state = {};
|
81
|
+
break;
|
79
82
|
default:
|
80
83
|
assertUnreachable(evType);
|
81
84
|
}
|
@@ -89,9 +92,20 @@ function default_1(R) {
|
|
89
92
|
hardware: (0, config_1.HardwareSelection)()
|
90
93
|
},
|
91
94
|
form: {
|
92
|
-
|
93
|
-
|
95
|
+
previewMode: {
|
96
|
+
help: "How to display the video",
|
97
|
+
hint: {
|
98
|
+
type: 'select',
|
99
|
+
defaultValue: 'image',
|
100
|
+
options: [
|
101
|
+
{ value: 'video_encode', display: 'WebRTC (Re-Encode)' },
|
102
|
+
{ value: 'video_passthrough', display: 'WebRTC (Passthrough)' },
|
103
|
+
{ value: 'images', display: 'JPEG Only' }
|
104
|
+
]
|
105
|
+
}
|
106
|
+
},
|
94
107
|
showPreview: { help: "Show video preview", hint: { type: 'boolean', defaultValue: true } },
|
108
|
+
bufferDelayMs: { help: "How many milliseconds in the jitter buffer (WebRTC only)", hint: { type: 'numeric', validation: JitterBuffer, defaultValue: 500.0 } },
|
95
109
|
notes: {
|
96
110
|
help: "Additional notes about this component",
|
97
111
|
hint: { type: 'text', optional: true }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.preview/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.preview/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4BAuFC;AA5FD,kDAA0B;AAG1B,uEAAiG;AAEjG,mBAAwB,CAAe;IACrC,MAAM,EACJ,eAAe,EACf,EAAE,EACF,UAAU,EAAE,EAAE,YAAY,EAAE,GAC7B,GAAG,CAAC,CAAC;IACN,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,eAAe,GAAC,CAAC,CAAC;IAEnE,OAAO,eAAe,CAAsF;QAC1G,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,sLAAsL;QACnM,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;aACV;YACD,QAAQ,EAAE,SAAS;SACpB;QACD,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,MAAM,KAAK,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;iBACvC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC;AAEY,QAAA,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;CACA,CAAA"}
|
@@ -26,6 +26,16 @@ function InlineView({ state, config, raise }) {
|
|
26
26
|
video.remove();
|
27
27
|
});
|
28
28
|
};
|
29
|
+
const [loadedImage, setLoadedImage] = (0, react_1.useState)(undefined);
|
30
|
+
(0, react_1.useEffect)(() => {
|
31
|
+
const container = document.getElementById(`preview-${id}`) ?? undefined;
|
32
|
+
if (!container)
|
33
|
+
return;
|
34
|
+
container.innerHTML = '';
|
35
|
+
if (loadedImage) {
|
36
|
+
container.appendChild(loadedImage);
|
37
|
+
}
|
38
|
+
}, [loadedImage]);
|
29
39
|
(0, react_1.useEffect)(() => {
|
30
40
|
if (!url || !showPreview) {
|
31
41
|
if (client) {
|
@@ -34,11 +44,25 @@ function InlineView({ state, config, raise }) {
|
|
34
44
|
}
|
35
45
|
return;
|
36
46
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
47
|
+
if (config.previewMode == "image") {
|
48
|
+
const container = document.getElementById(`preview-${id}`) ?? undefined;
|
49
|
+
if (!container)
|
50
|
+
return;
|
51
|
+
const img = document.createElement('img');
|
52
|
+
img.width = 420;
|
53
|
+
img.height = 236;
|
54
|
+
img.onload = () => {
|
55
|
+
setLoadedImage(img);
|
56
|
+
};
|
57
|
+
img.src = url;
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
const newClient = createClient(url);
|
61
|
+
setClient(newClient);
|
62
|
+
return () => {
|
63
|
+
cleanupClient(newClient);
|
64
|
+
};
|
65
|
+
}
|
42
66
|
}, [state.url, showPreview]);
|
43
67
|
(0, react_1.useEffect)(() => {
|
44
68
|
setShowPreview(config.showPreview ?? true);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/output.preview/inline-view.tsx"],"names":[],"mappings":";;;AAAA,iCAA4C;AAG5C,6DAAuD;AAGvD,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAwD;IAChG,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAoB,IAAI,CAAC,CAAC;IAE9D,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;
|
1
|
+
{"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/output.preview/inline-view.tsx"],"names":[],"mappings":";;;AAAA,iCAA4C;AAG5C,6DAAuD;AAGvD,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAwD;IAChG,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAoB,IAAI,CAAC,CAAC;IAE9D,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,IAAI,0BAAU,CAAC;YAC5B,GAAG;YACH,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,SAAS;SACjE,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,EAA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O,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CACL,iCAAK,SAAS,EAAC,yBAAyB,aACtC,iCAAK,SAAS,EAAC,8BAA8B,aAC3C,kCACE,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,gBAAgB,EAAE,EAAE,EACxB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACjD,SAAS,EAAC,SAAS,GACnB,EACF,kCAAO,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,SAAS,EAAC,SAAS,6BAEjD,IACJ,EACL,WAAW,CAAC,CAAC,CAAC,CACb,gCAAK,SAAS,EAAC,eAAe,EAAC,EAAE,EAAE,WAAW,EAAE,EAAE,YAChD,4CACG;uBACU,EAAE;WACd,GACO,GACJ,CACP,CAAC,CAAC,CAAC,CACF,gCAAK,SAAS,EAAC,2EAA2E,mCAEpF,CACP,EACD,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,gCACE,SAAS,EAAE,sBAAsB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,GAC9D,GACH,IACF,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
@@ -1,27 +1,23 @@
|
|
1
|
-
import { AudioMeasureLevelsNode, Norsk, WhepOutputSettings as SdkSettings, SourceMediaNode, WhepOutputNode } from '@norskvideo/norsk-sdk';
|
2
|
-
import { OnCreated, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
-
import { CustomSinkNode,
|
1
|
+
import { AudioMeasureLevelsNode, ImagePreviewOutputNode, Norsk, ReceiveFromAddressAuto, WhepOutputSettings as SdkSettings, SourceMediaNode, SubscriptionError, WhepOutputNode } from '@norskvideo/norsk-sdk';
|
2
|
+
import { InstanceRouteInfo, OnCreated, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomSinkNode, SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
4
|
import { HardwareAccelerationType, IceServer } from '@norskvideo/norsk-studio/lib/shared/config';
|
5
5
|
import { ContextPromiseControl } from '@norskvideo/norsk-studio/lib/runtime/util';
|
6
|
+
import { components } from './types';
|
7
|
+
export type PreviewMode = 'video_passthrough' | 'video_encode' | 'image';
|
6
8
|
export type PreviewOutputSettings = {
|
7
9
|
id: string;
|
8
10
|
displayName: string;
|
9
11
|
notes?: string;
|
10
12
|
bufferDelayMs?: SdkSettings['bufferDelayMs'];
|
11
|
-
|
13
|
+
previewMode: PreviewMode;
|
12
14
|
showPreview?: boolean;
|
13
15
|
__global: {
|
14
16
|
iceServers: IceServer[];
|
15
17
|
hardware?: HardwareAccelerationType;
|
16
18
|
};
|
17
19
|
};
|
18
|
-
export type PreviewOutputState =
|
19
|
-
url?: string;
|
20
|
-
levels?: {
|
21
|
-
peak: number;
|
22
|
-
rms: number;
|
23
|
-
};
|
24
|
-
};
|
20
|
+
export type PreviewOutputState = components['schemas']['latest_state'];
|
25
21
|
export type PreviewOutputEvent = {
|
26
22
|
type: 'url-published';
|
27
23
|
url: string;
|
@@ -31,10 +27,13 @@ export type PreviewOutputEvent = {
|
|
31
27
|
peak: number;
|
32
28
|
rms: number;
|
33
29
|
};
|
30
|
+
} | {
|
31
|
+
type: 'source-lost';
|
34
32
|
};
|
35
33
|
export type PreviewOutputCommand = object;
|
36
|
-
export default class WhepOutputDefinition implements ServerComponentDefinition<PreviewOutputSettings,
|
37
|
-
create(norsk: Norsk, cfg: PreviewOutputSettings, cb: OnCreated<
|
34
|
+
export default class WhepOutputDefinition implements ServerComponentDefinition<PreviewOutputSettings, PreviewOutput, PreviewOutputState, PreviewOutputCommand, PreviewOutputEvent> {
|
35
|
+
create(norsk: Norsk, cfg: PreviewOutputSettings, cb: OnCreated<PreviewOutput>, runtime: StudioRuntime<PreviewOutputState, PreviewOutputCommand, PreviewOutputEvent>): Promise<void>;
|
36
|
+
instanceRoutes(): Promise<InstanceRouteInfo<PreviewOutputSettings, PreviewOutput, PreviewOutputState, PreviewOutputCommand, PreviewOutputEvent>[]>;
|
38
37
|
}
|
39
38
|
export declare class PreviewOutput extends CustomSinkNode {
|
40
39
|
initialised: Promise<void>;
|
@@ -44,10 +43,14 @@ export declare class PreviewOutput extends CustomSinkNode {
|
|
44
43
|
cfg: PreviewOutputSettings;
|
45
44
|
encoder?: SourceMediaNode;
|
46
45
|
whep?: WhepOutputNode;
|
46
|
+
images?: ImagePreviewOutputNode;
|
47
47
|
audioLevels?: AudioMeasureLevelsNode;
|
48
48
|
context: ContextPromiseControl;
|
49
|
+
currentSources: StudioNodeSubscriptionSource[];
|
49
50
|
constructor(norsk: Norsk, { updates, shared }: StudioRuntime<PreviewOutputState, PreviewOutputCommand, PreviewOutputEvent>, cfg: PreviewOutputSettings);
|
50
51
|
initialise(): Promise<void>;
|
51
52
|
subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts | undefined): void;
|
53
|
+
sourceContextChange(_responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
|
52
54
|
subscribeImpl(sources: StudioNodeSubscriptionSource[]): Promise<void>;
|
55
|
+
setupWhep(subscriptions: ReceiveFromAddressAuto[]): Promise<void>;
|
53
56
|
}
|