Skip to content

Commit 220257a

Browse files
committed
vcap/ug_input: use explicit port=
Use port= (or shortcut) option for port specification and discourage implicit (position) port number (although allowed as a fallback). This is consistent with most of the other modules using key=val syntax.
1 parent 71fac58 commit 220257a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/video_capture/ug_input.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ usage()
107107
{
108108
printf("Usage:\n");
109109
color_printf("\t" TBOLD(
110-
TRED("-t ug_input") "[:<port>[:codec=<c>]] [-s embedded]") "\n");
110+
TRED("-t ug_input") "[:port=<port>][:codec=<c>]] [-s embedded]") "\n");
111111
printf("where:\n");
112112
color_printf("\t" TBOLD("<port>") " - UG port to listen to\n");
113113
color_printf("\t" TBOLD("<c>") " - enforce pixfmt to decode to\n");
@@ -122,7 +122,11 @@ parse_fmt(char *fmt, uint16_t *port, codec_t *decode_to)
122122
fmt = nullptr;
123123
const char *val = strchr(tok, '=') + 1;
124124
if (isdigit(tok[0])) {
125+
MSG(WARNING, "port specification without the keyword "
126+
"port= is deprecated\n");
125127
*port = stoi(tok);
128+
} else if (IS_KEY_PREFIX(tok, "port")) {
129+
*port = stoi(val);
126130
} else if (IS_KEY_PREFIX(tok, "codec")) {
127131
*decode_to = get_codec_from_name(val);
128132
if (*decode_to == VIDEO_CODEC_NONE) {

0 commit comments

Comments
 (0)