[gst-cvs] gst-plugins-good: rtsp: handle events in TCP mode

Wim Taymans wtay at kemper.freedesktop.org
Thu Oct 15 04:20:33 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: 6725c91387ac786559086e5761e32bc495ac105b
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=6725c91387ac786559086e5761e32bc495ac105b

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Oct 15 13:19:13 2009 +0200

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 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index b28e6a9..0ed3215 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);





More information about the Gstreamer-commits mailing list