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
This commit is contained in:
Edward Hervey 2006-03-15 16:17:12 +00:00
parent cd1bbadf59
commit 50f4eb876a
30 changed files with 140 additions and 141 deletions

View file

@ -1,3 +1,44 @@
2006-03-15 Edward Hervey <edward@fluendo.com>
* 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
2006-03-14 Tim-Philipp Müller <tim at centricular dot net> 2006-03-14 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac: * configure.ac:

View file

@ -211,8 +211,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
{ {
/* video sink */ /* video sink */
overlay->video_sinkpad = overlay->video_sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&video_sink_template_factory,
(&video_sink_template_factory), "video_sink"); "video_sink");
gst_pad_set_getcaps_function (overlay->video_sinkpad, gst_pad_set_getcaps_function (overlay->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps)); GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps));
gst_pad_set_setcaps_function (overlay->video_sinkpad, gst_pad_set_setcaps_function (overlay->video_sinkpad,
@ -221,8 +221,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
/* text sink */ /* text sink */
overlay->text_sinkpad = overlay->text_sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&text_sink_template_factory,
(&text_sink_template_factory), "text_sink"); "text_sink");
gst_pad_set_link_function (overlay->text_sinkpad, gst_pad_set_link_function (overlay->text_sinkpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_text_pad_linked)); GST_DEBUG_FUNCPTR (gst_text_overlay_text_pad_linked));
gst_pad_set_unlink_function (overlay->text_sinkpad, gst_pad_set_unlink_function (overlay->text_sinkpad,
@ -231,8 +231,8 @@ gst_text_overlay_init (GstCairoTextOverlay * overlay,
/* (video) source */ /* (video) source */
overlay->srcpad = overlay->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template
(&cairo_text_overlay_src_template_factory), "src"); (&cairo_text_overlay_src_template_factory, "src");
gst_pad_set_getcaps_function (overlay->srcpad, gst_pad_set_getcaps_function (overlay->srcpad,
GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps)); GST_DEBUG_FUNCPTR (gst_text_overlay_getcaps));
gst_element_add_pad (GST_ELEMENT (overlay), overlay->srcpad); gst_element_add_pad (GST_ELEMENT (overlay), overlay->srcpad);

View file

@ -215,9 +215,7 @@ gst_dvdemux_init (GstDVDemux * dvdemux, GstDVDemuxClass * g_class)
{ {
gint i; gint i;
dvdemux->sinkpad = dvdemux->sinkpad = gst_pad_new_from_static_template (&sink_temp, "sink");
gst_pad_new_from_template (gst_static_pad_template_get (&sink_temp),
"sink");
/* we can operate in pull and push mode so we install /* we can operate in pull and push mode so we install
* a custom activate function */ * a custom activate function */
gst_pad_set_activate_function (dvdemux->sinkpad, gst_pad_set_activate_function (dvdemux->sinkpad,
@ -297,8 +295,7 @@ static void
gst_dvdemux_add_pads (GstDVDemux * dvdemux) gst_dvdemux_add_pads (GstDVDemux * dvdemux)
{ {
dvdemux->videosrcpad = dvdemux->videosrcpad =
gst_pad_new_from_template (gst_static_pad_template_get (&video_src_temp), gst_pad_new_from_static_template (&video_src_temp, "video");
"video");
gst_pad_set_query_function (dvdemux->videosrcpad, gst_pad_set_query_function (dvdemux->videosrcpad,
GST_DEBUG_FUNCPTR (gst_dvdemux_src_query)); GST_DEBUG_FUNCPTR (gst_dvdemux_src_query));
gst_pad_set_query_type_function (dvdemux->videosrcpad, 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); gst_element_add_pad (GST_ELEMENT (dvdemux), dvdemux->videosrcpad);
dvdemux->audiosrcpad = dvdemux->audiosrcpad =
gst_pad_new_from_template (gst_static_pad_template_get (&audio_src_temp), gst_pad_new_from_static_template (&audio_src_temp, "audio");
"audio");
gst_pad_set_query_function (dvdemux->audiosrcpad, gst_pad_set_query_function (dvdemux->audiosrcpad,
GST_DEBUG_FUNCPTR (gst_dvdemux_src_query)); GST_DEBUG_FUNCPTR (gst_dvdemux_src_query));
gst_pad_set_query_type_function (dvdemux->audiosrcpad, gst_pad_set_query_type_function (dvdemux->audiosrcpad,

View file

@ -227,8 +227,7 @@ static void
gst_gdk_pixbuf_init (GstGdkPixbuf * filter, GstGdkPixbufClass * klass) gst_gdk_pixbuf_init (GstGdkPixbuf * filter, GstGdkPixbufClass * klass)
{ {
filter->sinkpad = filter->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_gdk_pixbuf_sink_template, "sink");
(&gst_gdk_pixbuf_sink_template), "sink");
gst_pad_set_setcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_setcaps); gst_pad_set_setcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_setcaps);
gst_pad_set_getcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_getcaps); 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); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_static_pad_template_get filter->srcpad =
(&gst_gdk_pixbuf_src_template), "src"); gst_pad_new_from_static_template (&gst_gdk_pixbuf_src_template, "src");
gst_pad_use_fixed_caps (filter->srcpad); gst_pad_use_fixed_caps (filter->srcpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);

View file

@ -232,8 +232,8 @@ gst_jpeg_dec_init (GstJpegDec * dec)
/* create the sink and src pads */ /* create the sink and src pads */
dec->sinkpad = dec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_jpeg_dec_sink_pad_template,
(&gst_jpeg_dec_sink_pad_template), "sink"); "sink");
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
gst_pad_set_setcaps_function (dec->sinkpad, gst_pad_set_setcaps_function (dec->sinkpad,
GST_DEBUG_FUNCPTR (gst_jpeg_dec_setcaps)); GST_DEBUG_FUNCPTR (gst_jpeg_dec_setcaps));
@ -241,8 +241,7 @@ gst_jpeg_dec_init (GstJpegDec * dec)
GST_DEBUG_FUNCPTR (gst_jpeg_dec_chain)); GST_DEBUG_FUNCPTR (gst_jpeg_dec_chain));
dec->srcpad = dec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_jpeg_dec_src_pad_template, "src");
(&gst_jpeg_dec_src_pad_template), "src");
gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
/* setup jpeglib */ /* 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 /* do not extract width/height here. we do that in the chain
* function on a per-frame basis (including the line[] array * function on a per-frame basis (including the line[] array
* setup) */ * setup) */
/* But we can take the framerate values and set them on the src pad */
return TRUE; return TRUE;
} }

View file

@ -205,16 +205,14 @@ gst_jpegenc_init (GstJpegEnc * jpegenc)
{ {
/* create the sink and src pads */ /* create the sink and src pads */
jpegenc->sinkpad = jpegenc->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_jpegenc_sink_pad_template, "sink");
(&gst_jpegenc_sink_pad_template), "sink");
gst_pad_set_chain_function (jpegenc->sinkpad, gst_jpegenc_chain); gst_pad_set_chain_function (jpegenc->sinkpad, gst_jpegenc_chain);
gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps); gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps);
gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps); gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps);
gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad); gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad);
jpegenc->srcpad = jpegenc->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_jpegenc_src_pad_template, "src");
(&gst_jpegenc_src_pad_template), "src");
gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps); gst_pad_set_getcaps_function (jpegenc->sinkpad, gst_jpegenc_getcaps);
/*gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps); */ /*gst_pad_set_setcaps_function (jpegenc->sinkpad, gst_jpegenc_setcaps); */
gst_pad_use_fixed_caps (jpegenc->sinkpad); gst_pad_use_fixed_caps (jpegenc->sinkpad);

View file

@ -131,14 +131,13 @@ gst_smokedec_init (GstSmokeDec * smokedec)
/* create the sink and src pads */ /* create the sink and src pads */
smokedec->sinkpad = smokedec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smokedec_sink_pad_template,
(&gst_smokedec_sink_pad_template), "sink"); "sink");
gst_pad_set_chain_function (smokedec->sinkpad, gst_smokedec_chain); gst_pad_set_chain_function (smokedec->sinkpad, gst_smokedec_chain);
gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->sinkpad); gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->sinkpad);
smokedec->srcpad = smokedec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smokedec_src_pad_template, "src");
(&gst_smokedec_src_pad_template), "src");
gst_pad_use_fixed_caps (smokedec->srcpad); gst_pad_use_fixed_caps (smokedec->srcpad);
gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->srcpad); gst_element_add_pad (GST_ELEMENT (smokedec), smokedec->srcpad);

View file

@ -168,16 +168,15 @@ gst_smokeenc_init (GstSmokeEnc * smokeenc)
{ {
/* create the sink and src pads */ /* create the sink and src pads */
smokeenc->sinkpad = smokeenc->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smokeenc_sink_pad_template,
(&gst_smokeenc_sink_pad_template), "sink"); "sink");
gst_pad_set_chain_function (smokeenc->sinkpad, gst_smokeenc_chain); gst_pad_set_chain_function (smokeenc->sinkpad, gst_smokeenc_chain);
gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps); gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps);
gst_pad_set_setcaps_function (smokeenc->sinkpad, gst_smokeenc_setcaps); gst_pad_set_setcaps_function (smokeenc->sinkpad, gst_smokeenc_setcaps);
gst_element_add_pad (GST_ELEMENT (smokeenc), smokeenc->sinkpad); gst_element_add_pad (GST_ELEMENT (smokeenc), smokeenc->sinkpad);
smokeenc->srcpad = smokeenc->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smokeenc_src_pad_template, "src");
(&gst_smokeenc_src_pad_template), "src");
gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps); gst_pad_set_getcaps_function (smokeenc->sinkpad, gst_smokeenc_getcaps);
gst_pad_use_fixed_caps (smokeenc->sinkpad); gst_pad_use_fixed_caps (smokeenc->sinkpad);
/*gst_pad_set_link_function (smokeenc->sinkpad, gst_smokeenc_link); */ /*gst_pad_set_link_function (smokeenc->sinkpad, gst_smokeenc_link); */

View file

@ -149,12 +149,12 @@ gst_mngdec_sinklink (GstPad * pad, const GstCaps * caps)
static void static void
gst_mngdec_init (GstMngDec * mngdec) gst_mngdec_init (GstMngDec * mngdec)
{ {
mngdec->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get mngdec->sinkpad =
(&gst_mngdec_sink_pad_template), "sink"); gst_pad_new_from_static_template (&gst_mngdec_sink_pad_template, "sink");
gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->sinkpad); gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->sinkpad);
mngdec->srcpad = gst_pad_new_from_template (gst_static_pad_template_get mngdec->srcpad =
(&gst_mngdec_src_pad_template), "src"); gst_pad_new_from_static_template (&gst_mngdec_src_pad_template, "src");
gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->srcpad); gst_element_add_pad (GST_ELEMENT (mngdec), mngdec->srcpad);
gst_pad_set_link_function (mngdec->sinkpad, gst_mngdec_sinklink); 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 (mngdec);
gst_object_unref (templ);
return caps; return caps;
} }

View file

@ -127,8 +127,8 @@ gst_pngdec_class_init (GstPngDecClass * klass)
static void static void
gst_pngdec_init (GstPngDec * pngdec) gst_pngdec_init (GstPngDec * pngdec)
{ {
pngdec->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get pngdec->sinkpad =
(&gst_pngdec_sink_pad_template), "sink"); 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_activate_function (pngdec->sinkpad, gst_pngdec_sink_activate);
gst_pad_set_activatepush_function (pngdec->sinkpad, gst_pad_set_activatepush_function (pngdec->sinkpad,
gst_pngdec_sink_activate_push); 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_pad_set_event_function (pngdec->sinkpad, gst_pngdec_sink_event);
gst_element_add_pad (GST_ELEMENT (pngdec), pngdec->sinkpad); gst_element_add_pad (GST_ELEMENT (pngdec), pngdec->sinkpad);
pngdec->srcpad = gst_pad_new_from_template (gst_static_pad_template_get pngdec->srcpad =
(&gst_pngdec_src_pad_template), "src"); gst_pad_new_from_static_template (&gst_pngdec_src_pad_template, "src");
gst_pad_use_fixed_caps (pngdec->srcpad); gst_pad_use_fixed_caps (pngdec->srcpad);
gst_element_add_pad (GST_ELEMENT (pngdec), 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)); res = gst_caps_intersect (caps, gst_pad_template_get_caps (templ));
gst_caps_unref (caps); gst_caps_unref (caps);
gst_object_unref (templ);
if (!gst_pad_set_caps (pngdec->srcpad, res)) { if (!gst_pad_set_caps (pngdec->srcpad, res)) {
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;

View file

@ -186,8 +186,8 @@ static void
gst_pngenc_init (GstPngEnc * pngenc, GstPngEncClass * g_class) gst_pngenc_init (GstPngEnc * pngenc, GstPngEncClass * g_class)
{ {
/* sinkpad */ /* sinkpad */
pngenc->sinkpad = gst_pad_new_from_template pngenc->sinkpad = gst_pad_new_from_static_template
(gst_static_pad_template_get (&pngenc_sink_template), "sink"); (&pngenc_sink_template, "sink");
gst_pad_set_chain_function (pngenc->sinkpad, gst_pngenc_chain); gst_pad_set_chain_function (pngenc->sinkpad, gst_pngenc_chain);
/* gst_pad_set_link_function (pngenc->sinkpad, gst_pngenc_sinklink); */ /* gst_pad_set_link_function (pngenc->sinkpad, gst_pngenc_sinklink); */
/* gst_pad_set_getcaps_function (pngenc->sinkpad, gst_pngenc_sink_getcaps); */ /* 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); gst_element_add_pad (GST_ELEMENT (pngenc), pngenc->sinkpad);
/* srcpad */ /* srcpad */
pngenc->srcpad = gst_pad_new_from_template pngenc->srcpad = gst_pad_new_from_static_template
(gst_static_pad_template_get (&pngenc_src_template), "src"); (&pngenc_src_template, "src");
/* pngenc->srcpad = gst_pad_new ("src", GST_PAD_SRC); */ /* pngenc->srcpad = gst_pad_new ("src", GST_PAD_SRC); */
/* gst_pad_set_getcaps_function (pngenc->srcpad, gst_pngenc_src_getcaps); */ /* gst_pad_set_getcaps_function (pngenc->srcpad, gst_pngenc_src_getcaps); */
/* gst_pad_set_setcaps_function (pngenc->srcpad, gst_pngenc_setcaps); */ /* gst_pad_set_setcaps_function (pngenc->srcpad, gst_pngenc_setcaps); */

View file

@ -208,11 +208,9 @@ static void
gst_mikmod_init (GstMikMod * filter) gst_mikmod_init (GstMikMod * filter)
{ {
filter->sinkpad = filter->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&mikmod_sink_factory, "sink");
(&mikmod_sink_factory), "sink");
filter->srcpad = filter->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&mikmod_src_factory, "src");
(&mikmod_src_factory), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);

View file

@ -129,15 +129,13 @@ static void
gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class) gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class)
{ {
dec->sinkpad = dec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&speex_dec_sink_factory, "sink");
(&speex_dec_sink_factory), "sink");
gst_pad_set_chain_function (dec->sinkpad, speex_dec_chain); gst_pad_set_chain_function (dec->sinkpad, speex_dec_chain);
gst_pad_set_event_function (dec->sinkpad, speex_dec_event); gst_pad_set_event_function (dec->sinkpad, speex_dec_event);
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
dec->srcpad = dec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&speex_dec_src_factory, "src");
(&speex_dec_src_factory), "src");
gst_pad_use_fixed_caps (dec->srcpad); gst_pad_use_fixed_caps (dec->srcpad);
gst_pad_set_event_function (dec->srcpad, speex_dec_src_event); gst_pad_set_event_function (dec->srcpad, speex_dec_src_event);
gst_pad_set_query_type_function (dec->srcpad, speex_get_query_types); gst_pad_set_query_type_function (dec->srcpad, speex_get_query_types);

View file

@ -267,15 +267,13 @@ gst_alpha_init (GstAlpha * alpha)
{ {
/* create the sink and src pads */ /* create the sink and src pads */
alpha->sinkpad = alpha->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_alpha_sink_template, "sink");
(&gst_alpha_sink_template), "sink");
gst_element_add_pad (GST_ELEMENT (alpha), alpha->sinkpad); gst_element_add_pad (GST_ELEMENT (alpha), alpha->sinkpad);
gst_pad_set_chain_function (alpha->sinkpad, gst_alpha_chain); gst_pad_set_chain_function (alpha->sinkpad, gst_alpha_chain);
gst_pad_set_setcaps_function (alpha->sinkpad, gst_alpha_sink_setcaps); gst_pad_set_setcaps_function (alpha->sinkpad, gst_alpha_sink_setcaps);
alpha->srcpad = alpha->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_alpha_src_template, "src");
(&gst_alpha_src_template), "src");
gst_element_add_pad (GST_ELEMENT (alpha), alpha->srcpad); gst_element_add_pad (GST_ELEMENT (alpha), alpha->srcpad);
alpha->alpha = DEFAULT_ALPHA; alpha->alpha = DEFAULT_ALPHA;

View file

@ -112,13 +112,12 @@ static void
gst_au_parse_init (GstAuParse * auparse, GstAuParseClass * klass) gst_au_parse_init (GstAuParse * auparse, GstAuParseClass * klass)
{ {
auparse->sinkpad = auparse->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_au_parse_sink_template, "sink");
(&gst_au_parse_sink_template), "sink");
gst_element_add_pad (GST_ELEMENT (auparse), auparse->sinkpad); gst_element_add_pad (GST_ELEMENT (auparse), auparse->sinkpad);
gst_pad_set_chain_function (auparse->sinkpad, gst_au_parse_chain); gst_pad_set_chain_function (auparse->sinkpad, gst_au_parse_chain);
auparse->srcpad = gst_pad_new_from_template (gst_static_pad_template_get auparse->srcpad =
(&gst_au_parse_src_template), "src"); gst_pad_new_from_static_template (&gst_au_parse_src_template, "src");
gst_pad_use_fixed_caps (auparse->srcpad); gst_pad_use_fixed_caps (auparse->srcpad);
gst_element_add_pad (GST_ELEMENT (auparse), auparse->srcpad); gst_element_add_pad (GST_ELEMENT (auparse), auparse->srcpad);

View file

@ -144,9 +144,7 @@ gst_avi_demux_class_init (GstAviDemuxClass * klass)
static void static void
gst_avi_demux_init (GstAviDemux * avi) gst_avi_demux_init (GstAviDemux * avi)
{ {
avi->sinkpad = avi->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink");
gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ),
"sink");
gst_pad_set_activate_function (avi->sinkpad, gst_avi_demux_sink_activate); gst_pad_set_activate_function (avi->sinkpad, gst_avi_demux_sink_activate);
gst_pad_set_activatepull_function (avi->sinkpad, gst_pad_set_activatepull_function (avi->sinkpad,
gst_avi_demux_sink_activate_pull); gst_avi_demux_sink_activate_pull);
@ -561,6 +559,7 @@ gst_avi_demux_handle_src_event (GstPad * pad, GstEvent * event)
done: done:
gst_event_unref (event); gst_event_unref (event);
GST_DEBUG_OBJECT (avi, "returning %d", res);
return res; return res;
} }
@ -1128,6 +1127,7 @@ gst_avi_demux_parse_stream (GstElement * element, GstBuffer * buf)
if (stream->pad) if (stream->pad)
gst_object_unref (stream->pad); gst_object_unref (stream->pad);
pad = stream->pad = gst_pad_new_from_template (templ, padname); pad = stream->pad = gst_pad_new_from_template (templ, padname);
gst_object_unref (templ);
stream->last_flow = GST_FLOW_OK; stream->last_flow = GST_FLOW_OK;
stream->idx_duration = GST_CLOCK_TIME_NONE; stream->idx_duration = GST_CLOCK_TIME_NONE;
g_free (padname); g_free (padname);

View file

@ -137,11 +137,9 @@ static void
gst_cutter_init (GstCutter * filter, GstCutterClass * g_class) gst_cutter_init (GstCutter * filter, GstCutterClass * g_class)
{ {
filter->sinkpad = filter->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&cutter_sink_factory, "sink");
(&cutter_sink_factory), "sink");
filter->srcpad = filter->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&cutter_src_factory, "src");
(&cutter_src_factory), "src");
filter->threshold_level = CUTTER_DEFAULT_THRESHOLD_LEVEL; filter->threshold_level = CUTTER_DEFAULT_THRESHOLD_LEVEL;
filter->threshold_length = CUTTER_DEFAULT_THRESHOLD_LENGTH; filter->threshold_length = CUTTER_DEFAULT_THRESHOLD_LENGTH;

View file

@ -180,10 +180,8 @@ gst_efence_class_init (GstEFenceClass * klass)
static void static void
gst_efence_init (GstEFence * filter) gst_efence_init (GstEFence * filter)
{ {
GstPadTemplate *tmpl; filter->sinkpad =
gst_pad_new_from_static_template (&gst_efence_sink_factory, "sink");
tmpl = gst_static_pad_template_get (&gst_efence_sink_factory);
filter->sinkpad = gst_pad_new_from_template (tmpl, "sink");
gst_pad_set_getcaps_function (filter->sinkpad, gst_pad_set_getcaps_function (filter->sinkpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps)); GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
gst_pad_set_setcaps_function (filter->sinkpad, gst_pad_set_setcaps_function (filter->sinkpad,
@ -193,10 +191,9 @@ gst_efence_init (GstEFence * filter)
gst_pad_set_bufferalloc_function (filter->sinkpad, gst_pad_set_bufferalloc_function (filter->sinkpad,
GST_DEBUG_FUNCPTR (gst_efence_buffer_alloc)); GST_DEBUG_FUNCPTR (gst_efence_buffer_alloc));
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); 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 =
filter->srcpad = gst_pad_new_from_template (tmpl, "src"); gst_pad_new_from_static_template (&gst_efence_src_factory, "src");
gst_pad_set_getcaps_function (filter->srcpad, gst_pad_set_getcaps_function (filter->srcpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps)); GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
gst_pad_set_setcaps_function (filter->srcpad, 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_DEBUG_FUNCPTR (gst_efence_activate_src_pull));
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
gst_object_unref (tmpl);
filter->fence_top = TRUE; filter->fence_top = TRUE;
} }

View file

@ -179,13 +179,11 @@ static void
gst_negotiation_init (GstNegotiation * filter) gst_negotiation_init (GstNegotiation * filter)
{ {
filter->sinkpad = filter->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_negotiation_sink_factory, "sink");
(&gst_negotiation_sink_factory), "sink");
gst_pad_set_getcaps_function (filter->sinkpad, gst_negotiation_getcaps); gst_pad_set_getcaps_function (filter->sinkpad, gst_negotiation_getcaps);
gst_pad_set_link_function (filter->sinkpad, gst_negotiation_pad_link); gst_pad_set_link_function (filter->sinkpad, gst_negotiation_pad_link);
filter->srcpad = filter->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_negotiation_src_factory, "src");
(&gst_negotiation_src_factory), "src");
gst_pad_set_getcaps_function (filter->srcpad, gst_negotiation_getcaps); gst_pad_set_getcaps_function (filter->srcpad, gst_negotiation_getcaps);
gst_pad_set_link_function (filter->srcpad, gst_negotiation_pad_link); gst_pad_set_link_function (filter->srcpad, gst_negotiation_pad_link);

View file

@ -152,16 +152,12 @@ gst_flxdec_class_init (GstFlxDecClass * klass)
static void static void
gst_flxdec_init (GstFlxDec * flxdec) gst_flxdec_init (GstFlxDec * flxdec)
{ {
flxdec->sinkpad = flxdec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
gst_pad_new_from_template (gst_static_pad_template_get (&sink_factory),
"sink");
gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->sinkpad); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->sinkpad);
gst_pad_set_chain_function (flxdec->sinkpad, gst_flxdec_chain); gst_pad_set_chain_function (flxdec->sinkpad, gst_flxdec_chain);
gst_pad_set_event_function (flxdec->sinkpad, gst_flxdec_sink_event_handler); gst_pad_set_event_function (flxdec->sinkpad, gst_flxdec_sink_event_handler);
flxdec->srcpad = flxdec->srcpad = gst_pad_new_from_static_template (&src_video_factory, "src");
gst_pad_new_from_template (gst_static_pad_template_get
(&src_video_factory), "src");
gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->srcpad); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->srcpad);
gst_pad_set_query_function (flxdec->srcpad, gst_flxdec_src_query_handler); gst_pad_set_query_function (flxdec->srcpad, gst_flxdec_src_query_handler);
gst_pad_set_event_function (flxdec->srcpad, gst_flxdec_src_event_handler); gst_pad_set_event_function (flxdec->srcpad, gst_flxdec_src_event_handler);

View file

@ -156,12 +156,8 @@ static void
gst_goom_init (GstGoom * goom) gst_goom_init (GstGoom * goom)
{ {
/* create the sink and src pads */ /* create the sink and src pads */
goom->sinkpad = goom->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_new_from_template (gst_static_pad_template_get (&sink_template), goom->srcpad = gst_pad_new_from_static_template (&src_template, "src");
"sink");
goom->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get (&src_template),
"src");
gst_element_add_pad (GST_ELEMENT (goom), goom->sinkpad); gst_element_add_pad (GST_ELEMENT (goom), goom->sinkpad);
gst_element_add_pad (GST_ELEMENT (goom), goom->srcpad); gst_element_add_pad (GST_ELEMENT (goom), goom->srcpad);

View file

@ -158,13 +158,12 @@ static void
gst_asteriskh263_init (GstAsteriskh263 * asteriskh263) gst_asteriskh263_init (GstAsteriskh263 * asteriskh263)
{ {
asteriskh263->srcpad = asteriskh263->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_asteriskh263_src_template, "src");
(&gst_asteriskh263_src_template), "src");
gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->srcpad); gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->srcpad);
asteriskh263->sinkpad = asteriskh263->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_asteriskh263_sink_template,
(&gst_asteriskh263_sink_template), "sink"); "sink");
gst_pad_set_chain_function (asteriskh263->sinkpad, gst_asteriskh263_chain); gst_pad_set_chain_function (asteriskh263->sinkpad, gst_asteriskh263_chain);
gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->sinkpad); gst_element_add_pad (GST_ELEMENT (asteriskh263), asteriskh263->sinkpad);

View file

@ -140,11 +140,10 @@ static void
gst_rtp_L16depay_init (GstRtpL16Depay * rtpL16depay) gst_rtp_L16depay_init (GstRtpL16Depay * rtpL16depay)
{ {
rtpL16depay->srcpad = rtpL16depay->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_L16depay_src_template, "src");
(&gst_rtp_L16depay_src_template), "src");
rtpL16depay->sinkpad = rtpL16depay->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_L16depay_sink_template,
(&gst_rtp_L16depay_sink_template), "sink"); "sink");
gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->srcpad); gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->srcpad);
gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->sinkpad); gst_element_add_pad (GST_ELEMENT (rtpL16depay), rtpL16depay->sinkpad);
gst_pad_set_chain_function (rtpL16depay->sinkpad, gst_rtp_L16depay_chain); gst_pad_set_chain_function (rtpL16depay->sinkpad, gst_rtp_L16depay_chain);

View file

@ -137,11 +137,9 @@ static void
gst_rtpL16pay_init (GstRtpL16Pay * rtpL16enc) gst_rtpL16pay_init (GstRtpL16Pay * rtpL16enc)
{ {
rtpL16enc->sinkpad = rtpL16enc->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpL16pay_sink_template, "sink");
(&gst_rtpL16pay_sink_template), "sink");
rtpL16enc->srcpad = rtpL16enc->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpL16pay_src_template, "src");
(&gst_rtpL16pay_src_template), "src");
gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->sinkpad); gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->sinkpad);
gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->srcpad); gst_element_add_pad (GST_ELEMENT (rtpL16enc), rtpL16enc->srcpad);
gst_pad_set_chain_function (rtpL16enc->sinkpad, gst_rtpL16pay_chain); gst_pad_set_chain_function (rtpL16enc->sinkpad, gst_rtpL16pay_chain);

View file

@ -159,14 +159,13 @@ static void
gst_rtp_amr_depay_init (GstRtpAMRDepay * rtpamrdepay) gst_rtp_amr_depay_init (GstRtpAMRDepay * rtpamrdepay)
{ {
rtpamrdepay->srcpad = rtpamrdepay->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_amr_depay_src_template, "src");
(&gst_rtp_amr_depay_src_template), "src");
gst_element_add_pad (GST_ELEMENT (rtpamrdepay), rtpamrdepay->srcpad); gst_element_add_pad (GST_ELEMENT (rtpamrdepay), rtpamrdepay->srcpad);
rtpamrdepay->sinkpad = rtpamrdepay->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_amr_depay_sink_template,
(&gst_rtp_amr_depay_sink_template), "sink"); "sink");
gst_pad_set_setcaps_function (rtpamrdepay->sinkpad, gst_pad_set_setcaps_function (rtpamrdepay->sinkpad,
gst_rtp_amr_depay_sink_setcaps); gst_rtp_amr_depay_sink_setcaps);
gst_pad_set_chain_function (rtpamrdepay->sinkpad, gst_rtp_amr_depay_chain); gst_pad_set_chain_function (rtpamrdepay->sinkpad, gst_rtp_amr_depay_chain);

View file

@ -154,30 +154,30 @@ gst_rtp_depay_init (GstRTPDepay * rtpdepay)
{ {
/* the input rtp pad */ /* the input rtp pad */
rtpdepay->sink_rtp = rtpdepay->sink_rtp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtp_template,
(&gst_rtp_depay_sink_rtp_template), "sinkrtp"); "sinkrtp");
gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtp); 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_getcaps_function (rtpdepay->sink_rtp, gst_rtp_depay_getcaps);
gst_pad_set_chain_function (rtpdepay->sink_rtp, gst_rtp_depay_chain_rtp); gst_pad_set_chain_function (rtpdepay->sink_rtp, gst_rtp_depay_chain_rtp);
/* the input rtcp pad */ /* the input rtcp pad */
rtpdepay->sink_rtcp = rtpdepay->sink_rtcp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtcp_template,
(&gst_rtp_depay_sink_rtcp_template), "sinkrtcp"); "sinkrtcp");
gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtcp); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtcp);
gst_pad_set_chain_function (rtpdepay->sink_rtcp, gst_rtp_depay_chain_rtcp); gst_pad_set_chain_function (rtpdepay->sink_rtcp, gst_rtp_depay_chain_rtcp);
/* the output rtp pad */ /* the output rtp pad */
rtpdepay->src_rtp = rtpdepay->src_rtp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_depay_src_rtp_template,
(&gst_rtp_depay_src_rtp_template), "srcrtp"); "srcrtp");
gst_pad_set_getcaps_function (rtpdepay->src_rtp, gst_rtp_depay_getcaps); gst_pad_set_getcaps_function (rtpdepay->src_rtp, gst_rtp_depay_getcaps);
gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtp); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtp);
/* the output rtcp pad */ /* the output rtcp pad */
rtpdepay->src_rtcp = rtpdepay->src_rtcp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_depay_src_rtcp_template,
(&gst_rtp_depay_src_rtcp_template), "srcrtcp"); "srcrtcp");
gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtcp); gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtcp);
} }

View file

@ -134,13 +134,12 @@ static void
gst_rtp_mpa_depay_init (GstRtpMPADepay * rtpmpadepay) gst_rtp_mpa_depay_init (GstRtpMPADepay * rtpmpadepay)
{ {
rtpmpadepay->srcpad = rtpmpadepay->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_mpa_depay_src_template, "src");
(&gst_rtp_mpa_depay_src_template), "src");
gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->srcpad); gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->srcpad);
rtpmpadepay->sinkpad = rtpmpadepay->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtp_mpa_depay_sink_template,
(&gst_rtp_mpa_depay_sink_template), "sink"); "sink");
gst_pad_set_chain_function (rtpmpadepay->sinkpad, gst_rtp_mpa_depay_chain); gst_pad_set_chain_function (rtpmpadepay->sinkpad, gst_rtp_mpa_depay_chain);
gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->sinkpad); gst_element_add_pad (GST_ELEMENT (rtpmpadepay), rtpmpadepay->sinkpad);
} }

View file

@ -151,30 +151,29 @@ gst_rtpdec_init (GstRTPDec * rtpdec)
{ {
/* the input rtp pad */ /* the input rtp pad */
rtpdec->sink_rtp = rtpdec->sink_rtp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpdec_sink_rtp_template,
(&gst_rtpdec_sink_rtp_template), "sinkrtp"); "sinkrtp");
gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtp); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtp);
gst_pad_set_getcaps_function (rtpdec->sink_rtp, gst_rtpdec_getcaps); gst_pad_set_getcaps_function (rtpdec->sink_rtp, gst_rtpdec_getcaps);
gst_pad_set_chain_function (rtpdec->sink_rtp, gst_rtpdec_chain_rtp); gst_pad_set_chain_function (rtpdec->sink_rtp, gst_rtpdec_chain_rtp);
/* the input rtcp pad */ /* the input rtcp pad */
rtpdec->sink_rtcp = rtpdec->sink_rtcp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpdec_sink_rtcp_template,
(&gst_rtpdec_sink_rtcp_template), "sinkrtcp"); "sinkrtcp");
gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtcp); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->sink_rtcp);
gst_pad_set_chain_function (rtpdec->sink_rtcp, gst_rtpdec_chain_rtcp); gst_pad_set_chain_function (rtpdec->sink_rtcp, gst_rtpdec_chain_rtcp);
/* the output rtp pad */ /* the output rtp pad */
rtpdec->src_rtp = rtpdec->src_rtp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpdec_src_rtp_template, "srcrtp");
(&gst_rtpdec_src_rtp_template), "srcrtp");
gst_pad_set_getcaps_function (rtpdec->src_rtp, gst_rtpdec_getcaps); gst_pad_set_getcaps_function (rtpdec->src_rtp, gst_rtpdec_getcaps);
gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtp); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtp);
/* the output rtcp pad */ /* the output rtcp pad */
rtpdec->src_rtcp = rtpdec->src_rtcp =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_rtpdec_src_rtcp_template,
(&gst_rtpdec_src_rtcp_template), "srcrtcp"); "srcrtcp");
gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtcp); gst_element_add_pad (GST_ELEMENT (rtpdec), rtpdec->src_rtcp);
} }

View file

@ -262,20 +262,17 @@ static void
gst_smpte_init (GstSMPTE * smpte) gst_smpte_init (GstSMPTE * smpte)
{ {
smpte->sinkpad1 = smpte->sinkpad1 =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smpte_sink1_template, "sink1");
(&gst_smpte_sink1_template), "sink1");
gst_pad_set_setcaps_function (smpte->sinkpad1, gst_smpte_setcaps); gst_pad_set_setcaps_function (smpte->sinkpad1, gst_smpte_setcaps);
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1);
smpte->sinkpad2 = smpte->sinkpad2 =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smpte_sink2_template, "sink2");
(&gst_smpte_sink2_template), "sink2");
gst_pad_set_setcaps_function (smpte->sinkpad2, gst_smpte_setcaps); gst_pad_set_setcaps_function (smpte->sinkpad2, gst_smpte_setcaps);
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2);
smpte->srcpad = smpte->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&gst_smpte_src_template, "src");
(&gst_smpte_src_template), "src");
gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad); gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad);
smpte->collect = gst_collect_pads_new (); smpte->collect = gst_collect_pads_new ();

View file

@ -221,8 +221,7 @@ gst_wavparse_init (GstWavParse * wavparse)
/* sink */ /* sink */
wavparse->sinkpad = wavparse->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get gst_pad_new_from_static_template (&sink_template_factory, "sink");
(&sink_template_factory), "sink");
gst_pad_set_activate_function (wavparse->sinkpad, gst_pad_set_activate_function (wavparse->sinkpad,
GST_DEBUG_FUNCPTR (gst_wavparse_sink_activate)); GST_DEBUG_FUNCPTR (gst_wavparse_sink_activate));
gst_pad_set_activatepull_function (wavparse->sinkpad, gst_pad_set_activatepull_function (wavparse->sinkpad,
@ -242,15 +241,12 @@ gst_wavparse_destroy_sourcepad (GstWavParse * wavparse)
static void static void
gst_wavparse_create_sourcepad (GstWavParse * wavparse) gst_wavparse_create_sourcepad (GstWavParse * wavparse)
{ {
GstPadTemplate *templ;
/* destroy previous one */ /* destroy previous one */
gst_wavparse_destroy_sourcepad (wavparse); gst_wavparse_destroy_sourcepad (wavparse);
/* source */ /* source */
templ = gst_static_pad_template_get (&src_template_factory); wavparse->srcpad =
wavparse->srcpad = gst_pad_new_from_template (templ, "src"); gst_pad_new_from_static_template (&src_template_factory, "src");
gst_object_unref (templ);
gst_pad_use_fixed_caps (wavparse->srcpad); gst_pad_use_fixed_caps (wavparse->srcpad);
gst_pad_set_query_type_function (wavparse->srcpad, gst_pad_set_query_type_function (wavparse->srcpad,
GST_DEBUG_FUNCPTR (gst_wavparse_get_query_types)); GST_DEBUG_FUNCPTR (gst_wavparse_get_query_types));