mirror of
https://bitbucket.org/ohhara/ohmulticastvideoscanner.git
synced 2025-06-09 17:06:23 +00:00
Remove verbose option, add quiet option.
Verbose is default. Quiet option is enabled if a user specifies it in the cmdline arg.
This commit is contained in:
parent
5e8b1667f9
commit
562cf22cdc
12
omvs_main.c
12
omvs_main.c
@ -15,7 +15,7 @@ static gchar *_omvs_outdir = "omvs_out";
|
|||||||
static gint _omvs_jobs = 1;
|
static gint _omvs_jobs = 1;
|
||||||
static gint _omvs_sleep = 1000;
|
static gint _omvs_sleep = 1000;
|
||||||
static gint _omvs_timeout = 10000;
|
static gint _omvs_timeout = 10000;
|
||||||
static gboolean _omvs_verbose;
|
static gboolean _omvs_quiet;
|
||||||
|
|
||||||
static gchar **_omvs_net_dev_names;
|
static gchar **_omvs_net_dev_names;
|
||||||
static gchar **_omvs_net_dev_descs;
|
static gchar **_omvs_net_dev_descs;
|
||||||
@ -35,8 +35,8 @@ static GOptionEntry _omvs_entries[] =
|
|||||||
"Sleep time(milliseconds) between scans", "ms" },
|
"Sleep time(milliseconds) between scans", "ms" },
|
||||||
{ "timeout", 't', 0, G_OPTION_ARG_INT, &_omvs_timeout,
|
{ "timeout", 't', 0, G_OPTION_ARG_INT, &_omvs_timeout,
|
||||||
"Timeout time(milliseconds) in each scan", "ms" },
|
"Timeout time(milliseconds) in each scan", "ms" },
|
||||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &_omvs_verbose,
|
{ "quiet", 'q', 0, G_OPTION_ARG_NONE, &_omvs_quiet,
|
||||||
"Be verbose", NULL },
|
"Print no log except for errors", NULL },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ static gpointer _omvs_start_scan_job(gpointer data) {
|
|||||||
addr_str =
|
addr_str =
|
||||||
g_strdup_printf("%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
|
g_strdup_printf("%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
|
||||||
|
|
||||||
if (_omvs_verbose) {
|
if (!_omvs_quiet) {
|
||||||
g_print("[%p] start scanning %s\n", (void *)g_thread_self(), addr_str);
|
g_print("[%p] start scanning %s\n", (void *)g_thread_self(), addr_str);
|
||||||
}
|
}
|
||||||
group_address = g_inet_address_new_from_string(addr_str);
|
group_address = g_inet_address_new_from_string(addr_str);
|
||||||
@ -294,7 +294,7 @@ static gpointer _omvs_start_scan_job(gpointer data) {
|
|||||||
uri = g_strdup_printf("udp://%s:%d", addr_str, udp_port);
|
uri = g_strdup_printf("udp://%s:%d", addr_str, udp_port);
|
||||||
filename =
|
filename =
|
||||||
g_strdup_printf("%s/%s-%d.png", _omvs_outdir, addr_str, udp_port);
|
g_strdup_printf("%s/%s-%d.png", _omvs_outdir, addr_str, udp_port);
|
||||||
if (_omvs_verbose) {
|
if (!_omvs_quiet) {
|
||||||
g_print("[%p] trying to save %s to %s\n", (void *)g_thread_self(),
|
g_print("[%p] trying to save %s to %s\n", (void *)g_thread_self(),
|
||||||
uri, filename);
|
uri, filename);
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ static gpointer _omvs_start_scan_job(gpointer data) {
|
|||||||
}
|
}
|
||||||
g_free(o_ipaddr->gsts);
|
g_free(o_ipaddr->gsts);
|
||||||
|
|
||||||
if (_omvs_verbose) {
|
if (!_omvs_quiet) {
|
||||||
g_print("[%p] finish scanning %s\n", (void *)g_thread_self(), addr_str);
|
g_print("[%p] finish scanning %s\n", (void *)g_thread_self(), addr_str);
|
||||||
}
|
}
|
||||||
if (!g_socket_leave_multicast_group(socket, group_address, FALSE,
|
if (!g_socket_leave_multicast_group(socket, group_address, FALSE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user