summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-09-27 18:35:34 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-09-27 18:35:34 +0200
commit15b4ff94088747cb6a29f05a48d2dd55f51acb81 (patch)
treeb34e39caba27da9d6a19a26d5c4a2a86cfcef716 /src/options.c
parentadded option for mode (diff)
prepared main loop for receiver mode
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c
index 18fe1e1..48a0f20 100644
--- a/src/options.c
+++ b/src/options.c
@@ -74,6 +74,7 @@ static void options_defaults(options_t* opt)
opt->rtp_addr_local_ = NULL;
opt->rtp_port_base_local_ = 5000;
opt->timeout_ = 30;
+ opt->keepalive_int_ = 10;
opt->preview_videosink_ = NULL;
@@ -129,7 +130,9 @@ static GOptionGroup* options_get_rtp_group(options_t* opt)
{ "rtp-port-base-local", 'O', 0, G_OPTION_ARG_INT, &opt->rtp_port_base_local_,
"base number for local ports to bind to", "PORT" },
{ "timeout", 't', 0, G_OPTION_ARG_INT, &opt->timeout_,
- "client timeout in seconds (0 means no timeout)", "VALUE" },
+ "client timeout in seconds (0 means no timeout) - sender mode only!", "VALUE" },
+ { "keepalive-interval", 'k', 0, G_OPTION_ARG_INT, &opt->keepalive_int_,
+ "interval in seconds for sending out keep alive messages (0 means no keep alives) - receiver mode only!", "VALUE" },
{ NULL }
};
GOptionGroup* rtp_group = g_option_group_new ("rtp", "RTP Options",
@@ -262,6 +265,10 @@ static int options_parse_post(options_t* opt)
printf("Failed to initialize: timeout is invalid\n");
return -3;
}
+ if(opt->keepalive_int_ < 0) {
+ printf("Failed to initialize: keep alive interval is invalid\n");
+ return -3;
+ }
if(opt->debug_) {
opt->daemonize_ = 0;
@@ -364,6 +371,7 @@ void options_print(options_t* opt)
printf(" rtp_addr_local: >>%s<<\n", opt->rtp_addr_local_);
printf(" rtp_port_base_local: %d\n", opt->rtp_port_base_local_);
printf(" timeout: %d\n", opt->timeout_);
+ printf(" keepalive_int: %d\n", opt->keepalive_int_);
printf(" preview_video_sink: >>%s<<\n", opt->preview_videosink_);
printf(" video_enc_rec: >>%s<<\n", opt->video_enc_rec_);
printf(" audio_enc_rec: >>%s<<\n", opt->audio_enc_rec_);