2110-20 Rx

This commit is contained in:
itten
2026-07-14 19:55:54 +03:00
parent d0303a4a4c
commit 0e13dabf71
4 changed files with 38 additions and 4 deletions
+2 -1
View File
@@ -11,7 +11,7 @@ interface PaletteGroup {
} }
const groups: PaletteGroup[] = [ const groups: PaletteGroup[] = [
{ label: 'SOURCES', types: ['testpattern', 'ndiin', 'decklinkin', 'videoin'] }, { label: 'SOURCES', types: ['testpattern', 'ndiin', 'decklinkin', 'videoin', '2110'] },
{ label: 'PROCESS', types: ['mix', 'pip', 'gaindb'] }, { label: 'PROCESS', types: ['mix', 'pip', 'gaindb'] },
{ label: 'SINKS', types: ['ndiout', 'decklinkout', 'fakesink'] }, { label: 'SINKS', types: ['ndiout', 'decklinkout', 'fakesink'] },
] ]
@@ -27,6 +27,7 @@ const iconMap: Record<string, string> = {
mix: '⊕', mix: '⊕',
pip: '⊞', pip: '⊞',
gaindb: '◎', gaindb: '◎',
2110: '◬',
} }
function onDragStart(event: DragEvent, nodeType: string) { function onDragStart(event: DragEvent, nodeType: string) {
+8 -1
View File
@@ -129,6 +129,13 @@ function onDeleteNode() {
{{ opt.label }} {{ opt.label }}
</option> </option>
</select> </select>
<input
v-else-if="param.type === 'input'"
type="input"
class="param-input"
:value="data.params[param.key] ?? param.default"
@change="setParam(param.key, String(($event.target as HTMLInputElement).value))"
/>
<input <input
v-else-if="param.type === 'number'" v-else-if="param.type === 'number'"
type="number" type="number"
@@ -139,7 +146,7 @@ function onDeleteNode() {
@change="setParam(param.key, Number(($event.target as HTMLInputElement).value))" @change="setParam(param.key, Number(($event.target as HTMLInputElement).value))"
/> />
<input <input
v-else-if="param.type === 'input'" v-else-if="param.type === 'file'"
type="file" type="file"
class="param-input-file" class="param-input-file"
@change="handleFileChange(param.key, $event)" @change="handleFileChange(param.key, $event)"
+27 -1
View File
@@ -51,6 +51,15 @@ export const SAMPLE_RATE_OPTIONS = [
{ label: '96000', value: 96000 }, { label: '96000', value: 96000 },
] ]
export const NIC_OPTIONS = [
{ label: 'lo', value: 'lo' },
{ label: 'eno1', value: 'eno1' },
{ label: 'enp119s0', value: 'enp119s0' },
{ label: 'wlp10s0', value: 'wlp10s0' },
{ label: 'eno1np0', value: 'eno1np0' },
{ label: 'enp1s0f1np1', value: 'enp1s0f1np1' },
]
// Format params shown on source nodes; values go into edge format (not node params) // Format params shown on source nodes; values go into edge format (not node params)
export const FORMAT_OPTIONS_VIDEO: ParamDef[] = [ export const FORMAT_OPTIONS_VIDEO: ParamDef[] = [
{ key: 'res', label: 'Resolution', type: 'select', options: RESOLUTION_OPTIONS, default: '1920x1080', isFormat: true, group: 'VIDEO' }, { key: 'res', label: 'Resolution', type: 'select', options: RESOLUTION_OPTIONS, default: '1920x1080', isFormat: true, group: 'VIDEO' },
@@ -137,7 +146,7 @@ export const NODE_TYPES: Record<string, NodeTypeDef> = {
{ id: 'audio-out', kind: 'audio', direction: 'out' }, { id: 'audio-out', kind: 'audio', direction: 'out' },
], ],
params: [ params: [
{ key: 'file', label: 'File', type: 'input', default: '0.ts' } { key: 'file', label: 'File', type: 'file', default: '0.ts' }
], ],
}, },
mix: { mix: {
@@ -183,6 +192,23 @@ export const NODE_TYPES: Record<string, NodeTypeDef> = {
{ key: 'gain_db', label: 'Gain (dB)', type: 'number', default: 0, min: -60, max: 20 }, { key: 'gain_db', label: 'Gain (dB)', type: 'number', default: 0, min: -60, max: 20 },
], ],
}, },
2110: {
type: '2110',
label: 'SMPTE 2110-20 Rx',
ports: [
{ id: 'video-out', kind: 'video', direction: 'out' },
],
params: [
{ key: 'interface', label: 'NIC', type: 'select', options: NIC_OPTIONS, default: "eno1np0", group: 'NETWORK' },
{ key: 'local_ip', label: 'NIC IP', type: 'input', default: "192.168.0.3", group: 'NETWORK' },
{ key: 'source_ip', label: 'Src IP', type: 'input', default: "192.168.0.2", group: 'NETWORK' },
{ key: 'mcast_ip', label: 'Mcast IP', type: 'input', default: "239.255.197.181", group: 'NETWORK' },
{ key: 'udp_port', label: 'UDP Port', type: 'number', default: 16388, min: 1, max: 65536, group: 'NETWORK' },
{ key: 'payload_type', label: 'Payload Type', type: 'number', default: 96, min: 1, max: 255, group: 'VIDEO' },
{ key: 'res', label: 'Resolution', type: 'select', options: RESOLUTION_OPTIONS, default: '1920x1080', group: 'VIDEO' },
{ key: 'fps', label: 'FPS', type: 'select', options: FPS_OPTIONS, default: '25', group: 'VIDEO' },
]
}
} }
// Default params for a new node of the given type // Default params for a new node of the given type
+1 -1
View File
@@ -10,7 +10,7 @@ export interface PortDef {
export interface ParamDef { export interface ParamDef {
key: string key: string
label: string label: string
type: 'select' | 'number' | 'input' type: 'select' | 'number' | 'file' | 'input'
options?: { label: string; value: string | number }[] options?: { label: string; value: string | number }[]
default: string | number default: string | number
min?: number min?: number