From 61903122145419d88d3f418b856b299572db3cc2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 16 Nov 2011 17:27:13 +0100 Subject: [PATCH] add parent to query function --- ext/annodex/gstcmmldec.c | 5 +-- ext/jpeg/gstjpegdec.c | 7 ++-- ext/jpeg/gstjpegenc.c | 11 +++--- ext/pulse/pulseaudiosink.c | 17 ++++----- gst/audiofx/audiofxbasefirfilter.c | 56 ++++++++++++++--------------- gst/auparse/gstauparse.c | 10 +++--- gst/avi/gstavidemux.c | 15 ++++---- gst/debugutils/gstpushfilesrc.c | 5 +-- gst/flv/gstflvdemux.c | 21 +++-------- gst/goom/gstgoom.c | 9 ++--- gst/isomp4/qtdemux.c | 9 +++-- gst/law/alaw-decode.c | 4 +-- gst/law/alaw-encode.c | 4 +-- gst/law/mulaw-decode.c | 4 +-- gst/law/mulaw-encode.c | 4 +-- gst/rtpmanager/gstrtpjitterbuffer.c | 31 ++++++---------- gst/rtpmanager/gstrtpsession.c | 12 +++---- gst/rtpmanager/gstrtpssrcdemux.c | 13 ++++--- gst/rtsp/gstrtpdec.c | 4 +-- gst/rtsp/gstrtspsrc.c | 9 ++--- gst/shapewipe/gstshapewipe.c | 26 +++++++------- gst/videocrop/gstaspectratiocrop.c | 7 ++-- gst/wavparse/gstwavparse.c | 14 ++++---- 23 files changed, 135 insertions(+), 162 deletions(-) diff --git a/ext/annodex/gstcmmldec.c b/ext/annodex/gstcmmldec.c index 83337413a9..ed7072daf6 100644 --- a/ext/annodex/gstcmmldec.c +++ b/ext/annodex/gstcmmldec.c @@ -90,7 +90,8 @@ static void gst_cmml_dec_get_property (GObject * dec, guint property_id, GValue * value, GParamSpec * pspec); static void gst_cmml_dec_set_property (GObject * dec, guint property_id, const GValue * value, GParamSpec * pspec); -static gboolean gst_cmml_dec_sink_query (GstPad * pad, GstQuery * query); +static gboolean gst_cmml_dec_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query); static gboolean gst_cmml_dec_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_cmml_dec_convert (GstPad * pad, GstFormat src_fmt, gint64 src_val, GstFormat * dest_fmt, gint64 * dest_val); @@ -253,7 +254,7 @@ gst_cmml_dec_change_state (GstElement * element, GstStateChange transition) } static gboolean -gst_cmml_dec_sink_query (GstPad * pad, GstQuery * query) +gst_cmml_dec_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res = FALSE; diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index 9ef858e33d..5528c094ca 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -95,7 +95,8 @@ static void gst_jpeg_dec_get_property (GObject * object, guint prop_id, static GstFlowReturn gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buffer); static GstCaps *gst_jpeg_dec_getcaps (GstPad * pad, GstCaps * filter); -static gboolean gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query); +static gboolean gst_jpeg_dec_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query); static gboolean gst_jpeg_dec_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_jpeg_dec_src_event (GstPad * pad, GstEvent * event); static GstStateChangeReturn gst_jpeg_dec_change_state (GstElement * element, @@ -1777,7 +1778,7 @@ gst_jpeg_dec_sink_event (GstPad * pad, GstEvent * event) } static gboolean -gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query) +gst_jpeg_dec_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res = FALSE; @@ -1794,7 +1795,7 @@ gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index f622e4cbd9..d9619446bf 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -72,7 +72,8 @@ static void gst_jpegenc_finalize (GObject * object); static GstFlowReturn gst_jpegenc_chain (GstPad * pad, GstBuffer * buf); static gboolean gst_jpegenc_sink_event (GstPad * pad, GstEvent * event); static GstCaps *gst_jpegenc_getcaps (GstPad * pad, GstCaps * filter); -static gboolean gst_jpegenc_sink_query (GstPad * pad, GstQuery * query); +static gboolean gst_jpegenc_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query); static void gst_jpegenc_resync (GstJpegEnc * jpegenc); static void gst_jpegenc_set_property (GObject * object, guint prop_id, @@ -342,10 +343,9 @@ done: } static gboolean -gst_jpegenc_sink_query (GstPad * pad, GstQuery * query) +gst_jpegenc_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; - GstJpegEnc *enc = GST_JPEGENC (gst_pad_get_parent (pad)); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CAPS: @@ -360,12 +360,9 @@ gst_jpegenc_sink_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - - gst_object_unref (enc); - return res; } diff --git a/ext/pulse/pulseaudiosink.c b/ext/pulse/pulseaudiosink.c index 315df7ffe8..e17c2a6c22 100644 --- a/ext/pulse/pulseaudiosink.c +++ b/ext/pulse/pulseaudiosink.c @@ -115,12 +115,11 @@ static gboolean gst_pulse_audio_sink_src_event (GstPad * pad, GstEvent * event); static gboolean gst_pulse_audio_sink_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_pulse_audio_sink_sink_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); static gboolean gst_pulse_audio_sink_sink_acceptcaps (GstPulseAudioSink * pbin, GstPad * pad, GstCaps * caps); -static GstStateChangeReturn -gst_pulse_audio_sink_change_state (GstElement * element, - GstStateChange transition); +static GstStateChangeReturn gst_pulse_audio_sink_change_state (GstElement * + element, GstStateChange transition); static gboolean gst_pulse_audio_sink_set_caps (GstPulseAudioSink * pbin, GstCaps * caps); @@ -847,9 +846,10 @@ out: } static gboolean -gst_pulse_audio_sink_sink_query (GstPad * pad, GstQuery * query) +gst_pulse_audio_sink_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query) { - GstPulseAudioSink *pbin = GST_PULSE_AUDIO_SINK (gst_pad_get_parent (pad)); + GstPulseAudioSink *pbin = GST_PULSE_AUDIO_SINK (parent); gboolean ret = FALSE; switch (GST_QUERY_TYPE (query)) { @@ -864,12 +864,9 @@ gst_pulse_audio_sink_sink_query (GstPad * pad, GstQuery * query) break; } default: - ret = gst_pad_query_default (pad, query); + ret = gst_pad_query_default (pad, parent, query); break; } - - gst_object_unref (pbin); - return ret; } diff --git a/gst/audiofx/audiofxbasefirfilter.c b/gst/audiofx/audiofxbasefirfilter.c index 3d361053f1..ff64e19f23 100644 --- a/gst/audiofx/audiofxbasefirfilter.c +++ b/gst/audiofx/audiofxbasefirfilter.c @@ -72,7 +72,7 @@ static gboolean gst_audio_fx_base_fir_filter_setup (GstAudioFilter * base, const GstAudioInfo * info); static gboolean gst_audio_fx_base_fir_filter_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); /* * The code below calculates the linear convolution: @@ -942,10 +942,10 @@ gst_audio_fx_base_fir_filter_stop (GstBaseTransform * base) } static gboolean -gst_audio_fx_base_fir_filter_query (GstPad * pad, GstQuery * query) +gst_audio_fx_base_fir_filter_query (GstPad * pad, GstObject * parent, + GstQuery * query) { - GstAudioFXBaseFIRFilter *self = - GST_AUDIO_FX_BASE_FIR_FILTER (gst_pad_get_parent (pad)); + GstAudioFXBaseFIRFilter *self = GST_AUDIO_FX_BASE_FIR_FILTER (parent); gboolean res = TRUE; switch (GST_QUERY_TYPE (query)) { @@ -954,49 +954,45 @@ gst_audio_fx_base_fir_filter_query (GstPad * pad, GstQuery * query) GstClockTime min, max; gboolean live; guint64 latency; - GstPad *peer; gint rate = GST_AUDIO_FILTER_RATE (self); if (rate == 0) { res = FALSE; - } else if ((peer = gst_pad_get_peer (GST_BASE_TRANSFORM (self)->sinkpad))) { - if ((res = gst_pad_query (peer, query))) { - gst_query_parse_latency (query, &live, &min, &max); + } else if ((res = + gst_pad_peer_query (GST_BASE_TRANSFORM (self)->sinkpad, query))) { + gst_query_parse_latency (query, &live, &min, &max); - GST_DEBUG_OBJECT (self, "Peer latency: min %" - GST_TIME_FORMAT " max %" GST_TIME_FORMAT, - GST_TIME_ARGS (min), GST_TIME_ARGS (max)); + GST_DEBUG_OBJECT (self, "Peer latency: min %" + GST_TIME_FORMAT " max %" GST_TIME_FORMAT, + GST_TIME_ARGS (min), GST_TIME_ARGS (max)); - if (self->fft && !self->low_latency) - latency = self->block_length - self->kernel_length + 1; - else - latency = self->latency; + if (self->fft && !self->low_latency) + latency = self->block_length - self->kernel_length + 1; + else + latency = self->latency; - /* add our own latency */ - latency = gst_util_uint64_scale_round (latency, GST_SECOND, rate); + /* add our own latency */ + latency = gst_util_uint64_scale_round (latency, GST_SECOND, rate); - GST_DEBUG_OBJECT (self, "Our latency: %" - GST_TIME_FORMAT, GST_TIME_ARGS (latency)); + GST_DEBUG_OBJECT (self, "Our latency: %" + GST_TIME_FORMAT, GST_TIME_ARGS (latency)); - min += latency; - if (max != GST_CLOCK_TIME_NONE) - max += latency; + min += latency; + if (max != GST_CLOCK_TIME_NONE) + max += latency; - GST_DEBUG_OBJECT (self, "Calculated total latency : min %" - GST_TIME_FORMAT " max %" GST_TIME_FORMAT, - GST_TIME_ARGS (min), GST_TIME_ARGS (max)); + GST_DEBUG_OBJECT (self, "Calculated total latency : min %" + GST_TIME_FORMAT " max %" GST_TIME_FORMAT, + GST_TIME_ARGS (min), GST_TIME_ARGS (max)); - gst_query_set_latency (query, live, min, max); - } - gst_object_unref (peer); + gst_query_set_latency (query, live, min, max); } break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (self); return res; } diff --git a/gst/auparse/gstauparse.c b/gst/auparse/gstauparse.c index f2bab52b96..a73bd3fe88 100644 --- a/gst/auparse/gstauparse.c +++ b/gst/auparse/gstauparse.c @@ -80,7 +80,8 @@ static GstFlowReturn gst_au_parse_chain (GstPad * pad, GstBuffer * buf); static GstStateChangeReturn gst_au_parse_change_state (GstElement * element, GstStateChange transition); static void gst_au_parse_reset (GstAuParse * auparse); -static gboolean gst_au_parse_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_au_parse_src_query (GstPad * pad, GstObject * parent, + GstQuery * query); static gboolean gst_au_parse_src_event (GstPad * pad, GstEvent * event); static gboolean gst_au_parse_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_au_parse_src_convert (GstAuParse * auparse, @@ -541,12 +542,12 @@ gst_au_parse_src_convert (GstAuParse * auparse, GstFormat src_format, } static gboolean -gst_au_parse_src_query (GstPad * pad, GstQuery * query) +gst_au_parse_src_query (GstPad * pad, GstObject * parent, GstQuery * query) { GstAuParse *auparse; gboolean ret = FALSE; - auparse = GST_AU_PARSE (gst_pad_get_parent (pad)); + auparse = GST_AU_PARSE (parent); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_DURATION:{ @@ -606,11 +607,10 @@ gst_au_parse_src_query (GstPad * pad, GstQuery * query) break; } default: - ret = gst_pad_query_default (pad, query); + ret = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (auparse); return ret; } diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 225876b554..54323912f6 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -87,7 +87,8 @@ static gboolean gst_avi_demux_push_event (GstAviDemux * avi, GstEvent * event); #if 0 static const GstFormat *gst_avi_demux_get_src_formats (GstPad * pad); #endif -static gboolean gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_avi_demux_handle_src_query (GstPad * pad, + GstObject * parent, GstQuery * query); static gboolean gst_avi_demux_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value); @@ -417,15 +418,16 @@ done: } static gboolean -gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query) +gst_avi_demux_handle_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { gboolean res = TRUE; - GstAviDemux *avi = GST_AVI_DEMUX (gst_pad_get_parent (pad)); + GstAviDemux *avi = GST_AVI_DEMUX (parent); GstAviStream *stream = gst_pad_get_element_private (pad); if (!stream->strh || !stream->strf.data) - return gst_pad_query_default (pad, query); + return gst_pad_query_default (pad, parent, query); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION:{ @@ -552,15 +554,14 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query) &dest_val))) gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val); else - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (avi); return res; } diff --git a/gst/debugutils/gstpushfilesrc.c b/gst/debugutils/gstpushfilesrc.c index 2718d5c7c7..06e3f15c5f 100644 --- a/gst/debugutils/gstpushfilesrc.c +++ b/gst/debugutils/gstpushfilesrc.c @@ -102,7 +102,8 @@ gst_push_file_src_class_init (GstPushFileSrcClass * g_class) } static gboolean -gst_push_file_src_ghostpad_query (GstPad * pad, GstQuery * query) +gst_push_file_src_ghostpad_query (GstPad * pad, GstObject * parent, + GstQuery * query) { gboolean res; @@ -112,7 +113,7 @@ gst_push_file_src_ghostpad_query (GstPad * pad, GstQuery * query) res = TRUE; break; default: - res = gst_proxy_pad_query_default (pad, query); + res = gst_proxy_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index a94abe6ab5..f6929aeb4e 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -93,7 +93,8 @@ static gboolean flv_demux_handle_seek_push (GstFlvDemux * demux, static gboolean gst_flv_demux_handle_seek_pull (GstFlvDemux * demux, GstEvent * event, gboolean seeking); -static gboolean gst_flv_demux_query (GstPad * pad, GstQuery * query); +static gboolean gst_flv_demux_query (GstPad * pad, GstObject * parent, + GstQuery * query); static gboolean gst_flv_demux_src_event (GstPad * pad, GstEvent * event); @@ -2966,12 +2967,12 @@ gst_flv_demux_src_event (GstPad * pad, GstEvent * event) } static gboolean -gst_flv_demux_query (GstPad * pad, GstQuery * query) +gst_flv_demux_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res = TRUE; GstFlvDemux *demux; - demux = GST_FLV_DEMUX (gst_pad_get_parent (pad)); + demux = GST_FLV_DEMUX (parent); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_DURATION: @@ -3056,23 +3057,11 @@ gst_flv_demux_query (GstPad * pad, GstQuery * query) } case GST_QUERY_LATENCY: default: - { - GstPad *peer; - - if ((peer = gst_pad_get_peer (demux->sinkpad))) { - /* query latency on peer pad */ - res = gst_pad_query (peer, query); - gst_object_unref (peer); - } else { - /* no peer, we don't know */ - res = FALSE; - } + res = gst_pad_peer_query (demux->sinkpad, query); break; - } } beach: - gst_object_unref (demux); return res; } diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index 8eb99ae9b9..6faf603cc8 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -98,7 +98,8 @@ static GstFlowReturn gst_goom_chain (GstPad * pad, GstBuffer * buffer); static gboolean gst_goom_src_event (GstPad * pad, GstEvent * event); static gboolean gst_goom_sink_event (GstPad * pad, GstEvent * event); -static gboolean gst_goom_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_goom_src_query (GstPad * pad, GstObject * parent, + GstQuery * query); #define gst_goom_parent_class parent_class G_DEFINE_TYPE (GstGoom, gst_goom, GST_TYPE_ELEMENT); @@ -400,12 +401,12 @@ gst_goom_sink_event (GstPad * pad, GstEvent * event) } static gboolean -gst_goom_src_query (GstPad * pad, GstQuery * query) +gst_goom_src_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res = FALSE; GstGoom *goom; - goom = GST_GOOM (GST_PAD_PARENT (pad)); + goom = GST_GOOM (parent); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_LATENCY: @@ -450,7 +451,7 @@ gst_goom_src_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 6caf7f4dac..b0ffc0b8b5 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -695,10 +695,11 @@ gst_qtdemux_get_duration (GstQTDemux * qtdemux, gint64 * duration) } static gboolean -gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query) +gst_qtdemux_handle_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { gboolean res = FALSE; - GstQTDemux *qtdemux = GST_QTDEMUX (gst_pad_get_parent (pad)); + GstQTDemux *qtdemux = GST_QTDEMUX (parent); GST_LOG_OBJECT (pad, "%s query", GST_QUERY_TYPE_NAME (query)); @@ -771,12 +772,10 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (qtdemux); - return res; } diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c index 7dbb3f9e0c..02a31c35be 100644 --- a/gst/law/alaw-decode.c +++ b/gst/law/alaw-decode.c @@ -208,7 +208,7 @@ gst_alaw_dec_getcaps (GstPad * pad, GstCaps * filter) } static gboolean -gst_alaw_dec_query (GstPad * pad, GstQuery * query) +gst_alaw_dec_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; @@ -226,7 +226,7 @@ gst_alaw_dec_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/law/alaw-encode.c b/gst/law/alaw-encode.c index 8fc4978925..c21be7d379 100644 --- a/gst/law/alaw-encode.c +++ b/gst/law/alaw-encode.c @@ -360,7 +360,7 @@ gst_alaw_enc_getcaps (GstPad * pad, GstCaps * filter) } static gboolean -gst_alaw_enc_query (GstPad * pad, GstQuery * query) +gst_alaw_enc_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; @@ -378,7 +378,7 @@ gst_alaw_enc_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c index e977c543ec..81c34f323a 100644 --- a/gst/law/mulaw-decode.c +++ b/gst/law/mulaw-decode.c @@ -147,7 +147,7 @@ mulawdec_getcaps (GstPad * pad, GstCaps * filter) } static gboolean -gst_mulawdec_query (GstPad * pad, GstQuery * query) +gst_mulawdec_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; @@ -165,7 +165,7 @@ gst_mulawdec_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/law/mulaw-encode.c b/gst/law/mulaw-encode.c index 83019db2e0..149e7c38ba 100644 --- a/gst/law/mulaw-encode.c +++ b/gst/law/mulaw-encode.c @@ -114,7 +114,7 @@ mulawenc_getcaps (GstPad * pad, GstCaps * filter) } static gboolean -gst_mulawenc_query (GstPad * pad, GstQuery * query) +gst_mulawenc_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; @@ -132,7 +132,7 @@ gst_mulawenc_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index e814f32f36..e629f69c0e 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -253,7 +253,7 @@ static GstFlowReturn gst_rtp_jitter_buffer_chain_rtcp (GstPad * pad, GstBuffer * buffer); static gboolean gst_rtp_jitter_buffer_sink_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); /* srcpad overrides */ static gboolean gst_rtp_jitter_buffer_src_event (GstPad * pad, @@ -262,7 +262,7 @@ static gboolean gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, gboolean active); static void gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer); static gboolean gst_rtp_jitter_buffer_src_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); static void gst_rtp_jitter_buffer_clear_pt_map (GstRtpJitterBuffer * jitterbuffer); @@ -2087,15 +2087,11 @@ ignore_buffer: } static gboolean -gst_rtp_jitter_buffer_sink_query (GstPad * pad, GstQuery * query) +gst_rtp_jitter_buffer_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query) { - GstRtpJitterBuffer *jitterbuffer; gboolean res = FALSE; - jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad)); - if (G_UNLIKELY (jitterbuffer == NULL)) - return FALSE; - switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CAPS: { @@ -2109,25 +2105,22 @@ gst_rtp_jitter_buffer_sink_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (jitterbuffer); - return res; } static gboolean -gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query) +gst_rtp_jitter_buffer_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { GstRtpJitterBuffer *jitterbuffer; GstRtpJitterBufferPrivate *priv; gboolean res = FALSE; - jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad)); - if (G_UNLIKELY (jitterbuffer == NULL)) - return FALSE; + jitterbuffer = GST_RTP_JITTER_BUFFER (parent); priv = jitterbuffer->priv; switch (GST_QUERY_TYPE (query)) { @@ -2174,7 +2167,7 @@ gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query) gst_query_parse_position (query, &fmt, NULL); if (fmt != GST_FORMAT_TIME) { - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } @@ -2192,7 +2185,7 @@ gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query) gst_query_set_position (query, GST_FORMAT_TIME, start + last_out); res = TRUE; } else { - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); } break; } @@ -2208,12 +2201,10 @@ gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (jitterbuffer); - return res; } diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 2ff60b8aaf..2b38ad773a 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1598,12 +1598,13 @@ gst_rtp_session_chain_recv_rtcp (GstPad * pad, GstBuffer * buffer) } static gboolean -gst_rtp_session_query_send_rtcp_src (GstPad * pad, GstQuery * query) +gst_rtp_session_query_send_rtcp_src (GstPad * pad, GstObject * parent, + GstQuery * query) { GstRtpSession *rtpsession; gboolean ret = FALSE; - rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad)); + rtpsession = GST_RTP_SESSION (parent); GST_DEBUG_OBJECT (rtpsession, "received QUERY"); @@ -1618,8 +1619,6 @@ gst_rtp_session_query_send_rtcp_src (GstPad * pad, GstQuery * query) break; } - gst_object_unref (rtpsession); - return ret; } @@ -1769,7 +1768,8 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad, GstCaps * filter) } static gboolean -gst_rtp_session_query_send_rtp (GstPad * pad, GstQuery * query) +gst_rtp_session_query_send_rtp (GstPad * pad, GstObject * parent, + GstQuery * query) { gboolean res = FALSE; @@ -1786,7 +1786,7 @@ gst_rtp_session_query_send_rtp (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c index 8f470b48b8..dee6927769 100644 --- a/gst/rtpmanager/gstrtpssrcdemux.c +++ b/gst/rtpmanager/gstrtpssrcdemux.c @@ -124,7 +124,8 @@ static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * static gboolean gst_rtp_ssrc_demux_src_event (GstPad * pad, GstEvent * event); static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad * pad); -static gboolean gst_rtp_ssrc_demux_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_rtp_ssrc_demux_src_query (GstPad * pad, GstObject * parent, + GstQuery * query); static guint gst_rtp_ssrc_demux_signals[LAST_SIGNAL] = { 0 }; @@ -760,14 +761,13 @@ gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * pad) static gboolean -gst_rtp_ssrc_demux_src_query (GstPad * pad, GstQuery * query) +gst_rtp_ssrc_demux_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { GstRtpSsrcDemux *demux; gboolean res = FALSE; - demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad)); - if (G_UNLIKELY (demux == NULL)) - return FALSE; + demux = GST_RTP_SSRC_DEMUX (parent); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_LATENCY: @@ -792,10 +792,9 @@ gst_rtp_ssrc_demux_src_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (demux); return res; } diff --git a/gst/rtsp/gstrtpdec.c b/gst/rtsp/gstrtpdec.c index b1ec62fa40..513f3569d7 100644 --- a/gst/rtsp/gstrtpdec.c +++ b/gst/rtsp/gstrtpdec.c @@ -433,7 +433,7 @@ gst_rtp_dec_finalize (GObject * object) } static gboolean -gst_rtp_dec_query_src (GstPad * pad, GstQuery * query) +gst_rtp_dec_query_src (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res; @@ -446,7 +446,7 @@ gst_rtp_dec_query_src (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 88f4152e99..29ad495644 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1994,7 +1994,8 @@ gst_rtspsrc_handle_internal_src_event (GstPad * pad, GstEvent * event) /* this is the final query function we receive on the internal source pad when * we deal with TCP connections */ static gboolean -gst_rtspsrc_handle_internal_src_query (GstPad * pad, GstQuery * query) +gst_rtspsrc_handle_internal_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { GstRTSPSrc *src; gboolean res = TRUE; @@ -2042,12 +2043,13 @@ gst_rtspsrc_handle_internal_src_query (GstPad * pad, GstQuery * query) /* this query is executed on the ghost source pad exposed on rtspsrc. */ static gboolean -gst_rtspsrc_handle_src_query (GstPad * pad, GstQuery * query) +gst_rtspsrc_handle_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { GstRTSPSrc *src; gboolean res = FALSE; - src = GST_RTSPSRC_CAST (gst_pad_get_parent (pad)); + src = GST_RTSPSRC_CAST (parent); GST_DEBUG_OBJECT (src, "pad %s:%s received query %s", GST_DEBUG_PAD_NAME (pad), GST_QUERY_TYPE_NAME (query)); @@ -2101,7 +2103,6 @@ gst_rtspsrc_handle_src_query (GstPad * pad, GstQuery * query) break; } } - gst_object_unref (src); return res; } diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c index e3667a7fc7..c0b4d045b8 100644 --- a/gst/shapewipe/gstshapewipe.c +++ b/gst/shapewipe/gstshapewipe.c @@ -73,7 +73,7 @@ static gboolean gst_shape_wipe_video_sink_setcaps (GstShapeWipe * self, static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad, GstCaps * filter); static gboolean gst_shape_wipe_video_sink_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); static GstFlowReturn gst_shape_wipe_mask_sink_chain (GstPad * pad, GstBuffer * buffer); static gboolean gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event); @@ -81,10 +81,12 @@ static gboolean gst_shape_wipe_mask_sink_setcaps (GstShapeWipe * self, GstCaps * caps); static GstCaps *gst_shape_wipe_mask_sink_getcaps (GstPad * pad, GstCaps * filter); -static gboolean gst_shape_wipe_mask_sink_query (GstPad * pad, GstQuery * query); +static gboolean gst_shape_wipe_mask_sink_query (GstPad * pad, + GstObject * parent, GstQuery * query); static gboolean gst_shape_wipe_src_event (GstPad * pad, GstEvent * event); static GstCaps *gst_shape_wipe_src_getcaps (GstPad * pad, GstCaps * filter); -static gboolean gst_shape_wipe_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_shape_wipe_src_query (GstPad * pad, GstObject * parent, + GstQuery * query); enum { @@ -625,9 +627,10 @@ done: } static gboolean -gst_shape_wipe_video_sink_query (GstPad * pad, GstQuery * query) +gst_shape_wipe_video_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query) { - GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad)); + GstShapeWipe *self = GST_SHAPE_WIPE (parent); gboolean ret; GST_LOG_OBJECT (pad, "Handling query of type '%s'", @@ -650,14 +653,13 @@ gst_shape_wipe_video_sink_query (GstPad * pad, GstQuery * query) break; } - gst_object_unref (self); return ret; } static gboolean -gst_shape_wipe_src_query (GstPad * pad, GstQuery * query) +gst_shape_wipe_src_query (GstPad * pad, GstObject * parent, GstQuery * query) { - GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad)); + GstShapeWipe *self = GST_SHAPE_WIPE (parent); gboolean ret; GST_LOG_OBJECT (pad, "Handling query of type '%s'", @@ -680,7 +682,6 @@ gst_shape_wipe_src_query (GstPad * pad, GstQuery * query) break; } - gst_object_unref (self); return ret; } @@ -1077,9 +1078,9 @@ gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event) } static gboolean -gst_shape_wipe_mask_sink_query (GstPad * pad, GstQuery * query) +gst_shape_wipe_mask_sink_query (GstPad * pad, GstObject * parent, + GstQuery * query) { - GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad)); gboolean ret; GST_LOG_OBJECT (pad, "Handling query of type '%s'", @@ -1098,11 +1099,10 @@ gst_shape_wipe_mask_sink_query (GstPad * pad, GstQuery * query) break; } default: - ret = gst_pad_query_default (pad, query); + ret = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (self); return ret; } diff --git a/gst/videocrop/gstaspectratiocrop.c b/gst/videocrop/gstaspectratiocrop.c index d2e5c5913c..d66b39f99c 100644 --- a/gst/videocrop/gstaspectratiocrop.c +++ b/gst/videocrop/gstaspectratiocrop.c @@ -81,7 +81,7 @@ static void gst_aspect_ratio_crop_set_cropping (GstAspectRatioCrop * aspect_ratio_crop, gint top, gint right, gint bottom, gint left); static GstCaps *gst_aspect_ratio_crop_get_caps (GstPad * pad, GstCaps * filter); static gboolean gst_aspect_ratio_crop_src_query (GstPad * pad, - GstQuery * query); + GstObject * parent, GstQuery * query); static gboolean gst_aspect_ratio_crop_set_caps (GstAspectRatioCrop * aspect_ratio_crop, GstCaps * caps); static gboolean gst_aspect_ratio_crop_sink_event (GstPad * pad, GstEvent * evt); @@ -419,7 +419,8 @@ gst_aspect_ratio_crop_get_caps (GstPad * pad, GstCaps * filter) } static gboolean -gst_aspect_ratio_crop_src_query (GstPad * pad, GstQuery * query) +gst_aspect_ratio_crop_src_query (GstPad * pad, GstObject * parent, + GstQuery * query) { gboolean res = FALSE; @@ -436,7 +437,7 @@ gst_aspect_ratio_crop_src_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } return res; diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 4a59d4f61c..1ef7a51908 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -71,9 +71,9 @@ static gboolean gst_wavparse_send_event (GstElement * element, static GstStateChangeReturn gst_wavparse_change_state (GstElement * element, GstStateChange transition); -static gboolean gst_wavparse_pad_query (GstPad * pad, GstQuery * query); -static gboolean gst_wavparse_pad_convert (GstPad * pad, - GstFormat src_format, +static gboolean gst_wavparse_pad_query (GstPad * pad, GstObject * parent, + GstQuery * query); +static gboolean gst_wavparse_pad_convert (GstPad * pad, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value); static GstFlowReturn gst_wavparse_chain (GstPad * pad, GstBuffer * buf); @@ -2402,14 +2402,13 @@ no_bps_fact: /* handle queries for location and length in requested format */ static gboolean -gst_wavparse_pad_query (GstPad * pad, GstQuery * query) +gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean res = TRUE; - GstWavParse *wav = GST_WAVPARSE (gst_pad_get_parent (pad)); + GstWavParse *wav = GST_WAVPARSE (parent); /* only if we know */ if (wav->state != GST_WAVPARSE_DATA) { - gst_object_unref (wav); return FALSE; } @@ -2505,10 +2504,9 @@ gst_wavparse_pad_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_query_default (pad, query); + res = gst_pad_query_default (pad, parent, query); break; } - gst_object_unref (wav); return res; }