diff options
author | Olivier Crete <tester@tester.ca> | 2009-01-02 17:40:06 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2009-01-02 17:40:06 +0000 |
commit | c3060dfb647fbde116918eda3adee183fb7d35b7 (patch) | |
tree | 796e8301c451c1fb3ff195191341d724cf842673 /gst | |
parent | 0df77bfcd66cc9b96d3ed4d425e7beec26b24508 (diff) | |
download | gst-plugins-bad-c3060dfb647fbde116918eda3adee183fb7d35b7.tar.gz gst-plugins-bad-c3060dfb647fbde116918eda3adee183fb7d35b7.tar.bz2 gst-plugins-bad-c3060dfb647fbde116918eda3adee183fb7d35b7.zip |
gst/rtpmanager/: When an SSRC is found on the caps of the sender RTP, use this as the internal SSRC. Fixes #565910.
Original commit message from CVS:
Patch by: Olivier Crete <tester at tester dot ca>
* gst/rtpmanager/gstrtpsession.c:
(gst_rtp_session_setcaps_send_rtp), (create_send_rtp_sink):
* gst/rtpmanager/rtpsession.c: (rtp_session_set_internal_ssrc):
When an SSRC is found on the caps of the sender RTP, use this as the
internal SSRC. Fixes #565910.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtpmanager/gstrtpsession.c | 23 | ||||
-rw-r--r-- | gst/rtpmanager/rtpsession.c | 5 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index c1ca0ebb..615dc15a 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1675,6 +1675,27 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad) return result; } +static gboolean +gst_rtp_session_setcaps_send_rtp (GstPad * pad, GstCaps * caps) +{ + GstRtpSession *rtpsession; + GstRtpSessionPrivate *priv; + GstStructure *s = gst_caps_get_structure (caps, 0); + guint ssrc; + + rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad)); + priv = rtpsession->priv; + + if (gst_structure_get_uint (s, "ssrc", &ssrc)) { + GST_DEBUG_OBJECT (rtpsession, "setting internal SSRC to %08x", ssrc); + rtp_session_set_internal_ssrc (priv->session, ssrc); + } + + gst_object_unref (rtpsession); + + return TRUE; +} + /* Recieve an RTP packet to be send to the receivers, send to RTP session * manager and forward to send_rtp_src. */ @@ -1852,6 +1873,8 @@ create_send_rtp_sink (GstRtpSession * rtpsession) gst_rtp_session_chain_send_rtp); gst_pad_set_getcaps_function (rtpsession->send_rtp_sink, gst_rtp_session_getcaps_send_rtp); + gst_pad_set_setcaps_function (rtpsession->send_rtp_sink, + gst_rtp_session_setcaps_send_rtp); gst_pad_set_event_function (rtpsession->send_rtp_sink, (GstPadEventFunction) gst_rtp_session_event_send_rtp_sink); gst_pad_set_internal_link_function (rtpsession->send_rtp_sink, diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index c57c9966..bd72ed98 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -1209,9 +1209,14 @@ rtp_session_set_internal_ssrc (RTPSession * sess, guint32 ssrc) g_hash_table_steal (sess->ssrcs[sess->mask_idx], GINT_TO_POINTER (sess->source->ssrc)); + GST_DEBUG ("setting internal SSRC to %08x", ssrc); + /* After this call, any receiver of the old SSRC either in RTP or RTCP + * packets will timeout on the old SSRC, we could potentially schedule a + * BYE RTCP for the old SSRC... */ sess->source->ssrc = ssrc; rtp_source_reset (sess->source); + /* rehash with the new SSRC */ g_hash_table_insert (sess->ssrcs[sess->mask_idx], GINT_TO_POINTER (sess->source->ssrc), sess->source); } |