diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-11-18 13:56:04 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-11-18 13:56:04 +0100 |
commit | 1ad4d20607bf8f97a3bcabd19e526bed738dd6f8 (patch) | |
tree | 39b8c6a29ae679f787e6d05ccbcba7b308903844 | |
parent | 285702a1a6b7a41e951dcb448ba9487752143fef (diff) |
add parent to activate functions
-rw-r--r-- | ext/ogg/gstoggdemux.c | 19 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudioencoder.c | 8 | ||||
-rw-r--r-- | gst-libs/gst/tag/gsttagdemux.c | 15 |
3 files changed, 24 insertions, 18 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 986e4882c..3614001d2 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -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; diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 81f61b5f1..fe5619b39 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -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; } diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index 7ebb92595..4d02a64dd 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -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); } |