add parent to activate functions
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 18 Nov 2011 12:56:04 +0000 (13:56 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 18 Nov 2011 12:56:04 +0000 (13:56 +0100)
ext/ogg/gstoggdemux.c
gst-libs/gst/audio/gstaudioencoder.c
gst-libs/gst/tag/gsttagdemux.c

index 986e488..3614001 100644 (file)
@@ -1781,11 +1781,12 @@ static gboolean gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent,
 static void gst_ogg_demux_loop (GstOggPad * pad);
 static GstFlowReturn gst_ogg_demux_chain (GstPad * pad, GstObject * parent,
     GstBuffer * buffer);
-static gboolean gst_ogg_demux_sink_activate (GstPad * sinkpad);
+static gboolean gst_ogg_demux_sink_activate (GstPad * sinkpad,
+    GstObject * parent);
 static gboolean gst_ogg_demux_sink_activate_pull (GstPad * sinkpad,
-    gboolean active);
+    GstObject * parent, gboolean active);
 static gboolean gst_ogg_demux_sink_activate_push (GstPad * sinkpad,
-    gboolean active);
+    GstObject * parent, gboolean active);
 static GstStateChangeReturn gst_ogg_demux_change_state (GstElement * element,
     GstStateChange transition);
 
@@ -4307,7 +4308,7 @@ gst_ogg_demux_clear_chains (GstOggDemux * ogg)
  * pull based.
  */
 static gboolean
-gst_ogg_demux_sink_activate (GstPad * sinkpad)
+gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent)
 {
   GstQuery *query;
   gboolean pull_mode;
@@ -4338,11 +4339,12 @@ activate_push:
 /* this function gets called when we activate ourselves in push mode.
  * We cannot seek (ourselves) in the stream */
 static gboolean
-gst_ogg_demux_sink_activate_push (GstPad * sinkpad, gboolean active)
+gst_ogg_demux_sink_activate_push (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstOggDemux *ogg;
 
-  ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (sinkpad));
+  ogg = GST_OGG_DEMUX (parent);
 
   ogg->pullmode = FALSE;
   ogg->resync = FALSE;
@@ -4354,11 +4356,12 @@ gst_ogg_demux_sink_activate_push (GstPad * sinkpad, gboolean active)
  * We can perform  random access to the resource and we start a task
  * to start reading */
 static gboolean
-gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, gboolean active)
+gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstOggDemux *ogg;
 
-  ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (sinkpad));
+  ogg = GST_OGG_DEMUX (parent);
 
   if (active) {
     ogg->need_chains = TRUE;
index 81f61b5..fe5619b 100644 (file)
@@ -294,7 +294,7 @@ static void gst_audio_encoder_get_property (GObject * object,
     guint prop_id, GValue * value, GParamSpec * pspec);
 
 static gboolean gst_audio_encoder_sink_activate_push (GstPad * pad,
-    gboolean active);
+    GstObject * parent, gboolean active);
 
 static GstCaps *gst_audio_encoder_getcaps_default (GstAudioEncoder * enc,
     GstCaps * filter);
@@ -1701,12 +1701,13 @@ gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active)
 
 
 static gboolean
-gst_audio_encoder_sink_activate_push (GstPad * pad, gboolean active)
+gst_audio_encoder_sink_activate_push (GstPad * pad, GstObject * parent,
+    gboolean active)
 {
   gboolean result = TRUE;
   GstAudioEncoder *enc;
 
-  enc = GST_AUDIO_ENCODER (gst_pad_get_parent (pad));
+  enc = GST_AUDIO_ENCODER (parent);
 
   GST_DEBUG_OBJECT (enc, "sink activate push %d", active);
 
@@ -1717,7 +1718,6 @@ gst_audio_encoder_sink_activate_push (GstPad * pad, gboolean active)
 
   GST_DEBUG_OBJECT (enc, "sink activate push return: %d", result);
 
-  gst_object_unref (enc);
   return result;
 }
 
index 7ebb925..4d02a64 100644 (file)
@@ -139,7 +139,8 @@ static GstFlowReturn gst_tag_demux_chain (GstPad * pad, GstObject * parent,
 static gboolean gst_tag_demux_sink_event (GstPad * pad, GstObject * parent,
     GstEvent * event);
 
-static gboolean gst_tag_demux_src_activate_pull (GstPad * pad, gboolean active);
+static gboolean gst_tag_demux_src_activate_pull (GstPad * pad,
+    GstObject * parent, gboolean active);
 static GstFlowReturn gst_tag_demux_read_range (GstTagDemux * tagdemux,
     GstObject * parent, guint64 offset, guint length, GstBuffer ** buffer);
 
@@ -151,7 +152,8 @@ static void gst_tag_demux_set_src_caps (GstTagDemux * tagdemux,
 
 static gboolean gst_tag_demux_srcpad_event (GstPad * pad, GstObject * parent,
     GstEvent * event);
-static gboolean gst_tag_demux_sink_activate (GstPad * sinkpad);
+static gboolean gst_tag_demux_sink_activate (GstPad * sinkpad,
+    GstObject * parent);
 static GstStateChangeReturn gst_tag_demux_change_state (GstElement * element,
     GstStateChange transition);
 static gboolean gst_tag_demux_pad_query (GstPad * pad, GstObject * parent,
@@ -1092,7 +1094,7 @@ done:
  *    otherwise activate both pads in push mode and succeed.
  */
 static gboolean
-gst_tag_demux_sink_activate (GstPad * sinkpad)
+gst_tag_demux_sink_activate (GstPad * sinkpad, GstObject * parent)
 {
   GstTypeFindProbability probability = 0;
   GstTagDemuxClass *klass;
@@ -1105,7 +1107,7 @@ gst_tag_demux_sink_activate (GstPad * sinkpad)
   GstQuery *query;
   gboolean pull_mode;
 
-  demux = GST_TAG_DEMUX (GST_PAD_PARENT (sinkpad));
+  demux = GST_TAG_DEMUX (parent);
   klass = GST_TAG_DEMUX_CLASS (G_OBJECT_GET_CLASS (demux));
 
   /* 1: */
@@ -1229,9 +1231,10 @@ activate_push:
 }
 
 static gboolean
-gst_tag_demux_src_activate_pull (GstPad * pad, gboolean active)
+gst_tag_demux_src_activate_pull (GstPad * pad, GstObject * parent,
+    gboolean active)
 {
-  GstTagDemux *demux = GST_TAG_DEMUX (GST_PAD_PARENT (pad));
+  GstTagDemux *demux = GST_TAG_DEMUX (parent);
 
   return gst_pad_activate_pull (demux->priv->sinkpad, active);
 }