add parent to internal links

This commit is contained in:
Wim Taymans 2011-11-16 17:54:49 +01:00
parent 6190312214
commit 7cc4b72550
3 changed files with 14 additions and 27 deletions

View file

@ -239,7 +239,8 @@ static GstClock *gst_rtp_jitter_buffer_provide_clock (GstElement * element);
/* pad overrides */
static GstCaps *gst_rtp_jitter_buffer_getcaps (GstPad * pad, GstCaps * filter);
static GstIterator *gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad);
static GstIterator *gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad,
GstObject * parent);
/* sinkpad overrides */
static gboolean gst_rtp_jitter_buffer_sink_event (GstPad * pad,
@ -512,14 +513,14 @@ gst_rtp_jitter_buffer_finalize (GObject * object)
}
static GstIterator *
gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad)
gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad, GstObject * parent)
{
GstRtpJitterBuffer *jitterbuffer;
GstPad *otherpad = NULL;
GstIterator *it;
GValue val = { 0, };
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
jitterbuffer = GST_RTP_JITTER_BUFFER (parent);
if (pad == jitterbuffer->priv->sinkpad) {
otherpad = jitterbuffer->priv->srcpad;
@ -534,8 +535,6 @@ gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad)
it = gst_iterator_new_single (GST_TYPE_PAD, &val);
g_value_unset (&val);
gst_object_unref (jitterbuffer);
return it;
}

View file

@ -1449,15 +1449,13 @@ gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstEvent * event)
static GstIterator *
gst_rtp_session_iterate_internal_links (GstPad * pad)
gst_rtp_session_iterate_internal_links (GstPad * pad, GstObject * parent)
{
GstRtpSession *rtpsession;
GstPad *otherpad = NULL;
GstIterator *it = NULL;
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpsession == NULL))
return NULL;
rtpsession = GST_RTP_SESSION (parent);
GST_RTP_SESSION_LOCK (rtpsession);
if (pad == rtpsession->recv_rtp_src) {
@ -1481,8 +1479,6 @@ gst_rtp_session_iterate_internal_links (GstPad * pad)
gst_object_unref (otherpad);
}
gst_object_unref (rtpsession);
return it;
}

View file

@ -118,12 +118,12 @@ static GstFlowReturn gst_rtp_ssrc_demux_rtcp_chain (GstPad * pad,
static gboolean gst_rtp_ssrc_demux_rtcp_sink_event (GstPad * pad,
GstEvent * event);
static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad *
pad);
pad, GstObject * parent);
/* srcpad stuff */
static gboolean gst_rtp_ssrc_demux_src_event (GstPad * pad, GstEvent * event);
static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad *
pad);
pad, GstObject * parent);
static gboolean gst_rtp_ssrc_demux_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
@ -676,17 +676,14 @@ gst_rtp_ssrc_demux_src_event (GstPad * pad, GstEvent * event)
}
static GstIterator *
gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad * pad)
gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad * pad, GstObject * parent)
{
GstRtpSsrcDemux *demux;
GstPad *otherpad = NULL;
GstIterator *it = NULL;
GSList *current;
demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad));
if (!demux)
return NULL;
demux = GST_RTP_SSRC_DEMUX (parent);
GST_PAD_LOCK (demux);
for (current = demux->srcpads; current; current = g_slist_next (current)) {
@ -711,7 +708,6 @@ gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad * pad)
}
GST_PAD_UNLOCK (demux);
gst_object_unref (demux);
return it;
}
@ -731,16 +727,14 @@ src_pad_compare_func (gconstpointer a, gconstpointer b)
}
static GstIterator *
gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * pad)
gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * pad,
GstObject * parent)
{
GstRtpSsrcDemux *demux;
GstIterator *it = NULL;
GValue gval = { 0, };
demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad));
if (!demux)
return NULL;
demux = GST_RTP_SSRC_DEMUX (parent);
g_value_init (&gval, G_TYPE_STRING);
if (pad == demux->rtp_sink)
@ -750,12 +744,10 @@ gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * pad)
else
g_assert_not_reached ();
it = gst_element_iterate_src_pads (GST_ELEMENT (demux));
it = gst_element_iterate_src_pads (GST_ELEMENT_CAST (demux));
it = gst_iterator_filter (it, src_pad_compare_func, &gval);
gst_object_unref (demux);
return it;
}