From 372b9329b923bc5e9991cc1067cd5d5352edc962 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 9 Nov 2011 11:47:54 +0100 Subject: [PATCH] remove query types --- ext/ogg/gstoggdemux.c | 15 --------------- ext/ogg/gstogmparse.c | 14 -------------- ext/theora/gsttheoradec.c | 16 ---------------- gst-libs/gst/audio/gstaudiodecoder.c | 19 +------------------ gst-libs/gst/audio/gstaudioencoder.c | 17 ----------------- gst-libs/gst/cdda/gstcddabasesrc.c | 17 ----------------- gst-libs/gst/tag/gsttagdemux.c | 15 --------------- gst/audioresample/gstaudioresample.c | 14 -------------- 8 files changed, 1 insertion(+), 126 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index ea501716f4..e30fac7e47 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -131,7 +131,6 @@ static gboolean gst_ogg_demux_receive_event (GstElement * element, static void gst_ogg_pad_dispose (GObject * object); static void gst_ogg_pad_finalize (GObject * object); -static const GstQueryType *gst_ogg_pad_query_types (GstPad * pad); static gboolean gst_ogg_pad_src_query (GstPad * pad, GstQuery * query); static gboolean gst_ogg_pad_event (GstPad * pad, GstEvent * event); static GstOggPad *gst_ogg_chain_get_stream (GstOggChain * chain, @@ -168,8 +167,6 @@ gst_ogg_pad_init (GstOggPad * pad) { gst_pad_set_event_function (GST_PAD (pad), GST_DEBUG_FUNCPTR (gst_ogg_pad_event)); - gst_pad_set_query_type_function (GST_PAD (pad), - GST_DEBUG_FUNCPTR (gst_ogg_pad_query_types)); gst_pad_set_query_function (GST_PAD (pad), GST_DEBUG_FUNCPTR (gst_ogg_pad_src_query)); gst_pad_use_fixed_caps (GST_PAD (pad)); @@ -241,18 +238,6 @@ gst_ogg_pad_finalize (GObject * object) G_OBJECT_CLASS (gst_ogg_pad_parent_class)->finalize (object); } -static const GstQueryType * -gst_ogg_pad_query_types (GstPad * pad) -{ - static const GstQueryType query_types[] = { - GST_QUERY_DURATION, - GST_QUERY_SEEKING, - 0 - }; - - return query_types; -} - static gboolean gst_ogg_pad_src_query (GstPad * pad, GstQuery * query) { diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index e2e0d825d8..47108a753e 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -151,7 +151,6 @@ static void gst_ogm_video_parse_init (GstOgmParse * ogm); static void gst_ogm_audio_parse_init (GstOgmParse * ogm); static void gst_ogm_text_parse_init (GstOgmParse * ogm); -static const GstQueryType *gst_ogm_parse_get_sink_querytypes (GstPad * pad); static gboolean gst_ogm_parse_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_ogm_parse_sink_query (GstPad * pad, GstQuery * query); static gboolean gst_ogm_parse_sink_convert (GstPad * pad, GstFormat src_format, @@ -381,8 +380,6 @@ static void gst_ogm_text_parse_init (GstOgmParse * ogm) { ogm->sinkpad = gst_pad_new_from_static_template (&sink_factory_text, "sink"); - gst_pad_set_query_type_function (ogm->sinkpad, - gst_ogm_parse_get_sink_querytypes); gst_pad_set_query_function (ogm->sinkpad, GST_DEBUG_FUNCPTR (gst_ogm_parse_sink_query)); gst_pad_set_chain_function (ogm->sinkpad, @@ -395,17 +392,6 @@ gst_ogm_text_parse_init (GstOgmParse * ogm) ogm->srcpadtempl = text_src_templ; } -static const GstQueryType * -gst_ogm_parse_get_sink_querytypes (GstPad * pad) -{ - static const GstQueryType types[] = { - GST_QUERY_POSITION, - 0 - }; - - return types; -} - static gboolean gst_ogm_parse_sink_convert (GstPad * pad, GstFormat src_format, gint64 src_value, diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index b10e841f27..4ee9d8366e 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -108,7 +108,6 @@ static const GstFormat *theora_get_formats (GstPad * pad); #if 0 static const GstEventMask *theora_get_event_masks (GstPad * pad); #endif -static const GstQueryType *theora_get_query_types (GstPad * pad); static gboolean gst_theora_dec_ctl_is_supported (int req) @@ -201,7 +200,6 @@ gst_theora_dec_init (GstTheoraDec * dec) dec->srcpad = gst_pad_new_from_static_template (&theora_dec_src_factory, "src"); gst_pad_set_event_function (dec->srcpad, theora_dec_src_event); - gst_pad_set_query_type_function (dec->srcpad, theora_get_query_types); gst_pad_set_query_function (dec->srcpad, theora_dec_src_query); gst_pad_use_fixed_caps (dec->srcpad); @@ -287,20 +285,6 @@ theora_get_event_masks (GstPad * pad) } #endif -static const GstQueryType * -theora_get_query_types (GstPad * pad) -{ - static const GstQueryType theora_src_query_types[] = { - GST_QUERY_POSITION, - GST_QUERY_DURATION, - GST_QUERY_CONVERT, - 0 - }; - - return theora_src_query_types; -} - - static gboolean theora_dec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index ffd98398c3..2bd7de8612 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -284,7 +284,6 @@ gboolean gst_audio_decoder_src_setcaps (GstAudioDecoder * dec, GstCaps * caps); static GstFlowReturn gst_audio_decoder_chain (GstPad * pad, GstBuffer * buf); static gboolean gst_audio_decoder_src_query (GstPad * pad, GstQuery * query); static gboolean gst_audio_decoder_sink_query (GstPad * pad, GstQuery * query); -static const GstQueryType *gst_audio_decoder_get_query_types (GstPad * pad); static void gst_audio_decoder_reset (GstAudioDecoder * dec, gboolean full); static GstElementClass *parent_class = NULL; @@ -395,8 +394,6 @@ gst_audio_decoder_init (GstAudioDecoder * dec, GstAudioDecoderClass * klass) GST_DEBUG_FUNCPTR (gst_audio_decoder_src_event)); gst_pad_set_query_function (dec->srcpad, GST_DEBUG_FUNCPTR (gst_audio_decoder_src_query)); - gst_pad_set_query_type_function (dec->srcpad, - GST_DEBUG_FUNCPTR (gst_audio_decoder_get_query_types)); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); GST_DEBUG_OBJECT (dec, "srcpad created"); @@ -580,7 +577,7 @@ gst_audio_decoder_setup (GstAudioDecoder * dec) gst_query_unref (query); /* normalize to bool */ - dec->priv->agg = !!res; + dec->priv->agg = ! !res; } /* mini aggregator combining output buffers into fewer larger ones, @@ -1766,20 +1763,6 @@ error: return res; } -static const GstQueryType * -gst_audio_decoder_get_query_types (GstPad * pad) -{ - static const GstQueryType gst_audio_decoder_src_query_types[] = { - GST_QUERY_POSITION, - GST_QUERY_DURATION, - GST_QUERY_CONVERT, - GST_QUERY_LATENCY, - 0 - }; - - return gst_audio_decoder_src_query_types; -} - /* FIXME ? are any of these queries (other than latency) a decoder's business ?? * also, the conversion stuff might seem to make sense, but seems to not mind * segment stuff etc at all diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index cfd5455f5e..25139ec38a 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -302,7 +302,6 @@ static gboolean gst_audio_encoder_sink_setcaps (GstAudioEncoder * enc, static GstFlowReturn gst_audio_encoder_chain (GstPad * pad, GstBuffer * buffer); static gboolean gst_audio_encoder_src_query (GstPad * pad, GstQuery * query); static gboolean gst_audio_encoder_sink_query (GstPad * pad, GstQuery * query); -static const GstQueryType *gst_audio_encoder_get_query_types (GstPad * pad); static GstCaps *gst_audio_encoder_sink_getcaps (GstPad * pad, GstCaps * filter); static void @@ -378,8 +377,6 @@ gst_audio_encoder_init (GstAudioEncoder * enc, GstAudioEncoderClass * bclass) enc->srcpad = gst_pad_new_from_template (pad_template, "src"); gst_pad_set_query_function (enc->srcpad, GST_DEBUG_FUNCPTR (gst_audio_encoder_src_query)); - gst_pad_set_query_type_function (enc->srcpad, - GST_DEBUG_FUNCPTR (gst_audio_encoder_get_query_types)); gst_pad_use_fixed_caps (enc->srcpad); gst_element_add_pad (GST_ELEMENT (enc), enc->srcpad); GST_DEBUG_OBJECT (enc, "src created"); @@ -1410,20 +1407,6 @@ error: return res; } -static const GstQueryType * -gst_audio_encoder_get_query_types (GstPad * pad) -{ - static const GstQueryType gst_audio_encoder_src_query_types[] = { - GST_QUERY_POSITION, - GST_QUERY_DURATION, - GST_QUERY_CONVERT, - GST_QUERY_LATENCY, - 0 - }; - - return gst_audio_encoder_src_query_types; -} - /* * gst_audio_encoded_audio_convert: * @fmt: audio format of the encoded audio diff --git a/gst-libs/gst/cdda/gstcddabasesrc.c b/gst-libs/gst/cdda/gstcddabasesrc.c index 4fd69c3dbd..61d714d504 100644 --- a/gst-libs/gst/cdda/gstcddabasesrc.c +++ b/gst-libs/gst/cdda/gstcddabasesrc.c @@ -122,7 +122,6 @@ static void gst_cdda_base_src_get_property (GObject * object, guint prop_id, static void gst_cdda_base_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_cdda_base_src_finalize (GObject * obj); -static const GstQueryType *gst_cdda_base_src_get_query_types (GstPad * pad); static gboolean gst_cdda_base_src_query (GstBaseSrc * src, GstQuery * query); static gboolean gst_cdda_base_src_handle_event (GstBaseSrc * basesrc, GstEvent * event); @@ -259,9 +258,6 @@ gst_cdda_base_src_class_init (GstCddaBaseSrcClass * klass) static void gst_cdda_base_src_init (GstCddaBaseSrc * src) { - gst_pad_set_query_type_function (GST_BASE_SRC_PAD (src), - GST_DEBUG_FUNCPTR (gst_cdda_base_src_get_query_types)); - /* we're not live and we operate in time */ gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (src), FALSE); @@ -430,19 +426,6 @@ gst_cdda_base_src_get_track_from_sector (GstCddaBaseSrc * src, gint sector) return -1; } -static const GstQueryType * -gst_cdda_base_src_get_query_types (GstPad * pad) -{ - static const GstQueryType src_query_types[] = { - GST_QUERY_DURATION, - GST_QUERY_POSITION, - GST_QUERY_CONVERT, - 0 - }; - - return src_query_types; -} - static gboolean gst_cdda_base_src_convert (GstCddaBaseSrc * src, GstFormat src_format, gint64 src_val, GstFormat dest_format, gint64 * dest_val) diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index 7239b582b1..ceb09d6c70 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -153,7 +153,6 @@ static gboolean gst_tag_demux_sink_activate (GstPad * sinkpad); static GstStateChangeReturn gst_tag_demux_change_state (GstElement * element, GstStateChange transition); static gboolean gst_tag_demux_pad_query (GstPad * pad, GstQuery * query); -static const GstQueryType *gst_tag_demux_get_query_types (GstPad * pad); static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux); static void gst_tag_demux_send_pending_events (GstTagDemux * tagdemux); static void gst_tag_demux_send_tag_event (GstTagDemux * tagdemux); @@ -335,8 +334,6 @@ gst_tag_demux_add_srcpad (GstTagDemux * tagdemux, GstCaps * new_caps) (GST_ELEMENT_GET_CLASS (tagdemux), "src"), "src"); g_return_val_if_fail (tagdemux->priv->srcpad != NULL, FALSE); - gst_pad_set_query_type_function (tagdemux->priv->srcpad, - GST_DEBUG_FUNCPTR (gst_tag_demux_get_query_types)); gst_pad_set_query_function (tagdemux->priv->srcpad, GST_DEBUG_FUNCPTR (gst_tag_demux_pad_query)); gst_pad_set_event_function (tagdemux->priv->srcpad, @@ -1416,18 +1413,6 @@ gst_tag_demux_pad_query (GstPad * pad, GstQuery * query) return TRUE; } -static const GstQueryType * -gst_tag_demux_get_query_types (GstPad * pad) -{ - static const GstQueryType types[] = { - GST_QUERY_POSITION, - GST_QUERY_DURATION, - 0 - }; - - return types; -} - static void gst_tag_demux_send_pending_events (GstTagDemux * demux) { diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 358061e808..3b78b98aca 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -118,7 +118,6 @@ static gboolean gst_audio_resample_sink_event (GstBaseTransform * base, static gboolean gst_audio_resample_start (GstBaseTransform * base); static gboolean gst_audio_resample_stop (GstBaseTransform * base); static gboolean gst_audio_resample_query (GstPad * pad, GstQuery * query); -static const GstQueryType *gst_audio_resample_query_type (GstPad * pad); #define gst_audio_resample_parent_class parent_class G_DEFINE_TYPE (GstAudioResample, gst_audio_resample, GST_TYPE_BASE_TRANSFORM); @@ -179,8 +178,6 @@ gst_audio_resample_init (GstAudioResample * resample) gst_base_transform_set_gap_aware (trans, TRUE); gst_pad_set_query_function (trans->srcpad, gst_audio_resample_query); - gst_pad_set_query_type_function (trans->srcpad, - gst_audio_resample_query_type); } /* vmethods */ @@ -1261,17 +1258,6 @@ gst_audio_resample_query (GstPad * pad, GstQuery * query) return res; } -static const GstQueryType * -gst_audio_resample_query_type (GstPad * pad) -{ - static const GstQueryType types[] = { - GST_QUERY_LATENCY, - 0 - }; - - return types; -} - static void gst_audio_resample_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)