[0.11] gst-plugins-good: rtpptdemux: Forward sticky events

Olivier Crête tester at kemper.freedesktop.org
Sat Jan 28 08:56:41 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: 33a6d1921f5c4ff045d6570a6258adbd007061b6
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=33a6d1921f5c4ff045d6570a6258adbd007061b6

Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Fri Jan 27 12:04:53 2012 +0100

rtpptdemux: Forward sticky events

---

 gst/rtpmanager/gstrtpptdemux.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/gst/rtpmanager/gstrtpptdemux.c b/gst/rtpmanager/gstrtpptdemux.c
index cb17ff2..06a28c5 100644
--- a/gst/rtpmanager/gstrtpptdemux.c
+++ b/gst/rtpmanager/gstrtpptdemux.c
@@ -332,6 +332,16 @@ clear_newcaps_for_pt (GstRtpPtDemux * rtpdemux, guint8 pt)
   GST_OBJECT_UNLOCK (rtpdemux);
 }
 
+static gboolean
+forward_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
+{
+  GstPad *srcpad = GST_PAD_CAST (user_data);
+
+  gst_pad_push_event (srcpad, gst_event_ref (*event));
+
+  return TRUE;
+}
+
 static GstFlowReturn
 gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
 {
@@ -389,6 +399,8 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
     GST_OBJECT_UNLOCK (rtpdemux);
 
     gst_pad_set_active (srcpad, TRUE);
+    gst_pad_sticky_events_foreach (rtpdemux->sink, forward_sticky_events,
+        srcpad);
     gst_element_add_pad (GST_ELEMENT_CAST (rtpdemux), srcpad);
 
     GST_DEBUG ("emitting new-payload-type for pt %d", pt);
@@ -476,6 +488,13 @@ gst_rtp_pt_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
   rtpdemux = GST_RTP_PT_DEMUX (parent);
 
   switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_CAPS:
+    {
+      gst_rtp_pt_demux_clear_pt_map (rtpdemux);
+      gst_event_unref (event);
+      res = TRUE;
+      break;
+    }
     case GST_EVENT_CUSTOM_DOWNSTREAM:
     {
       const GstStructure *s;



More information about the gstreamer-commits mailing list