gst_event_set_group_id (event, src->group_id);
}
-static gboolean
-gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
+static GstEvent *
+gst_rtspsrc_update_src_event (GstRTSPSrc * self, GstRTSPStream * stream,
GstEvent * event)
{
- GstRTSPStream *stream;
- GstRTSPSrc *self = GST_RTSPSRC (GST_OBJECT_PARENT (parent));
-
- stream = gst_pad_get_element_private (pad);
-
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_STREAM_START:{
GChecksum *cs;
break;
}
+ return event;
+}
+
+static gboolean
+gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
+{
+ GstRTSPStream *stream;
+ GstRTSPSrc *self = GST_RTSPSRC (GST_OBJECT_PARENT (parent));
+
+ stream = gst_pad_get_element_private (pad);
+
+ event = gst_rtspsrc_update_src_event (self, stream, event);
+
return gst_pad_push_event (stream->srcpad, event);
}
return GST_PAD_PROBE_OK;
}
+typedef struct
+{
+ GstRTSPSrc *src;
+ GstRTSPStream *stream;
+} CopyStickyEventsData;
+
static gboolean
copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
- GstPad *gpad = GST_PAD_CAST (user_data);
+ CopyStickyEventsData *data = user_data;
+ GstEvent *new_event;
- GST_DEBUG_OBJECT (gpad, "store sticky event %" GST_PTR_FORMAT, *event);
- gst_pad_store_sticky_event (gpad, *event);
+ GST_DEBUG_OBJECT (data->stream->srcpad, "send sticky event %" GST_PTR_FORMAT,
+ *event);
+ new_event =
+ gst_rtspsrc_update_src_event (data->src, data->stream,
+ gst_event_ref (*event));
+ gst_pad_store_sticky_event (data->stream->srcpad, new_event);
return TRUE;
}
GstRTSPStream *stream;
gboolean all_added;
GstPad *internal_src;
+ CopyStickyEventsData copy_sticky_events_data;
GST_DEBUG_OBJECT (src, "got new manager pad %" GST_PTR_FORMAT, pad);
GST_PAD (gst_proxy_pad_get_internal (GST_PROXY_PAD (stream->srcpad)));
gst_pad_set_element_private (internal_src, stream);
gst_pad_set_event_function (internal_src, gst_rtspsrc_handle_src_sink_event);
- gst_object_unref (internal_src);
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_active (stream->srcpad, TRUE);
- gst_pad_sticky_events_foreach (pad, copy_sticky_events, stream->srcpad);
+
+ copy_sticky_events_data.src = src;
+ copy_sticky_events_data.stream = stream;
+ gst_pad_sticky_events_foreach (pad, copy_sticky_events,
+ ©_sticky_events_data);
+
+ gst_object_unref (internal_src);
/* don't add the srcpad if this is a sendonly stream */
if (stream->is_backchannel)