diff options
author | Christian Pointner <equinox@spreadspace.org> | 2014-09-24 00:13:53 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2014-09-24 00:13:53 +0200 |
commit | 71c3b511e3df7619c92a045f6781034191b2004a (patch) | |
tree | 143ef3539a1c7941a2621ea9a8638f4a96cc16d7 /src/sydra.c | |
parent | also listening for packets on IPv6 sockets (diff) |
binding to address/port
Diffstat (limited to 'src/sydra.c')
-rw-r--r-- | src/sydra.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/sydra.c b/src/sydra.c index 69d3026..e1c67db 100644 --- a/src/sydra.c +++ b/src/sydra.c @@ -321,10 +321,22 @@ static gboolean create_udp_elements(options_t* opt, GstElement* pipeline, GstEle log_printf(DEBUG, "udp elements created successfully!"); int rtp_port = opt->rtp_port_base_; - g_object_set(G_OBJECT(udp->rtp_video_), "host", opt->rtp_host_, "port", rtp_port++, NULL); - g_object_set(G_OBJECT(udp->rtcp_video_), "host", opt->rtp_host_, "port", rtp_port++, "sync", FALSE, "async", FALSE, NULL); - g_object_set(G_OBJECT(udp->rtp_audio_), "host", opt->rtp_host_, "port", rtp_port++, NULL); - g_object_set(G_OBJECT(udp->rtcp_audio_), "host", opt->rtp_host_, "port", rtp_port++, "sync", FALSE, "async", FALSE, NULL); + int rtp_port_local = opt->rtp_port_base_local_; + g_object_set(G_OBJECT(udp->rtp_video_), "host", opt->rtp_host_, "port", rtp_port++, + "bind-port", rtp_port_local++, NULL); + g_object_set(G_OBJECT(udp->rtcp_video_), "host", opt->rtp_host_, "port", rtp_port++, + "bind-port", rtp_port_local++, "sync", FALSE, "async", FALSE, NULL); + g_object_set(G_OBJECT(udp->rtp_audio_), "host", opt->rtp_host_, "port", rtp_port++, + "bind-port", rtp_port_local++, NULL); + g_object_set(G_OBJECT(udp->rtcp_audio_), "host", opt->rtp_host_, "port", rtp_port++, + "bind-port", rtp_port_local++, "sync", FALSE, "async", FALSE, NULL); + + if(opt->rtp_addr_local_) { + g_object_set(G_OBJECT(udp->rtp_video_), "bind-address", opt->rtp_addr_local_, NULL); + g_object_set(G_OBJECT(udp->rtcp_video_), "bind-address", opt->rtp_addr_local_, NULL); + g_object_set(G_OBJECT(udp->rtp_audio_), "bind-address", opt->rtp_addr_local_, NULL); + g_object_set(G_OBJECT(udp->rtcp_audio_), "bind-address", opt->rtp_addr_local_, NULL); + } gst_bin_add_many(GST_BIN (pipeline), udp->rtp_video_, udp->rtcp_video_, udp->rtp_audio_, udp->rtcp_audio_, NULL); |