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,6 +6,8 @@ xxxx-xx-xx : Version 0.5-dev
6 6
     --se-dir and --list-serial.
7 7
  * Add support for undocumented "Thunderbolt" port status/type.
8 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 12
 2014-11-30 : Version 0.4
11 13
  * Add videohubctrl(1) man page.

+ 22
- 7
README View File

@@ -13,11 +13,7 @@ videohubctrl currently displays and can configure:
13 13
   - Input/Output port statuses
14 14
   - Monitoring video output port names, routing and locking
15 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 18
 Configuration of Videohub's network settings can be made using
23 19
 Blackmagic's Windows program when the device is connected via USB.
@@ -53,6 +49,7 @@ Commands:
53 49
  --list-voutputs            | List device video outputs.
54 50
  --list-moutputs            | List device monitoring outputs.
55 51
  --list-serial              | List device serial ports.
52
+ --list-proc-units          | List device processing units.
56 53
 
57 54
 Video inputs configuration:
58 55
  --vi-name <in_X> <name>    | Set video input port X name.
@@ -78,6 +75,12 @@ Serial ports configuration:
78 75
  --se-dir <ser_X> <dir>     | Set serial port X direction.
79 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 84
 Misc options:
82 85
  -T --test-input <file>     | Read commands from <file>.
83 86
  -d --debug                 | Increase logging verbosity.
@@ -153,10 +156,10 @@ Example output
153 156
 ==============
154 157
 
155 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 163
 Device info
161 164
   -------------------------------------------------------------------
162 165
   | Device address             | sdi-matrix                         |
@@ -167,6 +170,7 @@ Device info
167 170
   | Video inputs               | 16                                 |
168 171
   | Video outputs              | 16                                 |
169 172
   | Serial ports               | 8                                  |
173
+  | Video processing units     | 4                                  |
170 174
   | Video monitoring outputs   | 4                                  |
171 175
   -------------------------------------------------------------------
172 176
 
@@ -240,6 +244,17 @@ Serial ports
240 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,6 +36,8 @@ const char *videohub_commands_text[NUM_COMMANDS] = {
36 36
 	[CMD_SERIAL_PORT_LOCKS]      = "SERIAL PORT LOCKS",
37 37
 	[CMD_SERIAL_PORT_STATUS]     = "SERIAL PORT STATUS",
38 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 41
 	[CMD_PING]                 = "PING",
40 42
 	[CMD_ACK]                  = "ACK",
41 43
 	[CMD_NAK]                  = "NAK",
@@ -123,6 +125,19 @@ struct videohub_commands videohub_commands[NUM_COMMANDS] = {
123 125
 		.port_id1 = "serial",
124 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 141
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
127 142
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
128 143
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
@@ -273,7 +288,7 @@ bool parse_command(struct videohub_data *d, char *cmd) {
273 288
 			else if ((p = parse_text(line, "Video inputs: ")))
274 289
 				d->inputs.num = strtoul(p, NULL, 10);
275 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 292
 			else if ((p = parse_text(line, "Video outputs: ")))
278 293
 				d->outputs.num = strtoul(p, NULL, 10);
279 294
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))

+ 3
- 1
cmd.h View File

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

+ 1
- 1
data.h View File

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

+ 21
- 2
display.c View File

@@ -53,8 +53,8 @@ void print_device_info(struct videohub_data *d) {
53 53
 	printf("  | %-26s | %-34u |\n", "Video outputs", d->outputs.num);
54 54
 	if (d->serial.num)
55 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 58
 	if (d->mon_outputs.num)
59 59
 		printf("  | %-26s | %-34u |\n", "Video monitoring outputs", d->mon_outputs.num);
60 60
 	printf_line(len);
@@ -185,6 +185,25 @@ void print_device_serial_ports(struct videohub_data *d) {
185 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 207
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
189 208
 	unsigned int i, last = 0;
190 209
 	struct videohub_commands *v = &videohub_commands[vcmd];

+ 1
- 0
display.h View File

@@ -18,6 +18,7 @@ void print_device_video_inputs(struct videohub_data *d);
18 18
 void print_device_video_outputs(struct videohub_data *d);
19 19
 void print_device_monitoring_outputs(struct videohub_data *d);
20 20
 void print_device_serial_ports(struct videohub_data *d);
21
+void print_device_processing_units(struct videohub_data *d);
21 22
 
22 23
 void print_device_backup(struct videohub_data *d);
23 24
 

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

@@ -6,7 +6,7 @@ Device present: true
6 6
 Model name: Blackmagic Micro Videohub
7 7
 Unique ID: 7c2e0d021714
8 8
 Video inputs: 16
9
-Video processing units: 0
9
+Video processing units: 4
10 10
 Video outputs: 16
11 11
 Video monitoring outputs: 4
12 12
 Serial ports: 8
@@ -167,3 +167,14 @@ SERIAL PORT DIRECTIONS:
167 167
 6 control
168 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,7 +6,7 @@ Device present: true
6 6
 Model name: Blackmagic Micro Videohub
7 7
 Unique ID: 7c2e0d021714
8 8
 Video inputs: 16
9
-Video processing units: 0
9
+Video processing units: 4
10 10
 Video outputs: 16
11 11
 Video monitoring outputs: 4
12 12
 Serial ports: 8

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

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

+ 3
- 0
test/run View File

@@ -62,6 +62,9 @@ videohubctrl --test-input test/input-00.txt \
62 62
 	--se-input 6 7 \
63 63
 	--se-clear 4 \
64 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 68
 $@ &> test/test-04.out
66 69
 check test/test-04 "Test multiple configuration commands"
67 70
 

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

@@ -8,6 +8,7 @@ Device info
8 8
   | Video inputs               | 16                                 |
9 9
   | Video outputs              | 16                                 |
10 10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11 12
   | Video monitoring outputs   | 4                                  |
12 13
   -------------------------------------------------------------------
13 14
 
@@ -81,3 +82,13 @@ Serial ports
81 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,6 +65,9 @@ videohubctrl \
65 65
   --mo-input   4   4 \
66 66
   --se-input   1   3 \
67 67
   --se-input   2   4 \
68
+  --pu-input   1   4 \
69
+  --pu-input   2   2 \
70
+  --pu-input   4   3 \
68 71
   --se-dir   1 in \
69 72
   --se-dir   2 auto \
70 73
   --se-dir   3 out \
@@ -101,4 +104,8 @@ videohubctrl \
101 104
   --se-unlock   6 \
102 105
   --se-unlock   7 \
103 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,6 +64,9 @@ videohub: set monitoring output 3 "Monitor 3" to read from video input 3 "Window
64 64
 videohub: set monitoring output 4 "Monitor 4" to read from video input 4 "Windows 4 HD"
65 65
 videohub: connect serial 1 "Serial Ctrl 1" to serial 3 "Deck 3"
66 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 70
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
68 71
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
69 72
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
@@ -112,6 +115,12 @@ videohub: unlock serial 5 "Serial 5"
112 115
 videohub: unlock serial 6 "Serial 6"
113 116
 videohub: unlock serial 7 "Serial 7"
114 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 124
 Device info
116 125
   -------------------------------------------------------------------
117 126
   | Device address             | sdi-matrix                         |
@@ -122,6 +131,7 @@ Device info
122 131
   | Video inputs               | 16                                 |
123 132
   | Video outputs              | 16                                 |
124 133
   | Serial ports               | 8                                  |
134
+  | Video processing units     | 4                                  |
125 135
   | Video monitoring outputs   | 4                                  |
126 136
   -------------------------------------------------------------------
127 137
 
@@ -195,3 +205,13 @@ Serial ports
195 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,6 +29,14 @@ videohub: connect serial 4 "Deck 4" to serial 5 "Serial 5"
29 29
 videohub: connect serial 6 "Serial 6" to serial 7 "Serial 7"
30 30
 videohub: disconnect serial 4 "Deck 4"
31 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 40
 Device info
33 41
   -------------------------------------------------------------------
34 42
   | Device address             | sdi-matrix                         |
@@ -39,6 +47,7 @@ Device info
39 47
   | Video inputs               | 16                                 |
40 48
   | Video outputs              | 16                                 |
41 49
   | Serial ports               | 8                                  |
50
+  | Video processing units     | 4                                  |
42 51
   | Video monitoring outputs   | 4                                  |
43 52
   -------------------------------------------------------------------
44 53
 
@@ -113,3 +122,13 @@ Serial ports
113 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,6 +8,7 @@ Device info
8 8
   | Video inputs               | 16                                 |
9 9
   | Video outputs              | 16                                 |
10 10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11 12
   | Video monitoring outputs   | 4                                  |
12 13
   -------------------------------------------------------------------
13 14
 
@@ -81,3 +82,13 @@ Serial ports
81 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,6 +8,7 @@ Device info
8 8
   | Video inputs               | 16                                 |
9 9
   | Video outputs              | 16                                 |
10 10
   | Serial ports               | 8                                  |
11
+  | Video processing units     | 4                                  |
11 12
   | Video monitoring outputs   | 4                                  |
12 13
   -------------------------------------------------------------------
13 14
 

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

@@ -59,20 +59,6 @@ WARNING: Videohub sent unknown command!
59 59
          Please report this command to author's email: georgi@unixsol.org
60 60
          You may use -q or --quiet to suppress the message.
61 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 62
 ALARM STATUS:
77 63
 0 Error
78 64
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
@@ -100,7 +86,6 @@ Device info
100 86
   | Video inputs               | 16                                 |
101 87
   | Video outputs              | 32                                 |
102 88
   | Serial ports               | 8                                  |
103
-  | Video processing units     | 16                                 |
104 89
   | Video monitoring outputs   | 8                                  |
105 90
   -------------------------------------------------------------------
106 91
 

+ 22
- 2
videohubctrl.1 View File

@@ -15,6 +15,7 @@ videohubctrl currently displays and can configure:
15 15
   - Input/Output port statuses
16 16
   - Monitoring video output port names, routing and locking
17 17
   - Serial ports names, routing, locking and directions
18
+  - Processing units
18 19
 .SH MAIN OPTIONS
19 20
 .PP
20 21
 .TP
@@ -83,6 +84,10 @@ same as video input and output ports.
83 84
 Display device serial ports. Port numbers, names, locking status, directions
84 85
 and how serial ports are routed. The locking statuses are the same as video
85 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 91
 .SH CONFIGURATION COMMANDS
87 92
 .PP
88 93
 Everywhere where port needs to be set, you can use the port number or the
@@ -135,7 +140,7 @@ Connect serial port X to serial port Y. This option have two aliases \fB\-\-se\-
135 140
 and \fB\-\-se\-route\fR.
136 141
 .TP
137 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 144
 .TP
140 145
 \fB\-\-se\-lock\fR <ser_X>
141 146
 Lock serial port X.
@@ -144,12 +149,27 @@ Lock serial port X.
144 149
 Unlock serial port X. If the port is locked by somebody else the
145 150
 port would be forcefully unlocked.
146 151
 .TP
147
-\fB\-\-se\-dir\fR <set_X> <in|out|auto>
152
+\fB\-\-se\-dir\fR <ser_X> <in|out|auto>
148 153
 Set serial port X direction. There are three possible settings for
149 154
 each port:
150 155
  \fBin\fR   - input/control/Workstation
151 156
  \fBout\fR  - output/slave/Deck
152 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 173
 .SH MISC OPTIONS
154 174
 .PP
155 175
 .TP

+ 22
- 0
videohubctrl.c View File

@@ -43,6 +43,7 @@ enum list_actions {
43 43
 	action_list_voutputs	= (1 << 2),
44 44
 	action_list_moutputs	= (1 << 3),
45 45
 	action_list_serial		= (1 << 4),
46
+	action_list_proc_units	= (1 << 5),
46 47
 };
47 48
 
48 49
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
@@ -84,6 +85,12 @@ static const struct option long_options[] = {
84 85
 	{ "se-unlock",			required_argument, NULL, 4004 },
85 86
 	{ "se-dir",				required_argument, NULL, 4005 },
86 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 94
 	{ 0, 0, 0, 0 }
88 95
 };
89 96
 
@@ -109,6 +116,7 @@ static void show_help(struct videohub_data *data) {
109 116
 	printf(" --list-voutputs            | List device video outputs.\n");
110 117
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
111 118
 	printf(" --list-serial              | List device serial ports.\n");
119
+	printf(" --list-proc-units          | List device processing units.\n");
112 120
 	printf("\n");
113 121
 	printf("Video inputs configuration:\n");
114 122
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
@@ -134,6 +142,12 @@ static void show_help(struct videohub_data *data) {
134 142
 	printf(" --se-dir <ser_X> <dir>     | Set serial port X direction.\n");
135 143
 	printf("                            . <dir> can be 'auto', 'in' or 'out'.\n");
136 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 151
 	printf("Misc options:\n");
138 152
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
139 153
 	printf(" -d --debug                 | Increase logging verbosity.\n");
@@ -261,6 +275,10 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
261 275
 			case 4004: parse_cmd1(argc, argv, CMD_SERIAL_PORT_LOCKS, false); break; // --se-unlock
262 276
 			case 4005: parse_cmd2(argc, argv, CMD_SERIAL_PORT_DIRECTIONS); break; // --se-dir
263 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 282
 			case 'H': // --help
265 283
 				show_help(data);
266 284
 				exit(EXIT_SUCCESS);
@@ -301,6 +319,7 @@ static void print_device_full(struct videohub_data *d) {
301 319
 	print_device_video_outputs(d);
302 320
 	print_device_monitoring_outputs(d);
303 321
 	print_device_serial_ports(d);
322
+	print_device_processing_units(d);
304 323
 	fflush(stdout);
305 324
 }
306 325
 
@@ -337,6 +356,7 @@ int main(int argc, char **argv) {
337 356
 	}
338 357
 
339 358
 	reset_routed_to(&data->serial);
359
+	reset_routed_to(&data->proc_units);
340 360
 	read_device_command_stream(data);
341 361
 
342 362
 	if (test_data)
@@ -360,6 +380,7 @@ int main(int argc, char **argv) {
360 380
 	check_number_of_ports(&data->outputs);
361 381
 	check_number_of_ports(&data->mon_outputs);
362 382
 	check_number_of_ports(&data->serial);
383
+	check_number_of_ports(&data->proc_units);
363 384
 
364 385
 	if (num_parsed_cmds) {
365 386
 		unsigned int i;
@@ -408,6 +429,7 @@ int main(int argc, char **argv) {
408 429
 		if (show_list & action_list_voutputs)	print_device_video_outputs(data);
409 430
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
410 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 433
 		fflush(stdout);
412 434
 	} else if (show_backup) {
413 435
 		print_device_backup(data);

Loading…
Cancel
Save