summaryrefslogtreecommitdiff
path: root/src/pipelines.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipelines.c')
-rw-r--r--src/pipelines.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/pipelines.c b/src/pipelines.c
index 55054f8..c08c11f 100644
--- a/src/pipelines.c
+++ b/src/pipelines.c
@@ -496,11 +496,39 @@ static void rtpbin_pad_added(GstElement* rtp, GstPad* pad, gpointer user_data)
break;
}
if(!gst_pad_is_linked(pad)) {
- log_printf(ERROR, "rtpbin: no compatible depayloader found for pad %s", src_pad_name);
+ log_printf(ERROR, "rtpbin: no compatible depayloader found for pad %s (or all depayloader already connected)", src_pad_name);
+ GstStructure* ms = gst_structure_new("sydra-rtp", "quit", G_TYPE_BOOLEAN, TRUE, "reason",
+ G_TYPE_STRING, "New RTP Session but all depayloader are already connected or none compatible found", NULL);
+ GstMessage* msg = gst_message_new_application(GST_OBJECT(rtp), ms);
+ if(!ms || ! msg)
+ log_printf(ERROR, "rtpbin: message creation failed!");
+ else {
+ if(!gst_element_post_message(rtp, msg))
+ log_printf(ERROR, "rtpbin: sending message to the application failed: no bus");
+ }
}
g_free(src_pad_name);
}
+static void rtp_new_ssrc(GstElement *rtp, guint session, guint ssrc, gpointer user_data)
+{
+ log_printf(INFO, "rtpbin: new SSRC %u for session %u", ssrc, session);
+}
+
+static void rtp_ssrc_timeout(GstElement *rtp, guint session, guint ssrc, gpointer user_data)
+{
+ log_printf(INFO, "rtpbin: SSRC %u of session %u timed out", ssrc, session);
+ GstStructure* ms = gst_structure_new("sydra-rtp", "quit", G_TYPE_BOOLEAN, TRUE, "reason",
+ G_TYPE_STRING, "RTP session timed out", NULL);
+ GstMessage* msg = gst_message_new_application(GST_OBJECT(rtp), ms);
+ if(!ms || ! msg)
+ log_printf(ERROR, "rtpbin: message creation failed!");
+ else {
+ if(!gst_element_post_message(rtp, msg))
+ log_printf(ERROR, "rtpbin: sending message to the application failed: no bus");
+ }
+}
+
GstElement* create_receiver_pipeline(options_t* opt, struct udp_sources *udp)
{
GstElement *pipeline = gst_pipeline_new ("sydra-rtp-receiver");
@@ -531,6 +559,8 @@ GstElement* create_receiver_pipeline(options_t* opt, struct udp_sources *udp)
depays[0] = video.payloader_;
depays[1] = audio.payloader_;
g_signal_connect_closure(rtp, "pad-added", g_cclosure_new(G_CALLBACK(rtpbin_pad_added), depays, NULL), FALSE);
+ g_signal_connect(rtp, "on-new-ssrc", G_CALLBACK(rtp_new_ssrc), NULL);
+ g_signal_connect(rtp, "on-timeout", G_CALLBACK(rtp_ssrc_timeout), NULL);
if(opt->rec_mux_) {
if(!create_recorder_elements(opt, pipeline, &video, &audio))