From 2f20ba90fd83482f85c3fa8b6f22ac4cc9655976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lutz=20M=C3=BCller?= Date: Thu, 4 May 2006 08:24:52 +0000 Subject: [PATCH] ext/mad/gstmad.c: Make mad the second element to support the highly useful MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Lutz Müller * ext/mad/gstmad.c: (gst_mad_init), (gst_mad_src_query): Make mad the second element to support the highly useful FORMATS query (#340594) --- ChangeLog | 8 ++++++++ ext/mad/gstmad.c | 40 ++++------------------------------------ 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80a9f1ab0a..bed780add8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-04 Tim-Philipp Müller + + Patch by: Lutz Müller + + * ext/mad/gstmad.c: (gst_mad_init), (gst_mad_src_query): + Make mad the second element to support the highly useful + FORMATS query (#340594) + 2006-05-02 Edward Hervey * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_sink_convert), diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 3c0b2f23db..22527116c3 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -159,10 +159,6 @@ static void gst_mad_get_property (GObject * object, guint prop_id, static gboolean gst_mad_src_event (GstPad * pad, GstEvent * event); -#if 0 -static const GstFormat *gst_mad_get_formats (GstPad * pad); -#endif - static const GstQueryType *gst_mad_get_query_types (GstPad * pad); static gboolean gst_mad_src_query (GstPad * pad, GstQuery * query); @@ -334,12 +330,6 @@ gst_mad_init (GstMad * mad) gst_pad_set_chain_function (mad->sinkpad, GST_DEBUG_FUNCPTR (gst_mad_chain)); gst_pad_set_event_function (mad->sinkpad, GST_DEBUG_FUNCPTR (gst_mad_sink_event)); -#if 0 - gst_pad_set_convert_function (mad->sinkpad, - GST_DEBUG_FUNCPTR (gst_mad_convert_sink)); - gst_pad_set_formats_function (mad->sinkpad, - GST_DEBUG_FUNCPTR (gst_mad_get_formats)); -#endif template = gst_static_pad_template_get (&mad_src_template_factory); mad->srcpad = gst_pad_new_from_template (template, "src"); gst_object_unref (template); @@ -351,12 +341,6 @@ gst_mad_init (GstMad * mad) gst_pad_set_query_type_function (mad->srcpad, GST_DEBUG_FUNCPTR (gst_mad_get_query_types)); gst_pad_use_fixed_caps (mad->srcpad); -#if 0 - gst_pad_set_convert_function (mad->srcpad, - GST_DEBUG_FUNCPTR (gst_mad_convert_src)); - gst_pad_set_formats_function (mad->srcpad, - GST_DEBUG_FUNCPTR (gst_mad_get_formats)); -#endif mad->tempbuffer = g_malloc (MAD_BUFFER_MDLEN * 3); mad->tempsize = 0; mad->base_byte_offset = 0; @@ -410,26 +394,6 @@ gst_mad_get_index (GstElement * element) return mad->index; } -#if 0 -static const GstFormat * -gst_mad_get_formats (GstPad * pad) -{ - static const GstFormat src_formats[] = { - GST_FORMAT_BYTES, - GST_FORMAT_DEFAULT, - GST_FORMAT_TIME, - 0 - }; - static const GstFormat sink_formats[] = { - GST_FORMAT_BYTES, - GST_FORMAT_TIME, - 0 - }; - - return (GST_PAD_IS_SRC (pad) ? src_formats : sink_formats); -} -#endif - static gboolean gst_mad_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value) @@ -575,6 +539,10 @@ gst_mad_src_query (GstPad * pad, GstQuery * query) peer = gst_pad_get_peer (mad->sinkpad); switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_FORMATS: + gst_query_set_formats (query, 3, GST_FORMAT_DEFAULT, GST_FORMAT_TIME, + GST_FORMAT_BYTES); + break; case GST_QUERY_POSITION: { GstFormat format;