summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-06 20:47:14 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-06 20:47:14 +0200
commit987580746fefae041b6d62e0c2d1cc44fdc1763b (patch)
treefec761a2d2bba3356a82843706c87727302658d0 /src
parentfixed gitingore (diff)
fixed rtp reflector init
Diffstat (limited to 'src')
-rw-r--r--src/pipelines.c31
-rw-r--r--src/utils.c7
-rw-r--r--src/utils.h1
3 files changed, 21 insertions, 18 deletions
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);