summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2006-03-15 16:17:12 +0000
committerEdward Hervey <bilboed@bilboed.com>2006-03-15 16:17:12 +0000
commit50f4eb876a9d272847e22e3349309ce3f7ac42dc (patch)
tree82316dc1608ea22e7da781d625c0b0a76bcc2fac /ext
parentcd1bbadf591befc4dc6c52c0d5bc1b912ff1c63d (diff)
Fix memleak with gst_static_pad_template_get().
Original commit message from CVS: * ext/cairo/gsttextoverlay.c: (gst_text_overlay_init): * ext/dv/gstdvdemux.c: (gst_dvdemux_init), (gst_dvdemux_add_pads): * ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_init): * ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_init), (gst_jpeg_dec_setcaps): * ext/jpeg/gstjpegenc.c: (gst_jpegenc_init): * ext/jpeg/gstsmokedec.c: (gst_smokedec_init): * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_init): * ext/libmng/gstmngdec.c: (gst_mngdec_init), (gst_mngdec_src_getcaps): * ext/libpng/gstpngdec.c: (gst_pngdec_init), (gst_pngdec_caps_create_and_set): * ext/libpng/gstpngenc.c: (gst_pngenc_init): * ext/mikmod/gstmikmod.c: (gst_mikmod_init): * ext/speex/gstspeexdec.c: (gst_speex_dec_init): * gst/alpha/gstalpha.c: (gst_alpha_init): * gst/auparse/gstauparse.c: (gst_au_parse_init): * gst/avi/gstavidemux.c: (gst_avi_demux_init), (gst_avi_demux_handle_src_event), (gst_avi_demux_parse_stream): * gst/cutter/gstcutter.c: (gst_cutter_init): * gst/debug/efence.c: (gst_efence_init), (gst_efence_getrange), (gst_efence_checkgetrange): * gst/debug/negotiation.c: (gst_negotiation_init): * gst/flx/gstflxdec.c: (gst_flxdec_init): * gst/goom/gstgoom.c: (gst_goom_init): * gst/rtp/gstasteriskh263.c: (gst_asteriskh263_init): * gst/rtp/gstrtpL16depay.c: (gst_rtp_L16depay_init): * gst/rtp/gstrtpL16pay.c: (gst_rtpL16pay_init): * gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_init): * gst/rtp/gstrtpdepay.c: (gst_rtp_depay_init): * gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_init): * gst/rtsp/gstrtpdec.c: (gst_rtpdec_init): * gst/smpte/gstsmpte.c: (gst_smpte_init): * gst/wavparse/gstwavparse.c: (gst_wavparse_init), (gst_wavparse_create_sourcepad): Fix memleak with gst_static_pad_template_get(). This uses gst_pad_new_from_static_template() instead. Fixes #333512
Diffstat (limited to 'ext')
-rw-r--r--ext/cairo/gsttextoverlay.c12
-rw-r--r--ext/dv/gstdvdemux.c10
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbuf.c7
-rw-r--r--ext/jpeg/gstjpegdec.c10
-rw-r--r--ext/jpeg/gstjpegenc.c6
-rw-r--r--ext/jpeg/gstsmokedec.c7
-rw-r--r--ext/jpeg/gstsmokeenc.c7
-rw-r--r--ext/libmng/gstmngdec.c9
-rw-r--r--ext/libpng/gstpngdec.c9
-rw-r--r--ext/libpng/gstpngenc.c8
-rw-r--r--ext/mikmod/gstmikmod.c6
-rw-r--r--ext/speex/gstspeexdec.c6
12 files changed, 44 insertions, 53 deletions
diff --git a/ext/cairo/gsttextoverlay.c b/ext/cairo/gsttextoverlay.c
index 34137ad9..73f539d9 100644
--- a/ext/cairo/gsttextoverlay.c
+++ b/ext/cairo/gsttextoverlay.c
@@ -211,8 +211,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
{
/* video sink */
overlay->video_sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&video_sink_template_factory), "video_sink");
+ gst_pad_new_from_static_template (&video_sink_template_factory,
+ "video_sink");
gst_pad_set_getcaps_function (overlay->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps));
gst_pad_set_setcaps_function (overlay->video_sinkpad,
@@ -221,8 +221,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
/* text sink */
overlay->text_sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&text_sink_template_factory), "text_sink");
+ gst_pad_new_from_static_template (&text_sink_template_factory,
+ "text_sink");
gst_pad_set_link_function (overlay->text_sinkpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_text_pad_linked));
gst_pad_set_unlink_function (overlay->text_sinkpad,
@@ -231,8 +231,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
/* (video) source */
overlay->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&cairo_text_overlay_src_template_factory), "src");
+ gst_pad_new_from_static_template
+ (&cairo_text_overlay_src_template_factory, "src");
gst_pad_set_getcaps_function (overlay->srcpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps));
gst_element_add_pad (GST_ELEMENT (overlay), overlay->srcpad);
diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c
index eb5b98b4..221a12c0 100644
--- a/ext/dv/gstdvdemux.c
+++ b/ext/dv/gstdvdemux.c
@@ -215,9 +215,7 @@ gst_dvdemux_init (GstDVDemux * dvdemux, GstDVDemuxClass * g_class)
{
gint i;
- dvdemux->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&sink_temp),
- "sink");
+ dvdemux->sinkpad = gst_pad_new_from_static_template (&sink_temp, "sink");
/* we can operate in pull and push mode so we install
* a custom activate function */
gst_pad_set_activate_function (dvdemux->sinkpad,
@@ -297,8 +295,7 @@ static void
gst_dvdemux_add_pads (GstDVDemux * dvdemux)
{
dvdemux->videosrcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&video_src_temp),
- "video");
+ gst_pad_new_from_static_template (&video_src_temp, "video");
gst_pad_set_query_function (dvdemux->videosrcpad,
GST_DEBUG_FUNCPTR (gst_dvdemux_src_query));
gst_pad_set_query_type_function (dvdemux->videosrcpad,
@@ -309,8 +306,7 @@ gst_dvdemux_add_pads (GstDVDemux * dvdemux)
gst_element_add_pad (GST_ELEMENT (dvdemux), dvdemux->videosrcpad);
dvdemux->audiosrcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&audio_src_temp),
- "audio");
+ gst_pad_new_from_static_template (&audio_src_temp, "audio");
gst_pad_set_query_function (dvdemux->audiosrcpad,
GST_DEBUG_FUNCPTR (gst_dvdemux_src_query));
gst_pad_set_query_type_function (dvdemux->audiosrcpad,
diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c
index 3ddf1d2e..4f65677a 100644
--- a/ext/gdk_pixbuf/gstgdkpixbuf.c
+++ b/ext/gdk_pixbuf/gstgdkpixbuf.c
@@ -227,8 +227,7 @@ static void
gst_gdk_pixbuf_init (GstGdkPixbuf * filter, GstGdkPixbufClass * klass)
{
filter->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_gdk_pixbuf_sink_template), "sink");
+ gst_pad_new_from_static_template (&gst_gdk_pixbuf_sink_template, "sink");
gst_pad_set_setcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_setcaps);
gst_pad_set_getcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_getcaps);
@@ -241,8 +240,8 @@ gst_gdk_pixbuf_init (GstGdkPixbuf * filter, GstGdkPixbufClass * klass)
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
- filter->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_gdk_pixbuf_src_template), "src");
+ filter->srcpad =
+ gst_pad_new_from_static_template (&gst_gdk_pixbuf_src_template, "src");
gst_pad_use_fixed_caps (filter->srcpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c
index 472b3520..492831fc 100644
--- a/ext/jpeg/gstjpegdec.c
+++ b/ext/jpeg/gstjpegdec.c
@@ -232,8 +232,8 @@ gst_jpeg_dec_init (GstJpegDec * dec)
/* create the sink and src pads */
dec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_jpeg_dec_sink_pad_template), "sink");
+ gst_pad_new_from_static_template (&gst_jpeg_dec_sink_pad_template,
+ "sink");
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
gst_pad_set_setcaps_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_setcaps));
@@ -241,8 +241,7 @@ gst_jpeg_dec_init (GstJpegDec * dec)
GST_DEBUG_FUNCPTR (gst_jpeg_dec_chain));
dec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_jpeg_dec_src_pad_template), "src");
+ gst_pad_new_from_static_template (&gst_jpeg_dec_src_pad_template, "src");
gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
/* setup jpeglib */
@@ -606,6 +605,9 @@ gst_jpeg_dec_setcaps (GstPad * pad, GstCaps * caps)
/* do not extract width/height here. we do that in the chain
* function on a per-frame basis (including the line[] array
* setup) */
+
+ /* But we can take the framerate values and set them on the src pad */
+
return TRUE;
}
diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c
index b76b6205..59fc1022 100644
--- a/ext/jpeg/gstjpegenc.c
+++ b/ext/jpeg/gstjpegenc.c
@@ -205,16 +205,14 @@ gst_jpegenc_init (GstJpegEnc * jpegenc)
{
/* create the sink and src pads */
jpegenc->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_jpegenc_sink_pad_template), "sink");
+ gst_pad_new_from_static_template (&gst_jpegenc_sink_pad_template, "sink");
gst_pad_set_chain_function (jpegenc->sinkpad, gst_jpegenc_chain);
gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps);
gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps);
gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad);
jpegenc->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_jpegenc_src_pad_template), "src");
+ gst_pad_new_from_static_template (&gst_jpegenc_src_pad_template, "src");
gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps);
/*gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps); */
gst_pad_use_fixed_caps (jpegenc->sinkpad);
diff --git a/ext/jpeg/gstsmokedec.c b/ext/jpeg/gstsmokedec.c
index 72ed8fe0..ddeb0367 100644
--- a/ext/jpeg/gstsmokedec.c
+++ b/ext/jpeg/gstsmokedec.c
@@ -131,14 +131,13 @@ gst_smokedec_init (GstSmokeDec * smokedec)
/* create the sink and src pads */
smokedec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_smokedec_sink_pad_template), "sink");
+ gst_pad_new_from_static_template (&gst_smokedec_sink_pad_template,
+ "sink");
gst_pad_set_chain_function (smokedec->sinkpad, gst_smokedec_chain);
gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->sinkpad);
smokedec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_smokedec_src_pad_template), "src");
+ gst_pad_new_from_static_template (&gst_smokedec_src_pad_template, "src");
gst_pad_use_fixed_caps (smokedec->srcpad);
gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->srcpad);
diff --git a/ext/jpeg/gstsmokeenc.c b/ext/jpeg/gstsmokeenc.c
index cd499f85..c1d94cbc 100644
--- a/ext/jpeg/gstsmokeenc.c
+++ b/ext/jpeg/gstsmokeenc.c
@@ -168,16 +168,15 @@ gst_smokeenc_init (GstSmokeEnc * smokeenc)
{
/* create the sink and src pads */
smokeenc->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_smokeenc_sink_pad_template), "sink");
+ gst_pad_new_from_static_template (&gst_smokeenc_sink_pad_template,
+ "sink");
gst_pad_set_chain_function (smokeenc->sinkpad, gst_smokeenc_chain);
gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps);
gst_pad_set_setcaps_function (smokeenc->sinkpad, gst_smokeenc_setcaps);
gst_element_add_pad (GST_ELEMENT (smokeenc), smokeenc->sinkpad);
smokeenc->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_smokeenc_src_pad_template), "src");
+ gst_pad_new_from_static_template (&gst_smokeenc_src_pad_template, "src");
gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps);
gst_pad_use_fixed_caps (smokeenc->sinkpad);
/*gst_pad_set_link_function (smokeenc->sinkpad, gst_smokeenc_link); */
diff --git a/ext/libmng/gstmngdec.c b/ext/libmng/gstmngdec.c
index dab5c044..97e9ff9c 100644
--- a/ext/libmng/gstmngdec.c
+++ b/ext/libmng/gstmngdec.c
@@ -149,12 +149,12 @@ gst_mngdec_sinklink (GstPad * pad, const GstCaps * caps)
static void
gst_mngdec_init (GstMngDec * mngdec)
{
- mngdec->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_mngdec_sink_pad_template), "sink");
+ mngdec->sinkpad =
+ gst_pad_new_from_static_template (&gst_mngdec_sink_pad_template, "sink");
gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->sinkpad);
- mngdec->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_mngdec_src_pad_template), "src");
+ mngdec->srcpad =
+ gst_pad_new_from_static_template (&gst_mngdec_src_pad_template, "src");
gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->srcpad);
gst_pad_set_link_function (mngdec->sinkpad, gst_mngdec_sinklink);
@@ -229,6 +229,7 @@ gst_mngdec_src_getcaps (GstPad * pad)
}
gst_object_unref (mngdec);
+ gst_object_unref (templ);
return caps;
}
diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c
index bbdda42b..68423288 100644
--- a/ext/libpng/gstpngdec.c
+++ b/ext/libpng/gstpngdec.c
@@ -127,8 +127,8 @@ gst_pngdec_class_init (GstPngDecClass * klass)
static void
gst_pngdec_init (GstPngDec * pngdec)
{
- pngdec->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_pngdec_sink_pad_template), "sink");
+ pngdec->sinkpad =
+ gst_pad_new_from_static_template (&gst_pngdec_sink_pad_template, "sink");
gst_pad_set_activate_function (pngdec->sinkpad, gst_pngdec_sink_activate);
gst_pad_set_activatepush_function (pngdec->sinkpad,
gst_pngdec_sink_activate_push);
@@ -138,8 +138,8 @@ gst_pngdec_init (GstPngDec * pngdec)
gst_pad_set_event_function (pngdec->sinkpad, gst_pngdec_sink_event);
gst_element_add_pad (GST_ELEMENT (pngdec), pngdec->sinkpad);
- pngdec->srcpad = gst_pad_new_from_template (gst_static_pad_template_get
- (&gst_pngdec_src_pad_template), "src");
+ pngdec->srcpad =
+ gst_pad_new_from_static_template (&gst_pngdec_src_pad_template, "src");
gst_pad_use_fixed_caps (pngdec->srcpad);
gst_element_add_pad (GST_ELEMENT (pngdec), pngdec->srcpad);
@@ -364,6 +364,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec)
res = gst_caps_intersect (caps, gst_pad_template_get_caps (templ));
gst_caps_unref (caps);
+ gst_object_unref (templ);
if (!gst_pad_set_caps (pngdec->srcpad, res)) {
ret = GST_FLOW_ERROR;
diff --git a/ext/libpng/gstpngenc.c b/ext/libpng/gstpngenc.c
index f52e57b4..be0830ab 100644
--- a/ext/libpng/gstpngenc.c
+++ b/ext/libpng/gstpngenc.c
@@ -186,8 +186,8 @@ static void
gst_pngenc_init (GstPngEnc * pngenc, GstPngEncClass * g_class)
{
/* sinkpad */
- pngenc->sinkpad = gst_pad_new_from_template
- (gst_static_pad_template_get (&pngenc_sink_template), "sink");
+ pngenc->sinkpad = gst_pad_new_from_static_template
+ (&pngenc_sink_template, "sink");
gst_pad_set_chain_function (pngenc->sinkpad, gst_pngenc_chain);
/* gst_pad_set_link_function (pngenc->sinkpad, gst_pngenc_sinklink); */
/* gst_pad_set_getcaps_function (pngenc->sinkpad, gst_pngenc_sink_getcaps); */
@@ -195,8 +195,8 @@ gst_pngenc_init (GstPngEnc * pngenc, GstPngEncClass * g_class)
gst_element_add_pad (GST_ELEMENT (pngenc), pngenc->sinkpad);
/* srcpad */
- pngenc->srcpad = gst_pad_new_from_template
- (gst_static_pad_template_get (&pngenc_src_template), "src");
+ pngenc->srcpad = gst_pad_new_from_static_template
+ (&pngenc_src_template, "src");
/* pngenc->srcpad = gst_pad_new ("src", GST_PAD_SRC); */
/* gst_pad_set_getcaps_function (pngenc->srcpad, gst_pngenc_src_getcaps); */
/* gst_pad_set_setcaps_function (pngenc->srcpad, gst_pngenc_setcaps); */
diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c
index 4226467f..55692f1c 100644
--- a/ext/mikmod/gstmikmod.c
+++ b/ext/mikmod/gstmikmod.c
@@ -208,11 +208,9 @@ static void
gst_mikmod_init (GstMikMod * filter)
{
filter->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&mikmod_sink_factory), "sink");
+ gst_pad_new_from_static_template (&mikmod_sink_factory, "sink");
filter->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&mikmod_src_factory), "src");
+ gst_pad_new_from_static_template (&mikmod_src_factory, "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c
index d213f9b3..035e8b77 100644
--- a/ext/speex/gstspeexdec.c
+++ b/ext/speex/gstspeexdec.c
@@ -129,15 +129,13 @@ static void
gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class)
{
dec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&speex_dec_sink_factory), "sink");
+ gst_pad_new_from_static_template (&speex_dec_sink_factory, "sink");
gst_pad_set_chain_function (dec->sinkpad, speex_dec_chain);
gst_pad_set_event_function (dec->sinkpad, speex_dec_event);
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
dec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&speex_dec_src_factory), "src");
+ gst_pad_new_from_static_template (&speex_dec_src_factory, "src");
gst_pad_use_fixed_caps (dec->srcpad);
gst_pad_set_event_function (dec->srcpad, speex_dec_src_event);
gst_pad_set_query_type_function (dec->srcpad, speex_get_query_types);