summaryrefslogtreecommitdiffstats
path: root/ext/shout
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-01-06 20:42:03 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-01-06 20:42:03 +0000
commitc8e0a3a743efb293d1786ad454221e13a960184a (patch)
treea984be8ab483cb4f2590d04a9198171f89c63ceb /ext/shout
parent68d66772de8370fb8866fded21d5ed15b071e60c (diff)
downloadgst-plugins-bad-c8e0a3a743efb293d1786ad454221e13a960184a.tar.gz
gst-plugins-bad-c8e0a3a743efb293d1786ad454221e13a960184a.tar.bz2
gst-plugins-bad-c8e0a3a743efb293d1786ad454221e13a960184a.zip
This should have been committed along with the changelog entry a few hours ago
Original commit message from CVS: This should have been committed along with the changelog entry a few hours ago
Diffstat (limited to 'ext/shout')
-rw-r--r--ext/shout/gstshout.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/ext/shout/gstshout.c b/ext/shout/gstshout.c
index 144835fe..0a8ee186 100644
--- a/ext/shout/gstshout.c
+++ b/ext/shout/gstshout.c
@@ -63,29 +63,16 @@ enum {
ARG_IRC, /* IRC server (shoutcast only) */
};
-static GstPadTemplate*
-sink_template_factory (void)
-{
- static GstPadTemplate *template = NULL;
-
- if (!template) {
- template = gst_pad_template_new (
- "sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
- gst_caps_new (
- "icecastsend_sink",
- "audio/mpeg",
- gst_props_new (
- "mpegversion", GST_PROPS_INT (1),
- "layer", GST_PROPS_INT_RANGE (1, 3),
- NULL
- )),
- NULL);
- }
-
- return template;
-}
+static GstStaticPadTemplate sink_template_factory =
+GST_STATIC_PAD_TEMPLATE (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/mpeg, "
+ "mpegversion = (int) 1, "
+ "layer = (int) [ 1, 3 ]"
+ )
+);
static void gst_icecastsend_class_init (GstIcecastSendClass *klass);
static void gst_icecastsend_base_init (GstIcecastSendClass *klass);
@@ -125,7 +112,8 @@ gst_icecastsend_base_init (GstIcecastSendClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
- gst_element_class_add_pad_template (element_class, sink_template_factory());
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&sink_template_factory));
gst_element_class_set_details (element_class, &icecastsend_details);
}
@@ -204,7 +192,10 @@ gst_icecastsend_class_init (GstIcecastSendClass *klass)
static void
gst_icecastsend_init (GstIcecastSend *icecastsend)
{
- icecastsend->sinkpad = gst_pad_new_from_template (sink_template_factory (), "sink");
+ GstElementClass *klass = GST_ELEMENT_GET_CLASS (icecastsend);
+
+ icecastsend->sinkpad = gst_pad_new_from_template (
+ gst_element_class_get_pad_template (klass, "sink"), "sink");
gst_element_add_pad(GST_ELEMENT(icecastsend),icecastsend->sinkpad);
gst_pad_set_chain_function(icecastsend->sinkpad,gst_icecastsend_chain);