Browse Source

Add support for frames (names, routing and locks)

It is not tested on a real hardware. The number of frame buffers
is assumed to be the same as number of serial ports (as good guess
as any).
Georgi Chorbadzhiyski 9 years ago
parent
commit
d6f8eeeebe
19 changed files with 281 additions and 35 deletions
  1. 2
    0
      ChangeLog
  2. 22
    0
      README
  3. 24
    2
      cmd.c
  4. 4
    1
      cmd.h
  5. 1
    0
      data.h
  6. 21
    0
      display.c
  7. 1
    0
      display.h
  8. 20
    0
      test/input-00.txt
  9. 6
    0
      test/input-14.txt
  10. 4
    0
      test/run
  11. 14
    0
      test/test-01.ok
  12. 19
    0
      test/test-02.ok
  13. 35
    0
      test/test-03.ok
  14. 23
    0
      test/test-04.ok
  15. 14
    0
      test/test-05.ok
  16. 10
    0
      test/test-14.ok
  17. 14
    30
      test/test-17.ok
  18. 21
    2
      videohubctrl.1
  19. 26
    0
      videohubctrl.c

+ 2
- 0
ChangeLog View File

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
9
  * Add support for processing units (routing and locks). It is not tested
10
    on a real hardware.
10
    on a real hardware.
11
+ * Add support for frames (names, routing and locks). It is not tested on
12
+   a real hardware.
11
 
13
 
12
 2014-11-30 : Version 0.4
14
 2014-11-30 : Version 0.4
13
  * Add videohubctrl(1) man page.
15
  * Add videohubctrl(1) man page.

+ 22
- 0
README View File

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
   - Processing units
16
   - Processing units
17
+  - Frames
17
 
18
 
18
 Configuration of Videohub's network settings can be made using
19
 Configuration of Videohub's network settings can be made using
19
 Blackmagic's Windows program when the device is connected via USB.
20
 Blackmagic's Windows program when the device is connected via USB.
81
  --pu-lock <pu_X>           | Lock processing unit X.
82
  --pu-lock <pu_X>           | Lock processing unit X.
82
  --pu-unlock <pu_X>         | Unlock processing unit X.
83
  --pu-unlock <pu_X>         | Unlock processing unit X.
83
 
84
 
85
+Frames configuration:
86
+ --fr-name <fr_X> <name>    | Set frame X name.
87
+ --fr-output <fr_X> <out_Y> | Output frame X to output Y.
88
+ --fr-clear <fr_X>          | Stop outputing frame X to the output.
89
+ --fr-lock <fr_X>           | Lock frame X.
90
+ --fr-unlock <rf_X>         | Unlock frame X.
91
+
84
 Misc options:
92
 Misc options:
85
  -T --test-input <file>     | Read commands from <file>.
93
  -T --test-input <file>     | Read commands from <file>.
86
  -d --debug                 | Increase logging verbosity.
94
  -d --debug                 | Increase logging verbosity.
254
   |         4 |   | Windows 3                |
262
   |         4 |   | Windows 3                |
255
   --------------------------------------------
263
   --------------------------------------------
256
 
264
 
265
+Frames
266
+  -----------------------------------------------------------------
267
+  | ### | x | Frame name               | Connected output         |
268
+  -----------------------------------------------------------------
269
+  |   1 |   | Frame 1                  | Output 13                |
270
+  |   2 | L | Frame 2                  | Output 14                |
271
+  |   3 | O | Frame 3                  | Output 15                |
272
+  |   4 |   | Frame 4                  |                          |
273
+  |   5 |   | Frame 5                  |                          |
274
+  |   6 |   | Frame 6                  |                          |
275
+  |   7 |   | Frame 7                  |                          |
276
+  |   8 |   | Frame 8                  |                          |
277
+  -----------------------------------------------------------------
278
+
257
 
279
 
258
 |----------------------------------------------------------------------|
280
 |----------------------------------------------------------------------|
259
 
281
 

+ 24
- 2
cmd.c View File

38
 	[CMD_SERIAL_PORT_DIRECTIONS] = "SERIAL PORT DIRECTIONS",
38
 	[CMD_SERIAL_PORT_DIRECTIONS] = "SERIAL PORT DIRECTIONS",
39
 	[CMD_PROCESSING_UNIT_ROUTING]= "PROCESSING UNIT ROUTING",
39
 	[CMD_PROCESSING_UNIT_ROUTING]= "PROCESSING UNIT ROUTING",
40
 	[CMD_PROCESSING_UNIT_LOCKS]  = "PROCESSING UNIT LOCKS",
40
 	[CMD_PROCESSING_UNIT_LOCKS]  = "PROCESSING UNIT LOCKS",
41
+	[CMD_FRAME_LABELS]           = "FRAME LABELS",
42
+	[CMD_FRAME_BUFFER_ROUTING]   = "FRAME BUFFER ROUTING",
43
+	[CMD_FRAME_BUFFER_LOCKS]     = "FRAME BUFFER LOCKS",
41
 	[CMD_PING]                 = "PING",
44
 	[CMD_PING]                 = "PING",
42
 	[CMD_ACK]                  = "ACK",
45
 	[CMD_ACK]                  = "ACK",
43
 	[CMD_NAK]                  = "NAK",
46
 	[CMD_NAK]                  = "NAK",
138
 		.port_id1 = "proc unit",
141
 		.port_id1 = "proc unit",
139
 		.opt_prefix = "pu",
142
 		.opt_prefix = "pu",
140
 	},
143
 	},
144
+	[CMD_FRAME_LABELS]  = { .cmd = CMD_FRAME_LABELS, .type = PARSE_LABEL,
145
+		.ports1 = OFS(frames),
146
+		.port_id1 = "frame",
147
+		.opt_prefix = "fr",
148
+	},
149
+	[CMD_FRAME_BUFFER_ROUTING] = { .cmd = CMD_FRAME_BUFFER_ROUTING, .type = PARSE_ROUTE,
150
+		.ports1 = OFS(frames),
151
+		.ports2 = OFS(outputs),
152
+		.port_id1 = "frame",
153
+		.port_id2 = "output",
154
+		.opt_prefix = "fr",
155
+		.allow_disconnect = true,
156
+	},
157
+	[CMD_FRAME_BUFFER_LOCKS] = { .cmd = CMD_FRAME_BUFFER_LOCKS, .type = PARSE_LOCK,
158
+		.ports1 = OFS(frames),
159
+		.port_id1 = "frame",
160
+		.opt_prefix = "fr",
161
+	},
141
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
162
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
142
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
163
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
143
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
164
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
293
 				d->outputs.num = strtoul(p, NULL, 10);
314
 				d->outputs.num = strtoul(p, NULL, 10);
294
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))
315
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))
295
 				d->mon_outputs.num = strtoul(p, NULL, 10);
316
 				d->mon_outputs.num = strtoul(p, NULL, 10);
296
-			else if ((p = parse_text(line, "Serial ports: ")))
317
+			else if ((p = parse_text(line, "Serial ports: "))) {
297
 				d->serial.num = strtoul(p, NULL, 10);
318
 				d->serial.num = strtoul(p, NULL, 10);
298
-			else {
319
+				d->frames.num = d->serial.num;
320
+			} else {
299
 				q("WARNING: VIDEOHUB DEVICE command sent unknown line: '%s'\n", line);
321
 				q("WARNING: VIDEOHUB DEVICE command sent unknown line: '%s'\n", line);
300
 				q("Please report this line to author's email: georgi@unixsol.org\n");
322
 				q("Please report this line to author's email: georgi@unixsol.org\n");
301
 			}
323
 			}

+ 4
- 1
cmd.h View File

15
 
15
 
16
 #include <stdbool.h>
16
 #include <stdbool.h>
17
 
17
 
18
-#define NUM_COMMANDS 21
18
+#define NUM_COMMANDS 24
19
 
19
 
20
 enum vcmd {
20
 enum vcmd {
21
 	CMD_PROTOCOL_PREAMBLE,
21
 	CMD_PROTOCOL_PREAMBLE,
36
 	CMD_SERIAL_PORT_DIRECTIONS,
36
 	CMD_SERIAL_PORT_DIRECTIONS,
37
 	CMD_PROCESSING_UNIT_ROUTING,
37
 	CMD_PROCESSING_UNIT_ROUTING,
38
 	CMD_PROCESSING_UNIT_LOCKS,
38
 	CMD_PROCESSING_UNIT_LOCKS,
39
+	CMD_FRAME_LABELS,
40
+	CMD_FRAME_BUFFER_ROUTING,
41
+	CMD_FRAME_BUFFER_LOCKS,
39
 	CMD_PING,
42
 	CMD_PING,
40
 	CMD_ACK,
43
 	CMD_ACK,
41
 	CMD_NAK = (NUM_COMMANDS - 1),
44
 	CMD_NAK = (NUM_COMMANDS - 1),

+ 1
- 0
data.h View File

82
 	struct port_set			mon_outputs;
82
 	struct port_set			mon_outputs;
83
 	struct port_set			serial;
83
 	struct port_set			serial;
84
 	struct port_set			proc_units;
84
 	struct port_set			proc_units;
85
+	struct port_set			frames;
85
 };
86
 };
86
 
87
 
87
 extern int debug;
88
 extern int debug;

+ 21
- 0
display.c View File

204
 	printf("\n");
204
 	printf("\n");
205
 }
205
 }
206
 
206
 
207
+void print_device_frame_buffers(struct videohub_data *d) {
208
+	unsigned int i, len = 65;
209
+	if (!d->frames.num)
210
+		return;
211
+	printf("Frames\n");
212
+	printf_line(len);
213
+	printf("  | ### | x | %-24s | %-24s |\n", "Frame name", "Connected output");
214
+	printf_line(len);
215
+	for(i = 0; i < d->frames.num; i++) {
216
+		printf("  | %3d | %c | %-24s | %-24s |\n",
217
+			i + 1,
218
+			port_lock_symbol(d->frames.port[i].lock),
219
+			d->frames.port[i].name,
220
+			d->frames.port[i].routed_to == NO_PORT ? "" : d->outputs.port[d->frames.port[i].routed_to].name
221
+		);
222
+	}
223
+	printf_line(len);
224
+	printf("\n");
225
+}
226
+
227
+
207
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
228
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
208
 	unsigned int i, last = 0;
229
 	unsigned int i, last = 0;
209
 	struct videohub_commands *v = &videohub_commands[vcmd];
230
 	struct videohub_commands *v = &videohub_commands[vcmd];

+ 1
- 0
display.h View File

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
 void print_device_processing_units(struct videohub_data *d);
22
+void print_device_frame_buffers(struct videohub_data *d);
22
 
23
 
23
 void print_device_backup(struct videohub_data *d);
24
 void print_device_backup(struct videohub_data *d);
24
 
25
 

+ 20
- 0
test/input-00.txt View File

178
 2 O
178
 2 O
179
 3 U
179
 3 U
180
 
180
 
181
+FRAME LABELS:
182
+0 Frame 1
183
+1 Frame 2
184
+2 Frame 3
185
+3 Frame 4
186
+4 Frame 5
187
+5 Frame 6
188
+6 Frame 7
189
+7 Frame 8
190
+
191
+FRAME BUFFER ROUTING:
192
+0 12
193
+1 13
194
+2 14
195
+
196
+FRAME BUFFER LOCKS:
197
+0 U
198
+1 L
199
+2 O
200
+

+ 6
- 0
test/input-14.txt View File

113
 2 Thunderbolt
113
 2 Thunderbolt
114
 3 RS422
114
 3 RS422
115
 
115
 
116
+FRAME LABELS:
117
+0 Pic 1
118
+1 Pic 2
119
+2 Pic 3
120
+3 Pic 4
121
+

+ 4
- 0
test/run View File

65
 	--pu-clear 1 --pu-clear 3 --pu-clear 4 \
65
 	--pu-clear 1 --pu-clear 3 --pu-clear 4 \
66
 	--pu-unlock 1 --pu-lock 1 --pu-connect 1 "Windows 4 HD" \
66
 	--pu-unlock 1 --pu-lock 1 --pu-connect 1 "Windows 4 HD" \
67
 	--pu-connect 4 "DPlay1" --pu-lock 4 \
67
 	--pu-connect 4 "DPlay1" --pu-lock 4 \
68
+	--fr-name 1 "Pic 1" --fr-name 2 "Pic 2" \
69
+	--fr-output 1 13 --fr-output 2 14 --fr-output 3 15 \
70
+	--fr-clear 3 \
71
+	--fr-lock 1 --fr-lock 2 --fr-lock 8 --fr-unlock 8 \
68
 $@ &> test/test-04.out
72
 $@ &> test/test-04.out
69
 check test/test-04 "Test multiple configuration commands"
73
 check test/test-04 "Test multiple configuration commands"
70
 
74
 

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

92
   |         4 |   | Windows 3                |
92
   |         4 |   | Windows 3                |
93
   --------------------------------------------
93
   --------------------------------------------
94
 
94
 
95
+Frames
96
+  -----------------------------------------------------------------
97
+  | ### | x | Frame name               | Connected output         |
98
+  -----------------------------------------------------------------
99
+  |   1 |   | Frame 1                  | Output 13                |
100
+  |   2 | L | Frame 2                  | Output 14                |
101
+  |   3 | O | Frame 3                  | Output 15                |
102
+  |   4 |   | Frame 4                  |                          |
103
+  |   5 |   | Frame 5                  |                          |
104
+  |   6 |   | Frame 6                  |                          |
105
+  |   7 |   | Frame 7                  |                          |
106
+  |   8 |   | Frame 8                  |                          |
107
+  -----------------------------------------------------------------
108
+

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

43
   --se-name   6 "Serial 6" \
43
   --se-name   6 "Serial 6" \
44
   --se-name   7 "Serial 7" \
44
   --se-name   7 "Serial 7" \
45
   --se-name   8 "Serial 8" \
45
   --se-name   8 "Serial 8" \
46
+  --fr-name   1 "Frame 1" \
47
+  --fr-name   2 "Frame 2" \
48
+  --fr-name   3 "Frame 3" \
49
+  --fr-name   4 "Frame 4" \
50
+  --fr-name   5 "Frame 5" \
51
+  --fr-name   6 "Frame 6" \
52
+  --fr-name   7 "Frame 7" \
53
+  --fr-name   8 "Frame 8" \
46
   --vo-input   1   3 \
54
   --vo-input   1   3 \
47
   --vo-input   2   2 \
55
   --vo-input   2   2 \
48
   --vo-input   3   1 \
56
   --vo-input   3   1 \
68
   --pu-input   1   4 \
76
   --pu-input   1   4 \
69
   --pu-input   2   2 \
77
   --pu-input   2   2 \
70
   --pu-input   4   3 \
78
   --pu-input   4   3 \
79
+  --fr-input   1  13 \
80
+  --fr-input   2  14 \
81
+  --fr-input   3  15 \
71
   --se-dir   1 in \
82
   --se-dir   1 in \
72
   --se-dir   2 auto \
83
   --se-dir   2 auto \
73
   --se-dir   3 out \
84
   --se-dir   3 out \
108
   --pu-unlock   2 \
119
   --pu-unlock   2 \
109
   --pu-unlock   3 --pu-lock   3 \
120
   --pu-unlock   3 --pu-lock   3 \
110
   --pu-unlock   4
121
   --pu-unlock   4
122
+  --fr-unlock   1 \
123
+  --fr-unlock   2 --fr-lock   2 \
124
+  --fr-unlock   3 --fr-lock   3 \
125
+  --fr-unlock   4 \
126
+  --fr-unlock   5 \
127
+  --fr-unlock   6 \
128
+  --fr-unlock   7 \
129
+  --fr-unlock   8
111
 
130
 

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

42
 videohub: rename serial 6 "" to "Serial 6"
42
 videohub: rename serial 6 "" to "Serial 6"
43
 videohub: rename serial 7 "" to "Serial 7"
43
 videohub: rename serial 7 "" to "Serial 7"
44
 videohub: rename serial 8 "" to "Serial 8"
44
 videohub: rename serial 8 "" to "Serial 8"
45
+videohub: rename frame 1 "" to "Frame 1"
46
+videohub: rename frame 2 "" to "Frame 2"
47
+videohub: rename frame 3 "" to "Frame 3"
48
+videohub: rename frame 4 "" to "Frame 4"
49
+videohub: rename frame 5 "" to "Frame 5"
50
+videohub: rename frame 6 "" to "Frame 6"
51
+videohub: rename frame 7 "" to "Frame 7"
52
+videohub: rename frame 8 "" to "Frame 8"
45
 videohub: set video output 1 "Enc1 1" to read from video input 3 "Windows 3"
53
 videohub: set video output 1 "Enc1 1" to read from video input 3 "Windows 3"
46
 videohub: set video output 2 "Enc1 2" to read from video input 2 "Windows 2"
54
 videohub: set video output 2 "Enc1 2" to read from video input 2 "Windows 2"
47
 videohub: set video output 3 "Enc1 3" to read from video input 1 "Windows 1"
55
 videohub: set video output 3 "Enc1 3" to read from video input 1 "Windows 1"
67
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HD"
75
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HD"
68
 videohub: connect proc unit 2 "" to input 2 "Windows 2"
76
 videohub: connect proc unit 2 "" to input 2 "Windows 2"
69
 videohub: connect proc unit 4 "" to input 3 "Windows 3"
77
 videohub: connect proc unit 4 "" to input 3 "Windows 3"
78
+videohub: connect frame 1 "Frame 1" to output 13 "Output 13"
79
+videohub: connect frame 2 "Frame 2" to output 14 "Output 14"
80
+videohub: connect frame 3 "Frame 3" to output 15 "Output 15"
70
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
81
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
71
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
82
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
72
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
83
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
121
 videohub: unlock proc unit 3 ""
132
 videohub: unlock proc unit 3 ""
122
 videohub: lock proc unit 3 ""
133
 videohub: lock proc unit 3 ""
123
 videohub: unlock proc unit 4 ""
134
 videohub: unlock proc unit 4 ""
135
+videohub: unlock frame 1 "Frame 1"
136
+videohub: unlock frame 2 "Frame 2"
137
+videohub: lock frame 2 "Frame 2"
138
+videohub: unlock frame 3 "Frame 3"
139
+videohub: lock frame 3 "Frame 3"
140
+videohub: unlock frame 4 "Frame 4"
141
+videohub: unlock frame 5 "Frame 5"
142
+videohub: unlock frame 6 "Frame 6"
143
+videohub: unlock frame 7 "Frame 7"
144
+videohub: unlock frame 8 "Frame 8"
124
 Device info
145
 Device info
125
   -------------------------------------------------------------------
146
   -------------------------------------------------------------------
126
   | Device address             | sdi-matrix                         |
147
   | Device address             | sdi-matrix                         |
215
   |         4 |   | Windows 3                |
236
   |         4 |   | Windows 3                |
216
   --------------------------------------------
237
   --------------------------------------------
217
 
238
 
239
+Frames
240
+  -----------------------------------------------------------------
241
+  | ### | x | Frame name               | Connected output         |
242
+  -----------------------------------------------------------------
243
+  |   1 |   | Frame 1                  | Output 13                |
244
+  |   2 | O | Frame 2                  | Output 14                |
245
+  |   3 | O | Frame 3                  | Output 15                |
246
+  |   4 |   | Frame 4                  |                          |
247
+  |   5 |   | Frame 5                  |                          |
248
+  |   6 |   | Frame 6                  |                          |
249
+  |   7 |   | Frame 7                  |                          |
250
+  |   8 |   | Frame 8                  |                          |
251
+  -----------------------------------------------------------------
252
+

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

37
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HighDef"
37
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HighDef"
38
 videohub: connect proc unit 4 "" to input 12 "DPlay1"
38
 videohub: connect proc unit 4 "" to input 12 "DPlay1"
39
 videohub: lock proc unit 4 ""
39
 videohub: lock proc unit 4 ""
40
+videohub: rename frame 1 "Frame 1" to "Pic 1"
41
+videohub: rename frame 2 "Frame 2" to "Pic 2"
42
+videohub: connect frame 1 "Pic 1" to output 13 "Output 13"
43
+videohub: connect frame 2 "Pic 2" to output 14 "Output 14"
44
+videohub: connect frame 3 "Frame 3" to output 15 "Output 15"
45
+videohub: lock frame 1 "Pic 1"
46
+videohub: lock frame 2 "Pic 2"
47
+videohub: lock frame 8 "Frame 8"
48
+videohub: unlock frame 8 "Frame 8"
40
 Device info
49
 Device info
41
   -------------------------------------------------------------------
50
   -------------------------------------------------------------------
42
   | Device address             | sdi-matrix                         |
51
   | Device address             | sdi-matrix                         |
132
   |         4 | O | DPlay1                   |
141
   |         4 | O | DPlay1                   |
133
   --------------------------------------------
142
   --------------------------------------------
134
 
143
 
144
+Frames
145
+  -----------------------------------------------------------------
146
+  | ### | x | Frame name               | Connected output         |
147
+  -----------------------------------------------------------------
148
+  |   1 | O | Pic 1                    | Output 13                |
149
+  |   2 | O | Pic 2                    | Output 14                |
150
+  |   3 | O | Frame 3                  | Output 15                |
151
+  |   4 |   | Frame 4                  |                          |
152
+  |   5 |   | Frame 5                  |                          |
153
+  |   6 |   | Frame 6                  |                          |
154
+  |   7 |   | Frame 7                  |                          |
155
+  |   8 |   | Frame 8                  |                          |
156
+  -----------------------------------------------------------------
157
+

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

92
   |         4 |   | Windows 3                |
92
   |         4 |   | Windows 3                |
93
   --------------------------------------------
93
   --------------------------------------------
94
 
94
 
95
+Frames
96
+  -----------------------------------------------------------------
97
+  | ### | x | Frame name               | Connected output         |
98
+  -----------------------------------------------------------------
99
+  |   1 |   | Frame 1                  | Output 13                |
100
+  |   2 | O | Frame 2                  | Output 14                |
101
+  |   3 | O | Frame 3                  | Output 15                |
102
+  |   4 |   | Frame 4                  |                          |
103
+  |   5 |   | Frame 5                  |                          |
104
+  |   6 |   | Frame 6                  |                          |
105
+  |   7 |   | Frame 7                  |                          |
106
+  |   8 |   | Frame 8                  |                          |
107
+  -----------------------------------------------------------------
108
+

+ 10
- 0
test/test-14.ok View File

93
   |   4 |   | auto | Remote 4           |                    | 4 |
93
   |   4 |   | auto | Remote 4           |                    | 4 |
94
   ----------------------------------------------------------------
94
   ----------------------------------------------------------------
95
 
95
 
96
+Frames
97
+  -----------------------------------------------------------------
98
+  | ### | x | Frame name               | Connected output         |
99
+  -----------------------------------------------------------------
100
+  |   1 |   | Pic 1                    |                          |
101
+  |   2 |   | Pic 2                    |                          |
102
+  |   3 |   | Pic 3                    |                          |
103
+  |   4 |   | Pic 4                    |                          |
104
+  -----------------------------------------------------------------
105
+

+ 14
- 30
test/test-17.ok View File

29
          Please report this command to author's email: georgi@unixsol.org
29
          Please report this command to author's email: georgi@unixsol.org
30
          You may use -q or --quiet to suppress the message.
30
          You may use -q or --quiet to suppress the message.
31
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
31
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
32
-FRAME LABELS:
33
-0 gf-Frame 1
34
-1 Frame 2
35
-2 gf-Frame 3
36
-3 Frame 4
37
-4 gf-Frame 5
38
-5 Frame 6
39
-6 gf-Frame 7
40
-7 Frame 8
41
----------8<-----------8<----------- cut here ---------8<------------8<---------
42
-WARNING: Videohub sent unknown command!
43
-         Please report this command to author's email: georgi@unixsol.org
44
-         You may use -q or --quiet to suppress the message.
45
----------8<-----------8<----------- cut here ---------8<------------8<---------
46
-FRAME BUFFER ROUTING:
47
-0 Frame 4
48
-1 gf-Frame 3
49
-2 Frame 6
50
----------8<-----------8<----------- cut here ---------8<------------8<---------
51
-WARNING: Videohub sent unknown command!
52
-         Please report this command to author's email: georgi@unixsol.org
53
-         You may use -q or --quiet to suppress the message.
54
----------8<-----------8<----------- cut here ---------8<------------8<---------
55
-FRAME BUFFER LOCKS:
56
-0 U
57
----------8<-----------8<----------- cut here ---------8<------------8<---------
58
-WARNING: Videohub sent unknown command!
59
-         Please report this command to author's email: georgi@unixsol.org
60
-         You may use -q or --quiet to suppress the message.
61
----------8<-----------8<----------- cut here ---------8<------------8<---------
62
 ALARM STATUS:
32
 ALARM STATUS:
63
 0 Error
33
 0 Error
64
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
34
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
195
   |   8 |   |  out | Serial 8           |                    | x |
165
   |   8 |   |  out | Serial 8           |                    | x |
196
   ----------------------------------------------------------------
166
   ----------------------------------------------------------------
197
 
167
 
168
+Frames
169
+  -----------------------------------------------------------------
170
+  | ### | x | Frame name               | Connected output         |
171
+  -----------------------------------------------------------------
172
+  |   1 |   | gf-Frame 1               | Enc1 1                   |
173
+  |   2 |   | Frame 2                  | Enc1 1                   |
174
+  |   3 |   | gf-Frame 3               | Enc1 1                   |
175
+  |   4 |   | Frame 4                  |                          |
176
+  |   5 |   | gf-Frame 5               |                          |
177
+  |   6 |   | Frame 6                  |                          |
178
+  |   7 |   | gf-Frame 7               |                          |
179
+  |   8 |   | Frame 8                  |                          |
180
+  -----------------------------------------------------------------
181
+

+ 21
- 2
videohubctrl.1 View File

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
   - Processing units
19
+  - Frames
19
 .SH MAIN OPTIONS
20
 .SH MAIN OPTIONS
20
 .PP
21
 .PP
21
 .TP
22
 .TP
168
 Lock processing unit port X.
169
 Lock processing unit port X.
169
 .TP
170
 .TP
170
 \fB\-\-pu\-unlock\fR <pu_X>
171
 \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.
172
+Unlock processing unit port X. If the processing unit is locked by somebody
173
+else the port would be forcefully unlocked.
174
+.SH FRAMES CONFIGURATION
175
+.PP
176
+.TP
177
+\fB\-\-fr\-name\fR <fr_X> <name>
178
+Set frame X name.
179
+.TP
180
+\fB\-\-fr\-output\fR <fr_X> <out_Y>
181
+Output frame X to video output port Y.
182
+.TP
183
+\fB\-\-fr\-clear\fR <fr_X>
184
+Disconnect frame X from the connected output port.
185
+.TP
186
+\fB\-\-fr\-lock\fR <fr_X>
187
+Lock frame X.
188
+.TP
189
+\fB\-\-fr\-unlock\fR <fr_X>
190
+Unlock frame X. If the frame is locked by somebody else the port would be
191
+forcefully unlocked.
173
 .SH MISC OPTIONS
192
 .SH MISC OPTIONS
174
 .PP
193
 .PP
175
 .TP
194
 .TP

+ 26
- 0
videohubctrl.c View File

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
 	action_list_proc_units	= (1 << 5),
47
+	action_list_frames		= (1 << 6),
47
 };
48
 };
48
 
49
 
49
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
50
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
91
 	{ "pu-lock",			required_argument, NULL, 5002 },
92
 	{ "pu-lock",			required_argument, NULL, 5002 },
92
 	{ "pu-unlock",			required_argument, NULL, 5003 },
93
 	{ "pu-unlock",			required_argument, NULL, 5003 },
93
 	{ "pu-clear",			required_argument, NULL, 5004 },
94
 	{ "pu-clear",			required_argument, NULL, 5004 },
95
+	{ "fr-name",			required_argument, NULL, 6001 },
96
+	{ "fr-output",			required_argument, NULL, 6002 },
97
+	{ "fr-connect",			required_argument, NULL, 6002 }, // Alias of --fr-output
98
+	{ "fr-input",			required_argument, NULL, 6002 }, // Alias of --fr-output
99
+	{ "fr-route",			required_argument, NULL, 6002 }, // Alias of --fr-output
100
+	{ "fr-lock",			required_argument, NULL, 6003 },
101
+	{ "fr-unlock",			required_argument, NULL, 6004 },
102
+	{ "fr-clear",			required_argument, NULL, 6006 },
94
 	{ 0, 0, 0, 0 }
103
 	{ 0, 0, 0, 0 }
95
 };
104
 };
96
 
105
 
117
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
126
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
118
 	printf(" --list-serial              | List device serial ports.\n");
127
 	printf(" --list-serial              | List device serial ports.\n");
119
 	printf(" --list-proc-units          | List device processing units.\n");
128
 	printf(" --list-proc-units          | List device processing units.\n");
129
+	printf(" --list-frames              | List device frame buffers.\n");
120
 	printf("\n");
130
 	printf("\n");
121
 	printf("Video inputs configuration:\n");
131
 	printf("Video inputs configuration:\n");
122
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
132
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
148
 	printf(" --pu-lock <pu_X>           | Lock processing unit X.\n");
158
 	printf(" --pu-lock <pu_X>           | Lock processing unit X.\n");
149
 	printf(" --pu-unlock <pu_X>         | Unlock processing unit X.\n");
159
 	printf(" --pu-unlock <pu_X>         | Unlock processing unit X.\n");
150
 	printf("\n");
160
 	printf("\n");
161
+	printf("Frames configuration:\n");
162
+	printf(" --fr-name <fr_X> <name>    | Set frame X name.\n");
163
+	printf(" --fr-output <fr_X> <out_Y> | Output frame X to output Y.\n");
164
+	printf(" --fr-clear <fr_X>          | Stop outputing frame X to the output.\n");
165
+	printf(" --fr-lock <fr_X>           | Lock frame X.\n");
166
+	printf(" --fr-unlock <rf_X>         | Unlock frame X.\n");
167
+	printf("\n");
151
 	printf("Misc options:\n");
168
 	printf("Misc options:\n");
152
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
169
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
153
 	printf(" -d --debug                 | Increase logging verbosity.\n");
170
 	printf(" -d --debug                 | Increase logging verbosity.\n");
279
 			case 5002: parse_cmd1(argc, argv, CMD_PROCESSING_UNIT_LOCKS, true); break; // --pu-lock
296
 			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
297
 			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
298
 			case 5004: parse_cmd2s(argc, argv, CMD_PROCESSING_UNIT_ROUTING); break; // --pu-clear
299
+			case 6001: parse_cmd2(argc, argv, CMD_FRAME_LABELS); break; // --fr-name
300
+			case 6002: parse_cmd2(argc, argv, CMD_FRAME_BUFFER_ROUTING); break; // --fr-input
301
+			case 6003: parse_cmd1(argc, argv, CMD_FRAME_BUFFER_LOCKS, true); break; // --fr-lock
302
+			case 6004: parse_cmd1(argc, argv, CMD_FRAME_BUFFER_LOCKS, false); break; // --fr-unlock
303
+			case 6005: parse_cmd2s(argc, argv, CMD_FRAME_BUFFER_ROUTING); break; // --fr-clear
282
 			case 'H': // --help
304
 			case 'H': // --help
283
 				show_help(data);
305
 				show_help(data);
284
 				exit(EXIT_SUCCESS);
306
 				exit(EXIT_SUCCESS);
320
 	print_device_monitoring_outputs(d);
342
 	print_device_monitoring_outputs(d);
321
 	print_device_serial_ports(d);
343
 	print_device_serial_ports(d);
322
 	print_device_processing_units(d);
344
 	print_device_processing_units(d);
345
+	print_device_frame_buffers(d);
323
 	fflush(stdout);
346
 	fflush(stdout);
324
 }
347
 }
325
 
348
 
357
 
380
 
358
 	reset_routed_to(&data->serial);
381
 	reset_routed_to(&data->serial);
359
 	reset_routed_to(&data->proc_units);
382
 	reset_routed_to(&data->proc_units);
383
+	reset_routed_to(&data->frames);
360
 	read_device_command_stream(data);
384
 	read_device_command_stream(data);
361
 
385
 
362
 	if (test_data)
386
 	if (test_data)
381
 	check_number_of_ports(&data->mon_outputs);
405
 	check_number_of_ports(&data->mon_outputs);
382
 	check_number_of_ports(&data->serial);
406
 	check_number_of_ports(&data->serial);
383
 	check_number_of_ports(&data->proc_units);
407
 	check_number_of_ports(&data->proc_units);
408
+	check_number_of_ports(&data->frames);
384
 
409
 
385
 	if (num_parsed_cmds) {
410
 	if (num_parsed_cmds) {
386
 		unsigned int i;
411
 		unsigned int i;
430
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
455
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
431
 		if (show_list & action_list_serial)		print_device_serial_ports(data);
456
 		if (show_list & action_list_serial)		print_device_serial_ports(data);
432
 		if (show_list & action_list_proc_units)	print_device_processing_units(data);
457
 		if (show_list & action_list_proc_units)	print_device_processing_units(data);
458
+		if (show_list & action_list_frames)		print_device_frame_buffers(data);
433
 		fflush(stdout);
459
 		fflush(stdout);
434
 	} else if (show_backup) {
460
 	} else if (show_backup) {
435
 		print_device_backup(data);
461
 		print_device_backup(data);

Loading…
Cancel
Save