From 50f4eb876a9d272847e22e3349309ce3f7ac42dc Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 15 Mar 2006 16:17:12 +0000 Subject: 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 --- gst/alpha/gstalpha.c | 6 ++---- gst/auparse/gstauparse.c | 7 +++---- gst/avi/gstavidemux.c | 6 +++--- gst/cutter/gstcutter.c | 6 ++---- gst/debug/efence.c | 12 ++++-------- gst/debug/negotiation.c | 6 ++---- gst/flx/gstflxdec.c | 8 ++------ gst/goom/gstgoom.c | 8 ++------ gst/rtp/gstasteriskh263.c | 7 +++---- gst/rtp/gstrtpL16depay.c | 7 +++---- gst/rtp/gstrtpL16pay.c | 6 ++---- gst/rtp/gstrtpamrdepay.c | 7 +++---- gst/rtp/gstrtpdepay.c | 16 ++++++++-------- gst/rtp/gstrtpmpadepay.c | 7 +++---- gst/rtsp/gstrtpdec.c | 15 +++++++-------- gst/smpte/gstsmpte.c | 9 +++------ gst/wavparse/gstwavparse.c | 10 +++------- 17 files changed, 55 insertions(+), 88 deletions(-) (limited to 'gst') diff --git a/gst/alpha/gstalpha.c b/gst/alpha/gstalpha.c index 9596c0ba..5237706d 100644 --- a/gst/alpha/gstalpha.c +++ b/gst/alpha/gstalpha.c @@ -267,15 +267,13 @@ gst_alpha_init (GstAlpha * alpha) { /* create the sink and src pads */ alpha->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_alpha_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_alpha_sink_template, "sink"); gst_element_add_pad (GST_ELEMENT (alpha), alpha->sinkpad); gst_pad_set_chain_function (alpha->sinkpad, gst_alpha_chain); gst_pad_set_setcaps_function (alpha->sinkpad, gst_alpha_sink_setcaps); alpha->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_alpha_src_template), "src"); + gst_pad_new_from_static_template (&gst_alpha_src_template, "src"); gst_element_add_pad (GST_ELEMENT (alpha), alpha->srcpad); alpha->alpha = DEFAULT_ALPHA; diff --git a/gst/auparse/gstauparse.c b/gst/auparse/gstauparse.c index 071cb37d..018ee500 100644 --- a/gst/auparse/gstauparse.c +++ b/gst/auparse/gstauparse.c @@ -112,13 +112,12 @@ static void gst_au_parse_init (GstAuParse * auparse, GstAuParseClass * klass) { auparse->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_au_parse_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_au_parse_sink_template, "sink"); gst_element_add_pad (GST_ELEMENT (auparse), auparse->sinkpad); gst_pad_set_chain_function (auparse->sinkpad, gst_au_parse_chain); - auparse->srcpad = gst_pad_new_from_template (gst_static_pad_template_get - (&gst_au_parse_src_template), "src"); + auparse->srcpad = + gst_pad_new_from_static_template (&gst_au_parse_src_template, "src"); gst_pad_use_fixed_caps (auparse->srcpad); gst_element_add_pad (GST_ELEMENT (auparse), auparse->srcpad); diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 77278fd0..484288cb 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -144,9 +144,7 @@ gst_avi_demux_class_init (GstAviDemuxClass * klass) static void gst_avi_demux_init (GstAviDemux * avi) { - avi->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ), - "sink"); + avi->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink"); gst_pad_set_activate_function (avi->sinkpad, gst_avi_demux_sink_activate); gst_pad_set_activatepull_function (avi->sinkpad, gst_avi_demux_sink_activate_pull); @@ -561,6 +559,7 @@ gst_avi_demux_handle_src_event (GstPad * pad, GstEvent * event) done: gst_event_unref (event); + GST_DEBUG_OBJECT (avi, "returning %d", res); return res; } @@ -1128,6 +1127,7 @@ gst_avi_demux_parse_stream (GstElement * element, GstBuffer * buf) if (stream->pad) gst_object_unref (stream->pad); pad = stream->pad = gst_pad_new_from_template (templ, padname); + gst_object_unref (templ); stream->last_flow = GST_FLOW_OK; stream->idx_duration = GST_CLOCK_TIME_NONE; g_free (padname); diff --git a/gst/cutter/gstcutter.c b/gst/cutter/gstcutter.c index ec56cdd5..9b302cd8 100644 --- a/gst/cutter/gstcutter.c +++ b/gst/cutter/gstcutter.c @@ -137,11 +137,9 @@ static void gst_cutter_init (GstCutter * filter, GstCutterClass * g_class) { filter->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&cutter_sink_factory), "sink"); + gst_pad_new_from_static_template (&cutter_sink_factory, "sink"); filter->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&cutter_src_factory), "src"); + gst_pad_new_from_static_template (&cutter_src_factory, "src"); filter->threshold_level = CUTTER_DEFAULT_THRESHOLD_LEVEL; filter->threshold_length = CUTTER_DEFAULT_THRESHOLD_LENGTH; diff --git a/gst/debug/efence.c b/gst/debug/efence.c index 078a0e32..90932598 100644 --- a/gst/debug/efence.c +++ b/gst/debug/efence.c @@ -180,10 +180,8 @@ gst_efence_class_init (GstEFenceClass * klass) static void gst_efence_init (GstEFence * filter) { - GstPadTemplate *tmpl; - - tmpl = gst_static_pad_template_get (&gst_efence_sink_factory); - filter->sinkpad = gst_pad_new_from_template (tmpl, "sink"); + filter->sinkpad = + gst_pad_new_from_static_template (&gst_efence_sink_factory, "sink"); gst_pad_set_getcaps_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps)); gst_pad_set_setcaps_function (filter->sinkpad, @@ -193,10 +191,9 @@ gst_efence_init (GstEFence * filter) gst_pad_set_bufferalloc_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_efence_buffer_alloc)); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); - gst_object_unref (tmpl); - tmpl = gst_static_pad_template_get (&gst_efence_src_factory); - filter->srcpad = gst_pad_new_from_template (tmpl, "src"); + filter->srcpad = + gst_pad_new_from_static_template (&gst_efence_src_factory, "src"); gst_pad_set_getcaps_function (filter->srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps)); gst_pad_set_setcaps_function (filter->srcpad, @@ -209,7 +206,6 @@ gst_efence_init (GstEFence * filter) GST_DEBUG_FUNCPTR (gst_efence_activate_src_pull)); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); - gst_object_unref (tmpl); filter->fence_top = TRUE; } diff --git a/gst/debug/negotiation.c b/gst/debug/negotiation.c index da8a3033..c3f2314d 100644 --- a/gst/debug/negotiation.c +++ b/gst/debug/negotiation.c @@ -179,13 +179,11 @@ static void gst_negotiation_init (GstNegotiation * filter) { filter->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_negotiation_sink_factory), "sink"); + gst_pad_new_from_static_template (&gst_negotiation_sink_factory, "sink"); gst_pad_set_getcaps_function (filter->sinkpad, gst_negotiation_getcaps); gst_pad_set_link_function (filter->sinkpad, gst_negotiation_pad_link); filter->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_negotiation_src_factory), "src"); + gst_pad_new_from_static_template (&gst_negotiation_src_factory, "src"); gst_pad_set_getcaps_function (filter->srcpad, gst_negotiation_getcaps); gst_pad_set_link_function (filter->srcpad, gst_negotiation_pad_link); diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index 1b8d4482..d6db1bb4 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -152,16 +152,12 @@ gst_flxdec_class_init (GstFlxDecClass * klass) static void gst_flxdec_init (GstFlxDec * flxdec) { - flxdec->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get (&sink_factory), - "sink"); + flxdec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->sinkpad); gst_pad_set_chain_function (flxdec->sinkpad, gst_flxdec_chain); gst_pad_set_event_function (flxdec->sinkpad, gst_flxdec_sink_event_handler); - flxdec->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&src_video_factory), "src"); + flxdec->srcpad = gst_pad_new_from_static_template (&src_video_factory, "src"); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->srcpad); gst_pad_set_query_function (flxdec->srcpad, gst_flxdec_src_query_handler); gst_pad_set_event_function (flxdec->srcpad, gst_flxdec_src_event_handler); diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index d5bcb77f..54425aa6 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -156,12 +156,8 @@ static void gst_goom_init (GstGoom * goom) { /* create the sink and src pads */ - goom->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get (&sink_template), - "sink"); - goom->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get (&src_template), - "src"); + goom->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); + goom->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_element_add_pad (GST_ELEMENT (goom), goom->sinkpad); gst_element_add_pad (GST_ELEMENT (goom), goom->srcpad); diff --git a/gst/rtp/gstasteriskh263.c b/gst/rtp/gstasteriskh263.c index df93cfe4..3fe3326f 100644 --- a/gst/rtp/gstasteriskh263.c +++ b/gst/rtp/gstasteriskh263.c @@ -158,13 +158,12 @@ static void gst_asteriskh263_init (GstAsteriskh263 * asteriskh263) { asteriskh263->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_asteriskh263_src_template), "src"); + gst_pad_new_from_static_template (&gst_asteriskh263_src_template, "src"); gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->srcpad); asteriskh263->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_asteriskh263_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_asteriskh263_sink_template, + "sink"); gst_pad_set_chain_function (asteriskh263->sinkpad, gst_asteriskh263_chain); gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->sinkpad); diff --git a/gst/rtp/gstrtpL16depay.c b/gst/rtp/gstrtpL16depay.c index d133fe9a..60e2bcd5 100644 --- a/gst/rtp/gstrtpL16depay.c +++ b/gst/rtp/gstrtpL16depay.c @@ -140,11 +140,10 @@ static void gst_rtp_L16depay_init (GstRtpL16Depay * rtpL16depay) { rtpL16depay->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_L16depay_src_template), "src"); + gst_pad_new_from_static_template (&gst_rtp_L16depay_src_template, "src"); rtpL16depay->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_L16depay_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_rtp_L16depay_sink_template, + "sink"); gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->srcpad); gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->sinkpad); gst_pad_set_chain_function (rtpL16depay->sinkpad, gst_rtp_L16depay_chain); diff --git a/gst/rtp/gstrtpL16pay.c b/gst/rtp/gstrtpL16pay.c index f68425c0..3f61d73d 100644 --- a/gst/rtp/gstrtpL16pay.c +++ b/gst/rtp/gstrtpL16pay.c @@ -137,11 +137,9 @@ static void gst_rtpL16pay_init (GstRtpL16Pay * rtpL16enc) { rtpL16enc->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpL16pay_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_rtpL16pay_sink_template, "sink"); rtpL16enc->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpL16pay_src_template), "src"); + gst_pad_new_from_static_template (&gst_rtpL16pay_src_template, "src"); gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->sinkpad); gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->srcpad); gst_pad_set_chain_function (rtpL16enc->sinkpad, gst_rtpL16pay_chain); diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c index aa410aa7..3eb08d35 100644 --- a/gst/rtp/gstrtpamrdepay.c +++ b/gst/rtp/gstrtpamrdepay.c @@ -159,14 +159,13 @@ static void gst_rtp_amr_depay_init (GstRtpAMRDepay * rtpamrdepay) { rtpamrdepay->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_amr_depay_src_template), "src"); + gst_pad_new_from_static_template (&gst_rtp_amr_depay_src_template, "src"); gst_element_add_pad (GST_ELEMENT (rtpamrdepay), rtpamrdepay->srcpad); rtpamrdepay->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_amr_depay_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_rtp_amr_depay_sink_template, + "sink"); gst_pad_set_setcaps_function (rtpamrdepay->sinkpad, gst_rtp_amr_depay_sink_setcaps); gst_pad_set_chain_function (rtpamrdepay->sinkpad, gst_rtp_amr_depay_chain); diff --git a/gst/rtp/gstrtpdepay.c b/gst/rtp/gstrtpdepay.c index b525ca96..531f8710 100644 --- a/gst/rtp/gstrtpdepay.c +++ b/gst/rtp/gstrtpdepay.c @@ -154,30 +154,30 @@ gst_rtp_depay_init (GstRTPDepay * rtpdepay) { /* the input rtp pad */ rtpdepay->sink_rtp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_depay_sink_rtp_template), "sinkrtp"); + gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtp_template, + "sinkrtp"); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtp); gst_pad_set_getcaps_function (rtpdepay->sink_rtp, gst_rtp_depay_getcaps); gst_pad_set_chain_function (rtpdepay->sink_rtp, gst_rtp_depay_chain_rtp); /* the input rtcp pad */ rtpdepay->sink_rtcp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_depay_sink_rtcp_template), "sinkrtcp"); + gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtcp_template, + "sinkrtcp"); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtcp); gst_pad_set_chain_function (rtpdepay->sink_rtcp, gst_rtp_depay_chain_rtcp); /* the output rtp pad */ rtpdepay->src_rtp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_depay_src_rtp_template), "srcrtp"); + gst_pad_new_from_static_template (&gst_rtp_depay_src_rtp_template, + "srcrtp"); gst_pad_set_getcaps_function (rtpdepay->src_rtp, gst_rtp_depay_getcaps); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtp); /* the output rtcp pad */ rtpdepay->src_rtcp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_depay_src_rtcp_template), "srcrtcp"); + gst_pad_new_from_static_template (&gst_rtp_depay_src_rtcp_template, + "srcrtcp"); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtcp); } diff --git a/gst/rtp/gstrtpmpadepay.c b/gst/rtp/gstrtpmpadepay.c index 3a6e7fe4..046efe93 100644 --- a/gst/rtp/gstrtpmpadepay.c +++ b/gst/rtp/gstrtpmpadepay.c @@ -134,13 +134,12 @@ static void gst_rtp_mpa_depay_init (GstRtpMPADepay * rtpmpadepay) { rtpmpadepay->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_mpa_depay_src_template), "src"); + gst_pad_new_from_static_template (&gst_rtp_mpa_depay_src_template, "src"); gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->srcpad); rtpmpadepay->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtp_mpa_depay_sink_template), "sink"); + gst_pad_new_from_static_template (&gst_rtp_mpa_depay_sink_template, + "sink"); gst_pad_set_chain_function (rtpmpadepay->sinkpad, gst_rtp_mpa_depay_chain); gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->sinkpad); } diff --git a/gst/rtsp/gstrtpdec.c b/gst/rtsp/gstrtpdec.c index 7484ad33..02785ef7 100644 --- a/gst/rtsp/gstrtpdec.c +++ b/gst/rtsp/gstrtpdec.c @@ -151,30 +151,29 @@ gst_rtpdec_init (GstRTPDec * rtpdec) { /* the input rtp pad */ rtpdec->sink_rtp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpdec_sink_rtp_template), "sinkrtp"); + gst_pad_new_from_static_template (&gst_rtpdec_sink_rtp_template, + "sinkrtp"); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtp); gst_pad_set_getcaps_function (rtpdec->sink_rtp, gst_rtpdec_getcaps); gst_pad_set_chain_function (rtpdec->sink_rtp, gst_rtpdec_chain_rtp); /* the input rtcp pad */ rtpdec->sink_rtcp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpdec_sink_rtcp_template), "sinkrtcp"); + gst_pad_new_from_static_template (&gst_rtpdec_sink_rtcp_template, + "sinkrtcp"); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtcp); gst_pad_set_chain_function (rtpdec->sink_rtcp, gst_rtpdec_chain_rtcp); /* the output rtp pad */ rtpdec->src_rtp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpdec_src_rtp_template), "srcrtp"); + gst_pad_new_from_static_template (&gst_rtpdec_src_rtp_template, "srcrtp"); gst_pad_set_getcaps_function (rtpdec->src_rtp, gst_rtpdec_getcaps); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtp); /* the output rtcp pad */ rtpdec->src_rtcp = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtpdec_src_rtcp_template), "srcrtcp"); + gst_pad_new_from_static_template (&gst_rtpdec_src_rtcp_template, + "srcrtcp"); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtcp); } diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c index bf5ed282..a87b4d95 100644 --- a/gst/smpte/gstsmpte.c +++ b/gst/smpte/gstsmpte.c @@ -262,20 +262,17 @@ static void gst_smpte_init (GstSMPTE * smpte) { smpte->sinkpad1 = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_smpte_sink1_template), "sink1"); + gst_pad_new_from_static_template (&gst_smpte_sink1_template, "sink1"); gst_pad_set_setcaps_function (smpte->sinkpad1, gst_smpte_setcaps); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1); smpte->sinkpad2 = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_smpte_sink2_template), "sink2"); + gst_pad_new_from_static_template (&gst_smpte_sink2_template, "sink2"); gst_pad_set_setcaps_function (smpte->sinkpad2, gst_smpte_setcaps); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2); smpte->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_smpte_src_template), "src"); + gst_pad_new_from_static_template (&gst_smpte_src_template, "src"); gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad); smpte->collect = gst_collect_pads_new (); diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 98256ed9..6ad82ae2 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -221,8 +221,7 @@ gst_wavparse_init (GstWavParse * wavparse) /* sink */ wavparse->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get - (&sink_template_factory), "sink"); + gst_pad_new_from_static_template (&sink_template_factory, "sink"); gst_pad_set_activate_function (wavparse->sinkpad, GST_DEBUG_FUNCPTR (gst_wavparse_sink_activate)); gst_pad_set_activatepull_function (wavparse->sinkpad, @@ -242,15 +241,12 @@ gst_wavparse_destroy_sourcepad (GstWavParse * wavparse) static void gst_wavparse_create_sourcepad (GstWavParse * wavparse) { - GstPadTemplate *templ; - /* destroy previous one */ gst_wavparse_destroy_sourcepad (wavparse); /* source */ - templ = gst_static_pad_template_get (&src_template_factory); - wavparse->srcpad = gst_pad_new_from_template (templ, "src"); - gst_object_unref (templ); + wavparse->srcpad = + gst_pad_new_from_static_template (&src_template_factory, "src"); gst_pad_use_fixed_caps (wavparse->srcpad); gst_pad_set_query_type_function (wavparse->srcpad, GST_DEBUG_FUNCPTR (gst_wavparse_get_query_types)); -- cgit