From 6725c91387ac786559086e5761e32bc495ac105b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 15 Oct 2009 13:19:13 +0200 Subject: rtsp: handle events in TCP mode We need to handle events in TCP mode so that we can reply to the LATENCY event with TRUE. --- gst/rtsp/gstrtspsrc.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index b28e6a90..0ed3215c 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1650,6 +1650,31 @@ gst_rtspsrc_handle_src_event (GstPad * pad, GstEvent * event) return res; } +/* this is the final event function we receive on the internal source pad when + * we deal with TCP connections */ +static gboolean +gst_rtspsrc_handle_internal_src_event (GstPad * pad, GstEvent * event) +{ + GstRTSPSrc *src; + gboolean res; + + src = GST_RTSPSRC_CAST (gst_pad_get_element_private (pad)); + + GST_DEBUG_OBJECT (src, "pad %s:%s received event %s", + GST_DEBUG_PAD_NAME (pad), GST_EVENT_TYPE_NAME (event)); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_SEEK: + case GST_EVENT_QOS: + case GST_EVENT_NAVIGATION: + case GST_EVENT_LATENCY: + default: + res = TRUE; + break; + } + return res; +} + /* this is the final query function we receive on the internal source pad when * we deal with TCP connections */ static gboolean @@ -2140,6 +2165,7 @@ gst_rtspsrc_stream_configure_tcp (GstRTSPSrc * src, GstRTSPStream * stream, gst_pad_link (pad0, stream->channelpad[0]); gst_object_unref (stream->channelpad[0]); stream->channelpad[0] = pad0; + gst_pad_set_event_function (pad0, gst_rtspsrc_handle_internal_src_event); gst_pad_set_query_function (pad0, gst_rtspsrc_handle_internal_src_query); gst_pad_set_element_private (pad0, src); gst_pad_set_active (pad0, TRUE); -- cgit