gst/: s/gst_pad_new/&_from_template/ register pad templates in the base_init function...
authorBenjamin Otte <otte@gnome.org>
Tue, 17 Aug 2004 14:11:23 +0000 (14:11 +0000)
committerBenjamin Otte <otte@gnome.org>
Tue, 17 Aug 2004 14:11:23 +0000 (14:11 +0000)
Original commit message from CVS:
* gst/autoplug/gstspideridentity.c:
(gst_spider_identity_request_new_pad):
* gst/elements/gstaggregator.c: (gst_aggregator_base_init),
(gst_aggregator_init):
* gst/elements/gstfakesink.c: (gst_fakesink_base_init),
(gst_fakesink_init):
* gst/elements/gstfakesrc.c: (gst_fakesrc_base_init),
(gst_fakesrc_init):
* gst/elements/gstfdsink.c: (gst_fdsink_base_init),
(gst_fdsink_init):
* gst/elements/gstfdsrc.c: (gst_fdsrc_base_init), (gst_fdsrc_init):
* gst/elements/gstfilesink.c: (gst_filesink_base_init),
(gst_filesink_init):
* gst/elements/gstfilesrc.c: (gst_filesrc_base_init),
(gst_filesrc_init):
* gst/elements/gstidentity.c: (gst_identity_base_init),
(gst_identity_init):
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_base_init),
(gst_multifilesrc_init):
* gst/elements/gstpipefilter.c: (gst_pipefilter_base_init),
(gst_pipefilter_init):
* gst/elements/gststatistics.c: (gst_statistics_base_init),
(gst_statistics_init):
* gst/elements/gsttee.c: (gst_tee_base_init), (gst_tee_init):
* gst/gstqueue.c: (gst_queue_base_init), (gst_queue_init):
s/gst_pad_new/&_from_template/
register pad templates in the base_init function
add static pad template definitions

28 files changed:
ChangeLog
gst/autoplug/gstspideridentity.c
gst/elements/gstaggregator.c
gst/elements/gstfakesink.c
gst/elements/gstfakesrc.c
gst/elements/gstfdsink.c
gst/elements/gstfdsrc.c
gst/elements/gstfilesink.c
gst/elements/gstfilesrc.c
gst/elements/gstidentity.c
gst/elements/gstmultifilesrc.c
gst/elements/gstpipefilter.c
gst/elements/gststatistics.c
gst/elements/gsttee.c
gst/gstqueue.c
plugins/elements/gstaggregator.c
plugins/elements/gstfakesink.c
plugins/elements/gstfakesrc.c
plugins/elements/gstfdsink.c
plugins/elements/gstfdsrc.c
plugins/elements/gstfilesink.c
plugins/elements/gstfilesrc.c
plugins/elements/gstidentity.c
plugins/elements/gstmultifilesrc.c
plugins/elements/gstpipefilter.c
plugins/elements/gstqueue.c
plugins/elements/gststatistics.c
plugins/elements/gsttee.c

index 0666ba8..7dfd690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,36 @@
 2004-08-17  Benjamin Otte  <in7y118@public.uni-hamburg.de>
 
+       * gst/autoplug/gstspideridentity.c:
+       (gst_spider_identity_request_new_pad):
+       * gst/elements/gstaggregator.c: (gst_aggregator_base_init),
+       (gst_aggregator_init):
+       * gst/elements/gstfakesink.c: (gst_fakesink_base_init),
+       (gst_fakesink_init):
+       * gst/elements/gstfakesrc.c: (gst_fakesrc_base_init),
+       (gst_fakesrc_init):
+       * gst/elements/gstfdsink.c: (gst_fdsink_base_init),
+       (gst_fdsink_init):
+       * gst/elements/gstfdsrc.c: (gst_fdsrc_base_init), (gst_fdsrc_init):
+       * gst/elements/gstfilesink.c: (gst_filesink_base_init),
+       (gst_filesink_init):
+       * gst/elements/gstfilesrc.c: (gst_filesrc_base_init),
+       (gst_filesrc_init):
+       * gst/elements/gstidentity.c: (gst_identity_base_init),
+       (gst_identity_init):
+       * gst/elements/gstmultifilesrc.c: (gst_multifilesrc_base_init),
+       (gst_multifilesrc_init):
+       * gst/elements/gstpipefilter.c: (gst_pipefilter_base_init),
+       (gst_pipefilter_init):
+       * gst/elements/gststatistics.c: (gst_statistics_base_init),
+       (gst_statistics_init):
+       * gst/elements/gsttee.c: (gst_tee_base_init), (gst_tee_init):
+       * gst/gstqueue.c: (gst_queue_base_init), (gst_queue_init):
+         s/gst_pad_new/&_from_template/
+         register pad templates in the base_init function
+         add static pad template definitions
+
+2004-08-17  Benjamin Otte  <in7y118@public.uni-hamburg.de>
+
        * testsuite/bytestream/gstbstest.c: (gst_bstest_init):
        * testsuite/dynparams/dparamstest.c: (gst_dptest_init):
        * testsuite/refcounting/pad.c: (main):
index 94a4cf7..b493139 100644 (file)
@@ -319,7 +319,9 @@ gst_spider_identity_request_new_pad (GstElement * element,
         break;
       /* sink */
       GST_DEBUG ("element %s requests new sink pad", GST_ELEMENT_NAME (ident));
-      ident->sink = gst_pad_new ("sink", GST_PAD_SINK);
+      ident->sink =
+          gst_pad_new_from_template (gst_static_pad_template_get
+          (&spider_sink_factory), "sink");
       gst_element_add_pad (GST_ELEMENT (ident), ident->sink);
       gst_pad_set_link_function (ident->sink,
           GST_DEBUG_FUNCPTR (gst_spider_identity_link));
@@ -331,7 +333,9 @@ gst_spider_identity_request_new_pad (GstElement * element,
       if (ident->src != NULL)
         break;
       GST_DEBUG ("element %s requests new src pad", GST_ELEMENT_NAME (ident));
-      ident->src = gst_pad_new ("src", GST_PAD_SRC);
+      ident->src =
+          gst_pad_new_from_template (gst_static_pad_template_get
+          (&spider_src_factory), "src");
       gst_element_add_pad (GST_ELEMENT (ident), ident->src);
       gst_pad_set_link_function (ident->src,
           GST_DEBUG_FUNCPTR (gst_spider_identity_link));
index 48343e6..702bfb8 100644 (file)
 
 #include "gstaggregator.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
 #define GST_CAT_DEFAULT gst_aggregator_debug
 
@@ -105,6 +110,8 @@ gst_aggregator_base_init (gpointer g_class)
 
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&aggregator_src_template));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_aggregator_details);
 }
 
@@ -155,7 +162,9 @@ gst_aggregator_class_init (GstAggregatorClass * klass)
 static void
 gst_aggregator_init (GstAggregator * aggregator)
 {
-  aggregator->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  aggregator->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_getcaps_function (aggregator->srcpad, gst_pad_proxy_getcaps);
   gst_element_add_pad (GST_ELEMENT (aggregator), aggregator->srcpad);
 
index e9f1653..e872122 100644 (file)
 #include "gstfakesink.h"
 #include <gst/gstmarshal.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
 #define GST_CAT_DEFAULT gst_fakesink_debug
 
@@ -117,6 +122,8 @@ gst_fakesink_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&fakesink_sink_template));
@@ -177,7 +184,9 @@ gst_fakesink_init (GstFakeSink * fakesink)
 {
   GstPad *pad;
 
-  pad = gst_pad_new ("sink", GST_PAD_SINK);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (fakesink), pad);
   gst_pad_set_chain_function (pad, GST_DEBUG_FUNCPTR (gst_fakesink_chain));
 
index 78d4dab..5184b9f 100644 (file)
 #define DEFAULT_SIZEMAX                4096
 #define DEFAULT_PARENTSIZE     4096*10
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
 #define GST_CAT_DEFAULT gst_fakesrc_debug
 
@@ -188,6 +193,8 @@ gst_fakesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&fakesrc_src_template));
@@ -276,7 +283,9 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
   GstPad *pad;
 
   /* create our first output pad */
-  pad = gst_pad_new ("src", GST_PAD_SRC);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (fakesrc), pad);
 
   fakesrc->loop_based = FALSE;
index 93f8f57..411dd0a 100644 (file)
 #include <unistd.h>
 #endif
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
 #define GST_CAT_DEFAULT gst_fdsink_debug
 
@@ -72,6 +77,8 @@ gst_fdsink_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_fdsink_details);
 }
 static void
@@ -93,7 +100,9 @@ gst_fdsink_class_init (GstFdSinkClass * klass)
 static void
 gst_fdsink_init (GstFdSink * fdsink)
 {
-  fdsink->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  fdsink->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (fdsink), fdsink->sinkpad);
   gst_pad_set_chain_function (fdsink->sinkpad, gst_fdsink_chain);
 
index cd4fe15..ca33db3 100644 (file)
 
 #define DEFAULT_BLOCKSIZE      4096
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
 #define GST_CAT_DEFAULT gst_fdsrc_debug
 
@@ -86,6 +91,8 @@ gst_fdsrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_fdsrc_details);
 }
 static void
@@ -121,7 +128,9 @@ gst_fdsrc_class_init (GstFdSrcClass * klass)
 static void
 gst_fdsrc_init (GstFdSrc * fdsrc)
 {
-  fdsrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  fdsrc->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
 
   gst_pad_set_get_function (fdsrc->srcpad, gst_fdsrc_get);
   gst_element_add_pad (GST_ELEMENT (fdsrc), fdsrc->srcpad);
index bd670da..3b38881 100644 (file)
 #endif
 
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
 #define GST_CAT_DEFAULT gst_filesink_debug
 
@@ -131,6 +136,8 @@ gst_filesink_base_init (gpointer g_class)
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
   gstelement_class->change_state = gst_filesink_change_state;
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_filesink_details);
 }
 static void
@@ -157,7 +164,9 @@ gst_filesink_init (GstFileSink * filesink)
 {
   GstPad *pad;
 
-  pad = gst_pad_new ("sink", GST_PAD_SINK);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (filesink), pad);
   gst_pad_set_chain_function (pad, gst_filesink_chain);
 
index ba18487..2a21eb6 100644 (file)
 
 #include "../gst-i18n-lib.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 /* FIXME we should be using glib for this */
 #ifndef S_ISREG
 #define S_ISREG(mode) ((mode)&_S_IFREG)
@@ -197,6 +202,8 @@ gst_filesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
 }
 static void
@@ -237,7 +244,9 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
 static void
 gst_filesrc_init (GstFileSrc * src)
 {
-  src->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  src->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (src->srcpad, gst_filesrc_get);
   gst_pad_set_event_function (src->srcpad, gst_filesrc_srcpad_event);
   gst_pad_set_event_mask_function (src->srcpad, gst_filesrc_get_event_mask);
index 44a703d..49ec840 100644 (file)
 #include "gstidentity.h"
 #include <gst/gstmarshal.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
 #define GST_CAT_DEFAULT gst_identity_debug
 
@@ -87,6 +97,10 @@ gst_identity_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_identity_details);
 }
 
@@ -162,14 +176,18 @@ gst_identity_class_init (GstIdentityClass * klass)
 static void
 gst_identity_init (GstIdentity * identity)
 {
-  identity->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  identity->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
   gst_pad_set_chain_function (identity->sinkpad,
       GST_DEBUG_FUNCPTR (gst_identity_chain));
   gst_pad_set_link_function (identity->sinkpad, gst_pad_proxy_pad_link);
   gst_pad_set_getcaps_function (identity->sinkpad, gst_pad_proxy_getcaps);
 
-  identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  identity->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
   gst_pad_set_link_function (identity->srcpad, gst_pad_proxy_pad_link);
   gst_pad_set_getcaps_function (identity->srcpad, gst_pad_proxy_getcaps);
index fd32423..f781844 100644 (file)
 
 #include "gstmultifilesrc.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_multifilesrc_debug);
 #define GST_CAT_DEFAULT gst_multifilesrc_debug
 
@@ -89,6 +94,8 @@ gst_multifilesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_multifilesrc_details);
 }
 static void
@@ -125,7 +132,9 @@ gst_multifilesrc_init (GstMultiFileSrc * multifilesrc)
 {
 /*  GST_FLAG_SET (filesrc, GST_SRC_); */
 
-  multifilesrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  multifilesrc->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (multifilesrc->srcpad, gst_multifilesrc_get);
 /*  gst_pad_set_getregion_function (multifilesrc->srcpad,gst_multifilesrc_get_region); */
   gst_element_add_pad (GST_ELEMENT (multifilesrc), multifilesrc->srcpad);
index c141186..f802124 100644 (file)
 #include "../gst-i18n-lib.h"
 #include "gstpipefilter.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
 #define GST_CAT_DEFAULT gst_pipefilter_debug
 
@@ -83,6 +93,10 @@ gst_pipefilter_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_pipefilter_details);
 }
 static void
@@ -108,11 +122,15 @@ gst_pipefilter_init (GstPipefilter * pipefilter)
 {
   GST_FLAG_SET (pipefilter, GST_ELEMENT_DECOUPLED);
 
-  pipefilter->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  pipefilter->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->sinkpad);
   gst_pad_set_chain_function (pipefilter->sinkpad, gst_pipefilter_chain);
 
-  pipefilter->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  pipefilter->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->srcpad);
   gst_pad_set_get_function (pipefilter->srcpad, gst_pipefilter_get);
 
index a8f2239..82744ff 100644 (file)
 
 #include "gststatistics.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_statistics_debug);
 #define GST_CAT_DEFAULT gst_statistics_debug
 
@@ -84,6 +94,10 @@ gst_statistics_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_statistics_details);
 }
 
@@ -155,12 +169,16 @@ gst_statistics_class_init (GstStatisticsClass * klass)
 static void
 gst_statistics_init (GstStatistics * statistics)
 {
-  statistics->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  statistics->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (statistics), statistics->sinkpad);
   gst_pad_set_chain_function (statistics->sinkpad,
       GST_DEBUG_FUNCPTR (gst_statistics_chain));
 
-  statistics->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  statistics->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (statistics), statistics->srcpad);
 
   statistics->timer = NULL;
index 05194ff..d29336d 100644 (file)
 
 #include <string.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_tee_debug);
 #define GST_CAT_DEFAULT gst_tee_debug
 
@@ -80,6 +85,8 @@ gst_tee_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_tee_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&tee_src_template));
@@ -129,7 +136,9 @@ gst_tee_class_init (GstTeeClass * klass)
 static void
 gst_tee_init (GstTee * tee)
 {
-  tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  tee->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
   gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
   gst_pad_set_link_function (tee->sinkpad,
index f4f9230..00d585a 100644 (file)
 #include "gstinfo.h"
 #include "gsterror.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
 
 static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue",
@@ -170,6 +180,10 @@ gst_queue_base_init (GstQueueClass * klass)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_queue_details);
 }
 
@@ -265,7 +279,9 @@ gst_queue_init (GstQueue * queue)
   GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED);
   GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE);
 
-  queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  queue->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_pad_set_chain_function (queue->sinkpad,
       GST_DEBUG_FUNCPTR (gst_queue_chain));
   gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
@@ -275,7 +291,9 @@ gst_queue_init (GstQueue * queue)
       GST_DEBUG_FUNCPTR (gst_queue_getcaps));
   gst_pad_set_active (queue->sinkpad, TRUE);
 
-  queue->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  queue->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get));
   gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad);
   gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link));
index 48343e6..702bfb8 100644 (file)
 
 #include "gstaggregator.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
 #define GST_CAT_DEFAULT gst_aggregator_debug
 
@@ -105,6 +110,8 @@ gst_aggregator_base_init (gpointer g_class)
 
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&aggregator_src_template));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_aggregator_details);
 }
 
@@ -155,7 +162,9 @@ gst_aggregator_class_init (GstAggregatorClass * klass)
 static void
 gst_aggregator_init (GstAggregator * aggregator)
 {
-  aggregator->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  aggregator->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_getcaps_function (aggregator->srcpad, gst_pad_proxy_getcaps);
   gst_element_add_pad (GST_ELEMENT (aggregator), aggregator->srcpad);
 
index e9f1653..e872122 100644 (file)
 #include "gstfakesink.h"
 #include <gst/gstmarshal.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
 #define GST_CAT_DEFAULT gst_fakesink_debug
 
@@ -117,6 +122,8 @@ gst_fakesink_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&fakesink_sink_template));
@@ -177,7 +184,9 @@ gst_fakesink_init (GstFakeSink * fakesink)
 {
   GstPad *pad;
 
-  pad = gst_pad_new ("sink", GST_PAD_SINK);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (fakesink), pad);
   gst_pad_set_chain_function (pad, GST_DEBUG_FUNCPTR (gst_fakesink_chain));
 
index 78d4dab..5184b9f 100644 (file)
 #define DEFAULT_SIZEMAX                4096
 #define DEFAULT_PARENTSIZE     4096*10
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
 #define GST_CAT_DEFAULT gst_fakesrc_debug
 
@@ -188,6 +193,8 @@ gst_fakesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&fakesrc_src_template));
@@ -276,7 +283,9 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
   GstPad *pad;
 
   /* create our first output pad */
-  pad = gst_pad_new ("src", GST_PAD_SRC);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (fakesrc), pad);
 
   fakesrc->loop_based = FALSE;
index 93f8f57..411dd0a 100644 (file)
 #include <unistd.h>
 #endif
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
 #define GST_CAT_DEFAULT gst_fdsink_debug
 
@@ -72,6 +77,8 @@ gst_fdsink_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_fdsink_details);
 }
 static void
@@ -93,7 +100,9 @@ gst_fdsink_class_init (GstFdSinkClass * klass)
 static void
 gst_fdsink_init (GstFdSink * fdsink)
 {
-  fdsink->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  fdsink->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (fdsink), fdsink->sinkpad);
   gst_pad_set_chain_function (fdsink->sinkpad, gst_fdsink_chain);
 
index cd4fe15..ca33db3 100644 (file)
 
 #define DEFAULT_BLOCKSIZE      4096
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
 #define GST_CAT_DEFAULT gst_fdsrc_debug
 
@@ -86,6 +91,8 @@ gst_fdsrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_fdsrc_details);
 }
 static void
@@ -121,7 +128,9 @@ gst_fdsrc_class_init (GstFdSrcClass * klass)
 static void
 gst_fdsrc_init (GstFdSrc * fdsrc)
 {
-  fdsrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  fdsrc->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
 
   gst_pad_set_get_function (fdsrc->srcpad, gst_fdsrc_get);
   gst_element_add_pad (GST_ELEMENT (fdsrc), fdsrc->srcpad);
index bd670da..3b38881 100644 (file)
 #endif
 
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
 #define GST_CAT_DEFAULT gst_filesink_debug
 
@@ -131,6 +136,8 @@ gst_filesink_base_init (gpointer g_class)
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
   gstelement_class->change_state = gst_filesink_change_state;
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_filesink_details);
 }
 static void
@@ -157,7 +164,9 @@ gst_filesink_init (GstFileSink * filesink)
 {
   GstPad *pad;
 
-  pad = gst_pad_new ("sink", GST_PAD_SINK);
+  pad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (filesink), pad);
   gst_pad_set_chain_function (pad, gst_filesink_chain);
 
index ba18487..2a21eb6 100644 (file)
 
 #include "../gst-i18n-lib.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 /* FIXME we should be using glib for this */
 #ifndef S_ISREG
 #define S_ISREG(mode) ((mode)&_S_IFREG)
@@ -197,6 +202,8 @@ gst_filesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
 }
 static void
@@ -237,7 +244,9 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
 static void
 gst_filesrc_init (GstFileSrc * src)
 {
-  src->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  src->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (src->srcpad, gst_filesrc_get);
   gst_pad_set_event_function (src->srcpad, gst_filesrc_srcpad_event);
   gst_pad_set_event_mask_function (src->srcpad, gst_filesrc_get_event_mask);
index 44a703d..49ec840 100644 (file)
 #include "gstidentity.h"
 #include <gst/gstmarshal.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
 #define GST_CAT_DEFAULT gst_identity_debug
 
@@ -87,6 +97,10 @@ gst_identity_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_identity_details);
 }
 
@@ -162,14 +176,18 @@ gst_identity_class_init (GstIdentityClass * klass)
 static void
 gst_identity_init (GstIdentity * identity)
 {
-  identity->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  identity->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
   gst_pad_set_chain_function (identity->sinkpad,
       GST_DEBUG_FUNCPTR (gst_identity_chain));
   gst_pad_set_link_function (identity->sinkpad, gst_pad_proxy_pad_link);
   gst_pad_set_getcaps_function (identity->sinkpad, gst_pad_proxy_getcaps);
 
-  identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  identity->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
   gst_pad_set_link_function (identity->srcpad, gst_pad_proxy_pad_link);
   gst_pad_set_getcaps_function (identity->srcpad, gst_pad_proxy_getcaps);
index fd32423..f781844 100644 (file)
 
 #include "gstmultifilesrc.h"
 
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_multifilesrc_debug);
 #define GST_CAT_DEFAULT gst_multifilesrc_debug
 
@@ -89,6 +94,8 @@ gst_multifilesrc_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
   gst_element_class_set_details (gstelement_class, &gst_multifilesrc_details);
 }
 static void
@@ -125,7 +132,9 @@ gst_multifilesrc_init (GstMultiFileSrc * multifilesrc)
 {
 /*  GST_FLAG_SET (filesrc, GST_SRC_); */
 
-  multifilesrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  multifilesrc->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (multifilesrc->srcpad, gst_multifilesrc_get);
 /*  gst_pad_set_getregion_function (multifilesrc->srcpad,gst_multifilesrc_get_region); */
   gst_element_add_pad (GST_ELEMENT (multifilesrc), multifilesrc->srcpad);
index c141186..f802124 100644 (file)
 #include "../gst-i18n-lib.h"
 #include "gstpipefilter.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
 #define GST_CAT_DEFAULT gst_pipefilter_debug
 
@@ -83,6 +93,10 @@ gst_pipefilter_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_pipefilter_details);
 }
 static void
@@ -108,11 +122,15 @@ gst_pipefilter_init (GstPipefilter * pipefilter)
 {
   GST_FLAG_SET (pipefilter, GST_ELEMENT_DECOUPLED);
 
-  pipefilter->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  pipefilter->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->sinkpad);
   gst_pad_set_chain_function (pipefilter->sinkpad, gst_pipefilter_chain);
 
-  pipefilter->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  pipefilter->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->srcpad);
   gst_pad_set_get_function (pipefilter->srcpad, gst_pipefilter_get);
 
index f4f9230..00d585a 100644 (file)
 #include "gstinfo.h"
 #include "gsterror.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
 
 static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue",
@@ -170,6 +180,10 @@ gst_queue_base_init (GstQueueClass * klass)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_queue_details);
 }
 
@@ -265,7 +279,9 @@ gst_queue_init (GstQueue * queue)
   GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED);
   GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE);
 
-  queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  queue->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_pad_set_chain_function (queue->sinkpad,
       GST_DEBUG_FUNCPTR (gst_queue_chain));
   gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
@@ -275,7 +291,9 @@ gst_queue_init (GstQueue * queue)
       GST_DEBUG_FUNCPTR (gst_queue_getcaps));
   gst_pad_set_active (queue->sinkpad, TRUE);
 
-  queue->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  queue->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get));
   gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad);
   gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link));
index a8f2239..82744ff 100644 (file)
 
 #include "gststatistics.h"
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_statistics_debug);
 #define GST_CAT_DEFAULT gst_statistics_debug
 
@@ -84,6 +94,10 @@ gst_statistics_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_statistics_details);
 }
 
@@ -155,12 +169,16 @@ gst_statistics_class_init (GstStatisticsClass * klass)
 static void
 gst_statistics_init (GstStatistics * statistics)
 {
-  statistics->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  statistics->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (statistics), statistics->sinkpad);
   gst_pad_set_chain_function (statistics->sinkpad,
       GST_DEBUG_FUNCPTR (gst_statistics_chain));
 
-  statistics->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+  statistics->srcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
   gst_element_add_pad (GST_ELEMENT (statistics), statistics->srcpad);
 
   statistics->timer = NULL;
index 05194ff..d29336d 100644 (file)
 
 #include <string.h>
 
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
 GST_DEBUG_CATEGORY_STATIC (gst_tee_debug);
 #define GST_CAT_DEFAULT gst_tee_debug
 
@@ -80,6 +85,8 @@ gst_tee_base_init (gpointer g_class)
 {
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sinktemplate));
   gst_element_class_set_details (gstelement_class, &gst_tee_details);
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&tee_src_template));
@@ -129,7 +136,9 @@ gst_tee_class_init (GstTeeClass * klass)
 static void
 gst_tee_init (GstTee * tee)
 {
-  tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+  tee->sinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
   gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
   gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
   gst_pad_set_link_function (tee->sinkpad,