summaryrefslogtreecommitdiff
path: root/tools/element-templates
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-02-28 12:06:12 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2011-02-28 12:06:12 +0100
commit2eb38991c6d67e47ef90246b2561588cf4b5f390 (patch)
treeaa84497e9b719c9a2c1a5bf8657a3cdcae32c9d6 /tools/element-templates
parent670c883f401367e2591f446e63b5102cb2aba72f (diff)
parenta68137c4dcdbf3dce5cd278403478aef1de62f59 (diff)
Merge branch 'master' into 0.11
Conflicts: configure.ac win32/common/config.h
Diffstat (limited to 'tools/element-templates')
-rw-r--r--tools/element-templates/audiofilter26
-rw-r--r--tools/element-templates/audiosink73
-rw-r--r--tools/element-templates/audiosrc74
-rw-r--r--tools/element-templates/base34
-rw-r--r--tools/element-templates/baseaudiosink25
-rw-r--r--tools/element-templates/baseaudiosrc26
-rw-r--r--tools/element-templates/baseparse109
-rw-r--r--tools/element-templates/basertpdepayload60
-rw-r--r--tools/element-templates/basertppayload49
-rw-r--r--tools/element-templates/basesink163
-rw-r--r--tools/element-templates/basesrc239
-rw-r--r--tools/element-templates/basetransform159
-rw-r--r--tools/element-templates/cddabasesrc54
-rw-r--r--tools/element-templates/element129
-rw-r--r--tools/element-templates/gobject81
-rw-r--r--tools/element-templates/pushsrc235
-rw-r--r--tools/element-templates/sinkpad312
-rw-r--r--tools/element-templates/sinkpad-simple24
-rw-r--r--tools/element-templates/srcpad275
-rw-r--r--tools/element-templates/srcpad-simple24
-rw-r--r--tools/element-templates/tagdemux50
-rw-r--r--tools/element-templates/videosink32
22 files changed, 2253 insertions, 0 deletions
diff --git a/tools/element-templates/audiofilter b/tools/element-templates/audiofilter
new file mode 100644
index 000000000..2d0929364
--- /dev/null
+++ b/tools/element-templates/audiofilter
@@ -0,0 +1,26 @@
+/* vim: set filetype=c: */
+% ClassName
+GstAudioFilter
+% TYPE_CLASS_NAME
+GST_TYPE_AUDIO_FILTER
+% pads
+sinkpad-simple srcpad-simple
+% pkg-config
+gstreamer-audio-0.10
+% includes
+#include <gst/audio/gstaudiofilter.h>
+% prototypes
+static gboolean
+gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format);
+% declare-class
+ GstAudioFilter *audio_filter_class = GST_AUDIO_FILTER (klass);
+% set-methods
+ audio_filter_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
+% methods
+
+static gboolean
+gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format)
+{
+
+}
+% end
diff --git a/tools/element-templates/audiosink b/tools/element-templates/audiosink
new file mode 100644
index 000000000..2a1b7a421
--- /dev/null
+++ b/tools/element-templates/audiosink
@@ -0,0 +1,73 @@
+/* vim: set filetype=c: */
+% ClassName
+GstAudioSink
+% TYPE_CLASS_NAME
+GST_TYPE_AUDIO_SINK
+% pads
+sinkpad-simple
+% pkg-config
+gstreamer-audio-0.10
+% includes
+#include <gst/audio/gstaudiosink.h>
+% prototypes
+static gboolean gst_replace_open (GstAudioSink * sink);
+static gboolean
+gst_replace_prepare (GstAudioSink * sink, GstRingBufferSpec * spec);
+static gboolean gst_replace_unprepare (GstAudioSink * sink);
+static gboolean gst_replace_close (GstAudioSink * sink);
+static guint gst_replace_write (GstAudioSink * sink, gpointer data, guint length);
+static guint gst_replace_delay (GstAudioSink * sink);
+static void gst_replace_reset (GstAudioSink * sink);
+% declare-class
+ GstAudioSinkClass *audio_sink_class = GST_AUDIO_SINK_CLASS (klass);
+% set-methods
+ audio_sink_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
+ audio_sink_class->prepare = GST_DEBUG_FUNCPTR (gst_replace_prepare);
+ audio_sink_class->unprepare = GST_DEBUG_FUNCPTR (gst_replace_unprepare);
+ audio_sink_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
+ audio_sink_class->write = GST_DEBUG_FUNCPTR (gst_replace_write);
+ audio_sink_class->delay = GST_DEBUG_FUNCPTR (gst_replace_delay);
+ audio_sink_class->reset = GST_DEBUG_FUNCPTR (gst_replace_reset);
+% methods
+
+static gboolean
+gst_replace_open (GstAudioSink * sink)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_prepare (GstAudioSink * sink, GstRingBufferSpec * spec)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_unprepare (GstAudioSink * sink)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_close (GstAudioSink * sink)
+{
+ return FALSE;
+}
+
+static guint
+gst_replace_write (GstAudioSink * sink, gpointer data, guint length)
+{
+ return 0;
+}
+
+static guint
+gst_replace_delay (GstAudioSink * sink)
+{
+ return 0;
+}
+
+static void
+gst_replace_reset (GstAudioSink * sink)
+{
+}
+% end
diff --git a/tools/element-templates/audiosrc b/tools/element-templates/audiosrc
new file mode 100644
index 000000000..fe4f6129f
--- /dev/null
+++ b/tools/element-templates/audiosrc
@@ -0,0 +1,74 @@
+/* vim: set filetype=c: */
+% ClassName
+GstAudioSrc
+% TYPE_CLASS_NAME
+GST_TYPE_AUDIO_SRC
+% pads
+srcpad-simple
+% pkg-config
+gstreamer-audio-0.10
+% includes
+#include <gst/audio/gstaudiosrc.h>
+% prototypes
+static gboolean gst_replace_open (GstAudioSrc * src);
+static gboolean
+gst_replace_prepare (GstAudioSrc * src, GstRingBufferSpec * spec);
+static gboolean gst_replace_unprepare (GstAudioSrc * src);
+static gboolean gst_replace_close (GstAudioSrc * src);
+static guint
+gst_replace_read (GstAudioSrc * src, gpointer data, guint length);
+static guint gst_replace_delay (GstAudioSrc * src);
+static void gst_replace_reset (GstAudioSrc * src);
+% declare-class
+ GstAudioSrcClass *audio_src_class = GST_AUDIO_SRC_CLASS (klass);
+% set-methods
+ audio_src_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
+ audio_src_class->prepare = GST_DEBUG_FUNCPTR (gst_replace_prepare);
+ audio_src_class->unprepare = GST_DEBUG_FUNCPTR (gst_replace_unprepare);
+ audio_src_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
+ audio_src_class->read = GST_DEBUG_FUNCPTR (gst_replace_read);
+ audio_src_class->delay = GST_DEBUG_FUNCPTR (gst_replace_delay);
+ audio_src_class->reset = GST_DEBUG_FUNCPTR (gst_replace_reset);
+% methods
+
+static gboolean
+gst_replace_open (GstAudioSrc * src)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_prepare (GstAudioSrc * src, GstRingBufferSpec * spec)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_unprepare (GstAudioSrc * src)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_replace_close (GstAudioSrc * src)
+{
+ return FALSE;
+}
+
+static guint
+gst_replace_read (GstAudioSrc * src, gpointer data, guint length)
+{
+ return 0;
+}
+
+static guint
+gst_replace_delay (GstAudioSrc * src)
+{
+ return 0;
+}
+
+static void
+gst_replace_reset (GstAudioSrc * src)
+{
+}
+% end
diff --git a/tools/element-templates/base b/tools/element-templates/base
new file mode 100644
index 000000000..44d652892
--- /dev/null
+++ b/tools/element-templates/base
@@ -0,0 +1,34 @@
+/* vim: set filetype=c: */
+
+% copyright
+/* GStreamer
+ * Copyright (C) 2010 REAL_NAME <EMAIL_ADDRESS>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+% includes
+#include <gst/gst.h>
+% part2
+
+enum
+{
+ ARG_0
+};
+
+
+% end
+
diff --git a/tools/element-templates/baseaudiosink b/tools/element-templates/baseaudiosink
new file mode 100644
index 000000000..4d6555d7d
--- /dev/null
+++ b/tools/element-templates/baseaudiosink
@@ -0,0 +1,25 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseAudioSink
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_AUDIO_SINK
+% pads
+sinkpad-simple
+% pkg-config
+gstreamer-audio-0.10
+% includes
+#include <gst/audio/gstbaseaudiosink.h>
+% prototypes
+static GstRingBuffer *gst_replace_create_ringbuffer (GstBaseAudioSink * sink);
+% declare-class
+ GstBaseAudioSinkClass *base_audio_sink_class = GST_BASE_AUDIO_SINK_CLASS (klass);
+% set-methods
+ base_audio_sink_class->create_ringbuffer = GST_DEBUG_FUNCPTR (gst_replace_create_ringbuffer);
+% methods
+
+static GstRingBuffer *
+gst_replace_create_ringbuffer (GstBaseAudioSink * sink)
+{
+ return NULL;
+}
+% end
diff --git a/tools/element-templates/baseaudiosrc b/tools/element-templates/baseaudiosrc
new file mode 100644
index 000000000..8b0e4ab0e
--- /dev/null
+++ b/tools/element-templates/baseaudiosrc
@@ -0,0 +1,26 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseAudioSrc
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_AUDIO_SRC
+% pads
+srcpad-simple
+% pkg-config
+gstreamer-audio-0.10
+% includes
+#include <gst/audio/gstbaseaudiosrc.h>
+% prototypes
+static GstRingBuffer *gst_replace_create_ringbuffer (GstBaseAudioSrc * src);
+% declare-class
+ GstBaseAudioSrcClass *base_audio_src_class = GST_BASE_AUDIO_SRC_CLASS (klass);
+% set-methods
+ base_audio_src_class->create_ringbuffer = GST_DEBUG_FUNCPTR (gst_replace_create_ringbuffer);
+% methods
+
+static GstRingBuffer *
+gst_replace_create_ringbuffer (GstBaseAudioSrc * src)
+{
+
+ return NULL;
+}
+% end
diff --git a/tools/element-templates/baseparse b/tools/element-templates/baseparse
new file mode 100644
index 000000000..ff56b3ca4
--- /dev/null
+++ b/tools/element-templates/baseparse
@@ -0,0 +1,109 @@
+% ClassName
+GstBaseParse
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_PARSE
+% pkg-config
+gstreamer-base-0.10
+% includes
+#include <gst/baseparse/gstbaseparse.h>
+% prototypes
+static gboolean gst_replace_start (GstBaseParse *parse);
+static gboolean gst_replace_stop (GstBaseParse *parse);
+static gboolean gst_replace_set_sink_caps (GstBaseParse *parse, GstCaps *caps);
+static gboolean gst_replace_check_valid_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame, guint *framesize, gint *skipsize);
+static GstFlowReturn gst_replace_parse_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame);
+static gboolean gst_replace_convert (GstBaseParse * parse,
+ GstFormat src_format, gint64 src_value, GstFormat dest_format,
+ gint64 * dest_value);
+static gboolean gst_replace_event (GstBaseParse *parse, GstEvent *event);
+static gboolean gst_replace_src_event (GstBaseParse *parse, GstEvent *event);
+static GstFlowReturn gst_replace_pre_push_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame);
+% declare-class
+ GstBaseParseClass *base_parse_class = GST_BASE_PARSE_CLASS (klass);
+% set-methods
+ base_parse_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_parse_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_parse_class->set_sink_caps = GST_DEBUG_FUNCPTR (gst_replace_set_sink_caps);
+ base_parse_class->check_valid_frame = GST_DEBUG_FUNCPTR (gst_replace_check_valid_frame);
+ base_parse_class->parse_frame = GST_DEBUG_FUNCPTR (gst_replace_parse_frame);
+ base_parse_class->pre_push_frame = GST_DEBUG_FUNCPTR (gst_replace_pre_push_frame);
+ base_parse_class->convert = GST_DEBUG_FUNCPTR (gst_replace_convert);
+ base_parse_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_parse_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
+% methods
+
+static gboolean
+gst_replace_start (GstBaseParse *parse)
+{
+ return TRUE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseParse *parse)
+{
+ return TRUE;
+}
+
+static gboolean
+gst_replace_set_sink_caps (GstBaseParse *parse, GstCaps *caps)
+{
+ /* Called when sink caps are set */
+ return TRUE;
+}
+
+static gboolean
+gst_replace_check_valid_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame, guint *framesize, gint *skipsize)
+{
+ /* Called when processing incoming buffers. Function should check
+ whether the buffer contains a valid frame */
+ /* MUST implement */
+ return TRUE;
+}
+
+static GstFlowReturn
+gst_replace_parse_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame)
+{
+ /* Called when processing incoming buffers. Function should parse
+ a checked frame. */
+ /* MUST implement */
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_replace_convert (GstBaseParse * parse, GstFormat src_format,
+ gint64 src_value, GstFormat dest_format, gint64 * dest_value)
+{
+ /* Convert between formats */
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_event (GstBaseParse *parse, GstEvent *event)
+{
+ /* Sink pad event handler */
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_src_event (GstBaseParse *parse, GstEvent *event)
+{
+ /* Src pad event handler */
+
+ return FALSE;
+}
+
+static GstFlowReturn
+gst_replace_pre_push_frame (GstBaseParse *parse, GstBaseParseFrame *frame)
+{
+
+ return GST_FLOW_OK;
+}
+
+% end
diff --git a/tools/element-templates/basertpdepayload b/tools/element-templates/basertpdepayload
new file mode 100644
index 000000000..8b40e5265
--- /dev/null
+++ b/tools/element-templates/basertpdepayload
@@ -0,0 +1,60 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseRTPDepayload
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_RTP_DEPAYLOAD
+% pads
+sinkpad-simple srcpad-simple
+% pkg-config
+gstreamer-rtp-0.10
+% includes
+#include <gst/rtp/gstbasertpdepayload.h>
+% prototypes
+static gboolean
+gst_replace_set_caps (GstBaseRTPDepayload * filter, GstCaps * caps);
+static GstFlowReturn
+gst_replace_add_to_queue (GstBaseRTPDepayload * filter, GstBuffer * in);
+static GstBuffer *gst_replace_process (GstBaseRTPDepayload * base,
+ GstBuffer * in);
+static void
+gst_replace_set_gst_timestamp (GstBaseRTPDepayload * filter, guint32 timestamp,
+ Gst Buffer * buf);
+static gboolean
+gst_replace_packet_lost (GstBaseRTPDepayload * filter, GstEvent * event);
+% declare-class
+ GstBaseRTPDepayload *base_rtpdepayload_class = GST_BASE_RTPDEPAYLOAD (klass);
+% set-methods
+ base_rtpdepayload_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
+% methods
+
+static gboolean
+gst_replace_set_caps (GstBaseRTPDepayload * filter, GstCaps * caps)
+{
+
+}
+
+static GstFlowReturn
+gst_replace_add_to_queue (GstBaseRTPDepayload * filter, GstBuffer * in)
+{
+
+}
+
+static GstBuffer *
+gst_replace_process (GstBaseRTPDepayload * base, GstBuffer * in)
+{
+
+}
+
+static void
+gst_replace_set_gst_timestamp (GstBaseRTPDepayload * filter, guint32 timestamp,
+ Gst Buffer * buf)
+{
+
+}
+
+static gboolean
+gst_replace_packet_lost (GstBaseRTPDepayload * filter, GstEvent * event)
+{
+
+}
+% end
diff --git a/tools/element-templates/basertppayload b/tools/element-templates/basertppayload
new file mode 100644
index 000000000..1a5be183d
--- /dev/null
+++ b/tools/element-templates/basertppayload
@@ -0,0 +1,49 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseRTPPayload
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_RTP_PAYLOAD
+% pads
+sinkpad-simple srcpad-simple
+% pkg-config
+gstreamer-rtp-0.10
+% includes
+#include <gst/rtp/gstbasertppayload.h>
+% prototypes
+static gboolean
+gst_replace_set_caps (GstBaseRTPPayload * payload, GstCaps * caps);
+static GstFlowReturn
+gst_replace_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer);
+static gboolean gst_replace_handle_event (GstPad * pad, GstEvent * event);
+static GstCaps *gst_replace_get_caps (GstBaseRTPPayload * payload,
+ GstPad * pad);
+% declare-class
+ GstBaseRTPPayload *base_rtppayload_class = GST_BASE_RTPPAYLOAD (klass);
+% set-methods
+ base_rtppayload_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
+% methods
+
+static gboolean
+gst_replace_set_caps (GstBaseRTPPayload * payload, GstCaps * caps)
+{
+
+}
+
+static GstFlowReturn
+gst_replace_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer)
+{
+
+}
+
+static gboolean
+gst_replace_handle_event (GstPad * pad, GstEvent * event)
+{
+
+}
+
+static GstCaps *
+gst_replace_get_caps (GstBaseRTPPayload * payload, GstPad * pad)
+{
+
+}
+% end
diff --git a/tools/element-templates/basesink b/tools/element-templates/basesink
new file mode 100644
index 000000000..bf018283d
--- /dev/null
+++ b/tools/element-templates/basesink
@@ -0,0 +1,163 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseSink
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_SINK
+% pads
+sinkpad-simple
+% pkg-config
+gstreamer-base-0.10
+% includes
+#include <gst/base/gstbasesink.h>
+% prototypes
+static GstCaps *gst_replace_get_caps (GstBaseSink * sink);
+static gboolean gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps);
+static GstFlowReturn
+gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
+ GstCaps * caps, GstBuffer ** buf);
+static void
+gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end);
+static gboolean gst_replace_start (GstBaseSink * sink);
+static gboolean gst_replace_stop (GstBaseSink * sink);
+static gboolean gst_replace_unlock (GstBaseSink * sink);
+static gboolean gst_replace_event (GstBaseSink * sink, GstEvent * event);
+static GstFlowReturn
+gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer);
+static GstFlowReturn
+gst_replace_render (GstBaseSink * sink, GstBuffer * buffer);
+static GstStateChangeReturn gst_replace_async_play (GstBaseSink * sink);
+static gboolean gst_replace_activate_pull (GstBaseSink * sink, gboolean active);
+static void gst_replace_fixate (GstBaseSink * sink, GstCaps * caps);
+static gboolean gst_replace_unlock_stop (GstBaseSink * sink);
+static GstFlowReturn
+gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list);
+% declare-class
+ GstBaseSinkClass *base_sink_class = GST_BASE_SINK_CLASS (klass);
+% set-methods
+ base_sink_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
+ base_sink_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
+ base_sink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_replace_buffer_alloc);
+ base_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
+ base_sink_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_sink_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_sink_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
+ base_sink_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_replace_preroll);
+ base_sink_class->render = GST_DEBUG_FUNCPTR (gst_replace_render);
+ base_sink_class->async_play = GST_DEBUG_FUNCPTR (gst_replace_async_play);
+ base_sink_class->activate_pull = GST_DEBUG_FUNCPTR (gst_replace_activate_pull);
+ base_sink_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
+ base_sink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
+ base_sink_class->render_list = GST_DEBUG_FUNCPTR (gst_replace_render_list);
+% methods
+
+
+static GstCaps *
+gst_replace_get_caps (GstBaseSink * sink)
+{
+
+ return NULL;
+}
+
+static gboolean
+gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps)
+{
+
+ return FALSE;
+}
+
+static GstFlowReturn
+gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
+ GstCaps * caps, GstBuffer ** buf)
+{
+
+ return GST_FLOW_ERROR;
+}
+
+static void
+gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end)
+{
+
+}
+
+static gboolean
+gst_replace_start (GstBaseSink * sink)
+{
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseSink * sink)
+{
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_unlock (GstBaseSink * sink)
+{
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_event (GstBaseSink * sink, GstEvent * event)
+{
+
+ return TRUE;
+}
+
+static GstFlowReturn
+gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer)
+{
+
+ return GST_FLOW_OK;
+}
+
+static GstFlowReturn
+gst_replace_render (GstBaseSink * sink, GstBuffer * buffer)
+{
+
+ return GST_FLOW_OK;
+}
+
+static GstStateChangeReturn
+gst_replace_async_play (GstBaseSink * sink)
+{
+
+ return GST_STATE_CHANGE_SUCCESS;
+}
+
+static gboolean
+gst_replace_activate_pull (GstBaseSink * sink, gboolean active)
+{
+
+ return TRUE;
+}
+
+static void
+gst_replace_fixate (GstBaseSink * sink, GstCaps * caps)
+{
+
+}
+
+static gboolean
+gst_replace_unlock_stop (GstBaseSink * sink)
+{
+
+ return TRUE;
+}
+
+static GstFlowReturn
+gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list)
+{
+
+ return GST_FLOW_OK;
+}
+% end
+
+
+
diff --git a/tools/element-templates/basesrc b/tools/element-templates/basesrc
new file mode 100644
index 000000000..0b7e56fc1
--- /dev/null
+++ b/tools/element-templates/basesrc
@@ -0,0 +1,239 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseSrc
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_SRC
+% pads
+srcpad-simple
+% pkg-config
+gstreamer-base-0.10
+% includes
+#include <gst/base/gstbasesrc.h>
+% prototypes
+static GstCaps *gst_replace_get_caps (GstBaseSrc * src);
+static gboolean gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps);
+static gboolean gst_replace_negotiate (GstBaseSrc * src);
+static gboolean gst_replace_newsegment (GstBaseSrc * src);
+static gboolean gst_replace_start (GstBaseSrc * src);
+static gboolean gst_replace_stop (GstBaseSrc * src);
+static void
+gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end);
+static gboolean gst_replace_get_size (GstBaseSrc * src, guint64 * size);
+static gboolean gst_replace_is_seekable (GstBaseSrc * src);
+static gboolean gst_replace_unlock (GstBaseSrc * src);
+static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event);
+static GstFlowReturn
+gst_replace_create (GstBaseSrc * src, guint64 offset, guint size,
+ GstBuffer ** buf);
+static gboolean gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment);
+static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query);
+static gboolean gst_replace_check_get_range (GstBaseSrc * src);
+static void gst_replace_fixate (GstBaseSrc * src, GstCaps * caps);
+static gboolean gst_replace_unlock_stop (GstBaseSrc * src);
+static gboolean
+gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
+ GstSegment * segment);
+% declare-class
+ GstBaseSrcClass *base_src_class = GST_BASE_SRC_CLASS (klass);
+% set-methods
+ base_src_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
+ base_src_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
+ base_src_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
+ base_src_class->newsegment = GST_DEBUG_FUNCPTR (gst_replace_newsegment);
+ base_src_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_src_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_src_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
+ base_src_class->get_size = GST_DEBUG_FUNCPTR (gst_replace_get_size);
+ base_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_replace_is_seekable);
+ base_src_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
+ base_src_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_src_class->create = GST_DEBUG_FUNCPTR (gst_replace_create);
+ base_src_class->do_seek = GST_DEBUG_FUNCPTR (gst_replace_do_seek);
+ base_src_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
+ base_src_class->check_get_range = GST_DEBUG_FUNCPTR (gst_replace_check_get_range);
+ base_src_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
+ base_src_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
+ base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_replace_prepare_seek_segment);
+
+% methods
+
+static GstCaps *
+gst_replace_get_caps (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_caps");
+
+ return NULL;
+}
+
+static gboolean
+gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "set_caps");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_negotiate (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "negotiate");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_newsegment (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "newsegment");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_start (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "start");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "stop");
+
+ return TRUE;
+}
+
+static void
+gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_times");
+}
+
+static gboolean
+gst_replace_get_size (GstBaseSrc * src, guint64 * size)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_size");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_is_seekable (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "is_seekable");
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_unlock (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "unlock");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_event (GstBaseSrc * src, GstEvent * event)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "event");
+
+ return TRUE;
+}
+
+static GstFlowReturn
+gst_replace_create (GstBaseSrc * src, guint64 offset, guint size,
+ GstBuffer ** buf)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "create");
+
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "do_seek");
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_query (GstBaseSrc * src, GstQuery * query)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "query");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_check_get_range (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_range");
+
+ return FALSE;
+}
+
+static void
+gst_replace_fixate (GstBaseSrc * src, GstCaps * caps)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "fixate");
+}
+
+static gboolean
+gst_replace_unlock_stop (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "stop");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
+ GstSegment * segment)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "seek_segment");
+
+ return FALSE;
+}
+% end
diff --git a/tools/element-templates/basetransform b/tools/element-templates/basetransform
new file mode 100644
index 000000000..e5fd24cf3
--- /dev/null
+++ b/tools/element-templates/basetransform
@@ -0,0 +1,159 @@
+/* vim: set filetype=c: */
+% ClassName
+GstBaseTransform
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_TRANSFORM
+% pads
+sinkpad-simple srcpad-simple
+% pkg-config
+gstreamer-base-0.10
+% pads
+sinkpad-simple srcpad-simple
+% includes
+#include <gst/base/gstbasetransform.h>
+% prototypes
+static GstCaps *gst_replace_transform_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps);
+static void
+gst_replace_fixate_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
+static gboolean
+gst_replace_transform_size (GstBaseTransform * trans,
+ GstPadDirection direction,
+ GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize);
+static gboolean
+gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
+ guint * size);
+static gboolean
+gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
+ GstCaps * outcaps);
+static gboolean gst_replace_start (GstBaseTransform * trans);
+static gboolean gst_replace_stop (GstBaseTransform * trans);
+static gboolean gst_replace_event (GstBaseTransform * trans, GstEvent * event);
+static GstFlowReturn
+gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
+ GstBuffer * outbuf);
+static GstFlowReturn
+gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf);
+static GstFlowReturn
+gst_replace_prepare_output_buffer (GstBaseTransform * trans,
+ GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf);
+static gboolean
+gst_replace_src_event (GstBaseTransform * trans, GstEvent * event);
+static void
+gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer);
+% declare-class
+ GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
+% set-methods
+ base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_replace_transform_caps);
+ base_transform_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_replace_fixate_caps);
+ base_transform_class->transform_size = GST_DEBUG_FUNCPTR (gst_replace_transform_size);
+ base_transform_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_replace_get_unit_size);
+ base_transform_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
+ base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_transform_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_transform_class->transform = GST_DEBUG_FUNCPTR (gst_replace_transform);
+ base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_ip);
+ base_transform_class->prepare_output_buffer = GST_DEBUG_FUNCPTR (gst_replace_prepare_output_buffer);
+ base_transform_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
+ base_transform_class->before_transform = GST_DEBUG_FUNCPTR (gst_replace_before_transform);
+% methods
+
+static GstCaps *
+gst_replace_transform_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps)
+{
+
+ return NULL;
+}
+
+static void
+gst_replace_fixate_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
+{
+
+}
+
+static gboolean
+gst_replace_transform_size (GstBaseTransform * trans,
+ GstPadDirection direction,
+ GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize)
+{
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
+ guint * size)
+{
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
+ GstCaps * outcaps)
+{
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_start (GstBaseTransform * trans)
+{
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseTransform * trans)
+{
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_event (GstBaseTransform * trans, GstEvent * event)
+{
+
+ return FALSE;
+}
+
+static GstFlowReturn
+gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
+ GstBuffer * outbuf)
+{
+
+ return GST_FLOW_ERROR;
+}
+
+static GstFlowReturn
+gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
+{
+
+ return GST_FLOW_ERROR;
+}
+
+static GstFlowReturn
+gst_replace_prepare_output_buffer (GstBaseTransform * trans,
+ GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf)
+{
+
+ return GST_FLOW_ERROR;
+}
+
+static gboolean
+gst_replace_src_event (GstBaseTransform * trans, GstEvent * event)
+{
+
+ return FALSE;
+}
+
+static void
+gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer)
+{
+
+}
+% end
diff --git a/tools/element-templates/cddabasesrc b/tools/element-templates/cddabasesrc
new file mode 100644
index 000000000..d788d19c4
--- /dev/null
+++ b/tools/element-templates/cddabasesrc
@@ -0,0 +1,54 @@
+/* vim: set filetype=c: */
+% ClassName
+GstCddaBaseSrc
+% TYPE_CLASS_NAME
+GST_TYPE_CDDA_BASE_SRC
+% pads
+srcpad-simple
+% pkg-config
+gstreamer-cdda-0.10
+% includes
+#include <gst/cdda/gstcddabasesrc.h>
+% prototypes
+static gboolean gst_replace_open (GstCddaBaseSrc * src, const gchar * device);
+static void gst_replace_close (GstCddaBaseSrc * src);
+static GstBuffer *gst_replace_read_sector (GstCddaBaseSrc * src, gint sector);
+static gchar *gst_replace_get_default_device (GstCddaBaseSrc * src);
+static gchar **gst_replace_probe_devices (GstCddaBaseSrc * src);
+% declare-class
+ GstcddaBaseSrc *cddabase_src_class = GST_CDDABASE_SRC (klass);
+% set-methods
+ cddabase_src_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
+% methods
+
+
+static gboolean
+gst_replace_open (GstCddaBaseSrc * src, const gchar * device)
+{
+
+}
+
+static void
+gst_replace_close (GstCddaBaseSrc * src)
+{
+
+}
+
+static GstBuffer *
+gst_replace_read_sector (GstCddaBaseSrc * src, gint sector)
+{
+
+}
+
+static gchar *
+gst_replace_get_default_device (GstCddaBaseSrc * src)
+{
+
+}
+
+static gchar **
+gst_replace_probe_devices (GstCddaBaseSrc * src)
+{
+
+}
+% end
diff --git a/tools/element-templates/element b/tools/element-templates/element
new file mode 100644
index 000000000..ed025ee2b
--- /dev/null
+++ b/tools/element-templates/element
@@ -0,0 +1,129 @@
+/* vim: set filetype=c: */
+% ClassName
+GstElement
+% TYPE_CLASS_NAME
+GST_TYPE_ELEMENT
+% pads
+sinkpad srcpad
+% pkg-config
+gstreamer-0.10
+% includes
+#include <gst/gst.h>
+% prototypes
+static GstPad *gst_replace_request_new_pad (GstElement * element,
+ GstPadTemplate * templ, const gchar * name);
+static void gst_replace_release_pad (GstElement * element, GstPad * pad);
+static GstStateChangeReturn
+gst_replace_change_state (GstElement * element, GstStateChange transition);
+static GstClock *gst_replace_provide_clock (GstElement * element);
+static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock);
+static GstIndex *gst_replace_get_index (GstElement * element);
+static void gst_replace_set_index (GstElement * element, GstIndex * index);
+static gboolean gst_replace_send_event (GstElement * element, GstEvent * event);
+static gboolean gst_replace_query (GstElement * element, GstQuery * query);
+% declare-class
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+% set-methods
+ element_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_replace_request_new_pad);
+ element_class->release_pad = GST_DEBUG_FUNCPTR (gst_replace_release_pad);
+ element_class->change_state = GST_DEBUG_FUNCPTR (gst_replace_change_state);
+ element_class->provide_clock = GST_DEBUG_FUNCPTR (gst_replace_provide_clock);
+ element_class->set_clock = GST_DEBUG_FUNCPTR (gst_replace_set_clock);
+ element_class->get_index = GST_DEBUG_FUNCPTR (gst_replace_get_index);
+ element_class->set_index = GST_DEBUG_FUNCPTR (gst_replace_set_index);
+ element_class->send_event = GST_DEBUG_FUNCPTR (gst_replace_send_event);
+ element_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
+% methods
+
+
+static GstPad *
+gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ,
+ const gchar * name)
+{
+
+ return NULL;
+}
+
+static void
+gst_replace_release_pad (GstElement * element, GstPad * pad)
+{
+
+}
+
+static GstStateChangeReturn
+gst_replace_change_state (GstElement * element, GstStateChange transition)
+{
+ GstReplace *replace;
+ GstStateChangeReturn ret;
+
+ g_return_val_if_fail (GST_IS_REPLACE (element), GST_STATE_CHANGE_FAILURE);
+ replace = GST_REPLACE (element);
+
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
+ break;
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
+ break;
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+ break;
+ default:
+ break;
+ }
+
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+ switch (transition) {
+ case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
+ break;
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
+ break;
+ case GST_STATE_CHANGE_READY_TO_NULL:
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+static GstClock *
+gst_replace_provide_clock (GstElement * element)
+{
+
+ return NULL;
+}
+
+static gboolean
+gst_replace_set_clock (GstElement * element, GstClock * clock)
+{
+
+ return TRUE;
+}
+
+static GstIndex *
+gst_replace_get_index (GstElement * element)
+{
+
+ return NULL;
+}
+
+static void
+gst_replace_set_index (GstElement * element, GstIndex * index)
+{
+
+}
+
+static gboolean
+gst_replace_send_event (GstElement * element, GstEvent * event)
+{
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_query (GstElement * element, GstQuery * query)
+{
+
+ return FALSE;
+}
+% end
diff --git a/tools/element-templates/gobject b/tools/element-templates/gobject
new file mode 100644
index 000000000..4ef34e6c2
--- /dev/null
+++ b/tools/element-templates/gobject
@@ -0,0 +1,81 @@
+/* vim: set filetype=c: */
+
+% includes
+% prototypes
+
+static void gst_replace_set_property (GObject * object,
+ guint property_id, const GValue * value, GParamSpec * pspec);
+static void gst_replace_get_property (GObject * object,
+ guint property_id, GValue * value, GParamSpec * pspec);
+static void gst_replace_dispose (GObject * object);
+static void gst_replace_finalize (GObject * object);
+
+% declare-class
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+% set-methods
+ gobject_class->set_property = gst_replace_set_property;
+ gobject_class->get_property = gst_replace_get_property;
+ gobject_class->dispose = gst_replace_dispose;
+ gobject_class->finalize = gst_replace_finalize;
+% methods
+
+void
+gst_replace_set_property (GObject * object, guint property_id,
+ const GValue * value, GParamSpec * pspec)
+{
+ GstReplace *replace;
+
+ g_return_if_fail (GST_IS_REPLACE (object));
+ replace = GST_REPLACE (object);
+
+ switch (property_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+void
+gst_replace_get_property (GObject * object, guint property_id,
+ GValue * value, GParamSpec * pspec)
+{
+ GstReplace *replace;
+
+ g_return_if_fail (GST_IS_REPLACE (object));
+ replace = GST_REPLACE (object);
+
+ switch (property_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+void
+gst_replace_dispose (GObject * object)
+{
+ GstReplace *replace;
+
+ g_return_if_fail (GST_IS_REPLACE (object));
+ replace = GST_REPLACE (object);
+
+ /* clean up as possible. may be called multiple times */
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+void
+gst_replace_finalize (GObject * object)
+{
+ GstReplace *replace;
+
+ g_return_if_fail (GST_IS_REPLACE (object));
+ replace = GST_REPLACE (object);
+
+ /* clean up object here */
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+% end
+
diff --git a/tools/element-templates/pushsrc b/tools/element-templates/pushsrc
new file mode 100644
index 000000000..56cc7a6bf
--- /dev/null
+++ b/tools/element-templates/pushsrc
@@ -0,0 +1,235 @@
+/* vim: set filetype=c: */
+% ClassName
+GstPushSrc
+% TYPE_CLASS_NAME
+GST_TYPE_PUSH_SRC
+% pads
+srcpad-simple
+% pkg-config
+gstreamer-base-0.10
+% includes
+#include <gst/base/gstpushsrc.h>
+% prototypes
+static GstCaps *gst_replace_get_caps (GstBaseSrc * src);
+static gboolean gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps);
+static gboolean gst_replace_negotiate (GstBaseSrc * src);
+static gboolean gst_replace_newsegment (GstBaseSrc * src);
+static gboolean gst_replace_start (GstBaseSrc * src);
+static gboolean gst_replace_stop (GstBaseSrc * src);
+static void
+gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end);
+static gboolean gst_replace_get_size (GstBaseSrc * src, guint64 * size);
+static gboolean gst_replace_is_seekable (GstBaseSrc * src);
+static gboolean gst_replace_unlock (GstBaseSrc * src);
+static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event);
+static gboolean gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment);
+static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query);
+static gboolean gst_replace_check_get_range (GstBaseSrc * src);
+static void gst_replace_fixate (GstBaseSrc * src, GstCaps * caps);
+static gboolean gst_replace_unlock_stop (GstBaseSrc * src);
+static gboolean
+gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
+ GstSegment * segment);
+static GstFlowReturn gst_replace_create (GstPushSrc * src, GstBuffer ** buf);
+% declare-class
+ GstBaseSrcClass *base_src_class = GST_BASE_SRC_CLASS (klass);
+ GstPushSrcClass *push_src_class = GST_PUSH_SRC_CLASS (klass);
+% set-methods
+ base_src_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
+ base_src_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
+ base_src_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
+ base_src_class->newsegment = GST_DEBUG_FUNCPTR (gst_replace_newsegment);
+ base_src_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_src_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_src_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
+ base_src_class->get_size = GST_DEBUG_FUNCPTR (gst_replace_get_size);
+ base_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_replace_is_seekable);
+ base_src_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
+ base_src_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_src_class->do_seek = GST_DEBUG_FUNCPTR (gst_replace_do_seek);
+ base_src_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
+ base_src_class->check_get_range = GST_DEBUG_FUNCPTR (gst_replace_check_get_range);
+ base_src_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
+ base_src_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
+ base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_replace_prepare_seek_segment);
+
+ push_src_class->create = GST_DEBUG_FUNCPTR (gst_replace_create);
+% methods
+
+static GstCaps *
+gst_replace_get_caps (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_caps");
+
+ return NULL;
+}
+
+static gboolean
+gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "set_caps");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_negotiate (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "negotiate");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_newsegment (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "newsegment");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_start (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "start");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "stop");
+
+ return TRUE;
+}
+
+static void
+gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
+ GstClockTime * start, GstClockTime * end)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_times");
+}
+
+static gboolean
+gst_replace_get_size (GstBaseSrc * src, guint64 * size)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_size");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_is_seekable (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "is_seekable");
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_unlock (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "unlock");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_event (GstBaseSrc * src, GstEvent * event)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "event");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "do_seek");
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_query (GstBaseSrc * src, GstQuery * query)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "query");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_check_get_range (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "get_range");
+
+ return FALSE;
+}
+
+static void
+gst_replace_fixate (GstBaseSrc * src, GstCaps * caps)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "fixate");
+}
+
+static gboolean
+gst_replace_unlock_stop (GstBaseSrc * src)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "stop");
+
+ return TRUE;
+}
+
+static gboolean
+gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
+ GstSegment * segment)
+{
+ GstReplace *replace = GST_REPLACE (src);
+
+ GST_DEBUG_OBJECT (replace, "seek_segment");
+
+ return FALSE;
+}
+
+static GstFlowReturn
+gst_replace_create (GstPushSrc * src, GstBuffer ** buf)
+{
+
+ return GST_FLOW_OK;
+}
+% end
+
diff --git a/tools/element-templates/sinkpad b/tools/element-templates/sinkpad
new file mode 100644
index 000000000..6d3bad1fb
--- /dev/null
+++ b/tools/element-templates/sinkpad
@@ -0,0 +1,312 @@
+/* vim: set filetype=c: */
+
+% instance-members
+ GstPad *sinkpad;
+% prototypes
+
+static GstCaps* gst_replace_sink_getcaps (GstPad *pad);
+static gboolean gst_replace_sink_setcaps (GstPad *pad, GstCaps *caps);
+static gboolean gst_replace_sink_acceptcaps (GstPad *pad, GstCaps *caps);
+static void gst_replace_sink_fixatecaps (GstPad *pad, GstCaps *caps);
+static gboolean gst_replace_sink_activate (GstPad *pad);
+static gboolean gst_replace_sink_activatepush (GstPad *pad, gboolean active);
+static gboolean gst_replace_sink_activatepull (GstPad *pad, gboolean active);
+static GstPadLinkReturn gst_replace_sink_link (GstPad *pad, GstPad *peer);
+static void gst_replace_sink_unlink (GstPad *pad);
+static GstFlowReturn gst_replace_sink_chain (GstPad *pad, GstBuffer *buffer);
+static GstFlowReturn gst_replace_sink_chainlist (GstPad *pad, GstBufferList *bufferlist);
+static gboolean gst_replace_sink_event (GstPad *pad, GstEvent *event);
+static gboolean gst_replace_sink_query (GstPad *pad, GstQuery *query);
+static GstFlowReturn gst_replace_sink_bufferalloc (GstPad *pad, guint64 offset, guint size,
+ GstCaps *caps, GstBuffer **buf);
+static GstIterator * gst_replace_sink_iterintlink (GstPad *pad);
+
+% pad-template
+static GstStaticPadTemplate gst_replace_sink_template =
+GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("application/unknown")
+ );
+
+% base-init
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_replace_sink_template));
+% instance-init
+
+ replace->sinkpad = gst_pad_new_from_static_template (&gst_replace_sink_template
+ ,
+ "sink");
+ gst_pad_set_getcaps_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_getcaps));
+ gst_pad_set_setcaps_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_setcaps));
+ gst_pad_set_acceptcaps_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_acceptcaps));
+ gst_pad_set_fixatecaps_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_fixatecaps));
+ gst_pad_set_activate_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_activate));
+ gst_pad_set_activatepush_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_activatepush));
+ gst_pad_set_activatepull_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_activatepull));
+ gst_pad_set_link_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_link));
+ gst_pad_set_unlink_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_unlink));
+ gst_pad_set_chain_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_chain));
+ gst_pad_set_chain_list_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_chainlist));
+ gst_pad_set_event_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_event));
+ gst_pad_set_query_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_query));
+ gst_pad_set_bufferalloc_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_bufferalloc));
+ gst_pad_set_iterate_internal_links_function (replace->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_replace_sink_iterintlink));
+ gst_element_add_pad (GST_ELEMENT(replace), replace->sinkpad);
+
+
+% methods
+
+static GstCaps*
+gst_replace_sink_getcaps (GstPad *pad)
+{
+ GstReplace *replace;
+ GstCaps *caps;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "getcaps");
+
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+
+ gst_object_unref (replace);
+ return caps;
+}
+
+static gboolean
+gst_replace_sink_setcaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "setcaps");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static gboolean
+gst_replace_sink_acceptcaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "acceptcaps");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static void
+gst_replace_sink_fixatecaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "fixatecaps");
+
+
+ gst_object_unref (replace);
+}
+
+static gboolean
+gst_replace_sink_activate (GstPad *pad)
+{
+ GstReplace *replace;
+ gboolean ret;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activate");
+
+ if (gst_pad_check_pull_range (pad)) {
+ GST_DEBUG_OBJECT (pad, "activating pull");
+ ret = gst_pad_activate_pull (pad, TRUE);
+ } else {
+ GST_DEBUG_OBJECT (pad, "activating push");
+ ret = gst_pad_activate_push (pad, TRUE);
+ }
+
+ gst_object_unref (replace);
+ return ret;
+}
+
+static gboolean
+gst_replace_sink_activatepush (GstPad *pad, gboolean active)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activatepush");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static gboolean
+gst_replace_sink_activatepull (GstPad *pad, gboolean active)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activatepull");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static GstPadLinkReturn
+gst_replace_sink_link (GstPad *pad, GstPad *peer)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "link");
+
+
+ gst_object_unref (replace);
+ return GST_PAD_LINK_OK;
+}
+
+static void
+gst_replace_sink_unlink (GstPad *pad)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "unlink");
+
+
+ gst_object_unref (replace);
+}
+
+static GstFlowReturn
+gst_replace_sink_chain (GstPad *pad, GstBuffer *buffer)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "chain");
+
+
+ gst_object_unref (replace);
+ return GST_FLOW_OK;
+}
+
+static GstFlowReturn
+gst_replace_sink_chainlist (GstPad *pad, GstBufferList *bufferlist)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "chainlist");
+
+
+ gst_object_unref (replace);
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_replace_sink_event (GstPad *pad, GstEvent *event)
+{
+ gboolean res;
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "event");
+
+ switch (GST_EVENT_TYPE (event)) {
+ default:
+ res = gst_pad_event_default (pad, event);
+ break;
+ }
+
+ gst_object_unref (replace);
+ return res;
+}
+
+static gboolean
+gst_replace_sink_query (GstPad *pad, GstQuery *query)
+{
+ gboolean res;
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "query");
+
+ switch (GST_QUERY_TYPE(query)) {
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ gst_object_unref (replace);
+ return res;
+}
+
+static GstFlowReturn
+gst_replace_sink_bufferalloc (GstPad *pad, guint64 offset, guint size,
+ GstCaps *caps, GstBuffer **buf)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "bufferalloc");
+
+
+ *buf = gst_buffer_new_and_alloc (size);
+ gst_buffer_set_caps (*buf, caps);
+
+ gst_object_unref (replace);
+ return GST_FLOW_OK;
+}
+
+static GstIterator *
+gst_replace_sink_iterintlink (GstPad *pad)
+{
+ GstReplace *replace;
+ GstIterator *iter;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "iterintlink");
+
+ iter = gst_pad_iterate_internal_links_default (pad);
+
+ gst_object_unref (replace);
+ return iter;
+}
+
+% end
+
diff --git a/tools/element-templates/sinkpad-simple b/tools/element-templates/sinkpad-simple
new file mode 100644
index 000000000..e8538b6ec
--- /dev/null
+++ b/tools/element-templates/sinkpad-simple
@@ -0,0 +1,24 @@
+/* vim: set filetype=c: */
+
+% instance-members
+ GstPad *sinkpad;
+% prototypes
+% pad-template
+static GstStaticPadTemplate gst_replace_sink_template =
+GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("application/unknown")
+ );
+
+% base-init
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_replace_sink_template));
+% instance-init
+
+ replace->sinkpad = gst_pad_new_from_static_template (&gst_replace_sink_template
+ ,
+ "sink");
+% methods
+% end
+
diff --git a/tools/element-templates/srcpad b/tools/element-templates/srcpad
new file mode 100644
index 000000000..d1f799267
--- /dev/null
+++ b/tools/element-templates/srcpad
@@ -0,0 +1,275 @@
+/* vim: set filetype=c: */
+
+% instance-members
+ GstPad *srcpad;
+% prototypes
+
+static GstCaps* gst_replace_src_getcaps (GstPad *pad);
+static gboolean gst_replace_src_setcaps (GstPad *pad, GstCaps *caps);
+static gboolean gst_replace_src_acceptcaps (GstPad *pad, GstCaps *caps);
+static void gst_replace_src_fixatecaps (GstPad *pad, GstCaps *caps);
+static gboolean gst_replace_src_activate (GstPad *pad);
+static gboolean gst_replace_src_activatepush (GstPad *pad, gboolean active);
+static gboolean gst_replace_src_activatepull (GstPad *pad, gboolean active);
+static GstPadLinkReturn gst_replace_src_link (GstPad *pad, GstPad *peer);
+static void gst_replace_src_unlink (GstPad *pad);
+static GstFlowReturn gst_replace_src_getrange (GstPad *pad, guint64 offset, guint length,
+ GstBuffer **buffer);
+static gboolean gst_replace_src_event (GstPad *pad, GstEvent *event);
+static gboolean gst_replace_src_query (GstPad *pad, GstQuery *query);
+static GstIterator * gst_replace_src_iterintlink (GstPad *pad);
+
+% pad-template
+static GstStaticPadTemplate gst_replace_src_template =
+GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("application/unknown")
+ );
+
+% base-init
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_replace_src_template));
+% instance-init
+
+ replace->srcpad = gst_pad_new_from_static_template (&gst_replace_src_template
+ ,
+ "src");
+ gst_pad_set_getcaps_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_getcaps));
+ gst_pad_set_setcaps_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_setcaps));
+ gst_pad_set_acceptcaps_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_acceptcaps));
+ gst_pad_set_fixatecaps_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_fixatecaps));
+ gst_pad_set_activate_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_activate));
+ gst_pad_set_activatepush_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_activatepush));
+ gst_pad_set_activatepull_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_activatepull));
+ gst_pad_set_link_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_link));
+ gst_pad_set_unlink_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_unlink));
+ gst_pad_set_getrange_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_getrange));
+ gst_pad_set_event_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_event));
+ gst_pad_set_query_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_query));
+ gst_pad_set_iterate_internal_links_function (replace->srcpad,
+ GST_DEBUG_FUNCPTR(gst_replace_src_iterintlink));
+ gst_element_add_pad (GST_ELEMENT(replace), replace->srcpad);
+
+
+% methods
+
+static GstCaps*
+gst_replace_src_getcaps (GstPad *pad)
+{
+ GstReplace *replace;
+ GstCaps *caps;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "getcaps");
+
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+
+ gst_object_unref (replace);
+ return caps;
+}
+
+static gboolean
+gst_replace_src_setcaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "setcaps");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static gboolean
+gst_replace_src_acceptcaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "acceptcaps");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static void
+gst_replace_src_fixatecaps (GstPad *pad, GstCaps *caps)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "fixatecaps");
+
+
+ gst_object_unref (replace);
+}
+
+static gboolean
+gst_replace_src_activate (GstPad *pad)
+{
+ GstReplace *replace;
+ gboolean ret;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activate");
+
+ if (gst_pad_check_pull_range (pad)) {
+ GST_DEBUG_OBJECT (pad, "activating pull");
+ ret = gst_pad_activate_pull (pad, TRUE);
+ } else {
+ GST_DEBUG_OBJECT (pad, "activating push");
+ ret = gst_pad_activate_push (pad, TRUE);
+ }
+
+ gst_object_unref (replace);
+ return ret;
+}
+
+static gboolean
+gst_replace_src_activatepush (GstPad *pad, gboolean active)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activatepush");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static gboolean
+gst_replace_src_activatepull (GstPad *pad, gboolean active)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "activatepull");
+
+
+ gst_object_unref (replace);
+ return TRUE;
+}
+
+static GstPadLinkReturn
+gst_replace_src_link (GstPad *pad, GstPad *peer)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "link");
+
+
+ gst_object_unref (replace);
+ return GST_PAD_LINK_OK;
+}
+
+static void
+gst_replace_src_unlink (GstPad *pad)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "unlink");
+
+
+ gst_object_unref (replace);
+}
+
+static GstFlowReturn
+gst_replace_src_getrange (GstPad *pad, guint64 offset, guint length,
+ GstBuffer **buffer)
+{
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "getrange");
+
+
+ gst_object_unref (replace);
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_replace_src_event (GstPad *pad, GstEvent *event)
+{
+ gboolean res;
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "event");
+
+ switch (GST_EVENT_TYPE (event)) {
+ default:
+ res = gst_pad_event_default (pad, event);
+ break;
+ }
+
+ gst_object_unref (replace);
+ return res;
+}
+
+static gboolean
+gst_replace_src_query (GstPad *pad, GstQuery *query)
+{
+ gboolean res;
+ GstReplace *replace;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "query");
+
+ switch (GST_QUERY_TYPE(query)) {
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ gst_object_unref (replace);
+ return res;
+}
+
+static GstIterator *
+gst_replace_src_iterintlink (GstPad *pad)
+{
+ GstReplace *replace;
+ GstIterator *iter;
+
+ replace = GST_REPLACE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT(replace, "iterintlink");
+
+ iter = gst_pad_iterate_internal_links_default (pad);
+
+ gst_object_unref (replace);
+ return iter;
+}
+
+% end
+
diff --git a/tools/element-templates/srcpad-simple b/tools/element-templates/srcpad-simple
new file mode 100644
index 000000000..0fca9157e
--- /dev/null
+++ b/tools/element-templates/srcpad-simple
@@ -0,0 +1,24 @@
+/* vim: set filetype=c: */
+
+% instance-members
+ GstPad *srcpad;
+% prototypes
+% pad-template
+static GstStaticPadTemplate gst_replace_src_template =
+GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("application/unknown")
+ );
+
+% base-init
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_replace_src_template));
+% instance-init
+
+ replace->srcpad = gst_pad_new_from_static_template (&gst_replace_src_template
+ ,
+ "src");
+% methods
+% end
+
diff --git a/tools/element-templates/tagdemux b/tools/element-templates/tagdemux
new file mode 100644
index 000000000..8517c5802
--- /dev/null
+++ b/tools/element-templates/tagdemux
@@ -0,0 +1,50 @@
+/* vim: set filetype=c: */
+% ClassName
+GstTagDemux
+% TYPE_CLASS_NAME
+GST_TYPE_TAG_DEMUX
+% pads
+sinkpad-simple srcpad-simple
+% pkg-config
+gstreamer-tag-0.10
+% includes
+#include <gst/tag/gsttagdemux.h>
+% prototypes
+static gboolean
+gst_replace_identify_tag (GstTagDemux * demux,
+ GstBuffer * buffer, gboolean start_tag, guint * tag_size);
+static GstTagDemuxResult
+gst_replace_parse_tag (GstTagDemux * demux,
+ GstBuffer * buffer,
+ gboolean start_tag, guint * tag_size, GstTagList ** tags);
+static GstTagList *gst_replace_merge_tags (GstTagDemux * demux,
+ const GstTagList * start_tags, const GstTagList * end_tags);
+% declare-class
+ GstTagdemux *tagdemux_class = GST_TAGDEMUX (klass);
+% set-methods
+ tagdemux_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
+% methods
+
+
+static gboolean
+gst_replace_identify_tag (GstTagDemux * demux,
+ GstBuffer * buffer, gboolean start_tag, guint * tag_size)
+{
+
+}
+
+static GstTagDemuxResult
+gst_replace_parse_tag (GstTagDemux * demux,
+ GstBuffer * buffer,
+ gboolean start_tag, guint * tag_size, GstTagList ** tags)
+{
+
+}
+
+static GstTagList *
+gst_replace_merge_tags (GstTagDemux * demux,
+ const GstTagList * start_tags, const GstTagList * end_tags)
+{
+
+}
+% end
diff --git a/tools/element-templates/videosink b/tools/element-templates/videosink
new file mode 100644
index 000000000..d26de559b
--- /dev/null
+++ b/tools/element-templates/videosink
@@ -0,0 +1,32 @@
+/* vim: set filetype=c: */
+% ClassName
+GstVideoSink
+% TYPE_CLASS_NAME
+GST_TYPE_VIDEO_SINK
+% pads
+sinkpad-simple
+% pkg-config
+gstreamer-video-0.10
+% includes
+#include <gst/video/gstvideosink.h>
+% prototypes
+
+static GstFlowReturn
+gst_replace_show_frame (GstVideoSink * video_sink, GstBuffer * buf);
+
+
+% declare-class
+ GstVideoSinkClass *video_sink_class = GST_VIDEO_SINK_CLASS (klass);
+% set-methods
+ video_sink_class->show_frame = GST_DEBUG_FUNCPTR (gst_replace_show_frame);
+% methods
+
+static GstFlowReturn
+gst_replace_show_frame (GstVideoSink * video_sink, GstBuffer * buf)
+{
+
+ return GST_FLOW_OK;
+}
+
+% end
+