From: Wim Taymans Date: Fri, 18 Nov 2011 12:57:20 +0000 (+0100) Subject: add parent to activate functions X-Git-Tag: RELEASE-0.11.1~235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7aa7bca52363152129d225d60b8ff9419a51927;p=platform%2Fupstream%2Fgst-plugins-good.git add parent to activate functions --- diff --git a/ext/pulse/pulseaudiosink.c b/ext/pulse/pulseaudiosink.c index 0a24875..1b9aa41 100644 --- a/ext/pulse/pulseaudiosink.c +++ b/ext/pulse/pulseaudiosink.c @@ -711,7 +711,7 @@ gst_pulse_audio_sink_src_event (GstPad * pad, GstObject * parent, if (G_UNLIKELY (GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_UPSTREAM) && (gst_event_has_name (event, "pulse-format-lost") || gst_event_has_name (event, "pulse-sink-changed"))) { - g_return_val_if_fail (pad->mode != GST_PAD_ACTIVATE_PULL, FALSE); + g_return_val_if_fail (pad->mode != GST_PAD_MODE_PULL, FALSE); GST_PULSE_AUDIO_SINK_LOCK (pbin); if (gst_event_has_name (event, "pulse-format-lost")) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 6d063b1..585f488 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -99,10 +99,12 @@ static gboolean gst_avi_demux_handle_seek (GstAviDemux * avi, GstPad * pad, static gboolean gst_avi_demux_handle_seek_push (GstAviDemux * avi, GstPad * pad, GstEvent * event); static void gst_avi_demux_loop (GstPad * pad); -static gboolean gst_avi_demux_sink_activate (GstPad * sinkpad); +static gboolean gst_avi_demux_sink_activate (GstPad * sinkpad, + GstObject * parent); static gboolean gst_avi_demux_sink_activate_pull (GstPad * sinkpad, + GstObject * parent, gboolean active); +static gboolean gst_avi_demux_activate_push (GstPad * pad, GstObject * parent, gboolean active); -static gboolean gst_avi_demux_activate_push (GstPad * pad, gboolean active); static GstFlowReturn gst_avi_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf); @@ -5265,7 +5267,7 @@ abort_buffering: } static gboolean -gst_avi_demux_sink_activate (GstPad * sinkpad) +gst_avi_demux_sink_activate (GstPad * sinkpad, GstObject * parent) { GstQuery *query; gboolean pull_mode; @@ -5294,9 +5296,10 @@ activate_push: } static gboolean -gst_avi_demux_sink_activate_pull (GstPad * sinkpad, gboolean active) +gst_avi_demux_sink_activate_pull (GstPad * sinkpad, GstObject * parent, + gboolean active) { - GstAviDemux *avi = GST_AVI_DEMUX (GST_OBJECT_PARENT (sinkpad)); + GstAviDemux *avi = GST_AVI_DEMUX (parent); if (active) { avi->streaming = FALSE; @@ -5308,9 +5311,9 @@ gst_avi_demux_sink_activate_pull (GstPad * sinkpad, gboolean active) } static gboolean -gst_avi_demux_activate_push (GstPad * pad, gboolean active) +gst_avi_demux_activate_push (GstPad * pad, GstObject * parent, gboolean active) { - GstAviDemux *avi = GST_AVI_DEMUX (GST_OBJECT_PARENT (pad)); + GstAviDemux *avi = GST_AVI_DEMUX (parent); if (active) { GST_DEBUG ("avi: activating push/chain function"); diff --git a/gst/debugutils/rndbuffersize.c b/gst/debugutils/rndbuffersize.c index 71463a6..02e2166 100644 --- a/gst/debugutils/rndbuffersize.c +++ b/gst/debugutils/rndbuffersize.c @@ -85,9 +85,9 @@ static void gst_rnd_buffer_size_set_property (GObject * object, guint prop_id, static void gst_rnd_buffer_size_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static gboolean gst_rnd_buffer_size_activate (GstPad * pad); +static gboolean gst_rnd_buffer_size_activate (GstPad * pad, GstObject * parent); static gboolean gst_rnd_buffer_size_activate_pull (GstPad * pad, - gboolean active); + GstObject * parent, gboolean active); static void gst_rnd_buffer_size_loop (GstRndBufferSize * self); static GstStateChangeReturn gst_rnd_buffer_size_change_state (GstElement * element, GstStateChange transition); @@ -215,7 +215,7 @@ gst_rnd_buffer_size_get_property (GObject * object, guint prop_id, static gboolean -gst_rnd_buffer_size_activate (GstPad * pad) +gst_rnd_buffer_size_activate (GstPad * pad, GstObject * parent) { GstQuery *query; gboolean pull_mode; @@ -245,9 +245,10 @@ no_pull: static gboolean -gst_rnd_buffer_size_activate_pull (GstPad * pad, gboolean active) +gst_rnd_buffer_size_activate_pull (GstPad * pad, GstObject * parent, + gboolean active) { - GstRndBufferSize *self = GST_RND_BUFFER_SIZE (GST_OBJECT_PARENT (pad)); + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (parent); if (active) { GST_INFO_OBJECT (self, "starting pull"); diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 2e42982..56dc2d0 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -2799,7 +2799,7 @@ wrong_format: /* If we can pull that's prefered */ static gboolean -gst_flv_demux_sink_activate (GstPad * sinkpad) +gst_flv_demux_sink_activate (GstPad * sinkpad, GstObject * parent) { GstQuery *query; gboolean pull_mode; @@ -2830,16 +2830,15 @@ activate_push: /* This function gets called when we activate ourselves in push mode. * We cannot seek (ourselves) in the stream */ static gboolean -gst_flv_demux_sink_activate_push (GstPad * sinkpad, gboolean active) +gst_flv_demux_sink_activate_push (GstPad * sinkpad, GstObject * parent, + gboolean active) { GstFlvDemux *demux; - demux = GST_FLV_DEMUX (gst_pad_get_parent (sinkpad)); + demux = GST_FLV_DEMUX (parent); demux->random_access = FALSE; - gst_object_unref (demux); - return TRUE; } @@ -2847,20 +2846,19 @@ gst_flv_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_flv_demux_sink_activate_pull (GstPad * sinkpad, gboolean active) +gst_flv_demux_sink_activate_pull (GstPad * sinkpad, GstObject * parent, + gboolean active) { GstFlvDemux *demux; - demux = GST_FLV_DEMUX (gst_pad_get_parent (sinkpad)); + demux = GST_FLV_DEMUX (parent); if (active) { demux->random_access = TRUE; - gst_object_unref (demux); return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_flv_demux_loop, sinkpad); } else { demux->random_access = FALSE; - gst_object_unref (demux); return gst_pad_stop_task (sinkpad); } } diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 73a5493..a56d77a 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -400,9 +400,11 @@ static void gst_qtdemux_set_index (GstElement * element, GstIndex * index); static GstIndex *gst_qtdemux_get_index (GstElement * element); static GstStateChangeReturn gst_qtdemux_change_state (GstElement * element, GstStateChange transition); -static gboolean qtdemux_sink_activate (GstPad * sinkpad); -static gboolean qtdemux_sink_activate_pull (GstPad * sinkpad, gboolean active); -static gboolean qtdemux_sink_activate_push (GstPad * sinkpad, gboolean active); +static gboolean qtdemux_sink_activate (GstPad * sinkpad, GstObject * parent); +static gboolean qtdemux_sink_activate_pull (GstPad * sinkpad, + GstObject * parent, gboolean active); +static gboolean qtdemux_sink_activate_push (GstPad * sinkpad, + GstObject * parent, gboolean active); static void gst_qtdemux_loop (GstPad * pad); static GstFlowReturn gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, @@ -4420,7 +4422,7 @@ no_moov: } static gboolean -qtdemux_sink_activate (GstPad * sinkpad) +qtdemux_sink_activate (GstPad * sinkpad, GstObject * parent) { GstQuery *query; gboolean pull_mode; @@ -4449,9 +4451,10 @@ activate_push: } static gboolean -qtdemux_sink_activate_pull (GstPad * sinkpad, gboolean active) +qtdemux_sink_activate_pull (GstPad * sinkpad, GstObject * parent, + gboolean active) { - GstQTDemux *demux = GST_QTDEMUX (GST_PAD_PARENT (sinkpad)); + GstQTDemux *demux = GST_QTDEMUX (parent); if (active) { demux->pullbased = TRUE; @@ -4463,9 +4466,10 @@ qtdemux_sink_activate_pull (GstPad * sinkpad, gboolean active) } static gboolean -qtdemux_sink_activate_push (GstPad * sinkpad, gboolean active) +qtdemux_sink_activate_push (GstPad * sinkpad, GstObject * parent, + gboolean active) { - GstQTDemux *demux = GST_QTDEMUX (GST_PAD_PARENT (sinkpad)); + GstQTDemux *demux = GST_QTDEMUX (parent); demux->pullbased = FALSE; diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index eaad36f..8233284 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -260,7 +260,7 @@ static gboolean gst_rtp_jitter_buffer_sink_query (GstPad * pad, static gboolean gst_rtp_jitter_buffer_src_event (GstPad * pad, GstObject * parent, GstEvent * event); static gboolean gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, - gboolean active); + GstObject * parent, gboolean active); static void gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer); static gboolean gst_rtp_jitter_buffer_src_query (GstPad * pad, GstObject * parent, GstQuery * query); @@ -882,12 +882,13 @@ gst_rtp_jitter_buffer_flush_stop (GstRtpJitterBuffer * jitterbuffer) } static gboolean -gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, gboolean active) +gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, GstObject * parent, + gboolean active) { gboolean result = TRUE; GstRtpJitterBuffer *jitterbuffer = NULL; - jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad)); + jitterbuffer = GST_RTP_JITTER_BUFFER (parent); if (active) { /* allow data processing */ @@ -907,8 +908,6 @@ gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, gboolean active) result = gst_pad_stop_task (pad); } - gst_object_unref (jitterbuffer); - return result; } @@ -1069,7 +1068,8 @@ gst_rtp_jitter_buffer_sink_event (GstPad * pad, GstObject * parent, break; case GST_EVENT_FLUSH_STOP: ret = gst_pad_push_event (priv->srcpad, event); - ret = gst_rtp_jitter_buffer_src_activate_push (priv->srcpad, TRUE); + ret = + gst_rtp_jitter_buffer_src_activate_push (priv->srcpad, parent, TRUE); break; case GST_EVENT_EOS: { diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 3bea339..62c609b 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -63,9 +63,10 @@ GST_DEBUG_CATEGORY_STATIC (wavparse_debug); static void gst_wavparse_dispose (GObject * object); -static gboolean gst_wavparse_sink_activate (GstPad * sinkpad); +static gboolean gst_wavparse_sink_activate (GstPad * sinkpad, + GstObject * parent); static gboolean gst_wavparse_sink_activate_pull (GstPad * sinkpad, - gboolean active); + GstObject * parent, gboolean active); static gboolean gst_wavparse_send_event (GstElement * element, GstEvent * event); static GstStateChangeReturn gst_wavparse_change_state (GstElement * element, @@ -2537,9 +2538,9 @@ gst_wavparse_srcpad_event (GstPad * pad, GstObject * parent, GstEvent * event) } static gboolean -gst_wavparse_sink_activate (GstPad * sinkpad) +gst_wavparse_sink_activate (GstPad * sinkpad, GstObject * parent) { - GstWavParse *wav = GST_WAVPARSE (gst_pad_get_parent (sinkpad)); + GstWavParse *wav = GST_WAVPARSE (parent); GstQuery *query; gboolean pull_mode; @@ -2564,7 +2565,6 @@ gst_wavparse_sink_activate (GstPad * sinkpad) GST_DEBUG_OBJECT (sinkpad, "activating pull"); wav->streaming = FALSE; - gst_object_unref (wav); return gst_pad_activate_pull (sinkpad, TRUE); activate_push: @@ -2572,14 +2572,14 @@ activate_push: GST_DEBUG_OBJECT (sinkpad, "activating push"); wav->streaming = TRUE; wav->adapter = gst_adapter_new (); - gst_object_unref (wav); return gst_pad_activate_push (sinkpad, TRUE); } } static gboolean -gst_wavparse_sink_activate_pull (GstPad * sinkpad, gboolean active) +gst_wavparse_sink_activate_pull (GstPad * sinkpad, GstObject * parent, + gboolean active) { if (active) { /* if we have a scheduler we can start the task */