summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/options.c b/src/options.c
index 1227801..e090bdd 100644
--- a/src/options.c
+++ b/src/options.c
@@ -211,8 +211,10 @@ int options_parse(options_t* opt, int argc, char* argv[])
PARSE_STRING_PARAM("-as","--audio-source", opt->audio_src_)
PARSE_STRING_PARAM("-ae","--audio-encoder", opt->audio_enc_)
PARSE_STRING_PARAM("-ap","--audio-payloader", opt->audio_payloader_)
- PARSE_STRING_PARAM("-o","--rtp-host", opt->rtp_host_)
- PARSE_INT_PARAM("-O","--rtp-port-base", opt->rtp_port_base_, 10)
+ PARSE_STRING_PARAM("-a","--rtp-host", opt->rtp_host_)
+ PARSE_INT_PARAM("-o","--rtp-port-base", opt->rtp_port_base_, 10)
+ PARSE_STRING_PARAM("-A","--rtp-addr-local", opt->rtp_addr_local_)
+ PARSE_INT_PARAM("-O","--rtp-port-base-local", opt->rtp_port_base_local_, 10)
PARSE_STRING_PARAM("-V","--videosink", opt->preview_videosink_)
PARSE_STRING_PARAM("-rv","--rec-video-encoder", opt->video_enc_rec_)
PARSE_STRING_PARAM("-ra","--rec-audio-encoder", opt->audio_enc_rec_)
@@ -222,7 +224,8 @@ int options_parse(options_t* opt, int argc, char* argv[])
return i;
}
- if(opt->rtp_port_base_ < 1 || opt->rtp_port_base_ > 65535)
+ if(opt->rtp_port_base_ < 1 || opt->rtp_port_base_ > 65535 ||
+ opt->rtp_port_base_local_ < 1 || opt->rtp_port_base_local_ > 65535)
return -4;
if(opt->debug_) {
@@ -270,6 +273,8 @@ void options_default(options_t* opt)
opt->rtp_host_ = strdup("127.0.0.1");
opt->rtp_port_base_ = 5000;
+ opt->rtp_addr_local_ = NULL;
+ opt->rtp_port_base_local_ = 5000;
opt->preview_videosink_ = NULL;
@@ -311,6 +316,8 @@ void options_clear(options_t* opt)
free(opt->audio_payloader_);
if(opt->rtp_host_)
free(opt->rtp_host_);
+ if(opt->rtp_addr_local_)
+ free(opt->rtp_addr_local_);
if(opt->preview_videosink_)
free(opt->preview_videosink_);
if(opt->video_enc_rec_)
@@ -343,8 +350,10 @@ void options_print_usage()
printf(" [-as|--audio-source pipeline for raw audio (audiotestsrc)\n");
printf(" [-ae|--audio-encoder pipeline for audio encoder (stream)\n");
printf(" [-ap|--audio-payloader audio payloader element (i.e. rptopuspay)\n");
- printf(" [-o|--rtp-host remote host for RTP packets\n");
- printf(" [-O|--rtp-port-base base number for remote ports\n");
+ printf(" [-a|--rtp-host remote host for RTP packets\n");
+ printf(" [-o|--rtp-port-base base number for remote ports\n");
+ printf(" [-A|--rtp-addr-local local address to bind to\n");
+ printf(" [-O|--rtp-port-base-local base number for local ports to bind to\n");
printf(" [-V|--videosink video sink element for local preview (i.e. xvimagesink) - leave empty to disable preview\n");
printf(" [-rv|--rec-video-encoder pipeline for video encoder (recording - leave empty for same as stream)\n");
printf(" [-ra|--rec-audio-encoder pipeline for audio encoder (recording - leave empty for same as stream)\n");
@@ -381,6 +390,8 @@ void options_print(options_t* opt)
printf(" audio_payloader: >>%s<<\n", opt->audio_payloader_);
printf(" rtp_host: >>%s<<\n", opt->rtp_host_);
printf(" rtp_port_base: %d\n", opt->rtp_port_base_);
+ printf(" rtp_addr_local: >>%s<<\n", opt->rtp_addr_local_);
+ printf(" rtp_port_base_local: %d\n", opt->rtp_port_base_local_);
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_);