summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Grimaud <gstelzz@yahoo.fr>2009-02-11 12:09:29 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-02-11 12:09:29 (GMT)
commitb9d1f775127083eed727b05deab0cb51624ad33f (patch)
treefb7b70652ac238f147953af7c40b255a11bb37f7
parentbd94dda500473c32b3fe039fdd8cf0435f7d378e (diff)
downloadgst-plugins-farsight-tester-peer-ssrc.tar.gz
gst-plugins-farsight-tester-peer-ssrc.tar.xz
Use downstream peer SSRC when one is availablepeer-ssrc
-rw-r--r--gst/rtpmux/gstrtpmux.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index b6f1d28..566d8c5 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -417,6 +417,7 @@ gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
gboolean ret = TRUE;
gint clock_rate;
GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
+ GstCaps *peercaps;
rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
@@ -439,6 +440,26 @@ gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
"seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base,
NULL);
+
+ /* the peer caps can override some of the defaults */
+ peercaps = gst_pad_peer_get_caps (rtp_mux->srcpad);
+ if (peercaps) {
+ GstStructure *s;
+ guint ssrc;
+
+ s = gst_caps_get_structure(peercaps, 0);
+ if (gst_structure_get_uint (s, "ssrc", &ssrc)) {
+ rtp_mux->current_ssrc = ssrc;
+ GST_DEBUG_OBJECT (rtp_mux, "using peer ssrc %08x", rtp_mux->current_ssrc);
+ } else {
+ GST_DEBUG_OBJECT (rtp_mux, "using internal ssrc %08x",
+ rtp_mux->current_ssrc);
+ }
+ gst_caps_unref (peercaps);
+ }
+
+ gst_caps_set_simple(caps, "ssrc", G_TYPE_UINT, rtp_mux->current_ssrc, NULL);
+
GST_DEBUG_OBJECT (rtp_mux,
"setting caps %" GST_PTR_FORMAT " on src pad..", caps);
ret = gst_pad_set_caps (rtp_mux->srcpad, caps);