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):
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));
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));
#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
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);
}
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);
#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
{
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));
{
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));
#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
{
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));
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;
#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
{
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
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);
#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
{
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
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);
#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
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
{
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);
#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)
{
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
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);
#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
{
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);
}
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);
#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
{
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
{
/* 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);
#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
{
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
{
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);
#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
{
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);
}
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;
#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
{
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));
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,
#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",
{
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);
}
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);
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));
#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
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);
}
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);
#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
{
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));
{
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));
#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
{
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));
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;
#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
{
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
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);
#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
{
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
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);
#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
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
{
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);
#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)
{
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
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);
#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
{
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);
}
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);
#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
{
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
{
/* 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);
#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
{
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
{
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);
#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",
{
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);
}
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);
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));
#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
{
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);
}
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;
#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
{
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));
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,