element-maker: Clean up directory
authorDavid Schleef <ds@schleef.org>
Wed, 15 Dec 2010 20:45:38 +0000 (12:45 -0800)
committerDavid Schleef <ds@schleef.org>
Wed, 15 Dec 2010 20:47:02 +0000 (12:47 -0800)
23 files changed:
tools/Makefile.am
tools/element-templates/audiofilter [moved from tools/gstaudiofilter.c with 95% similarity]
tools/element-templates/audiosink [moved from tools/gstaudiosink.c with 98% similarity]
tools/element-templates/audiosrc [moved from tools/gstaudiosrc.c with 98% similarity]
tools/element-templates/base [moved from tools/base.c with 97% similarity]
tools/element-templates/baseaudiosink [moved from tools/gstbaseaudiosink.c with 95% similarity]
tools/element-templates/baseaudiosrc [moved from tools/gstbaseaudiosrc.c with 95% similarity]
tools/element-templates/basertpdepayload [moved from tools/gstbasertpdepayload.c with 98% similarity]
tools/element-templates/basertppayload [moved from tools/gstbasertppayload.c with 97% similarity]
tools/element-templates/basesink [moved from tools/gstbasesink.c with 99% similarity]
tools/element-templates/basesrc [moved from tools/gstbasesrc.c with 99% similarity]
tools/element-templates/basetransform [moved from tools/gstbasetransform.c with 99% similarity]
tools/element-templates/cddabasesrc [moved from tools/gstcddabasesrc.c with 97% similarity]
tools/element-templates/element [moved from tools/gstelement.c with 99% similarity]
tools/element-templates/gobject [moved from tools/gobject.c with 98% similarity]
tools/element-templates/pushsrc [moved from tools/gstpushsrc.c with 95% similarity]
tools/element-templates/sinkpad [moved from tools/sinkpad.c with 99% similarity]
tools/element-templates/sinkpad-simple [moved from tools/sinkpad-simple.c with 95% similarity]
tools/element-templates/srcpad [moved from tools/srcpad.c with 99% similarity]
tools/element-templates/srcpad-simple [moved from tools/srcpad-simple.c with 95% similarity]
tools/element-templates/tagdemux [moved from tools/gsttagdemux.c with 97% similarity]
tools/element-templates/videosink [moved from tools/gstvideosink.c with 95% similarity]
tools/gst-element-maker [moved from tools/element-maker with 67% similarity]

index f501ef3..ceb8be8 100644 (file)
@@ -1,24 +1,28 @@
 
+templatefiles=\
+       element-templates/audiofilter \
+       element-templates/audiosink \
+       element-templates/audiosrc \
+       element-templates/base \
+       element-templates/baseaudiosink \
+       element-templates/baseaudiosrc \
+       element-templates/basertpdepayload \
+       element-templates/basertppayload \
+       element-templates/basesink \
+       element-templates/basesrc \
+       element-templates/basetransform \
+       element-templates/cddabasesrc \
+       element-templates/element \
+       element-templates/gobject \
+       element-templates/pushsrc \
+       element-templates/sinkpad \
+       element-templates/sinkpad-simple \
+       element-templates/srcpad \
+       element-templates/srcpad-simple \
+       element-templates/tagdemux \
+       element-templates/videosink
+
 EXTRA_DIST = \
-       element-maker \
-       base.c \
-       gobject.c \
-       gstaudiofilter.c \
-       gstaudiosink.c \
-       gstaudiosrc.c \
-       gstbaseaudiosink.c \
-       gstbaseaudiosrc.c \
-       gstbasertpdepayload.c \
-       gstbasertppayload.c \
-       gstbasesink.c \
-       gstbasesrc.c \
-       gstbasetransform.c \
-       gstcddabasesrc.c \
-       gstelement.c \
-       gstpushsrc.c \
-       gsttagdemux.c \
-       gstvideosink.c \
-       sinkpad.c \
-       sinkpad-simple.c \
-       srcpad.c \
-       srcpad-simple.c
+       gst-element-maker \
+       $(templatefiles)
+
similarity index 95%
rename from tools/gstaudiofilter.c
rename to tools/element-templates/audiofilter
index 698e756..2d09293 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstAudioFilter
 % TYPE_CLASS_NAME
similarity index 98%
rename from tools/gstaudiosink.c
rename to tools/element-templates/audiosink
index 645993a..2a1b7a4 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstAudioSink
 % TYPE_CLASS_NAME
similarity index 98%
rename from tools/gstaudiosrc.c
rename to tools/element-templates/audiosrc
index 051211e..fe4f612 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstAudioSrc
 % TYPE_CLASS_NAME
similarity index 97%
rename from tools/base.c
rename to tools/element-templates/base
index 990168a..44d6528 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % copyright
 /* GStreamer
similarity index 95%
rename from tools/gstbaseaudiosink.c
rename to tools/element-templates/baseaudiosink
index 695b685..4d6555d 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseAudioSink
 % TYPE_CLASS_NAME
similarity index 95%
rename from tools/gstbaseaudiosrc.c
rename to tools/element-templates/baseaudiosrc
index 6ef302b..8b0e4ab 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseAudioSrc
 % TYPE_CLASS_NAME
similarity index 98%
rename from tools/gstbasertpdepayload.c
rename to tools/element-templates/basertpdepayload
index 8257a32..8b40e52 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseRTPDepayload
 % TYPE_CLASS_NAME
similarity index 97%
rename from tools/gstbasertppayload.c
rename to tools/element-templates/basertppayload
index 65d216f..1a5be18 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseRTPPayload
 % TYPE_CLASS_NAME
similarity index 99%
rename from tools/gstbasesink.c
rename to tools/element-templates/basesink
index 26ad3f9..bf01828 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseSink
 % TYPE_CLASS_NAME
similarity index 99%
rename from tools/gstbasesrc.c
rename to tools/element-templates/basesrc
index 048e274..0b7e56f 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseSrc
 % TYPE_CLASS_NAME
similarity index 99%
rename from tools/gstbasetransform.c
rename to tools/element-templates/basetransform
index 7dcbc85..e5fd24c 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstBaseTransform
 % TYPE_CLASS_NAME
similarity index 97%
rename from tools/gstcddabasesrc.c
rename to tools/element-templates/cddabasesrc
index 201a843..d788d19 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstCddaBaseSrc
 % TYPE_CLASS_NAME
similarity index 99%
rename from tools/gstelement.c
rename to tools/element-templates/element
index c9e05c6..ed025ee 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstElement
 % TYPE_CLASS_NAME
similarity index 98%
rename from tools/gobject.c
rename to tools/element-templates/gobject
index dc5392d..4ef34e6 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % includes
 % prototypes
similarity index 95%
rename from tools/gstpushsrc.c
rename to tools/element-templates/pushsrc
index a355950..4dfb678 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstPushSrc
 % TYPE_CLASS_NAME
similarity index 99%
rename from tools/sinkpad.c
rename to tools/element-templates/sinkpad
index 87babbc..6d3bad1 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % instance-members
   GstPad *sinkpad;
similarity index 95%
rename from tools/sinkpad-simple.c
rename to tools/element-templates/sinkpad-simple
index 9a031fc..e8538b6 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % instance-members
   GstPad *sinkpad;
similarity index 99%
rename from tools/srcpad.c
rename to tools/element-templates/srcpad
index 61cbd21..d1f7992 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % instance-members
   GstPad *srcpad;
similarity index 95%
rename from tools/srcpad-simple.c
rename to tools/element-templates/srcpad-simple
index 42db8d3..0fca915 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 
 % instance-members
   GstPad *srcpad;
similarity index 97%
rename from tools/gsttagdemux.c
rename to tools/element-templates/tagdemux
index 6cdfb58..8517c58 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstTagDemux
 % TYPE_CLASS_NAME
similarity index 95%
rename from tools/gstvideosink.c
rename to tools/element-templates/videosink
index 72a9e88..d26de55 100644 (file)
@@ -1,3 +1,4 @@
+/* vim: set filetype=c: */
 % ClassName
 GstVideoSink
 % TYPE_CLASS_NAME
similarity index 67%
rename from tools/element-maker
rename to tools/gst-element-maker
index 60dc35d..816385d 100755 (executable)
@@ -2,6 +2,7 @@
 
 
 prefix=gst
+templatedir=element-templates
 
 while [ "$1" ] ; do
   case $1 in
@@ -43,7 +44,7 @@ if [ "$name" = "" -o "$class" = "" ] ; then
   exit 1
 fi
 
-if [ ! -f "gst$class.c" ] ; then
+if [ ! -f "element-templates/$class" ] ; then
   echo "Template file for $class not found."
   exit 1
 fi
@@ -69,11 +70,11 @@ if [ "$EMAIL_ADDRESS" = "" ] ; then
   EMAIL_ADDRESS=fixme@example.com
 fi
 
-source=gst$class.c
-pkg=`grep -A 10000 '^% pkg-config' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
-GST_TYPE_BASE_REPLACE=`grep -A 10000 '^% TYPE_CLASS_NAME' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
-GstBaseReplace=`grep -A 10000 '^% ClassName' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
-pads=`grep -A 10000 '^% pads' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
+
+pkg=`grep -A 10000 '^% pkg-config' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
+GST_TYPE_BASE_REPLACE=`grep -A 10000 '^% TYPE_CLASS_NAME' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
+GstBaseReplace=`grep -A 10000 '^% ClassName' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
+pads=`grep -A 10000 '^% pads' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
 
 generate ()
 {
@@ -115,7 +116,7 @@ cat <<-EOF
  */
 EOF
 
-#grep -A 10000 '^% copyright' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+#grep -A 10000 '^% copyright' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 cat <<EOF
 
@@ -125,9 +126,9 @@ cat <<EOF
 
 EOF
 
-grep -A 10000 '^% includes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% includes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% includes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 cat <<EOF
 #include "gstreplace.h"
@@ -136,12 +137,12 @@ cat <<EOF
 
 EOF
 
-grep -A 10000 '^% prototypes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% prototypes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% prototypes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% prototypes' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% prototypes' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% prototypes' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 for each in $pads
 do
-  grep -A 10000 '^% prototypes' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% prototypes' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 cat <<EOF
@@ -157,7 +158,7 @@ EOF
 
 for each in $pads
 do
-  grep -A 10000 '^% pad-template' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% pad-template' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 cat <<EOF
@@ -176,7 +177,7 @@ EOF
 
 for each in $pads
 do
-  grep -A 10000 '^% base-init' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% base-init' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 cat <<EOF
@@ -189,15 +190,15 @@ static void
 gst_replace_class_init (GstReplaceClass * klass)
 {
 EOF
-grep -A 10000 '^% declare-class' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% declare-class' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% declare-class' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% declare-class' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% declare-class' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% declare-class' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 echo
 
-grep -A 10000 '^% set-methods' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% set-methods' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% set-methods' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% set-methods' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% set-methods' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% set-methods' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 cat <<EOF
 
@@ -210,7 +211,7 @@ EOF
 
 for each in $pads
 do
-  grep -A 10000 '^% instance-init' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% instance-init' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 
@@ -219,12 +220,12 @@ cat <<EOF
 EOF
 
 
-grep -A 10000 '^% methods' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% methods' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% methods' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% methods' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% methods' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% methods' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 for each in $pads
 do
-  grep -A 10000 '^% methods' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% methods' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 
@@ -267,7 +268,7 @@ EOF
 generate_header ()
 {
 
-grep -A 10000 '^% copyright' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% copyright' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 cat <<EOF
 #ifndef _GST_REPLACE_H_
@@ -275,9 +276,9 @@ cat <<EOF
 
 EOF
 
-grep -A 10000 '^% includes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% includes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
-grep -A 10000 '^% includes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/base | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/gobject | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+grep -A 10000 '^% includes' $templatedir/$class | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 
 cat <<EOF
 
@@ -305,7 +306,7 @@ EOF
 
 for each in $pads
 do
-  grep -A 10000 '^% instance-members' $each.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
+  grep -A 10000 '^% instance-members' $templatedir/$each | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
 done
 
 cat <<EOF