summaryrefslogtreecommitdiff
path: root/gst-plugin
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-01-15 23:30:20 +0000
committerDavid Schleef <ds@schleef.org>2004-01-15 23:30:20 +0000
commite818da2bcc47dc6d409f73859163524713c0a2e1 (patch)
treee66c9a665712fc0347720b73a87e52d405175e07 /gst-plugin
parentc5567107c3f34f66b560e3b43b1ffa5a3cefdfcb (diff)
Add make_element script for building new elements
Original commit message from CVS: Add make_element script for building new elements
Diffstat (limited to 'gst-plugin')
-rwxr-xr-xgst-plugin/tools/make_element49
1 files changed, 49 insertions, 0 deletions
diff --git a/gst-plugin/tools/make_element b/gst-plugin/tools/make_element
new file mode 100755
index 0000000..d606bd9
--- /dev/null
+++ b/gst-plugin/tools/make_element
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+Template=$1;
+srcfile=$2;
+
+if test x"$1" = x ; then
+ echo "$0 Objectname [srcfile]\n";
+ echo " creates gstobjectname.{c,h} implementing GstObjectname\n";
+ exit 1;
+fi
+
+if test x"$2" = x ; then
+ srcfile="gstplugin.c"
+ srcfile_h="gstplugin.h"
+fi
+
+id=$(echo '$Id$' | sed \
+ -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
+ )
+
+TEMPLATE=$(echo $Template | tr a-z A-Z)
+template=$(echo $Template | tr A-Z a-z)
+
+# remember to break up the Id: in the line below
+sed \
+ -e 's/gstplugin\.c/SOURCEFILE/g' \
+ -e "s/gstplugin\.h/gst$template.h/g" \
+ -e "s/GstPluginTemplate/Gst$Template/g" \
+ -e "s/gst_plugin_template/gst_$template/g" \
+ -e "s/gst_type_plugin_template/gst_$template/g" \
+ -e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
+ -e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
+ -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
+ -e 's/SOURCEFILE/gstobject\.c/g' \
+ -e "s%MAKEFILTERVERSION%$id%g" \
+ $srcfile >gst$template.c.tmp && mv gst$template.c.tmp gst$template.c
+
+sed \
+ -e 's/gstplugin\.c/SOURCEFILE/g' \
+ -e "s/GstPluginTemplate/Gst$Template/g" \
+ -e "s/gst_plugin_template/gst_$template/g" \
+ -e "s/gst_type_plugin_template/gst_$template/g" \
+ -e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
+ -e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
+ -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
+ -e 's/SOURCEFILE/gstobject\.c/g' \
+ -e "s%MAKEFILTERVERSION%$id%g" \
+ $srcfile_h >gst$template.h.tmp && mv gst$template.h.tmp gst$template.h
+