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,6 +8,8 @@ xxxx-xx-xx : Version 0.5-dev
8 8
  * Display the undocumented "Friendly name" device setting.
9 9
  * Add support for processing units (routing and locks). It is not tested
10 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 14
 2014-11-30 : Version 0.4
13 15
  * Add videohubctrl(1) man page.

+ 22
- 0
README View File

@@ -14,6 +14,7 @@ videohubctrl currently displays and can configure:
14 14
   - Monitoring video output port names, routing and locking
15 15
   - Serial ports names, routing, locking and directions
16 16
   - Processing units
17
+  - Frames
17 18
 
18 19
 Configuration of Videohub's network settings can be made using
19 20
 Blackmagic's Windows program when the device is connected via USB.
@@ -81,6 +82,13 @@ Processing units configuration:
81 82
  --pu-lock <pu_X>           | Lock processing unit X.
82 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 92
 Misc options:
85 93
  -T --test-input <file>     | Read commands from <file>.
86 94
  -d --debug                 | Increase logging verbosity.
@@ -254,6 +262,20 @@ Processing units
254 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,6 +38,9 @@ const char *videohub_commands_text[NUM_COMMANDS] = {
38 38
 	[CMD_SERIAL_PORT_DIRECTIONS] = "SERIAL PORT DIRECTIONS",
39 39
 	[CMD_PROCESSING_UNIT_ROUTING]= "PROCESSING UNIT ROUTING",
40 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 44
 	[CMD_PING]                 = "PING",
42 45
 	[CMD_ACK]                  = "ACK",
43 46
 	[CMD_NAK]                  = "NAK",
@@ -138,6 +141,24 @@ struct videohub_commands videohub_commands[NUM_COMMANDS] = {
138 141
 		.port_id1 = "proc unit",
139 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 162
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
142 163
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
143 164
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },
@@ -293,9 +314,10 @@ bool parse_command(struct videohub_data *d, char *cmd) {
293 314
 				d->outputs.num = strtoul(p, NULL, 10);
294 315
 			else if ((p = parse_text(line, "Video monitoring outputs: ")))
295 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 318
 				d->serial.num = strtoul(p, NULL, 10);
298
-			else {
319
+				d->frames.num = d->serial.num;
320
+			} else {
299 321
 				q("WARNING: VIDEOHUB DEVICE command sent unknown line: '%s'\n", line);
300 322
 				q("Please report this line to author's email: georgi@unixsol.org\n");
301 323
 			}

+ 4
- 1
cmd.h View File

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

+ 1
- 0
data.h View File

@@ -82,6 +82,7 @@ struct videohub_data {
82 82
 	struct port_set			mon_outputs;
83 83
 	struct port_set			serial;
84 84
 	struct port_set			proc_units;
85
+	struct port_set			frames;
85 86
 };
86 87
 
87 88
 extern int debug;

+ 21
- 0
display.c View File

@@ -204,6 +204,27 @@ void print_device_processing_units(struct videohub_data *d) {
204 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 228
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
208 229
 	unsigned int i, last = 0;
209 230
 	struct videohub_commands *v = &videohub_commands[vcmd];

+ 1
- 0
display.h View File

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

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

@@ -178,3 +178,23 @@ PROCESSING UNIT LOCKS:
178 178
 2 O
179 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,3 +113,9 @@ SERIAL PORT STATUS:
113 113
 2 Thunderbolt
114 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,6 +65,10 @@ videohubctrl --test-input test/input-00.txt \
65 65
 	--pu-clear 1 --pu-clear 3 --pu-clear 4 \
66 66
 	--pu-unlock 1 --pu-lock 1 --pu-connect 1 "Windows 4 HD" \
67 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 72
 $@ &> test/test-04.out
69 73
 check test/test-04 "Test multiple configuration commands"
70 74
 

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

@@ -92,3 +92,17 @@ Processing units
92 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,6 +43,14 @@ videohubctrl \
43 43
   --se-name   6 "Serial 6" \
44 44
   --se-name   7 "Serial 7" \
45 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 54
   --vo-input   1   3 \
47 55
   --vo-input   2   2 \
48 56
   --vo-input   3   1 \
@@ -68,6 +76,9 @@ videohubctrl \
68 76
   --pu-input   1   4 \
69 77
   --pu-input   2   2 \
70 78
   --pu-input   4   3 \
79
+  --fr-input   1  13 \
80
+  --fr-input   2  14 \
81
+  --fr-input   3  15 \
71 82
   --se-dir   1 in \
72 83
   --se-dir   2 auto \
73 84
   --se-dir   3 out \
@@ -108,4 +119,12 @@ videohubctrl \
108 119
   --pu-unlock   2 \
109 120
   --pu-unlock   3 --pu-lock   3 \
110 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,6 +42,14 @@ videohub: rename serial 5 "" to "Serial 5"
42 42
 videohub: rename serial 6 "" to "Serial 6"
43 43
 videohub: rename serial 7 "" to "Serial 7"
44 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 53
 videohub: set video output 1 "Enc1 1" to read from video input 3 "Windows 3"
46 54
 videohub: set video output 2 "Enc1 2" to read from video input 2 "Windows 2"
47 55
 videohub: set video output 3 "Enc1 3" to read from video input 1 "Windows 1"
@@ -67,6 +75,9 @@ videohub: connect serial 2 "Serial Ctrl 2" to serial 4 "Deck 4"
67 75
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HD"
68 76
 videohub: connect proc unit 2 "" to input 2 "Windows 2"
69 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 81
 videohub: set serial 1 "Serial Ctrl 1" direction to IN (Workstation)
71 82
 videohub: set serial 2 "Serial Ctrl 2" direction to AUTO
72 83
 videohub: set serial 3 "Deck 3" direction to OUT (Deck)
@@ -121,6 +132,16 @@ videohub: unlock proc unit 2 ""
121 132
 videohub: unlock proc unit 3 ""
122 133
 videohub: lock proc unit 3 ""
123 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 145
 Device info
125 146
   -------------------------------------------------------------------
126 147
   | Device address             | sdi-matrix                         |
@@ -215,3 +236,17 @@ Processing units
215 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,6 +37,15 @@ videohub: lock proc unit 1 ""
37 37
 videohub: connect proc unit 1 "" to input 4 "Windows 4 HighDef"
38 38
 videohub: connect proc unit 4 "" to input 12 "DPlay1"
39 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 49
 Device info
41 50
   -------------------------------------------------------------------
42 51
   | Device address             | sdi-matrix                         |
@@ -132,3 +141,17 @@ Processing units
132 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,3 +92,17 @@ Processing units
92 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,3 +93,13 @@ Serial ports
93 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,36 +29,6 @@ WARNING: Videohub sent unknown command!
29 29
          Please report this command to author's email: georgi@unixsol.org
30 30
          You may use -q or --quiet to suppress the message.
31 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 32
 ALARM STATUS:
63 33
 0 Error
64 34
 ---------8<-----------8<----------- cut here ---------8<------------8<---------
@@ -195,3 +165,17 @@ Serial ports
195 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,6 +16,7 @@ videohubctrl currently displays and can configure:
16 16
   - Monitoring video output port names, routing and locking
17 17
   - Serial ports names, routing, locking and directions
18 18
   - Processing units
19
+  - Frames
19 20
 .SH MAIN OPTIONS
20 21
 .PP
21 22
 .TP
@@ -168,8 +169,26 @@ Disconnect processing unit X from the connected input port.
168 169
 Lock processing unit port X.
169 170
 .TP
170 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 192
 .SH MISC OPTIONS
174 193
 .PP
175 194
 .TP

+ 26
- 0
videohubctrl.c View File

@@ -44,6 +44,7 @@ enum list_actions {
44 44
 	action_list_moutputs	= (1 << 3),
45 45
 	action_list_serial		= (1 << 4),
46 46
 	action_list_proc_units	= (1 << 5),
47
+	action_list_frames		= (1 << 6),
47 48
 };
48 49
 
49 50
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
@@ -91,6 +92,14 @@ static const struct option long_options[] = {
91 92
 	{ "pu-lock",			required_argument, NULL, 5002 },
92 93
 	{ "pu-unlock",			required_argument, NULL, 5003 },
93 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 103
 	{ 0, 0, 0, 0 }
95 104
 };
96 105
 
@@ -117,6 +126,7 @@ static void show_help(struct videohub_data *data) {
117 126
 	printf(" --list-moutputs            | List device monitoring outputs.\n");
118 127
 	printf(" --list-serial              | List device serial ports.\n");
119 128
 	printf(" --list-proc-units          | List device processing units.\n");
129
+	printf(" --list-frames              | List device frame buffers.\n");
120 130
 	printf("\n");
121 131
 	printf("Video inputs configuration:\n");
122 132
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
@@ -148,6 +158,13 @@ static void show_help(struct videohub_data *data) {
148 158
 	printf(" --pu-lock <pu_X>           | Lock processing unit X.\n");
149 159
 	printf(" --pu-unlock <pu_X>         | Unlock processing unit X.\n");
150 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 168
 	printf("Misc options:\n");
152 169
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
153 170
 	printf(" -d --debug                 | Increase logging verbosity.\n");
@@ -279,6 +296,11 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
279 296
 			case 5002: parse_cmd1(argc, argv, CMD_PROCESSING_UNIT_LOCKS, true); break; // --pu-lock
280 297
 			case 5003: parse_cmd1(argc, argv, CMD_PROCESSING_UNIT_LOCKS, false); break; // --pu-unlock
281 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 304
 			case 'H': // --help
283 305
 				show_help(data);
284 306
 				exit(EXIT_SUCCESS);
@@ -320,6 +342,7 @@ static void print_device_full(struct videohub_data *d) {
320 342
 	print_device_monitoring_outputs(d);
321 343
 	print_device_serial_ports(d);
322 344
 	print_device_processing_units(d);
345
+	print_device_frame_buffers(d);
323 346
 	fflush(stdout);
324 347
 }
325 348
 
@@ -357,6 +380,7 @@ int main(int argc, char **argv) {
357 380
 
358 381
 	reset_routed_to(&data->serial);
359 382
 	reset_routed_to(&data->proc_units);
383
+	reset_routed_to(&data->frames);
360 384
 	read_device_command_stream(data);
361 385
 
362 386
 	if (test_data)
@@ -381,6 +405,7 @@ int main(int argc, char **argv) {
381 405
 	check_number_of_ports(&data->mon_outputs);
382 406
 	check_number_of_ports(&data->serial);
383 407
 	check_number_of_ports(&data->proc_units);
408
+	check_number_of_ports(&data->frames);
384 409
 
385 410
 	if (num_parsed_cmds) {
386 411
 		unsigned int i;
@@ -430,6 +455,7 @@ int main(int argc, char **argv) {
430 455
 		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
431 456
 		if (show_list & action_list_serial)		print_device_serial_ports(data);
432 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 459
 		fflush(stdout);
434 460
 	} else if (show_backup) {
435 461
 		print_device_backup(data);

Loading…
Cancel
Save