Browse Source

Add support for processing units (routing and locks).

It is not tested on a real hardware.
Georgi Chorbadzhiyski 9 years ago
parent
commit
54b685d478
20 changed files with 196 additions and 38 deletions
  1. 2
    0
      ChangeLog
  2. 22
    7
      README
  3. 16
    1
      cmd.c
  4. 3
    1
      cmd.h
  5. 1
    1
      data.h
  6. 21
    2
      display.c
  7. 1
    0
      display.h
  8. 12
    1
      test/input-00.txt
  9. 1
    1
      test/input-03.txt
  10. 1
    7
      test/input-17.txt
  11. 3
    0
      test/run
  12. 11
    0
      test/test-01.ok
  13. 7
    0
      test/test-02.ok
  14. 20
    0
      test/test-03.ok
  15. 19
    0
      test/test-04.ok
  16. 11
    0
      test/test-05.ok
  17. 1
    0
      test/test-07.ok
  18. 0
    15
      test/test-17.ok
  19. 22
    2
      videohubctrl.1
  20. 22
    0
      videohubctrl.c

+ 2
- 0
ChangeLog View File

6
     --se-dir and --list-serial.
6
     --se-dir and --list-serial.
7
  * Add support for undocumented "Thunderbolt" port status/type.
7
  * Add support for undocumented "Thunderbolt" port status/type.
8
  * Display the undocumented "Friendly name" device setting.
8
  * Display the undocumented "Friendly name" device setting.
9
+ * Add support for processing units (routing and locks). It is not tested
10
+   on a real hardware.
9
 
11
 
10
 2014-11-30 : Version 0.4
12
 2014-11-30 : Version 0.4
11
  * Add videohubctrl(1) man page.
13
  * Add videohubctrl(1) man page.

+ 22
- 7
README View File

13
   - Input/Output port statuses
13
   - Input/Output port statuses
14
   - Monitoring video output port names, routing and locking
14
   - Monitoring video output port names, routing and locking
15
   - Serial ports names, routing, locking and directions
15
   - Serial ports names, routing, locking and directions
16
-
17
-The following features found in bigger Videohub models are currently
18
-not supported (I don't have the hardware):
19
-
20
-  - Configuration of video processing units
16
+  - Processing units
21
 
17
 
22
 Configuration of Videohub's network settings can be made using
18
 Configuration of Videohub's network settings can be made using
23
 Blackmagic's Windows program when the device is connected via USB.
19
 Blackmagic's Windows program when the device is connected via USB.
53
  --list-voutputs            | List device video outputs.
49
  --list-voutputs            | List device video outputs.
54
  --list-moutputs            | List device monitoring outputs.
50
  --list-moutputs            | List device monitoring outputs.
55
  --list-serial              | List device serial ports.
51
  --list-serial              | List device serial ports.
52
+ --list-proc-units          | List device processing units.
56
 
53
 
57
 Video inputs configuration:
54
 Video inputs configuration:
58
  --vi-name <in_X> <name>    | Set video input port X name.
55
  --vi-name <in_X> <name>    | Set video input port X name.
78
  --se-dir <ser_X> <dir>     | Set serial port X direction.
75
  --se-dir <ser_X> <dir>     | Set serial port X direction.
79
                             . <dir> can be 'auto', 'in' or 'out'.
76
                             . <dir> can be 'auto', 'in' or 'out'.
80
 
77
 
78
+Processing units configuration:
79
+ --pu-input <pu_X> <in_Y>   | Connect processing unit X to input Y.
80
+ --pu-clear <pu_X>          | Disconnect unit X from input Y.
81
+ --pu-lock <pu_X>           | Lock processing unit X.
82
+ --pu-unlock <pu_X>         | Unlock processing unit X.
83
+
81
 Misc options:
84
 Misc options:
82
  -T --test-input <file>     | Read commands from <file>.
85
  -T --test-input <file>     | Read commands from <file>.
83
  -d --debug                 | Increase logging verbosity.
86
  -d --debug                 | Increase logging verbosity.
153
 ==============
156
 ==============
154
 
157
 
155
 Here is how videohubctrl output looks like using the commands recorded
158
 Here is how videohubctrl output looks like using the commands recorded
156
-in tests/input-00.txt file.
159
+in test/input-00.txt file.
157
 
160
 
158
 |----------------------------------------------------------------------|
161
 |----------------------------------------------------------------------|
159
-$ videohubctrl --test tests/input-00.txt
162
+$ videohubctrl --test test/input-00.txt
160
 Device info
163
 Device info
161
   -------------------------------------------------------------------
164
   -------------------------------------------------------------------
162
   | Device address             | sdi-matrix                         |
165
   | Device address             | sdi-matrix                         |
167
   | Video inputs               | 16                                 |
170
   | Video inputs               | 16                                 |
168
   | Video outputs              | 16                                 |
171
   | Video outputs              | 16                                 |
169
   | Serial ports               | 8                                  |
172
   | Serial ports               | 8                                  |
173
+  | Video processing units     | 4                                  |
170
   | Video monitoring outputs   | 4                                  |
174
   | Video monitoring outputs   | 4                                  |
171
   -------------------------------------------------------------------
175
   -------------------------------------------------------------------
172
 
176
 
240
   |   8 |   |  out | Serial 8           |                    | x |
244
   |   8 |   |  out | Serial 8           |                    | x |
241
   ----------------------------------------------------------------
245
   ----------------------------------------------------------------
242
 
246
 
247
+Processing units
248
+  --------------------------------------------
249
+  | Proc Unit | x | Connected video input    |
250
+  --------------------------------------------
251
+  |         1 | L | Windows 4 HD             |
252
+  |         2 |   | Windows 2                |
253
+  |         3 | O |                          |
254
+  |         4 |   | Windows 3                |
255
+  --------------------------------------------
256
+
257
+
243
 |----------------------------------------------------------------------|
258
 |----------------------------------------------------------------------|
244
 
259
 
245
 
260
 

+ 16
- 1
cmd.c View File

36
 	[CMD_SERIAL_PORT_LOCKS]      = "SERIAL PORT LOCKS",
36
 	[CMD_SERIAL_PORT_LOCKS]      = "SERIAL PORT LOCKS",
37
 	[CMD_SERIAL_PORT_STATUS]     = "SERIAL PORT STATUS",
37
 	[CMD_SERIAL_PORT_STATUS]     = "SERIAL PORT STATUS",
38
 	[CMD_SERIAL_PORT_DIRECTIONS] = "SERIAL PORT DIRECTIONS",
38
 	[CMD_SERIAL_PORT_DIRECTIONS] = "SERIAL PORT DIRECTIONS",
39
+	[CMD_PROCESSING_UNIT_ROUTING]= "PROCESSING UNIT ROUTING",
40
+	[CMD_PROCESSING_UNIT_LOCKS]  = "PROCESSING UNIT LOCKS",
39
 	[CMD_PING]                 = "PING",
41
 	[CMD_PING]                 = "PING",
40
 	[CMD_ACK]                  = "ACK",
42
 	[CMD_ACK]                  = "ACK",
41
 	[CMD_NAK]                  = "NAK",
43
 	[CMD_NAK]                  = "NAK",
123
 		.port_id1 = "serial",
125
 		.port_id1 = "serial",
124
 		.opt_prefix = "se",
126
 		.opt_prefix = "se",
125
 	},
127
 	},
128
+	[CMD_PROCESSING_UNIT_ROUTING] = { .cmd = CMD_PROCESSING_UNIT_ROUTING, .type = PARSE_ROUTE,
129
+		.ports1 = OFS(proc_units),
130
+		.ports2 = OFS(inputs),
131
+		.port_id1 = "proc unit",
132
+		.port_id2 = "input",
133
+		.opt_prefix = "pu",
134
+		.allow_disconnect = true,
135
+	},
136
+	[CMD_PROCESSING_UNIT_LOCKS] = { .cmd = CMD_PROCESSING_UNIT_LOCKS, .type = PARSE_LOCK,
137
+		.ports1 = OFS(proc_units),
138
+		.port_id1 = "proc unit",
139
+		.opt_prefix = "pu",
140
+	},
126
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
141
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
127
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
142
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
128
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
143
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
273
 			else if ((p = parse_text(line, "Video inputs: ")))
288
 			else if ((p = parse_text(line, "Video inputs: ")))
274
 				d->inputs.num = strtoul(p, NULL, 10);
289
 				d->inputs.num = strtoul(p, NULL, 10);
275
 			else if ((p = parse_text(line, "Video processing units: ")))
290
 			else if ((p = parse_text(line, "Video processing units: ")))
276
-				d->device.num_video_processing_units = strtoul(p, NULL, 10);
291
+				d->proc_units.num = strtoul(p, NULL, 10);
277
 			else if ((p = parse_text(line, "Video outputs: ")))
292
 			else if ((p = parse_text(line, "Video outputs: ")))
278
 				d->outputs.num = strtoul(p, NULL, 10);
293
 				d->outputs.num = strtoul(p, NULL, 10);
279
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))
294
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))

+ 3
- 1
cmd.h View File

15
 
15
 
16
 #include <stdbool.h>
16
 #include <stdbool.h>
17
 
17
 
18
-#define NUM_COMMANDS 19
18
+#define NUM_COMMANDS 21
19
 
19
 
20
 enum vcmd {
20
 enum vcmd {
21
 	CMD_PROTOCOL_PREAMBLE,
21
 	CMD_PROTOCOL_PREAMBLE,
34
 	CMD_SERIAL_PORT_ROUTING,
34
 	CMD_SERIAL_PORT_ROUTING,
35
 	CMD_SERIAL_PORT_STATUS,
35
 	CMD_SERIAL_PORT_STATUS,
36
 	CMD_SERIAL_PORT_DIRECTIONS,
36
 	CMD_SERIAL_PORT_DIRECTIONS,
37
+	CMD_PROCESSING_UNIT_ROUTING,
38
+	CMD_PROCESSING_UNIT_LOCKS,
37
 	CMD_PING,
39
 	CMD_PING,
38
 	CMD_ACK,
40
 	CMD_ACK,
39
 	CMD_NAK = (NUM_COMMANDS - 1),
41
 	CMD_NAK = (NUM_COMMANDS - 1),

+ 1
- 1
data.h View File

27
 	char			model_name[MAX_NAME_LEN];
27
 	char			model_name[MAX_NAME_LEN];
28
 	char			friendly_name[MAX_NAME_LEN];
28
 	char			friendly_name[MAX_NAME_LEN];
29
 	char			unique_id[MAX_NAME_LEN];
29
 	char			unique_id[MAX_NAME_LEN];
30
-	unsigned int	num_video_processing_units;
31
 };
30
 };
32
 
31
 
33
 enum port_status {
32
 enum port_status {
82
 	struct port_set			outputs;
81
 	struct port_set			outputs;
83
 	struct port_set			mon_outputs;
82
 	struct port_set			mon_outputs;
84
 	struct port_set			serial;
83
 	struct port_set			serial;
84
+	struct port_set			proc_units;
85
 };
85
 };
86
 
86
 
87
 extern int debug;
87
 extern int debug;

+ 21
- 2
display.c View File

53
 	printf("  | %-26s | %-34u |\n", "Video outputs", d->outputs.num);
53
 	printf("  | %-26s | %-34u |\n", "Video outputs", d->outputs.num);
54
 	if (d->serial.num)
54
 	if (d->serial.num)
55
 		printf("  | %-26s | %-34u |\n", "Serial ports", d->serial.num);
55
 		printf("  | %-26s | %-34u |\n", "Serial ports", d->serial.num);
56
-	if (d->device.num_video_processing_units)
57
-		printf("  | %-26s | %-34u |\n", "Video processing units", d->device.num_video_processing_units);
56
+	if (d->proc_units.num)
57
+		printf("  | %-26s | %-34u |\n", "Video processing units", d->proc_units.num);
58
 	if (d->mon_outputs.num)
58
 	if (d->mon_outputs.num)
59
 		printf("  | %-26s | %-34u |\n", "Video monitoring outputs", d->mon_outputs.num);
59
 		printf("  | %-26s | %-34u |\n", "Video monitoring outputs", d->mon_outputs.num);
60
 	printf_line(len);
60
 	printf_line(len);
185
 	printf("\n");
185
 	printf("\n");
186
 }
186
 }
187
 
187
 
188
+void print_device_processing_units(struct videohub_data *d) {
189
+	unsigned int i, len = 44;
190
+	if (!d->proc_units.num)
191
+		return;
192
+	printf("Processing units\n");
193
+	printf_line(len);
194
+	printf("  | Proc Unit | x | %-24s |\n", "Connected video input");
195
+	printf_line(len);
196
+	for(i = 0; i < d->proc_units.num; i++) {
197
+		printf("  | %9d | %c | %-24s |\n",
198
+			i + 1,
199
+			port_lock_symbol(d->proc_units.port[i].lock),
200
+			d->proc_units.port[i].routed_to == NO_PORT ? "" : d->inputs.port[d->proc_units.port[i].routed_to].name
201
+		);
202
+	}
203
+	printf_line(len);
204
+	printf("\n");
205
+}
206
+
188
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
207
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
189
 	unsigned int i, last = 0;
208
 	unsigned int i, last = 0;
190
 	struct videohub_commands *v = &videohub_commands[vcmd];
209
 	struct videohub_commands *v = &videohub_commands[vcmd];

+ 1
- 0
display.h View File

18
 void print_device_video_outputs(struct videohub_data *d);
18
 void print_device_video_outputs(struct videohub_data *d);
19
 void print_device_monitoring_outputs(struct videohub_data *d);
19
 void print_device_monitoring_outputs(struct videohub_data *d);
20
 void print_device_serial_ports(struct videohub_data *d);
20
 void print_device_serial_ports(struct videohub_data *d);
21
+void print_device_processing_units(struct videohub_data *d);
21
 
22
 
22
 void print_device_backup(struct videohub_data *d);
23
 void print_device_backup(struct videohub_data *d);
23
 
24
 

+ 12
- 1
test/input-00.txt View File

6
 Model name: Blackmagic Micro Videohub
6
 Model name: Blackmagic Micro Videohub
7
 Unique ID: 7c2e0d021714
7
 Unique ID: 7c2e0d021714
8
 Video inputs: 16
8
 Video inputs: 16
9
-Video processing units: 0
9
+Video processing units: 4
10
 Video outputs: 16
10
 Video outputs: 16
11
 Video monitoring outputs: 4
11
 Video monitoring outputs: 4
12
 Serial ports: 8
12
 Serial ports: 8
167
 6 control
167
 6 control
168
 7 slave
168
 7 slave
169
 
169
 
170
+PROCESSING UNIT ROUTING:
171
+0 3
172
+1 1
173
+3 2
174
+
175
+PROCESSING UNIT LOCKS:
176
+0 L
177
+1 U
178
+2 O
179
+3 U
180
+

+ 1
- 1
test/input-03.txt View File

6
 Model name: Blackmagic Micro Videohub
6
 Model name: Blackmagic Micro Videohub
7
 Unique ID: 7c2e0d021714
7
 Unique ID: 7c2e0d021714
8
 Video inputs: 16
8
 Video inputs: 16
9
-Video processing units: 0
9
+Video processing units: 4
10
 Video outputs: 16
10
 Video outputs: 16
11
 Video monitoring outputs: 4
11
 Video monitoring outputs: 4
12
 Serial ports: 8
12
 Serial ports: 8

+ 1
- 7
test/input-17.txt View File

7
 Friendly name: SDI router on the 5th floor
7
 Friendly name: SDI router on the 5th floor
8
 Unique ID: 465647757584
8
 Unique ID: 465647757584
9
 Video inputs: 16
9
 Video inputs: 16
10
-Video processing units: 16
10
+Video processing units: 0
11
 Video outputs: 32
11
 Video outputs: 32
12
 Video monitoring outputs: 8
12
 Video monitoring outputs: 8
13
 Serial ports: 8
13
 Serial ports: 8
195
 FRAME BUFFER LOCKS:
195
 FRAME BUFFER LOCKS:
196
 0 U
196
 0 U
197
 
197
 
198
-PROCESSING UNIT ROUTING:
199
-0 Output 15
200
-
201
-PROCESSING UNIT LOCKS:
202
-0 U
203
-
204
 ALARM STATUS:
198
 ALARM STATUS:
205
 0 Error
199
 0 Error
206
 
200
 

+ 3
- 0
test/run View File

62
 	--se-input 6 7 \
62
 	--se-input 6 7 \
63
 	--se-clear 4 \
63
 	--se-clear 4 \
64
 	--se-clear "Serial 6" \
64
 	--se-clear "Serial 6" \
65
+	--pu-clear 1 --pu-clear 3 --pu-clear 4 \
66
+	--pu-unlock 1 --pu-lock 1 --pu-connect 1 "Windows 4 HD" \
67
+	--pu-connect 4 "DPlay1" --pu-lock 4 \
65
 $@ &> test/test-04.out
68
 $@ &> test/test-04.out
66
 check test/test-04 "Test multiple configuration commands"
69
 check test/test-04 "Test multiple configuration commands"
67
 
70
 

+ 11
- 0
test/test-01.ok View File

8
   | Video inputs               | 16                                 |
8
   | Video inputs               | 16                                 |
9
   | Video outputs              | 16                                 |
9
   | Video outputs              | 16                                 |
10
   | Serial ports               | 8                                  |
10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11
   | Video monitoring outputs   | 4                                  |
12
   | Video monitoring outputs   | 4                                  |
12
   -------------------------------------------------------------------
13
   -------------------------------------------------------------------
13
 
14
 
81
   |   8 |   |  out | Serial 8           |                    | x |
82
   |   8 |   |  out | Serial 8           |                    | x |
82
   ----------------------------------------------------------------
83
   ----------------------------------------------------------------
83
 
84
 
85
+Processing units
86
+  --------------------------------------------
87
+  | Proc Unit | x | Connected video input    |
88
+  --------------------------------------------
89
+  |         1 | L | Windows 4 HD             |
90
+  |         2 |   | Windows 2                |
91
+  |         3 | O |                          |
92
+  |         4 |   | Windows 3                |
93
+  --------------------------------------------
94
+

+ 7
- 0
test/test-02.ok View File

65
   --mo-input   4   4 \
65
   --mo-input   4   4 \
66
   --se-input   1   3 \
66
   --se-input   1   3 \
67
   --se-input   2   4 \
67
   --se-input   2   4 \
68
+  --pu-input   1   4 \
69
+  --pu-input   2   2 \
70
+  --pu-input   4   3 \
68
   --se-dir   1 in \
71
   --se-dir   1 in \
69
   --se-dir   2 auto \
72
   --se-dir   2 auto \
70
   --se-dir   3 out \
73
   --se-dir   3 out \
101
   --se-unlock   6 \
104
   --se-unlock   6 \
102
   --se-unlock   7 \
105
   --se-unlock   7 \
103
   --se-unlock   8
106
   --se-unlock   8
107
+  --pu-unlock   1 --pu-lock   1 \
108
+  --pu-unlock   2 \
109
+  --pu-unlock   3 --pu-lock   3 \
110
+  --pu-unlock   4
104
 
111
 

+ 20
- 0
test/test-03.ok View File

64
 videohub: set monitoring output 4 "Monitor 4" to read from video input 4 "Windows 4 HD"
64
 videohub: set monitoring output 4 "Monitor 4" to read from video input 4 "Windows 4 HD"
65
 videohub: connect serial 1 "Serial Ctrl 1" to serial 3 "Deck 3"
65
 videohub: connect serial 1 "Serial Ctrl 1" to serial 3 "Deck 3"
66
 videohub: connect serial 2 "Serial Ctrl 2" to serial 4 "Deck 4"
66
 videohub: connect serial 2 "Serial Ctrl 2" to serial 4 "Deck 4"
67
+videohub: connect proc unit 1 "" to input 4 "Windows 4 HD"
68
+videohub: connect proc unit 2 "" to input 2 "Windows 2"
69
+videohub: connect proc unit 4 "" to input 3 "Windows 3"
67
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
70
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
68
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
71
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
69
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
72
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
112
 videohub: unlock serial 6 "Serial 6"
115
 videohub: unlock serial 6 "Serial 6"
113
 videohub: unlock serial 7 "Serial 7"
116
 videohub: unlock serial 7 "Serial 7"
114
 videohub: unlock serial 8 "Serial 8"
117
 videohub: unlock serial 8 "Serial 8"
118
+videohub: unlock proc unit 1 ""
119
+videohub: lock proc unit 1 ""
120
+videohub: unlock proc unit 2 ""
121
+videohub: unlock proc unit 3 ""
122
+videohub: lock proc unit 3 ""
123
+videohub: unlock proc unit 4 ""
115
 Device info
124
 Device info
116
   -------------------------------------------------------------------
125
   -------------------------------------------------------------------
117
   | Device address             | sdi-matrix                         |
126
   | Device address             | sdi-matrix                         |
122
   | Video inputs               | 16                                 |
131
   | Video inputs               | 16                                 |
123
   | Video outputs              | 16                                 |
132
   | Video outputs              | 16                                 |
124
   | Serial ports               | 8                                  |
133
   | Serial ports               | 8                                  |
134
+  | Video processing units     | 4                                  |
125
   | Video monitoring outputs   | 4                                  |
135
   | Video monitoring outputs   | 4                                  |
126
   -------------------------------------------------------------------
136
   -------------------------------------------------------------------
127
 
137
 
195
   |   8 |   |  out | Serial 8           |                    | x |
205
   |   8 |   |  out | Serial 8           |                    | x |
196
   ----------------------------------------------------------------
206
   ----------------------------------------------------------------
197
 
207
 
208
+Processing units
209
+  --------------------------------------------
210
+  | Proc Unit | x | Connected video input    |
211
+  --------------------------------------------
212
+  |         1 | O | Windows 4 HD             |
213
+  |         2 |   | Windows 2                |
214
+  |         3 | O |                          |
215
+  |         4 |   | Windows 3                |
216
+  --------------------------------------------
217
+

+ 19
- 0
test/test-04.ok View File

29
 videohub: connect serial 6 "Serial 6" to serial 7 "Serial 7"
29
 videohub: connect serial 6 "Serial 6" to serial 7 "Serial 7"
30
 videohub: disconnect serial 4 "Deck 4"
30
 videohub: disconnect serial 4 "Deck 4"
31
 videohub: disconnect serial 6 "Serial 6"
31
 videohub: disconnect serial 6 "Serial 6"
32
+videohub: disconnect proc unit 1 ""
33
+videohub: disconnect proc unit 3 ""
34
+videohub: disconnect proc unit 4 ""
35
+videohub: force unlock proc unit 1 ""
36
+videohub: lock proc unit 1 ""
37
+videohub: connect proc unit 1 "" to input 4 "Windows 4 HighDef"
38
+videohub: connect proc unit 4 "" to input 12 "DPlay1"
39
+videohub: lock proc unit 4 ""
32
 Device info
40
 Device info
33
   -------------------------------------------------------------------
41
   -------------------------------------------------------------------
34
   | Device address             | sdi-matrix                         |
42
   | Device address             | sdi-matrix                         |
39
   | Video inputs               | 16                                 |
47
   | Video inputs               | 16                                 |
40
   | Video outputs              | 16                                 |
48
   | Video outputs              | 16                                 |
41
   | Serial ports               | 8                                  |
49
   | Serial ports               | 8                                  |
50
+  | Video processing units     | 4                                  |
42
   | Video monitoring outputs   | 4                                  |
51
   | Video monitoring outputs   | 4                                  |
43
   -------------------------------------------------------------------
52
   -------------------------------------------------------------------
44
 
53
 
113
   |   8 |   | auto | Serial 8           |                    | x |
122
   |   8 |   | auto | Serial 8           |                    | x |
114
   ----------------------------------------------------------------
123
   ----------------------------------------------------------------
115
 
124
 
125
+Processing units
126
+  --------------------------------------------
127
+  | Proc Unit | x | Connected video input    |
128
+  --------------------------------------------
129
+  |         1 | O | Windows 4 HighDef        |
130
+  |         2 |   | Windows 2                |
131
+  |         3 | O |                          |
132
+  |         4 | O | DPlay1                   |
133
+  --------------------------------------------
134
+

+ 11
- 0
test/test-05.ok View File

8
   | Video inputs               | 16                                 |
8
   | Video inputs               | 16                                 |
9
   | Video outputs              | 16                                 |
9
   | Video outputs              | 16                                 |
10
   | Serial ports               | 8                                  |
10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11
   | Video monitoring outputs   | 4                                  |
12
   | Video monitoring outputs   | 4                                  |
12
   -------------------------------------------------------------------
13
   -------------------------------------------------------------------
13
 
14
 
81
   |   8 |   |  out | Serial 8           |                    | x |
82
   |   8 |   |  out | Serial 8           |                    | x |
82
   ----------------------------------------------------------------
83
   ----------------------------------------------------------------
83
 
84
 
85
+Processing units
86
+  --------------------------------------------
87
+  | Proc Unit | x | Connected video input    |
88
+  --------------------------------------------
89
+  |         1 | O | Windows 4 HD             |
90
+  |         2 |   | Windows 2                |
91
+  |         3 | O |                          |
92
+  |         4 |   | Windows 3                |
93
+  --------------------------------------------
94
+

+ 1
- 0
test/test-07.ok View File

8
   | Video inputs               | 16                                 |
8
   | Video inputs               | 16                                 |
9
   | Video outputs              | 16                                 |
9
   | Video outputs              | 16                                 |
10
   | Serial ports               | 8                                  |
10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11
   | Video monitoring outputs   | 4                                  |
12
   | Video monitoring outputs   | 4                                  |
12
   -------------------------------------------------------------------
13
   -------------------------------------------------------------------
13
 
14
 

+ 0
- 15
test/test-17.ok View File

59
          Please report this command to author's email: georgi@unixsol.org
59
          Please report this command to author's email: georgi@unixsol.org
60
          You may use -q or --quiet to suppress the message.
60
          You may use -q or --quiet to suppress the message.
61
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
61
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
62
-PROCESSING UNIT ROUTING:
63
-0 Output 15
64
----------8<-----------8<----------- cut here ---------8<------------8<---------
65
-WARNING: Videohub sent unknown command!
66
-         Please report this command to author's email: georgi@unixsol.org
67
-         You may use -q or --quiet to suppress the message.
68
----------8<-----------8<----------- cut here ---------8<------------8<---------
69
-PROCESSING UNIT LOCKS:
70
-0 U
71
----------8<-----------8<----------- cut here ---------8<------------8<---------
72
-WARNING: Videohub sent unknown command!
73
-         Please report this command to author's email: georgi@unixsol.org
74
-         You may use -q or --quiet to suppress the message.
75
----------8<-----------8<----------- cut here ---------8<------------8<---------
76
 ALARM STATUS:
62
 ALARM STATUS:
77
 0 Error
63
 0 Error
78
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
64
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
100
   | Video inputs               | 16                                 |
86
   | Video inputs               | 16                                 |
101
   | Video outputs              | 32                                 |
87
   | Video outputs              | 32                                 |
102
   | Serial ports               | 8                                  |
88
   | Serial ports               | 8                                  |
103
-  | Video processing units     | 16                                 |
104
   | Video monitoring outputs   | 8                                  |
89
   | Video monitoring outputs   | 8                                  |
105
   -------------------------------------------------------------------
90
   -------------------------------------------------------------------
106
 
91
 

+ 22
- 2
videohubctrl.1 View File

15
   - Input/Output port statuses
15
   - Input/Output port statuses
16
   - Monitoring video output port names, routing and locking
16
   - Monitoring video output port names, routing and locking
17
   - Serial ports names, routing, locking and directions
17
   - Serial ports names, routing, locking and directions
18
+  - Processing units
18
 .SH MAIN OPTIONS
19
 .SH MAIN OPTIONS
19
 .PP
20
 .PP
20
 .TP
21
 .TP
83
 Display device serial ports. Port numbers, names, locking status, directions
84
 Display device serial ports. Port numbers, names, locking status, directions
84
 and how serial ports are routed. The locking statuses are the same as video
85
 and how serial ports are routed. The locking statuses are the same as video
85
 input, output ports and monitoring ports.
86
 input, output ports and monitoring ports.
87
+.TP
88
+\fB\-\-list\-proc-units\fR
89
+Display device procesing units. Unit numbers, locking status and connected
90
+video inputs.
86
 .SH CONFIGURATION COMMANDS
91
 .SH CONFIGURATION COMMANDS
87
 .PP
92
 .PP
88
 Everywhere where port needs to be set, you can use the port number or the
93
 Everywhere where port needs to be set, you can use the port number or the
135
 and \fB\-\-se\-route\fR.
140
 and \fB\-\-se\-route\fR.
136
 .TP
141
 .TP
137
 \fB\-\-se\-clear\fR <ser_X>
142
 \fB\-\-se\-clear\fR <ser_X>
138
-Disconnect serial port X from serial port Y.
143
+Disconnect serial port X from the connected serial port.
139
 .TP
144
 .TP
140
 \fB\-\-se\-lock\fR <ser_X>
145
 \fB\-\-se\-lock\fR <ser_X>
141
 Lock serial port X.
146
 Lock serial port X.
144
 Unlock serial port X. If the port is locked by somebody else the
149
 Unlock serial port X. If the port is locked by somebody else the
145
 port would be forcefully unlocked.
150
 port would be forcefully unlocked.
146
 .TP
151
 .TP
147
-\fB\-\-se\-dir\fR <set_X> <in|out|auto>
152
+\fB\-\-se\-dir\fR <ser_X> <in|out|auto>
148
 Set serial port X direction. There are three possible settings for
153
 Set serial port X direction. There are three possible settings for
149
 each port:
154
 each port:
150
  \fBin\fR   - input/control/Workstation
155
  \fBin\fR   - input/control/Workstation
151
  \fBout\fR  - output/slave/Deck
156
  \fBout\fR  - output/slave/Deck
152
  \fBauto\fR - Automatic in/out
157
  \fBauto\fR - Automatic in/out
158
+.SH PROCESSING UNITS CONFIGURATION
159
+.PP
160
+.TP
161
+\fB\-\-pu\-input\fR <pu_X> <in_Y>
162
+Connect processing unit X to video input port Y.
163
+.TP
164
+\fB\-\-pu\-clear\fR <pu_X>
165
+Disconnect processing unit X from the connected input port.
166
+.TP
167
+\fB\-\-pu\-lock\fR <pu_X>
168
+Lock processing unit port X.
169
+.TP
170
+\fB\-\-pu\-unlock\fR <pu_X>
171
+Unlock processing unit port X. If the port is locked by somebody else the
172
+port would be forcefully unlocked.
153
 .SH MISC OPTIONS
173
 .SH MISC OPTIONS
154
 .PP
174
 .PP
155
 .TP
175
 .TP

+ 22
- 0
videohubctrl.c View File

43
 	action_list_voutputs	= (1 << 2),
43
 	action_list_voutputs	= (1 << 2),
44
 	action_list_moutputs	= (1 << 3),
44
 	action_list_moutputs	= (1 << 3),
45
 	action_list_serial		= (1 << 4),
45
 	action_list_serial		= (1 << 4),
46
+	action_list_proc_units	= (1 << 5),
46
 };
47
 };
47
 
48
 
48
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
49
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
84
 	{ "se-unlock",			required_argument, NULL, 4004 },
85
 	{ "se-unlock",			required_argument, NULL, 4004 },
85
 	{ "se-dir",				required_argument, NULL, 4005 },
86
 	{ "se-dir",				required_argument, NULL, 4005 },
86
 	{ "se-clear",			required_argument, NULL, 4006 },
87
 	{ "se-clear",			required_argument, NULL, 4006 },
88
+	{ "pu-input",			required_argument, NULL, 5001 },
89
+	{ "pu-connect",			required_argument, NULL, 5001 }, // Alias of --pu-input
90
+	{ "pu-route",			required_argument, NULL, 5001 }, // Alias of --pu-input
91
+	{ "pu-lock",			required_argument, NULL, 5002 },
92
+	{ "pu-unlock",			required_argument, NULL, 5003 },
93
+	{ "pu-clear",			required_argument, NULL, 5004 },
87
 	{ 0, 0, 0, 0 }
94
 	{ 0, 0, 0, 0 }
88
 };
95
 };
89
 
96
 
109
 	printf(" --list-voutputs            | List device video outputs.\n");
116
 	printf(" --list-voutputs            | List device video outputs.\n");
110
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
117
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
111
 	printf(" --list-serial              | List device serial ports.\n");
118
 	printf(" --list-serial              | List device serial ports.\n");
119
+	printf(" --list-proc-units          | List device processing units.\n");
112
 	printf("\n");
120
 	printf("\n");
113
 	printf("Video inputs configuration:\n");
121
 	printf("Video inputs configuration:\n");
114
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
122
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
134
 	printf(" --se-dir <ser_X> <dir>     | Set serial port X direction.\n");
142
 	printf(" --se-dir <ser_X> <dir>     | Set serial port X direction.\n");
135
 	printf("                            . <dir> can be 'auto', 'in' or 'out'.\n");
143
 	printf("                            . <dir> can be 'auto', 'in' or 'out'.\n");
136
 	printf("\n");
144
 	printf("\n");
145
+	printf("Processing units configuration:\n");
146
+	printf(" --pu-input <pu_X> <in_Y>   | Connect processing unit X to input Y.\n");
147
+	printf(" --pu-clear <pu_X>          | Disconnect unit X from input Y.\n");
148
+	printf(" --pu-lock <pu_X>           | Lock processing unit X.\n");
149
+	printf(" --pu-unlock <pu_X>         | Unlock processing unit X.\n");
150
+	printf("\n");
137
 	printf("Misc options:\n");
151
 	printf("Misc options:\n");
138
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
152
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
139
 	printf(" -d --debug                 | Increase logging verbosity.\n");
153
 	printf(" -d --debug                 | Increase logging verbosity.\n");
261
 			case 4004: parse_cmd1(argc, argv, CMD_SERIAL_PORT_LOCKS, false); break; // --se-unlock
275
 			case 4004: parse_cmd1(argc, argv, CMD_SERIAL_PORT_LOCKS, false); break; // --se-unlock
262
 			case 4005: parse_cmd2(argc, argv, CMD_SERIAL_PORT_DIRECTIONS); break; // --se-dir
276
 			case 4005: parse_cmd2(argc, argv, CMD_SERIAL_PORT_DIRECTIONS); break; // --se-dir
263
 			case 4006: parse_cmd2s(argc, argv, CMD_SERIAL_PORT_ROUTING); break; // --se-clear
277
 			case 4006: parse_cmd2s(argc, argv, CMD_SERIAL_PORT_ROUTING); break; // --se-clear
278
+			case 5001: parse_cmd2(argc, argv, CMD_PROCESSING_UNIT_ROUTING); break; // --pu-input
279
+			case 5002: parse_cmd1(argc, argv, CMD_PROCESSING_UNIT_LOCKS, true); break; // --pu-lock
280
+			case 5003: parse_cmd1(argc, argv, CMD_PROCESSING_UNIT_LOCKS, false); break; // --pu-unlock
281
+			case 5004: parse_cmd2s(argc, argv, CMD_PROCESSING_UNIT_ROUTING); break; // --pu-clear
264
 			case 'H': // --help
282
 			case 'H': // --help
265
 				show_help(data);
283
 				show_help(data);
266
 				exit(EXIT_SUCCESS);
284
 				exit(EXIT_SUCCESS);
301
 	print_device_video_outputs(d);
319
 	print_device_video_outputs(d);
302
 	print_device_monitoring_outputs(d);
320
 	print_device_monitoring_outputs(d);
303
 	print_device_serial_ports(d);
321
 	print_device_serial_ports(d);
322
+	print_device_processing_units(d);
304
 	fflush(stdout);
323
 	fflush(stdout);
305
 }
324
 }
306
 
325
 
337
 	}
356
 	}
338
 
357
 
339
 	reset_routed_to(&data->serial);
358
 	reset_routed_to(&data->serial);
359
+	reset_routed_to(&data->proc_units);
340
 	read_device_command_stream(data);
360
 	read_device_command_stream(data);
341
 
361
 
342
 	if (test_data)
362
 	if (test_data)
360
 	check_number_of_ports(&data->outputs);
380
 	check_number_of_ports(&data->outputs);
361
 	check_number_of_ports(&data->mon_outputs);
381
 	check_number_of_ports(&data->mon_outputs);
362
 	check_number_of_ports(&data->serial);
382
 	check_number_of_ports(&data->serial);
383
+	check_number_of_ports(&data->proc_units);
363
 
384
 
364
 	if (num_parsed_cmds) {
385
 	if (num_parsed_cmds) {
365
 		unsigned int i;
386
 		unsigned int i;
408
 		if (show_list & action_list_voutputs)	print_device_video_outputs(data);
429
 		if (show_list & action_list_voutputs)	print_device_video_outputs(data);
409
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
430
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
410
 		if (show_list & action_list_serial)		print_device_serial_ports(data);
431
 		if (show_list & action_list_serial)		print_device_serial_ports(data);
432
+		if (show_list & action_list_proc_units)	print_device_processing_units(data);
411
 		fflush(stdout);
433
 		fflush(stdout);
412
 	} else if (show_backup) {
434
 	} else if (show_backup) {
413
 		print_device_backup(data);
435
 		print_device_backup(data);

Loading…
Cancel
Save