From 26bec72e520522af0751abe738fb169ea52d6c04 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 6 Apr 2015 12:56:50 +0530 Subject: [PATCH] rtpsession: Track RTX ssrc caps This is needed so that we can generate SR for RTX stream correctly (the clock rate is required). https://bugzilla.gnome.org/show_bug.cgi?id=747394 --- gst/rtpmanager/gstrtprtxsend.c | 8 ++++++++ gst/rtpmanager/rtpsession.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/gst/rtpmanager/gstrtprtxsend.c b/gst/rtpmanager/gstrtprtxsend.c index 8859decac0..117a2d4a0e 100644 --- a/gst/rtpmanager/gstrtprtxsend.c +++ b/gst/rtpmanager/gstrtprtxsend.c @@ -606,9 +606,17 @@ gst_rtp_rtx_send_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) data = gst_rtp_rtx_send_get_ssrc_data (rtx, ssrc); gst_structure_get_int (s, "clock-rate", &data->clock_rate); + /* The session might need to know the RTX ssrc */ + caps = gst_caps_copy (caps); + gst_caps_set_simple (caps, "rtx-ssrc", G_TYPE_UINT, data->rtx_ssrc, NULL); + GST_DEBUG_OBJECT (rtx, "got clock-rate from caps: %d for ssrc: %u", data->clock_rate, ssrc); GST_OBJECT_UNLOCK (rtx); + + gst_event_unref (event); + event = gst_event_new_caps (caps); + gst_caps_unref (caps); break; } default: diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index 0175125078..a711c88434 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -2701,6 +2701,15 @@ rtp_session_update_send_caps (RTPSession * sess, GstCaps * caps) rtp_source_update_caps (source, caps); g_object_unref (source); } + + if (gst_structure_get_uint (s, "rtx-ssrc", &ssrc)) { + source = + obtain_internal_source (sess, ssrc, &created, GST_CLOCK_TIME_NONE); + if (source) { + rtp_source_update_caps (source, caps); + g_object_unref (source); + } + } RTP_SESSION_UNLOCK (sess); } }