rtspsrc: copy sticky events to ghostpad

When we expose internal pads as ghostpads, first copy the sticky events
so that we have the caps and segment etc.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724712
This commit is contained in:
Wim Taymans 2014-03-25 11:36:40 +01:00
parent 67f3113759
commit 3b497bf7d5
2 changed files with 24 additions and 0 deletions

View file

@ -2684,6 +2684,17 @@ manage_failed:
} }
} }
static gboolean
copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
GstPad *gpad = GST_PAD_CAST (user_data);
GST_DEBUG_OBJECT (gpad, "store sticky event %" GST_PTR_FORMAT, *event);
gst_pad_store_sticky_event (gpad, *event);
return TRUE;
}
/* a new pad (SSRC) was created in @session. This signal is emited from the /* a new pad (SSRC) was created in @session. This signal is emited from the
* payload demuxer. */ * payload demuxer. */
static void static void
@ -2714,6 +2725,7 @@ new_payload_found (GstElement * element, guint pt, GstPad * pad,
gst_pad_set_active (gpad, TRUE); gst_pad_set_active (gpad, TRUE);
GST_RTP_BIN_SHUTDOWN_UNLOCK (rtpbin); GST_RTP_BIN_SHUTDOWN_UNLOCK (rtpbin);
gst_pad_sticky_events_foreach (pad, copy_sticky_events, gpad);
gst_element_add_pad (GST_ELEMENT_CAST (rtpbin), gpad); gst_element_add_pad (GST_ELEMENT_CAST (rtpbin), gpad);
return; return;

View file

@ -2702,6 +2702,17 @@ was_ok:
} }
} }
static gboolean
copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
GstPad *gpad = GST_PAD_CAST (user_data);
GST_DEBUG_OBJECT (gpad, "store sticky event %" GST_PTR_FORMAT, *event);
gst_pad_store_sticky_event (gpad, *event);
return TRUE;
}
/* this callback is called when the session manager generated a new src pad with /* this callback is called when the session manager generated a new src pad with
* payloaded RTP packets. We simply ghost the pad here. */ * payloaded RTP packets. We simply ghost the pad here. */
static void static void
@ -2760,6 +2771,7 @@ new_manager_pad (GstElement * manager, GstPad * pad, GstRTSPSrc * src)
gst_pad_set_event_function (stream->srcpad, gst_rtspsrc_handle_src_event); gst_pad_set_event_function (stream->srcpad, gst_rtspsrc_handle_src_event);
gst_pad_set_query_function (stream->srcpad, gst_rtspsrc_handle_src_query); gst_pad_set_query_function (stream->srcpad, gst_rtspsrc_handle_src_query);
gst_pad_set_active (stream->srcpad, TRUE); gst_pad_set_active (stream->srcpad, TRUE);
gst_pad_sticky_events_foreach (pad, copy_sticky_events, stream->srcpad);
gst_element_add_pad (GST_ELEMENT_CAST (src), stream->srcpad); gst_element_add_pad (GST_ELEMENT_CAST (src), stream->srcpad);
if (all_added) { if (all_added) {