Browse Source

Add full support for monitoring video outputs.

Georgi Chorbadzhiyski 9 years ago
parent
commit
74952e542a
18 changed files with 214 additions and 7 deletions
  1. 2
    0
      ChangeLog
  2. 18
    4
      README
  3. 20
    0
      cmd.c
  4. 4
    1
      cmd.h
  5. 20
    0
      display.c
  6. 1
    0
      display.h
  7. 19
    1
      test/input-00.txt
  8. 1
    1
      test/input-03.txt
  9. 15
    0
      test/run
  10. 11
    0
      test/test-01.ok
  11. 12
    0
      test/test-02.ok
  12. 25
    0
      test/test-03.ok
  13. 17
    0
      test/test-04.ok
  14. 11
    0
      test/test-05.ok
  15. 6
    0
      test/test-06.ok
  16. 1
    0
      test/test-07.ok
  17. 10
    0
      test/test-15.ok
  18. 21
    0
      videohubctrl.c

+ 2
- 0
ChangeLog View File

@@ -8,6 +8,8 @@
8 8
  * Add support for port statuses (types) which are reported by
9 9
    Universal Videohub.
10 10
  * Rename --vo-route parameter to --vo-input.
11
+ * Add support for video monitoring outputs (names, routing and locks),
12
+    --mo-name, mo-input, --mo-lock and --mo-unlock.
11 13
 
12 14
 2014-11-28 : Version 0.3
13 15
  * Rename -v / --verbose parameter to -d / --debug.

+ 18
- 4
README View File

@@ -9,16 +9,14 @@ router and probably will work with other Videohub models.
9 9
 videohubctrl currently displays and can configure:
10 10
 
11 11
   - Video input port names
12
-  - Video output port names
13
-  - Video output routing
14
-  - Video output locking
12
+  - Video output port names, routing and locking
15 13
   - Input/Output port statuses
14
+  - Monitoring video output port names, routing and locking
16 15
 
17 16
 The following features found in bigger Videohub models are currently
18 17
 not supported (I don't have the hardware):
19 18
 
20 19
   - Configuration of video processing units
21
-  - Configuration of Video monitoring outputs
22 20
   - Configuration of Serial ports
23 21
 
24 22
 Configuration of Videohub's network settings can be made using
@@ -63,6 +61,12 @@ Video outputs configuration:
63 61
  --vo-lock <out_X>          | Lock output port X.
64 62
  --vo-unlock <out_X>        | Unlock output port X.
65 63
 
64
+Monitoring outputs configuration:
65
+ --mo-name <mout_X> <name>  | Set monitoring port X name.
66
+ --mo-route <mout_X> <in_Y> | Connect monitoring X to video input Y
67
+ --mo-lock <mout_X>         | Lock monitoring port X.
68
+ --mo-unlock <mout_X>       | Unlock monitoring port X.
69
+
66 70
 Misc options:
67 71
  -T --test-input <file>     | Read commands from <file>.
68 72
  -d --debug                 | Increase logging verbosity.
@@ -199,6 +203,16 @@ Video outputs
199 203
   | 16 | O | Loopback                 | Loopback                 | o |
200 204
   --------------------------------------------------------------------
201 205
 
206
+Monitoring outputs
207
+  ----------------------------------------------------------------
208
+  | ## | x | Monitoring output name   | Connected video input    |
209
+  ----------------------------------------------------------------
210
+  |  1 |   | Monitor 1                | Windows 1                |
211
+  |  2 | O | Monitor 2                | Windows 2                |
212
+  |  3 | L | Monitor 3                | Windows 3                |
213
+  |  4 |   | Monitor 4                | Windows 4 HD             |
214
+  ----------------------------------------------------------------
215
+
202 216
 |----------------------------------------------------------------------|
203 217
 
204 218
 

+ 20
- 0
cmd.c View File

@@ -28,6 +28,9 @@ const char *videohub_commands_text[NUM_COMMANDS] = {
28 28
 	[CMD_VIDEO_OUTPUT_ROUTING] = "VIDEO OUTPUT ROUTING",
29 29
 	[CMD_VIDEO_INPUT_STATUS]   = "VIDEO INPUT STATUS",
30 30
 	[CMD_VIDEO_OUTPUT_STATUS]  = "VIDEO OUTPUT STATUS",
31
+	[CMD_MONITORING_OUTPUT_LABELS]  = "MONITORING OUTPUT LABELS",
32
+	[CMD_MONITORING_OUTPUT_LOCKS]   = "MONITORING OUTPUT LOCKS",
33
+	[CMD_MONITORING_OUTPUT_ROUTING] = "VIDEO MONITORING OUTPUT ROUTING",
31 34
 	[CMD_PING]                 = "PING",
32 35
 	[CMD_ACK]                  = "ACK",
33 36
 	[CMD_NAK]                  = "NAK",
@@ -70,6 +73,23 @@ struct videohub_commands videohub_commands[NUM_COMMANDS] = {
70 73
 		.port_id1 = "video output",
71 74
 		.opt_prefix = "vo",
72 75
 	},
76
+	[CMD_MONITORING_OUTPUT_LABELS]  = { .cmd = CMD_MONITORING_OUTPUT_LABELS , .type = PARSE_LABEL,
77
+		.ports1 = OFS(mon_outputs),
78
+		.port_id1 = "monitoring output",
79
+		.opt_prefix = "mo",
80
+	},
81
+	[CMD_MONITORING_OUTPUT_LOCKS]   = { .cmd = CMD_MONITORING_OUTPUT_LOCKS  , .type = PARSE_LOCK,
82
+		.ports1 = OFS(mon_outputs),
83
+		.port_id1 = "monitoring output",
84
+		.opt_prefix = "mo",
85
+	},
86
+	[CMD_MONITORING_OUTPUT_ROUTING] = { .cmd = CMD_MONITORING_OUTPUT_ROUTING, .type = PARSE_ROUTE,
87
+		.ports1 = OFS(mon_outputs),
88
+		.ports2 = OFS(inputs),
89
+		.port_id1 = "monitoring output",
90
+		.port_id2 = "video input",
91
+		.opt_prefix = "mo",
92
+	},
73 93
 	[CMD_PING]                 = { .cmd = CMD_PING                , .type = PARSE_NONE },
74 94
 	[CMD_ACK]                  = { .cmd = CMD_ACK                 , .type = PARSE_NONE },
75 95
 	[CMD_NAK]                  = { .cmd = CMD_NAK                 , .type = PARSE_NONE },

+ 4
- 1
cmd.h View File

@@ -15,7 +15,7 @@
15 15
 
16 16
 #include <stdbool.h>
17 17
 
18
-#define NUM_COMMANDS 11
18
+#define NUM_COMMANDS 14
19 19
 
20 20
 enum vcmd {
21 21
 	CMD_PROTOCOL_PREAMBLE,
@@ -26,6 +26,9 @@ enum vcmd {
26 26
 	CMD_VIDEO_OUTPUT_ROUTING,
27 27
 	CMD_VIDEO_INPUT_STATUS,
28 28
 	CMD_VIDEO_OUTPUT_STATUS,
29
+	CMD_MONITORING_OUTPUT_LABELS,
30
+	CMD_MONITORING_OUTPUT_LOCKS,
31
+	CMD_MONITORING_OUTPUT_ROUTING,
29 32
 	CMD_PING,
30 33
 	CMD_ACK,
31 34
 	CMD_NAK = (NUM_COMMANDS - 1),

+ 20
- 0
display.c View File

@@ -125,6 +125,26 @@ void print_device_video_outputs(struct videohub_data *d) {
125 125
 	printf("\n");
126 126
 }
127 127
 
128
+void print_device_monitoring_outputs(struct videohub_data *d) {
129
+	unsigned int i, len = 64;
130
+	if (!d->mon_outputs.num)
131
+		return;
132
+	printf("Monitoring outputs\n");
133
+	printf_line(len);
134
+	printf("  | ## | x | %-24s | %-24s |\n", "Monitoring output name", "Connected video input");
135
+	printf_line(len);
136
+	for(i = 0; i < d->mon_outputs.num; i++) {
137
+		printf("  | %2d | %c | %-24s | %-24s |\n",
138
+			i + 1,
139
+			port_lock_symbol(d->mon_outputs.port[i].lock),
140
+			d->mon_outputs.port[i].name,
141
+			d->inputs.port[d->mon_outputs.port[i].routed_to].name
142
+		);
143
+	}
144
+	printf_line(len);
145
+	printf("\n");
146
+}
147
+
128 148
 static void __print_opt(struct videohub_data *d, enum vcmd vcmd) {
129 149
 	unsigned int i, last = 0;
130 150
 	struct videohub_commands *v = &videohub_commands[vcmd];

+ 1
- 0
display.h View File

@@ -16,6 +16,7 @@
16 16
 void print_device_info(struct videohub_data *d);
17 17
 void print_device_video_inputs(struct videohub_data *d);
18 18
 void print_device_video_outputs(struct videohub_data *d);
19
+void print_device_monitoring_outputs(struct videohub_data *d);
19 20
 
20 21
 void print_device_backup(struct videohub_data *d);
21 22
 

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

@@ -8,7 +8,7 @@ Unique ID: 7c2e0d021714
8 8
 Video inputs: 16
9 9
 Video processing units: 0
10 10
 Video outputs: 16
11
-Video monitoring outputs: 0
11
+Video monitoring outputs: 4
12 12
 Serial ports: 0
13 13
 
14 14
 INPUT LABELS:
@@ -107,3 +107,21 @@ VIDEO OUTPUT STATUS:
107 107
 13 Optical
108 108
 14 Optical
109 109
 15 Optical
110
+
111
+MONITORING OUTPUT LABELS:
112
+0 Monitor 1
113
+1 Monitor 2
114
+2 Monitor 3
115
+3 Monitor 4
116
+
117
+VIDEO MONITORING OUTPUT ROUTING:
118
+0 0
119
+1 1
120
+2 2
121
+3 3
122
+
123
+MONITORING OUTPUT LOCKS:
124
+0 U
125
+1 O
126
+2 L
127
+3 U

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

@@ -8,7 +8,7 @@ Unique ID: 7c2e0d021714
8 8
 Video inputs: 16
9 9
 Video processing units: 0
10 10
 Video outputs: 16
11
-Video monitoring outputs: 0
11
+Video monitoring outputs: 4
12 12
 Serial ports: 0
13 13
 
14 14
 VIDEO INPUT STATUS:

+ 15
- 0
test/run View File

@@ -44,6 +44,12 @@ videohubctrl --test-input test/input-00.txt \
44 44
 	--vo-input "Output 5" "Windows 1" \
45 45
 	--vo-input 5 2 \
46 46
 	--vo-input 5 "Windows 3" \
47
+	--mo-name 1 "PC 1 Mon" \
48
+	--mo-name "Monitor 4" "Decklink" \
49
+	--mo-unlock 2 \
50
+	--mo-lock 4 \
51
+	--mo-name 3 "Loopback" \
52
+	--mo-input 3 16 \
47 53
 $@ &> test/test-04.out
48 54
 check test/test-04 "Test multiple configuration commands"
49 55
 
@@ -69,6 +75,12 @@ check test/test-05 "Test if --backup restored correct config."
69 75
 ./videohubctrl --test-input test/input-00.txt --vo-input "Input 10" "Output 10"      $@ &>> test/test-06.out
70 76
 ./videohubctrl --test-input test/input-00.txt --vo-input "Err Output" "Input 10"     $@ &>> test/test-06.out
71 77
 ./videohubctrl --test-input test/input-00.txt --vo-input "Output 10" "Err Input"     $@ &>> test/test-06.out
78
+./videohubctrl --test-input test/input-00.txt --mo-name 18          "Test Output 18" $@ &>> test/test-06.out
79
+./videohubctrl --test-input test/input-00.txt --mo-name "Output 18" "Test Output 18" $@ &>> test/test-06.out
80
+./videohubctrl --test-input test/input-00.txt --mo-lock 18                           $@ &>> test/test-06.out
81
+./videohubctrl --test-input test/input-00.txt --mo-lock "Output 18"                  $@ &>> test/test-06.out
82
+./videohubctrl --test-input test/input-00.txt --mo-unlock 18                         $@ &>> test/test-06.out
83
+./videohubctrl --test-input test/input-00.txt --mo-unlock "Output 18"                $@ &>> test/test-06.out
72 84
 check test/test-06 "Test errors on commands with invalid ports."
73 85
 
74 86
 videohubctrl --test-input test/input-00.txt --list-device $@ &> test/test-07.out
@@ -91,3 +103,6 @@ check test/test-12 "Test device-not_present check"
91 103
 
92 104
 videohubctrl --test-input test/input-14.txt $@ &> test/test-14.out
93 105
 check test/test-14 "Test buggy input"
106
+
107
+videohubctrl --test-input test/input-00.txt --list-moutputs $@ &> test/test-15.out
108
+check test/test-15 "Test --list-moutputs option output"

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

@@ -7,6 +7,7 @@ Device info
7 7
   | Protocol                   | 2.4                        |
8 8
   | Video inputs               | 16                         |
9 9
   | Video outputs              | 16                         |
10
+  | Video monitoring outputs   | 4                          |
10 11
   -----------------------------------------------------------
11 12
 
12 13
 Video inputs
@@ -55,3 +56,13 @@ Video outputs
55 56
   | 16 | O | Loopback                 | Loopback                 | o |
56 57
   --------------------------------------------------------------------
57 58
 
59
+Monitoring outputs
60
+  ----------------------------------------------------------------
61
+  | ## | x | Monitoring output name   | Connected video input    |
62
+  ----------------------------------------------------------------
63
+  |  1 |   | Monitor 1                | Windows 1                |
64
+  |  2 | O | Monitor 2                | Windows 2                |
65
+  |  3 | L | Monitor 3                | Windows 3                |
66
+  |  4 |   | Monitor 4                | Windows 4 HD             |
67
+  ----------------------------------------------------------------
68
+

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

@@ -31,6 +31,10 @@ videohubctrl \
31 31
   --vo-name 14 "Output 14" \
32 32
   --vo-name 15 "Output 15" \
33 33
   --vo-name 16 "Loopback" \
34
+  --mo-name  1 "Monitor 1" \
35
+  --mo-name  2 "Monitor 2" \
36
+  --mo-name  3 "Monitor 3" \
37
+  --mo-name  4 "Monitor 4" \
34 38
   --vo-input  1  3 \
35 39
   --vo-input  2  2 \
36 40
   --vo-input  3  1 \
@@ -47,6 +51,10 @@ videohubctrl \
47 51
   --vo-input 14 14 \
48 52
   --vo-input 15 15 \
49 53
   --vo-input 16 16 \
54
+  --mo-input  1  1 \
55
+  --mo-input  2  2 \
56
+  --mo-input  3  3 \
57
+  --mo-input  4  4 \
50 58
   --vo-unlock  1 --vo-lock  1 \
51 59
   --vo-unlock  2 --vo-lock  2 \
52 60
   --vo-unlock  3 --vo-lock  3 \
@@ -63,4 +71,8 @@ videohubctrl \
63 71
   --vo-unlock 14 \
64 72
   --vo-unlock 15 \
65 73
   --vo-unlock 16 --vo-lock 16
74
+  --mo-unlock  1 \
75
+  --mo-unlock  2 --mo-lock  2 \
76
+  --mo-unlock  3 --mo-lock  3 \
77
+  --mo-unlock  4
66 78
 

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

@@ -30,6 +30,10 @@ videohub: rename video output 13 "" to "Output 13"
30 30
 videohub: rename video output 14 "" to "Output 14"
31 31
 videohub: rename video output 15 "" to "Output 15"
32 32
 videohub: rename video output 16 "" to "Loopback"
33
+videohub: rename monitoring output 1 "" to "Monitor 1"
34
+videohub: rename monitoring output 2 "" to "Monitor 2"
35
+videohub: rename monitoring output 3 "" to "Monitor 3"
36
+videohub: rename monitoring output 4 "" to "Monitor 4"
33 37
 videohub: set video output 1 "Enc1 1" to read from video input 3 "Windows 3"
34 38
 videohub: set video output 2 "Enc1 2" to read from video input 2 "Windows 2"
35 39
 videohub: set video output 3 "Enc1 3" to read from video input 1 "Windows 1"
@@ -46,6 +50,10 @@ videohub: set video output 13 "Output 13" to read from video input 12 "DPlay1"
46 50
 videohub: set video output 14 "Output 14" to read from video input 14 "Input 14"
47 51
 videohub: set video output 15 "Output 15" to read from video input 15 "Input 15"
48 52
 videohub: set video output 16 "Loopback" to read from video input 16 "Loopback"
53
+videohub: set monitoring output 1 "Monitor 1" to read from video input 1 "Windows 1"
54
+videohub: set monitoring output 2 "Monitor 2" to read from video input 2 "Windows 2"
55
+videohub: set monitoring output 3 "Monitor 3" to read from video input 3 "Windows 3"
56
+videohub: set monitoring output 4 "Monitor 4" to read from video input 4 "Windows 4 HD"
49 57
 videohub: unlock video output 1 "Enc1 1"
50 58
 videohub: lock video output 1 "Enc1 1"
51 59
 videohub: unlock video output 2 "Enc1 2"
@@ -70,6 +78,12 @@ videohub: unlock video output 14 "Output 14"
70 78
 videohub: unlock video output 15 "Output 15"
71 79
 videohub: unlock video output 16 "Loopback"
72 80
 videohub: lock video output 16 "Loopback"
81
+videohub: unlock monitoring output 1 "Monitor 1"
82
+videohub: unlock monitoring output 2 "Monitor 2"
83
+videohub: lock monitoring output 2 "Monitor 2"
84
+videohub: unlock monitoring output 3 "Monitor 3"
85
+videohub: lock monitoring output 3 "Monitor 3"
86
+videohub: unlock monitoring output 4 "Monitor 4"
73 87
 Device info
74 88
   -----------------------------------------------------------
75 89
   | Device address             | sdi-matrix                 |
@@ -79,6 +93,7 @@ Device info
79 93
   | Protocol                   | 2.4                        |
80 94
   | Video inputs               | 16                         |
81 95
   | Video outputs              | 16                         |
96
+  | Video monitoring outputs   | 4                          |
82 97
   -----------------------------------------------------------
83 98
 
84 99
 Video inputs
@@ -127,3 +142,13 @@ Video outputs
127 142
   | 16 | O | Loopback                 | Loopback                 | o |
128 143
   --------------------------------------------------------------------
129 144
 
145
+Monitoring outputs
146
+  ----------------------------------------------------------------
147
+  | ## | x | Monitoring output name   | Connected video input    |
148
+  ----------------------------------------------------------------
149
+  |  1 |   | Monitor 1                | Windows 1                |
150
+  |  2 | O | Monitor 2                | Windows 2                |
151
+  |  3 | O | Monitor 3                | Windows 3                |
152
+  |  4 |   | Monitor 4                | Windows 4 HD             |
153
+  ----------------------------------------------------------------
154
+

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

@@ -10,6 +10,12 @@ videohub: force unlock video output 9 "Enc2 1"
10 10
 videohub: set video output 5 "Output 5" to read from video input 1 "Windows 1"
11 11
 videohub: set video output 5 "Output 5" to read from video input 2 "Windows 2"
12 12
 videohub: set video output 5 "Output 5" to read from video input 3 "Windows 3"
13
+videohub: rename monitoring output 1 "Monitor 1" to "PC 1 Mon"
14
+videohub: rename monitoring output 4 "Monitor 4" to "Decklink"
15
+videohub: unlock monitoring output 2 "Monitor 2"
16
+videohub: lock monitoring output 4 "Decklink"
17
+videohub: rename monitoring output 3 "Monitor 3" to "Loopback"
18
+videohub: set monitoring output 3 "Loopback" to read from video input 16 "Loopback"
13 19
 Device info
14 20
   -----------------------------------------------------------
15 21
   | Device address             | sdi-matrix                 |
@@ -19,6 +25,7 @@ Device info
19 25
   | Protocol                   | 2.4                        |
20 26
   | Video inputs               | 16                         |
21 27
   | Video outputs              | 16                         |
28
+  | Video monitoring outputs   | 4                          |
22 29
   -----------------------------------------------------------
23 30
 
24 31
 Video inputs
@@ -68,3 +75,13 @@ Video outputs
68 75
   | 16 | O | Dev-Lo                   | Loopback                 | o |
69 76
   --------------------------------------------------------------------
70 77
 
78
+Monitoring outputs
79
+  ----------------------------------------------------------------
80
+  | ## | x | Monitoring output name   | Connected video input    |
81
+  ----------------------------------------------------------------
82
+  |  1 |   | PC 1 Mon                 | Windows 1                |
83
+  |  2 |   | Monitor 2                | Windows 2                |
84
+  |  3 | L | Loopback                 | Loopback                 |
85
+  |  4 | O | Decklink                 | Windows 4 HighDef        |
86
+  ----------------------------------------------------------------
87
+

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

@@ -7,6 +7,7 @@ Device info
7 7
   | Protocol                   | 2.4                        |
8 8
   | Video inputs               | 16                         |
9 9
   | Video outputs              | 16                         |
10
+  | Video monitoring outputs   | 4                          |
10 11
   -----------------------------------------------------------
11 12
 
12 13
 Video inputs
@@ -55,3 +56,13 @@ Video outputs
55 56
   | 16 | O | Loopback                 | Loopback                 | o |
56 57
   --------------------------------------------------------------------
57 58
 
59
+Monitoring outputs
60
+  ----------------------------------------------------------------
61
+  | ## | x | Monitoring output name   | Connected video input    |
62
+  ----------------------------------------------------------------
63
+  |  1 |   | Monitor 1                | Windows 1                |
64
+  |  2 | O | Monitor 2                | Windows 2                |
65
+  |  3 | O | Monitor 3                | Windows 3                |
66
+  |  4 |   | Monitor 4                | Windows 4 HD             |
67
+  ----------------------------------------------------------------
68
+

+ 6
- 0
test/test-06.ok View File

@@ -16,3 +16,9 @@ ERROR: Unknown video output port number/name: 18
16 16
 ERROR: Unknown video output port number/name: Input 10
17 17
 ERROR: Unknown video output port number/name: Err Output
18 18
 ERROR: Unknown video input port number/name: Err Input
19
+ERROR: Unknown monitoring output port number/name: 18
20
+ERROR: Unknown monitoring output port number/name: Output 18
21
+ERROR: Unknown monitoring output port number/name: 18
22
+ERROR: Unknown monitoring output port number/name: Output 18
23
+ERROR: Unknown monitoring output port number/name: 18
24
+ERROR: Unknown monitoring output port number/name: Output 18

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

@@ -7,5 +7,6 @@ Device info
7 7
   | Protocol                   | 2.4                        |
8 8
   | Video inputs               | 16                         |
9 9
   | Video outputs              | 16                         |
10
+  | Video monitoring outputs   | 4                          |
10 11
   -----------------------------------------------------------
11 12
 

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

@@ -0,0 +1,10 @@
1
+Monitoring outputs
2
+  ----------------------------------------------------------------
3
+  | ## | x | Monitoring output name   | Connected video input    |
4
+  ----------------------------------------------------------------
5
+  |  1 |   | Monitor 1                | Windows 1                |
6
+  |  2 | O | Monitor 2                | Windows 2                |
7
+  |  3 | L | Monitor 3                | Windows 3                |
8
+  |  4 |   | Monitor 4                | Windows 4 HD             |
9
+  ----------------------------------------------------------------
10
+

+ 21
- 0
videohubctrl.c View File

@@ -41,6 +41,7 @@ enum list_actions {
41 41
 	action_list_device		= (1 << 0),
42 42
 	action_list_vinputs		= (1 << 1),
43 43
 	action_list_voutputs	= (1 << 2),
44
+	action_list_moutputs	= (1 << 3),
44 45
 };
45 46
 
46 47
 static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
@@ -61,12 +62,18 @@ static const struct option long_options[] = {
61 62
 	{ "list-device",		no_argument,       NULL, 901 },
62 63
 	{ "list-vinputs",		no_argument,       NULL, 902 },
63 64
 	{ "list-voutputs",		no_argument,       NULL, 903 },
65
+	{ "list-moutputs",		no_argument,       NULL, 904 },
64 66
 	{ "vi-name",			required_argument, NULL, 1001 },
65 67
 	{ "vo-name",			required_argument, NULL, 2001 },
66 68
 	{ "vo-input",			required_argument, NULL, 2002 },
67 69
 	{ "vo-route",			required_argument, NULL, 2002 }, // Alias of --vo-input
68 70
 	{ "vo-lock",			required_argument, NULL, 2003 },
69 71
 	{ "vo-unlock",			required_argument, NULL, 2004 },
72
+	{ "mo-name",			required_argument, NULL, 3001 },
73
+	{ "mo-input",			required_argument, NULL, 3002 },
74
+	{ "mo-route",			required_argument, NULL, 3002 }, // Alias of --mo-input
75
+	{ "mo-lock",			required_argument, NULL, 3003 },
76
+	{ "mo-unlock",			required_argument, NULL, 3004 },
70 77
 	{ 0, 0, 0, 0 }
71 78
 };
72 79
 
@@ -90,6 +97,7 @@ static void show_help(struct videohub_data *data) {
90 97
 	printf(" --list-device              | Display device info.\n");
91 98
 	printf(" --list-vinputs             | List device video inputs.\n");
92 99
 	printf(" --list-voutputs            | List device video outputs.\n");
100
+	printf(" --list-moutputs            | List device monitoring outputs.\n");
93 101
 	printf("\n");
94 102
 	printf("Video inputs configuration:\n");
95 103
 	printf(" --vi-name <in_X> <name>    | Set video input port X name.\n");
@@ -100,6 +108,12 @@ static void show_help(struct videohub_data *data) {
100 108
 	printf(" --vo-lock <out_X>          | Lock output port X.\n");
101 109
 	printf(" --vo-unlock <out_X>        | Unlock output port X.\n");
102 110
 	printf("\n");
111
+	printf("Monitoring outputs configuration:\n");
112
+	printf(" --mo-name <mout_X> <name>  | Set monitoring port X name.\n");
113
+	printf(" --mo-route <mout_X> <in_Y> | Connect monitoring X to video input Y\n");
114
+	printf(" --mo-lock <mout_X>         | Lock monitoring port X.\n");
115
+	printf(" --mo-unlock <mout_X>       | Unlock monitoring port X.\n");
116
+	printf("\n");
103 117
 	printf("Misc options:\n");
104 118
 	printf(" -T --test-input <file>     | Read commands from <file>.\n");
105 119
 	printf(" -d --debug                 | Increase logging verbosity.\n");
@@ -191,11 +205,16 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
191 205
 			case 901: show_list |= action_list_device; break; // --list-device
192 206
 			case 902: show_list |= action_list_vinputs; break; // --list-vinputs
193 207
 			case 903: show_list |= action_list_voutputs; break; // --list-voutputs
208
+			case 904: show_list |= action_list_moutputs; break; // --list-moutputs
194 209
 			case 1001: parse_cmd2(argc, argv, CMD_INPUT_LABELS); break; // --vi-name
195 210
 			case 2001: parse_cmd2(argc, argv, CMD_OUTPUT_LABELS); break; // --vo-name
196 211
 			case 2002: parse_cmd2(argc, argv, CMD_VIDEO_OUTPUT_ROUTING); break; // --vo-input
197 212
 			case 2003: parse_cmd1(argc, argv, CMD_VIDEO_OUTPUT_LOCKS, true); break; // --vo-lock
198 213
 			case 2004: parse_cmd1(argc, argv, CMD_VIDEO_OUTPUT_LOCKS, false); break; // --vo-unlock
214
+			case 3001: parse_cmd2(argc, argv, CMD_MONITORING_OUTPUT_LABELS); break; // --mo-name
215
+			case 3002: parse_cmd2(argc, argv, CMD_MONITORING_OUTPUT_ROUTING); break; // --mo-route
216
+			case 3003: parse_cmd1(argc, argv, CMD_MONITORING_OUTPUT_LOCKS, true); break; // --mo-lock
217
+			case 3004: parse_cmd1(argc, argv, CMD_MONITORING_OUTPUT_LOCKS, false); break; // --mo-unlock
199 218
 			case 'H': // --help
200 219
 				show_help(data);
201 220
 				exit(EXIT_SUCCESS);
@@ -228,6 +247,7 @@ static void print_device_full(struct videohub_data *d) {
228 247
 	print_device_info(d);
229 248
 	print_device_video_inputs(d);
230 249
 	print_device_video_outputs(d);
250
+	print_device_monitoring_outputs(d);
231 251
 	fflush(stdout);
232 252
 }
233 253
 
@@ -330,6 +350,7 @@ int main(int argc, char **argv) {
330 350
 		if (show_list & action_list_device)		print_device_info(data);
331 351
 		if (show_list & action_list_vinputs)	print_device_video_inputs(data);
332 352
 		if (show_list & action_list_voutputs)	print_device_video_outputs(data);
353
+		if (show_list & action_list_moutputs)	print_device_monitoring_outputs(data);
333 354
 		fflush(stdout);
334 355
 	} else if (show_backup) {
335 356
 		print_device_backup(data);

Loading…
Cancel
Save