summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/sydra-rtp.816
-rw-r--r--doc/sydra-rtp.8.txt11
-rw-r--r--src/pipelines.c31
-rw-r--r--src/utils.c7
-rw-r--r--src/utils.h1
5 files changed, 46 insertions, 20 deletions
diff --git a/doc/sydra-rtp.8 b/doc/sydra-rtp.8
index a768495..ceadcb9 100644
--- a/doc/sydra-rtp.8
+++ b/doc/sydra-rtp.8
@@ -2,12 +2,12 @@
.\" Title: sydra-rtp
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 10/02/2014
+.\" Date: 10/03/2014
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "SYDRA\-RTP" "8" "10/02/2014" "\ \&" "\ \&"
+.TH "SYDRA\-RTP" "8" "10/03/2014" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -60,6 +60,8 @@ sydra\-rtp
[ \fB\-o|\-\-rtp\-port\-base\fR <port> ]
[ \fB\-A|\-\-rtp\-addr\-local\fR <address> ]
[ \fB\-O|\-\-rtp\-port\-base\-local\fR <port> ]
+ [ \fB\-\-rtp\-host\-reflector\fR <host> ]
+ [ \fB\-\-rtp\-port\-base\-reflector\fR <port> ]
[ \fB\-c|\-\-no\-auto\-client\fR ]
[ \fB\-t|\-\-timeout\fR <timeout> ]
[ \fB\-k|\-\-keepalive\-interval\fR <interval> ]
@@ -328,6 +330,16 @@ The local address to wait for incoming UDP messages\&. Leave empty to listen on
The base number for local ports to bind to\&. The same mapping as for the remote port\-base is used to map incoming RTP packets to the RTP bin\&.
.RE
.PP
+\fB\-\-rtp\-host\-reflector <host>\fR
+.RS 4
+When in receiver mode the incoming RTP packets will get reflected to this host\&. Leave empty to disable RTP packet reflection\&.
+.RE
+.PP
+\fB\-\-rtp\-port\-base\-reflector <port>\fR
+.RS 4
+When a reflector\-host gets specified using the option above the RTP packets will get sent to the ports based on this\&. The same mapping as with the other port\-base options is used\&.
+.RE
+.PP
\fB\-c, \-\-no\-auto\-client\fR
.RS 4
This disables auto\-detection for clients in
diff --git a/doc/sydra-rtp.8.txt b/doc/sydra-rtp.8.txt
index 31c1585..7d9c88b 100644
--- a/doc/sydra-rtp.8.txt
+++ b/doc/sydra-rtp.8.txt
@@ -39,6 +39,8 @@ sydra-rtp
[ -o|--rtp-port-base <port> ]
[ -A|--rtp-addr-local <address> ]
[ -O|--rtp-port-base-local <port> ]
+ [ --rtp-host-reflector <host> ]
+ [ --rtp-port-base-reflector <port> ]
[ -c|--no-auto-client ]
[ -t|--timeout <timeout> ]
[ -k|--keepalive-interval <interval> ]
@@ -214,6 +216,15 @@ The following options can be passed to the *sydra-rtp* daemon:
The base number for local ports to bind to. The same mapping as for the remote port-base is
used to map incoming RTP packets to the RTP bin.
+*--rtp-host-reflector <host>*::
+ When in receiver mode the incoming RTP packets will get reflected to this host. Leave empty
+ to disable RTP packet reflection.
+
+*--rtp-port-base-reflector <port>*::
+ When a reflector-host gets specified using the option above the RTP packets will get sent to
+ the ports based on this. The same mapping as with the other port-base options is used.
+
+
*-c, --no-auto-client*::
This disables auto-detection for clients in 'sender' mode. Mind that if you disable the
automatic client detection and also omit the rtp-host option *sydra-rtp* won't send any RTP
diff --git a/src/pipelines.c b/src/pipelines.c
index c8eae3e..55054f8 100644
--- a/src/pipelines.c
+++ b/src/pipelines.c
@@ -243,10 +243,14 @@ static gboolean create_rtp_reflector(options_t* opt, GstElement* pipeline, struc
log_printf(INFO, "udp reflector sinks created successfully!");
int rtp_port_reflector = opt->rtp_port_base_reflector_;
- g_object_set(G_OBJECT(rtp_video), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++, "sync", FALSE, NULL);
- g_object_set(G_OBJECT(rtcp_video), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++, "sync", FALSE, NULL);
- g_object_set(G_OBJECT(rtp_audio), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++, "sync", FALSE, NULL);
- g_object_set(G_OBJECT(rtcp_audio), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++, "sync", FALSE, NULL);
+ g_object_set(G_OBJECT(rtp_video), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++,
+ "sync", FALSE, "async", FALSE, NULL);
+ g_object_set(G_OBJECT(rtcp_video), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++,
+ "sync", FALSE, "async", FALSE, NULL);
+ g_object_set(G_OBJECT(rtp_audio), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++,
+ "sync", FALSE, "async", FALSE, NULL);
+ g_object_set(G_OBJECT(rtcp_audio), "host", opt->rtp_host_reflector_, "port", rtp_port_reflector++,
+ "sync", FALSE, "async", FALSE, NULL);
log_printf(INFO, "udp reflector sinks configured successfully!");
@@ -275,19 +279,15 @@ static gboolean create_udp_sources(options_t* opt, GstElement* pipeline, GstElem
sources->rtp_video_ = sydra_create_element("udpsrc", "udprtpv");
tees.rtpv_ = sydra_create_element("tee", "rtpvt");
- GstElement* qrtpv = sydra_create_element("queue", NULL);
sources->rtcp_video_ = sydra_create_element("udpsrc", "udprtcpv");
tees.rtcpv_ = sydra_create_element("tee", "rtcpvt");
- GstElement* qrtcpv = sydra_create_element("queue", NULL);
sources->rtp_audio_ = sydra_create_element("udpsrc", "udprtpa");
tees.rtpa_ = sydra_create_element("tee", "rtpat");
- GstElement* qrtpa = sydra_create_element("queue", NULL);
sources->rtcp_audio_ = sydra_create_element("udpsrc", "udprtcpa");
tees.rtcpa_ = sydra_create_element("tee", "rtcpat");
- GstElement* qrtcpa = sydra_create_element("queue", NULL);
if(!(sources->rtp_video_) || !(sources->rtcp_video_) || !(sources->rtp_audio_) || !(sources->rtcp_audio_) ||
- !(tees.rtpv_) || !(tees.rtcpv_) || !(tees.rtpa_) || !(tees.rtcpa_) || !qrtpv || !qrtcpv || !qrtpa || !qrtcpa)
+ !(tees.rtpv_) || !(tees.rtcpv_) || !(tees.rtpa_) || !(tees.rtcpa_))
return FALSE;
log_printf(INFO, "udp sources created successfully!");
@@ -317,21 +317,16 @@ static gboolean create_udp_sources(options_t* opt, GstElement* pipeline, GstElem
gst_bin_add_many(GST_BIN(pipeline), sources->rtp_video_, sources->rtcp_video_, sources->rtp_audio_, sources->rtcp_audio_, NULL);
gst_bin_add_many(GST_BIN(pipeline), tees.rtpv_, tees.rtcpv_, tees.rtpa_, tees.rtcpa_, NULL);
- gst_bin_add_many(GST_BIN(pipeline), qrtpv, qrtcpv, qrtpa, qrtcpa, NULL);
gst_element_link(sources->rtp_video_, tees.rtpv_);
gst_element_link(sources->rtcp_video_, tees.rtcpv_);
gst_element_link(sources->rtp_audio_, tees.rtpa_);
gst_element_link(sources->rtcp_audio_, tees.rtcpa_);
- if(!sydra_link_request_static(tees.rtpv_, "src_%u", qrtpv, "sink") ||
- !sydra_link_static_request(qrtpv, "src", rtp, "recv_rtp_sink_0") ||
- !sydra_link_request_static(tees.rtcpv_, "src_%u", qrtcpv, "sink") ||
- !sydra_link_static_request(qrtcpv, "src", rtp, "recv_rtcp_sink_0") ||
- !sydra_link_request_static(tees.rtpa_, "src_%u", qrtpa, "sink") ||
- !sydra_link_static_request(qrtpa, "src", rtp, "recv_rtp_sink_1") ||
- !sydra_link_request_static(tees.rtcpa_, "src_%u", qrtcpa, "sink") ||
- !sydra_link_static_request(qrtcpa, "src", rtp, "recv_rtcp_sink_1"))
+ if(!sydra_link_request_request(tees.rtpv_, "src_%u", rtp, "recv_rtp_sink_0") ||
+ !sydra_link_request_request(tees.rtcpv_, "src_%u", rtp, "recv_rtcp_sink_0") ||
+ !sydra_link_request_request(tees.rtpa_, "src_%u", rtp, "recv_rtp_sink_1") ||
+ !sydra_link_request_request(tees.rtcpa_, "src_%u", rtp, "recv_rtcp_sink_1"))
return FALSE;
log_printf(INFO, "udp sources linked successfully!");
diff --git a/src/utils.c b/src/utils.c
index 443ab62..0797c20 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -98,6 +98,13 @@ static gboolean sydra_link_pads(GstElement* src, GstPad* src_pad, const char* sr
return TRUE;
}
+gboolean sydra_link_request_request(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name)
+{
+ GstPad *src_pad = gst_element_get_request_pad(src, src_pad_name);
+ GstPad *sink_pad = gst_element_get_request_pad(sink, sink_pad_name);
+ return sydra_link_pads(src, src_pad, src_pad_name, sink, sink_pad, sink_pad_name);
+}
+
gboolean sydra_link_request_static(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name)
{
GstPad *src_pad = gst_element_get_request_pad(src, src_pad_name);
diff --git a/src/utils.h b/src/utils.h
index 215efed..b4693c0 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -40,6 +40,7 @@
gint cmp_udp_client(gconstpointer A, gconstpointer B);
GstElement* sydra_create_bin_from_desc(const char* name, const char* desc, gboolean ghost_unlinked_pads);
GstElement* sydra_create_element(const char* type, const char* name);
+gboolean sydra_link_request_request(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);
gboolean sydra_link_request_static(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);
gboolean sydra_link_static_request(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);
gboolean sydra_link_static_static(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);