2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
+ * ext/libvisual/visual.c: (gst_visual_init):
+ * ext/ogg/gstoggdemux.c: (gst_ogg_demux_init):
+ * ext/ogg/gstoggparse.c: (gst_ogg_parse_init),
+ (gst_ogg_parse_chain):
+ * ext/ogg/gstogmparse.c: (gst_ogm_audio_parse_init),
+ (gst_ogm_video_parse_init), (gst_ogm_text_parse_init):
+ * ext/theora/theoradec.c: (gst_theora_dec_init):
+ * ext/theora/theoraenc.c: (gst_theora_enc_init):
+ * ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init):
+ * ext/vorbis/vorbisparse.c: (gst_vorbis_parse_init):
+ * gst/adder/gstadder.c: (gst_adder_class_init),
+ (gst_adder_dispose):
+ * gst/audiorate/gstaudiorate.c: (gst_audiorate_init):
+ * gst/subparse/gstsubparse.c: (gst_subparse_init):
+ * gst/videorate/gstvideorate.c: (gst_videorate_init):
+ Fix a whole set of pad template leaks
+
+2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
+
* check/generic/states.c: (GST_START_TEST):
fix the test so that it only checks for elements that are part of
this source module
gst_visual_init (GstVisual * visual)
{
/* create the sink and src pads */
- visual->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&sink_template),
- "sink");
+ visual->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_setcaps_function (visual->sinkpad, gst_visual_sink_setcaps);
gst_pad_set_chain_function (visual->sinkpad, gst_visual_chain);
gst_element_add_pad (GST_ELEMENT (visual), visual->sinkpad);
- visual->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&src_template),
- "src");
+ visual->srcpad = gst_pad_new_from_static_template (&src_template, "src");
gst_pad_set_setcaps_function (visual->srcpad, gst_visual_src_setcaps);
gst_pad_set_getcaps_function (visual->srcpad, gst_visual_getcaps);
gst_element_add_pad (GST_ELEMENT (visual), visual->srcpad);
gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class)
{
/* create the sink pad */
- GstPadTemplate *template = gst_static_pad_template_get
- (&ogg_demux_sink_template_factory);
- ogg->sinkpad = gst_pad_new_from_template (template, "sink");
+ ogg->sinkpad =
+ gst_pad_new_from_static_template (&ogg_demux_sink_template_factory,
+ "sink");
gst_pad_set_event_function (ogg->sinkpad, gst_ogg_demux_handle_event);
gst_pad_set_chain_function (ogg->sinkpad, gst_ogg_demux_chain);
{
/* create the sink and source pads */
ogg->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&ogg_parse_sink_template_factory), "sink");
+ gst_pad_new_from_static_template (&ogg_parse_sink_template_factory,
+ "sink");
ogg->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&ogg_parse_src_template_factory), "src");
+ gst_pad_new_from_static_template (&ogg_parse_src_template_factory, "src");
/* TODO: Are there any events we must handle? */
/* gst_pad_set_event_function (ogg->sinkpad, gst_ogg_parse_handle_event); */
GstPadTemplate *templ;
/* create the pads */
- templ = gst_static_pad_template_get (&ogm_audio_parse_sink_template_factory);
- ogm->sinkpad = gst_pad_new_from_template (templ, "sink");
+ ogm->sinkpad =
+ gst_pad_new_from_template (&ogm_audio_parse_sink_template_factory,
+ "sink");
gst_pad_set_query_function (ogm->sinkpad, gst_ogm_parse_sink_query);
gst_pad_set_chain_function (ogm->sinkpad, gst_ogm_parse_chain);
gst_element_add_pad (GST_ELEMENT (ogm), ogm->sinkpad);
static void
gst_ogm_video_parse_init (GstOgmParse * ogm)
{
- GstPadTemplate *templ;
-
/* create the pads */
- templ = gst_static_pad_template_get (&ogm_video_parse_sink_template_factory);
- ogm->sinkpad = gst_pad_new_from_template (templ, "sink");
+ ogm->sinkpad =
+ gst_pad_new_from_static_template (&ogm_video_parse_sink_template_factory,
+ "sink");
gst_pad_set_query_function (ogm->sinkpad, gst_ogm_parse_sink_query);
gst_pad_set_chain_function (ogm->sinkpad, gst_ogm_parse_chain);
gst_element_add_pad (GST_ELEMENT (ogm), ogm->sinkpad);
static void
gst_ogm_text_parse_init (GstOgmParse * ogm)
{
- GstPadTemplate *templ;
-
/* create the pads */
- templ = gst_static_pad_template_get (&ogm_text_parse_sink_template_factory);
- ogm->sinkpad = gst_pad_new_from_template (templ, "sink");
+ ogm->sinkpad =
+ gst_pad_new_from_static_template (&ogm_text_parse_sink_template_factory,
+ "sink");
gst_pad_set_query_type_function (ogm->sinkpad,
gst_ogm_parse_get_sink_querytypes);
gst_pad_set_query_function (ogm->sinkpad, gst_ogm_parse_sink_query);
gst_theora_dec_init (GstTheoraDec * dec, GstTheoraDecClass * g_class)
{
dec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&theora_dec_sink_factory), "sink");
+ gst_pad_new_from_static_template (&theora_dec_sink_factory, "sink");
gst_pad_set_query_function (dec->sinkpad, theora_dec_sink_query);
gst_pad_set_event_function (dec->sinkpad, theora_dec_sink_event);
gst_pad_set_chain_function (dec->sinkpad, theora_dec_chain);
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
dec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&theora_dec_src_factory), "src");
+ gst_pad_new_from_static_template (&theora_dec_src_factory, "src");
gst_pad_set_getcaps_function (dec->srcpad, theora_dec_src_getcaps);
gst_pad_set_event_function (dec->srcpad, theora_dec_src_event);
gst_pad_set_query_type_function (dec->srcpad, theora_get_query_types);
gst_theora_enc_init (GstTheoraEnc * enc, GstTheoraEncClass * g_class)
{
enc->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&theora_enc_sink_factory), "sink");
+ gst_pad_new_from_static_template (&theora_enc_sink_factory, "sink");
gst_pad_set_chain_function (enc->sinkpad, theora_enc_chain);
gst_pad_set_event_function (enc->sinkpad, theora_enc_sink_event);
gst_pad_set_setcaps_function (enc->sinkpad, theora_enc_sink_setcaps);
gst_element_add_pad (GST_ELEMENT (enc), enc->sinkpad);
enc->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&theora_enc_src_factory), "src");
+ gst_pad_new_from_static_template (&theora_enc_src_factory, "src");
gst_element_add_pad (GST_ELEMENT (enc), enc->srcpad);
enc->center = THEORA_DEF_CENTER;
static void
gst_vorbis_dec_init (GstVorbisDec * dec, GstVorbisDecClass * g_class)
{
- GstPadTemplate *template;
-
- template = gst_static_pad_template_get (&vorbis_dec_sink_factory);
- dec->sinkpad = gst_pad_new_from_template (template, "sink");
+ dec->sinkpad = gst_pad_new_from_static_template (&vorbis_dec_sink_factory,
+ "sink");
gst_pad_set_event_function (dec->sinkpad, vorbis_dec_sink_event);
gst_pad_set_chain_function (dec->sinkpad, vorbis_dec_chain);
gst_pad_set_query_function (dec->sinkpad, vorbis_dec_sink_query);
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
- template = gst_static_pad_template_get (&vorbis_dec_src_factory);
- dec->srcpad = gst_pad_new_from_template (template, "src");
+ dec->srcpad = gst_pad_new_from_static_template (&vorbis_dec_src_factory,
+ "src");
gst_pad_set_event_function (dec->srcpad, vorbis_dec_src_event);
gst_pad_set_query_type_function (dec->srcpad, vorbis_get_query_types);
gst_vorbis_parse_init (GstVorbisParse * parse, GstVorbisParseClass * g_class)
{
parse->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&vorbis_parse_sink_factory), "sink");
+ gst_pad_new_from_static_template (&vorbis_parse_sink_factory, "sink");
gst_pad_set_chain_function (parse->sinkpad, vorbis_parse_chain);
gst_element_add_pad (GST_ELEMENT (parse), parse->sinkpad);
parse->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&vorbis_parse_src_factory), "src");
+ gst_pad_new_from_static_template (&vorbis_parse_src_factory, "src");
gst_element_add_pad (GST_ELEMENT (parse), parse->srcpad);
}
+
static void
vorbis_parse_set_header_on_caps (GstVorbisParse * parse, GstCaps * caps)
{
static void gst_adder_class_init (GstAdderClass * klass);
static void gst_adder_init (GstAdder * adder);
+static void gst_adder_dispose (GObject * object);
static GstPad *gst_adder_request_new_pad (GstElement * element,
GstPadTemplate * temp, const gchar * unused);
GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass;
+
+ gobject_class->dispose = gst_adder_dispose;
+
gstelement_class = (GstElementClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_collectpads_set_function (adder->collect, gst_adder_collected, adder);
}
+static void
+gst_adder_dispose (GObject * object)
+{
+ GstAdder *adder = GST_ADDER (object);
+
+ gst_object_unref (adder->collect);
+ adder->collect = NULL;
+}
+
static GstPad *
gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * unused)
gst_audiorate_init (GstAudiorate * audiorate)
{
audiorate->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_audiorate_sink_template), "sink");
+ gst_pad_new_from_static_template (&gst_audiorate_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiorate), audiorate->sinkpad);
gst_pad_set_chain_function (audiorate->sinkpad, gst_audiorate_chain);
gst_pad_set_setcaps_function (audiorate->sinkpad, gst_audiorate_setcaps);
gst_pad_set_getcaps_function (audiorate->sinkpad, gst_pad_proxy_getcaps);
audiorate->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_audiorate_src_template), "src");
+ gst_pad_new_from_static_template (&gst_audiorate_src_template, "src");
gst_element_add_pad (GST_ELEMENT (audiorate), audiorate->srcpad);
gst_pad_set_setcaps_function (audiorate->srcpad, gst_audiorate_setcaps);
gst_pad_set_getcaps_function (audiorate->srcpad, gst_pad_proxy_getcaps);
static void
gst_subparse_init (GstSubparse * subparse)
{
- subparse->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ),
- "sink");
+ subparse->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink");
gst_pad_set_chain_function (subparse->sinkpad, gst_subparse_chain);
gst_element_add_pad (GST_ELEMENT (subparse), subparse->sinkpad);
- subparse->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&src_templ),
- "src");
+ subparse->srcpad = gst_pad_new_from_static_template (&src_templ, "src");
gst_pad_set_event_function (subparse->srcpad, gst_subparse_src_event);
gst_element_add_pad (GST_ELEMENT (subparse), subparse->srcpad);
{
GST_DEBUG ("gst_videorate_init");
videorate->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_videorate_sink_template), "sink");
+ gst_pad_new_from_static_template (&gst_videorate_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (videorate), videorate->sinkpad);
gst_pad_set_event_function (videorate->sinkpad, gst_videorate_event);
gst_pad_set_chain_function (videorate->sinkpad, gst_videorate_chain);
gst_pad_set_setcaps_function (videorate->sinkpad, gst_videorate_setcaps);
videorate->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_videorate_src_template), "src");
+ gst_pad_new_from_static_template (&gst_videorate_src_template, "src");
gst_element_add_pad (GST_ELEMENT (videorate), videorate->srcpad);
gst_pad_set_getcaps_function (videorate->srcpad, gst_videorate_getcaps);
gst_pad_set_setcaps_function (videorate->srcpad, gst_videorate_setcaps);