add parent to query function

This commit is contained in:
Wim Taymans 2011-11-16 17:27:13 +01:00
parent 445d4d8573
commit 6190312214
23 changed files with 135 additions and 162 deletions

View file

@ -90,7 +90,8 @@ static void gst_cmml_dec_get_property (GObject * dec, guint property_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static void gst_cmml_dec_set_property (GObject * dec, guint property_id, static void gst_cmml_dec_set_property (GObject * dec, guint property_id,
const GValue * value, GParamSpec * pspec); 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_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_cmml_dec_convert (GstPad * pad, GstFormat src_fmt, static gboolean gst_cmml_dec_convert (GstPad * pad, GstFormat src_fmt,
gint64 src_val, GstFormat * dest_fmt, gint64 * dest_val); gint64 src_val, GstFormat * dest_fmt, gint64 * dest_val);
@ -253,7 +254,7 @@ gst_cmml_dec_change_state (GstElement * element, GstStateChange transition)
} }
static gboolean 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; gboolean res = FALSE;

View file

@ -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 GstFlowReturn gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buffer);
static GstCaps *gst_jpeg_dec_getcaps (GstPad * pad, GstCaps * filter); 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_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_jpeg_dec_src_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, static GstStateChangeReturn gst_jpeg_dec_change_state (GstElement * element,
@ -1777,7 +1778,7 @@ gst_jpeg_dec_sink_event (GstPad * pad, GstEvent * event)
} }
static gboolean 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; gboolean res = FALSE;
@ -1794,7 +1795,7 @@ gst_jpeg_dec_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -72,7 +72,8 @@ static void gst_jpegenc_finalize (GObject * object);
static GstFlowReturn gst_jpegenc_chain (GstPad * pad, GstBuffer * buf); static GstFlowReturn gst_jpegenc_chain (GstPad * pad, GstBuffer * buf);
static gboolean gst_jpegenc_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_jpegenc_sink_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_jpegenc_getcaps (GstPad * pad, GstCaps * filter); 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_resync (GstJpegEnc * jpegenc);
static void gst_jpegenc_set_property (GObject * object, guint prop_id, static void gst_jpegenc_set_property (GObject * object, guint prop_id,
@ -342,10 +343,9 @@ done:
} }
static gboolean static gboolean
gst_jpegenc_sink_query (GstPad * pad, GstQuery * query) gst_jpegenc_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
GstJpegEnc *enc = GST_JPEGENC (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS: case GST_QUERY_CAPS:
@ -360,12 +360,9 @@ gst_jpegenc_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (enc);
return res; return res;
} }

View file

@ -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, static gboolean gst_pulse_audio_sink_sink_event (GstPad * pad,
GstEvent * event); GstEvent * event);
static gboolean gst_pulse_audio_sink_sink_query (GstPad * pad, 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, static gboolean gst_pulse_audio_sink_sink_acceptcaps (GstPulseAudioSink * pbin,
GstPad * pad, GstCaps * caps); GstPad * pad, GstCaps * caps);
static GstStateChangeReturn static GstStateChangeReturn gst_pulse_audio_sink_change_state (GstElement *
gst_pulse_audio_sink_change_state (GstElement * element, element, GstStateChange transition);
GstStateChange transition);
static gboolean gst_pulse_audio_sink_set_caps (GstPulseAudioSink * pbin, static gboolean gst_pulse_audio_sink_set_caps (GstPulseAudioSink * pbin,
GstCaps * caps); GstCaps * caps);
@ -847,9 +846,10 @@ out:
} }
static gboolean 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; gboolean ret = FALSE;
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
@ -864,12 +864,9 @@ gst_pulse_audio_sink_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
ret = gst_pad_query_default (pad, query); ret = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (pbin);
return ret; return ret;
} }

View file

@ -72,7 +72,7 @@ static gboolean gst_audio_fx_base_fir_filter_setup (GstAudioFilter * base,
const GstAudioInfo * info); const GstAudioInfo * info);
static gboolean gst_audio_fx_base_fir_filter_query (GstPad * pad, static gboolean gst_audio_fx_base_fir_filter_query (GstPad * pad,
GstQuery * query); GstObject * parent, GstQuery * query);
/* /*
* The code below calculates the linear convolution: * The code below calculates the linear convolution:
@ -942,10 +942,10 @@ gst_audio_fx_base_fir_filter_stop (GstBaseTransform * base)
} }
static gboolean 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 = GstAudioFXBaseFIRFilter *self = GST_AUDIO_FX_BASE_FIR_FILTER (parent);
GST_AUDIO_FX_BASE_FIR_FILTER (gst_pad_get_parent (pad));
gboolean res = TRUE; gboolean res = TRUE;
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
@ -954,49 +954,45 @@ gst_audio_fx_base_fir_filter_query (GstPad * pad, GstQuery * query)
GstClockTime min, max; GstClockTime min, max;
gboolean live; gboolean live;
guint64 latency; guint64 latency;
GstPad *peer;
gint rate = GST_AUDIO_FILTER_RATE (self); gint rate = GST_AUDIO_FILTER_RATE (self);
if (rate == 0) { if (rate == 0) {
res = FALSE; res = FALSE;
} else if ((peer = gst_pad_get_peer (GST_BASE_TRANSFORM (self)->sinkpad))) { } else if ((res =
if ((res = gst_pad_query (peer, query))) { gst_pad_peer_query (GST_BASE_TRANSFORM (self)->sinkpad, query))) {
gst_query_parse_latency (query, &live, &min, &max); gst_query_parse_latency (query, &live, &min, &max);
GST_DEBUG_OBJECT (self, "Peer latency: min %" GST_DEBUG_OBJECT (self, "Peer latency: min %"
GST_TIME_FORMAT " max %" GST_TIME_FORMAT, GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
GST_TIME_ARGS (min), GST_TIME_ARGS (max)); GST_TIME_ARGS (min), GST_TIME_ARGS (max));
if (self->fft && !self->low_latency) if (self->fft && !self->low_latency)
latency = self->block_length - self->kernel_length + 1; latency = self->block_length - self->kernel_length + 1;
else else
latency = self->latency; latency = self->latency;
/* add our own latency */ /* add our own latency */
latency = gst_util_uint64_scale_round (latency, GST_SECOND, rate); latency = gst_util_uint64_scale_round (latency, GST_SECOND, rate);
GST_DEBUG_OBJECT (self, "Our latency: %" GST_DEBUG_OBJECT (self, "Our latency: %"
GST_TIME_FORMAT, GST_TIME_ARGS (latency)); GST_TIME_FORMAT, GST_TIME_ARGS (latency));
min += latency; min += latency;
if (max != GST_CLOCK_TIME_NONE) if (max != GST_CLOCK_TIME_NONE)
max += latency; max += latency;
GST_DEBUG_OBJECT (self, "Calculated total latency : min %" GST_DEBUG_OBJECT (self, "Calculated total latency : min %"
GST_TIME_FORMAT " max %" GST_TIME_FORMAT, GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
GST_TIME_ARGS (min), GST_TIME_ARGS (max)); GST_TIME_ARGS (min), GST_TIME_ARGS (max));
gst_query_set_latency (query, live, min, max); gst_query_set_latency (query, live, min, max);
}
gst_object_unref (peer);
} }
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (self);
return res; return res;
} }

View file

@ -80,7 +80,8 @@ static GstFlowReturn gst_au_parse_chain (GstPad * pad, GstBuffer * buf);
static GstStateChangeReturn gst_au_parse_change_state (GstElement * element, static GstStateChangeReturn gst_au_parse_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static void gst_au_parse_reset (GstAuParse * auparse); 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_src_event (GstPad * pad, GstEvent * event);
static gboolean gst_au_parse_sink_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, 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 static gboolean
gst_au_parse_src_query (GstPad * pad, GstQuery * query) gst_au_parse_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
GstAuParse *auparse; GstAuParse *auparse;
gboolean ret = FALSE; gboolean ret = FALSE;
auparse = GST_AU_PARSE (gst_pad_get_parent (pad)); auparse = GST_AU_PARSE (parent);
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:{ case GST_QUERY_DURATION:{
@ -606,11 +607,10 @@ gst_au_parse_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
ret = gst_pad_query_default (pad, query); ret = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (auparse);
return ret; return ret;
} }

View file

@ -87,7 +87,8 @@ static gboolean gst_avi_demux_push_event (GstAviDemux * avi, GstEvent * event);
#if 0 #if 0
static const GstFormat *gst_avi_demux_get_src_formats (GstPad * pad); static const GstFormat *gst_avi_demux_get_src_formats (GstPad * pad);
#endif #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, static gboolean gst_avi_demux_src_convert (GstPad * pad, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value); gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
@ -417,15 +418,16 @@ done:
} }
static gboolean 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; 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); GstAviStream *stream = gst_pad_get_element_private (pad);
if (!stream->strh || !stream->strf.data) 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)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:{ case GST_QUERY_POSITION:{
@ -552,15 +554,14 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query)
&dest_val))) &dest_val)))
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val); gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
else else
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (avi);
return res; return res;
} }

View file

@ -102,7 +102,8 @@ gst_push_file_src_class_init (GstPushFileSrcClass * g_class)
} }
static gboolean 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; gboolean res;
@ -112,7 +113,7 @@ gst_push_file_src_ghostpad_query (GstPad * pad, GstQuery * query)
res = TRUE; res = TRUE;
break; break;
default: default:
res = gst_proxy_pad_query_default (pad, query); res = gst_proxy_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -93,7 +93,8 @@ static gboolean flv_demux_handle_seek_push (GstFlvDemux * demux,
static gboolean gst_flv_demux_handle_seek_pull (GstFlvDemux * demux, static gboolean gst_flv_demux_handle_seek_pull (GstFlvDemux * demux,
GstEvent * event, gboolean seeking); 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); 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 static gboolean
gst_flv_demux_query (GstPad * pad, GstQuery * query) gst_flv_demux_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res = TRUE; gboolean res = TRUE;
GstFlvDemux *demux; GstFlvDemux *demux;
demux = GST_FLV_DEMUX (gst_pad_get_parent (pad)); demux = GST_FLV_DEMUX (parent);
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION: case GST_QUERY_DURATION:
@ -3056,23 +3057,11 @@ gst_flv_demux_query (GstPad * pad, GstQuery * query)
} }
case GST_QUERY_LATENCY: case GST_QUERY_LATENCY:
default: default:
{ res = gst_pad_peer_query (demux->sinkpad, query);
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;
}
break; break;
}
} }
beach: beach:
gst_object_unref (demux);
return res; return res;
} }

View file

@ -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_src_event (GstPad * pad, GstEvent * event);
static gboolean gst_goom_sink_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 #define gst_goom_parent_class parent_class
G_DEFINE_TYPE (GstGoom, gst_goom, GST_TYPE_ELEMENT); G_DEFINE_TYPE (GstGoom, gst_goom, GST_TYPE_ELEMENT);
@ -400,12 +401,12 @@ gst_goom_sink_event (GstPad * pad, GstEvent * event)
} }
static gboolean static gboolean
gst_goom_src_query (GstPad * pad, GstQuery * query) gst_goom_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res = FALSE; gboolean res = FALSE;
GstGoom *goom; GstGoom *goom;
goom = GST_GOOM (GST_PAD_PARENT (pad)); goom = GST_GOOM (parent);
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY: case GST_QUERY_LATENCY:
@ -450,7 +451,7 @@ gst_goom_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }

View file

@ -695,10 +695,11 @@ gst_qtdemux_get_duration (GstQTDemux * qtdemux, gint64 * duration)
} }
static gboolean 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; 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)); 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; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (qtdemux);
return res; return res;
} }

View file

@ -208,7 +208,7 @@ gst_alaw_dec_getcaps (GstPad * pad, GstCaps * filter)
} }
static gboolean static gboolean
gst_alaw_dec_query (GstPad * pad, GstQuery * query) gst_alaw_dec_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
@ -226,7 +226,7 @@ gst_alaw_dec_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -360,7 +360,7 @@ gst_alaw_enc_getcaps (GstPad * pad, GstCaps * filter)
} }
static gboolean static gboolean
gst_alaw_enc_query (GstPad * pad, GstQuery * query) gst_alaw_enc_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
@ -378,7 +378,7 @@ gst_alaw_enc_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -147,7 +147,7 @@ mulawdec_getcaps (GstPad * pad, GstCaps * filter)
} }
static gboolean static gboolean
gst_mulawdec_query (GstPad * pad, GstQuery * query) gst_mulawdec_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
@ -165,7 +165,7 @@ gst_mulawdec_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -114,7 +114,7 @@ mulawenc_getcaps (GstPad * pad, GstCaps * filter)
} }
static gboolean static gboolean
gst_mulawenc_query (GstPad * pad, GstQuery * query) gst_mulawenc_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
@ -132,7 +132,7 @@ gst_mulawenc_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -253,7 +253,7 @@ static GstFlowReturn gst_rtp_jitter_buffer_chain_rtcp (GstPad * pad,
GstBuffer * buffer); GstBuffer * buffer);
static gboolean gst_rtp_jitter_buffer_sink_query (GstPad * pad, static gboolean gst_rtp_jitter_buffer_sink_query (GstPad * pad,
GstQuery * query); GstObject * parent, GstQuery * query);
/* srcpad overrides */ /* srcpad overrides */
static gboolean gst_rtp_jitter_buffer_src_event (GstPad * pad, 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); gst_rtp_jitter_buffer_src_activate_push (GstPad * pad, gboolean active);
static void gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer); static void gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer);
static gboolean gst_rtp_jitter_buffer_src_query (GstPad * pad, static gboolean gst_rtp_jitter_buffer_src_query (GstPad * pad,
GstQuery * query); GstObject * parent, GstQuery * query);
static void static void
gst_rtp_jitter_buffer_clear_pt_map (GstRtpJitterBuffer * jitterbuffer); gst_rtp_jitter_buffer_clear_pt_map (GstRtpJitterBuffer * jitterbuffer);
@ -2087,15 +2087,11 @@ ignore_buffer:
} }
static gboolean 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; 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)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS: case GST_QUERY_CAPS:
{ {
@ -2109,25 +2105,22 @@ gst_rtp_jitter_buffer_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (jitterbuffer);
return res; return res;
} }
static gboolean 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; GstRtpJitterBuffer *jitterbuffer;
GstRtpJitterBufferPrivate *priv; GstRtpJitterBufferPrivate *priv;
gboolean res = FALSE; gboolean res = FALSE;
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad)); jitterbuffer = GST_RTP_JITTER_BUFFER (parent);
if (G_UNLIKELY (jitterbuffer == NULL))
return FALSE;
priv = jitterbuffer->priv; priv = jitterbuffer->priv;
switch (GST_QUERY_TYPE (query)) { 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); gst_query_parse_position (query, &fmt, NULL);
if (fmt != GST_FORMAT_TIME) { if (fmt != GST_FORMAT_TIME) {
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; 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); gst_query_set_position (query, GST_FORMAT_TIME, start + last_out);
res = TRUE; res = TRUE;
} else { } else {
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
} }
break; break;
} }
@ -2208,12 +2201,10 @@ gst_rtp_jitter_buffer_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (jitterbuffer);
return res; return res;
} }

View file

@ -1598,12 +1598,13 @@ gst_rtp_session_chain_recv_rtcp (GstPad * pad, GstBuffer * buffer)
} }
static gboolean 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; GstRtpSession *rtpsession;
gboolean ret = FALSE; gboolean ret = FALSE;
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad)); rtpsession = GST_RTP_SESSION (parent);
GST_DEBUG_OBJECT (rtpsession, "received QUERY"); GST_DEBUG_OBJECT (rtpsession, "received QUERY");
@ -1618,8 +1619,6 @@ gst_rtp_session_query_send_rtcp_src (GstPad * pad, GstQuery * query)
break; break;
} }
gst_object_unref (rtpsession);
return ret; return ret;
} }
@ -1769,7 +1768,8 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad, GstCaps * filter)
} }
static gboolean 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; gboolean res = FALSE;
@ -1786,7 +1786,7 @@ gst_rtp_session_query_send_rtp (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }

View file

@ -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 gboolean gst_rtp_ssrc_demux_src_event (GstPad * pad, GstEvent * event);
static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad * static GstIterator *gst_rtp_ssrc_demux_iterate_internal_links_src (GstPad *
pad); 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 }; 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 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; GstRtpSsrcDemux *demux;
gboolean res = FALSE; gboolean res = FALSE;
demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad)); demux = GST_RTP_SSRC_DEMUX (parent);
if (G_UNLIKELY (demux == NULL))
return FALSE;
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY: case GST_QUERY_LATENCY:
@ -792,10 +792,9 @@ gst_rtp_ssrc_demux_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (demux);
return res; return res;
} }

View file

@ -433,7 +433,7 @@ gst_rtp_dec_finalize (GObject * object)
} }
static gboolean static gboolean
gst_rtp_dec_query_src (GstPad * pad, GstQuery * query) gst_rtp_dec_query_src (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res; gboolean res;
@ -446,7 +446,7 @@ gst_rtp_dec_query_src (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -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 /* this is the final query function we receive on the internal source pad when
* we deal with TCP connections */ * we deal with TCP connections */
static gboolean 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; GstRTSPSrc *src;
gboolean res = TRUE; 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. */ /* this query is executed on the ghost source pad exposed on rtspsrc. */
static gboolean static gboolean
gst_rtspsrc_handle_src_query (GstPad * pad, GstQuery * query) gst_rtspsrc_handle_src_query (GstPad * pad, GstObject * parent,
GstQuery * query)
{ {
GstRTSPSrc *src; GstRTSPSrc *src;
gboolean res = FALSE; 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_OBJECT (src, "pad %s:%s received query %s",
GST_DEBUG_PAD_NAME (pad), GST_QUERY_TYPE_NAME (query)); GST_DEBUG_PAD_NAME (pad), GST_QUERY_TYPE_NAME (query));
@ -2101,7 +2103,6 @@ gst_rtspsrc_handle_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
} }
gst_object_unref (src);
return res; return res;
} }

View file

@ -73,7 +73,7 @@ static gboolean gst_shape_wipe_video_sink_setcaps (GstShapeWipe * self,
static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad, static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad,
GstCaps * filter); GstCaps * filter);
static gboolean gst_shape_wipe_video_sink_query (GstPad * pad, 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, static GstFlowReturn gst_shape_wipe_mask_sink_chain (GstPad * pad,
GstBuffer * buffer); GstBuffer * buffer);
static gboolean gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event); 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); GstCaps * caps);
static GstCaps *gst_shape_wipe_mask_sink_getcaps (GstPad * pad, static GstCaps *gst_shape_wipe_mask_sink_getcaps (GstPad * pad,
GstCaps * filter); 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 gboolean gst_shape_wipe_src_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_shape_wipe_src_getcaps (GstPad * pad, GstCaps * filter); 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 enum
{ {
@ -625,9 +627,10 @@ done:
} }
static gboolean 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; gboolean ret;
GST_LOG_OBJECT (pad, "Handling query of type '%s'", GST_LOG_OBJECT (pad, "Handling query of type '%s'",
@ -650,14 +653,13 @@ gst_shape_wipe_video_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
gst_object_unref (self);
return ret; return ret;
} }
static gboolean 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; gboolean ret;
GST_LOG_OBJECT (pad, "Handling query of type '%s'", GST_LOG_OBJECT (pad, "Handling query of type '%s'",
@ -680,7 +682,6 @@ gst_shape_wipe_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
gst_object_unref (self);
return ret; return ret;
} }
@ -1077,9 +1078,9 @@ gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event)
} }
static gboolean 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; gboolean ret;
GST_LOG_OBJECT (pad, "Handling query of type '%s'", GST_LOG_OBJECT (pad, "Handling query of type '%s'",
@ -1098,11 +1099,10 @@ gst_shape_wipe_mask_sink_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
ret = gst_pad_query_default (pad, query); ret = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (self);
return ret; return ret;
} }

View file

@ -81,7 +81,7 @@ static void gst_aspect_ratio_crop_set_cropping (GstAspectRatioCrop *
aspect_ratio_crop, gint top, gint right, gint bottom, gint left); aspect_ratio_crop, gint top, gint right, gint bottom, gint left);
static GstCaps *gst_aspect_ratio_crop_get_caps (GstPad * pad, GstCaps * filter); static GstCaps *gst_aspect_ratio_crop_get_caps (GstPad * pad, GstCaps * filter);
static gboolean gst_aspect_ratio_crop_src_query (GstPad * pad, 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 * static gboolean gst_aspect_ratio_crop_set_caps (GstAspectRatioCrop *
aspect_ratio_crop, GstCaps * caps); aspect_ratio_crop, GstCaps * caps);
static gboolean gst_aspect_ratio_crop_sink_event (GstPad * pad, GstEvent * evt); 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 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; gboolean res = FALSE;
@ -436,7 +437,7 @@ gst_aspect_ratio_crop_src_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
return res; return res;

View file

@ -71,9 +71,9 @@ static gboolean gst_wavparse_send_event (GstElement * element,
static GstStateChangeReturn gst_wavparse_change_state (GstElement * element, static GstStateChangeReturn gst_wavparse_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static gboolean gst_wavparse_pad_query (GstPad * pad, GstQuery * query); static gboolean gst_wavparse_pad_query (GstPad * pad, GstObject * parent,
static gboolean gst_wavparse_pad_convert (GstPad * pad, GstQuery * query);
GstFormat src_format, static gboolean gst_wavparse_pad_convert (GstPad * pad, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value); gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
static GstFlowReturn gst_wavparse_chain (GstPad * pad, GstBuffer * buf); 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 */ /* handle queries for location and length in requested format */
static gboolean static gboolean
gst_wavparse_pad_query (GstPad * pad, GstQuery * query) gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
{ {
gboolean res = TRUE; gboolean res = TRUE;
GstWavParse *wav = GST_WAVPARSE (gst_pad_get_parent (pad)); GstWavParse *wav = GST_WAVPARSE (parent);
/* only if we know */ /* only if we know */
if (wav->state != GST_WAVPARSE_DATA) { if (wav->state != GST_WAVPARSE_DATA) {
gst_object_unref (wav);
return FALSE; return FALSE;
} }
@ -2505,10 +2504,9 @@ gst_wavparse_pad_query (GstPad * pad, GstQuery * query)
break; break;
} }
default: default:
res = gst_pad_query_default (pad, query); res = gst_pad_query_default (pad, parent, query);
break; break;
} }
gst_object_unref (wav);
return res; return res;
} }