diff --git a/tools/Makefile.am b/tools/Makefile.am index f501ef3530..ceb8be87f2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -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) + diff --git a/tools/gstaudiofilter.c b/tools/element-templates/audiofilter similarity index 95% rename from tools/gstaudiofilter.c rename to tools/element-templates/audiofilter index 698e756b4e..2d0929364f 100644 --- a/tools/gstaudiofilter.c +++ b/tools/element-templates/audiofilter @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstAudioFilter % TYPE_CLASS_NAME diff --git a/tools/gstaudiosink.c b/tools/element-templates/audiosink similarity index 98% rename from tools/gstaudiosink.c rename to tools/element-templates/audiosink index 645993ae09..2a1b7a421b 100644 --- a/tools/gstaudiosink.c +++ b/tools/element-templates/audiosink @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstAudioSink % TYPE_CLASS_NAME diff --git a/tools/gstaudiosrc.c b/tools/element-templates/audiosrc similarity index 98% rename from tools/gstaudiosrc.c rename to tools/element-templates/audiosrc index 051211e563..fe4f6129fe 100644 --- a/tools/gstaudiosrc.c +++ b/tools/element-templates/audiosrc @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstAudioSrc % TYPE_CLASS_NAME diff --git a/tools/base.c b/tools/element-templates/base similarity index 97% rename from tools/base.c rename to tools/element-templates/base index 990168a319..44d6528923 100644 --- a/tools/base.c +++ b/tools/element-templates/base @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % copyright /* GStreamer diff --git a/tools/gstbaseaudiosink.c b/tools/element-templates/baseaudiosink similarity index 95% rename from tools/gstbaseaudiosink.c rename to tools/element-templates/baseaudiosink index 695b685fb0..4d6555d7dd 100644 --- a/tools/gstbaseaudiosink.c +++ b/tools/element-templates/baseaudiosink @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseAudioSink % TYPE_CLASS_NAME diff --git a/tools/gstbaseaudiosrc.c b/tools/element-templates/baseaudiosrc similarity index 95% rename from tools/gstbaseaudiosrc.c rename to tools/element-templates/baseaudiosrc index 6ef302b0ef..8b0e4ab0ef 100644 --- a/tools/gstbaseaudiosrc.c +++ b/tools/element-templates/baseaudiosrc @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseAudioSrc % TYPE_CLASS_NAME diff --git a/tools/gstbasertpdepayload.c b/tools/element-templates/basertpdepayload similarity index 98% rename from tools/gstbasertpdepayload.c rename to tools/element-templates/basertpdepayload index 8257a32719..8b40e52656 100644 --- a/tools/gstbasertpdepayload.c +++ b/tools/element-templates/basertpdepayload @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseRTPDepayload % TYPE_CLASS_NAME diff --git a/tools/gstbasertppayload.c b/tools/element-templates/basertppayload similarity index 97% rename from tools/gstbasertppayload.c rename to tools/element-templates/basertppayload index 65d216f64c..1a5be183d0 100644 --- a/tools/gstbasertppayload.c +++ b/tools/element-templates/basertppayload @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseRTPPayload % TYPE_CLASS_NAME diff --git a/tools/gstbasesink.c b/tools/element-templates/basesink similarity index 99% rename from tools/gstbasesink.c rename to tools/element-templates/basesink index 26ad3f9218..bf018283df 100644 --- a/tools/gstbasesink.c +++ b/tools/element-templates/basesink @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseSink % TYPE_CLASS_NAME diff --git a/tools/gstbasesrc.c b/tools/element-templates/basesrc similarity index 99% rename from tools/gstbasesrc.c rename to tools/element-templates/basesrc index 048e274dd1..0b7e56fc17 100644 --- a/tools/gstbasesrc.c +++ b/tools/element-templates/basesrc @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseSrc % TYPE_CLASS_NAME diff --git a/tools/gstbasetransform.c b/tools/element-templates/basetransform similarity index 99% rename from tools/gstbasetransform.c rename to tools/element-templates/basetransform index 7dcbc8588a..e5fd24cf3a 100644 --- a/tools/gstbasetransform.c +++ b/tools/element-templates/basetransform @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstBaseTransform % TYPE_CLASS_NAME diff --git a/tools/gstcddabasesrc.c b/tools/element-templates/cddabasesrc similarity index 97% rename from tools/gstcddabasesrc.c rename to tools/element-templates/cddabasesrc index 201a843c96..d788d19c41 100644 --- a/tools/gstcddabasesrc.c +++ b/tools/element-templates/cddabasesrc @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstCddaBaseSrc % TYPE_CLASS_NAME diff --git a/tools/gstelement.c b/tools/element-templates/element similarity index 99% rename from tools/gstelement.c rename to tools/element-templates/element index c9e05c66c0..ed025ee2b2 100644 --- a/tools/gstelement.c +++ b/tools/element-templates/element @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstElement % TYPE_CLASS_NAME diff --git a/tools/gobject.c b/tools/element-templates/gobject similarity index 98% rename from tools/gobject.c rename to tools/element-templates/gobject index dc5392d860..4ef34e6c2d 100644 --- a/tools/gobject.c +++ b/tools/element-templates/gobject @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % includes % prototypes diff --git a/tools/gstpushsrc.c b/tools/element-templates/pushsrc similarity index 95% rename from tools/gstpushsrc.c rename to tools/element-templates/pushsrc index a35595085b..4dfb678494 100644 --- a/tools/gstpushsrc.c +++ b/tools/element-templates/pushsrc @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstPushSrc % TYPE_CLASS_NAME diff --git a/tools/sinkpad.c b/tools/element-templates/sinkpad similarity index 99% rename from tools/sinkpad.c rename to tools/element-templates/sinkpad index 87babbc7f9..6d3bad1fb3 100644 --- a/tools/sinkpad.c +++ b/tools/element-templates/sinkpad @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % instance-members GstPad *sinkpad; diff --git a/tools/sinkpad-simple.c b/tools/element-templates/sinkpad-simple similarity index 95% rename from tools/sinkpad-simple.c rename to tools/element-templates/sinkpad-simple index 9a031fc150..e8538b6ece 100644 --- a/tools/sinkpad-simple.c +++ b/tools/element-templates/sinkpad-simple @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % instance-members GstPad *sinkpad; diff --git a/tools/srcpad.c b/tools/element-templates/srcpad similarity index 99% rename from tools/srcpad.c rename to tools/element-templates/srcpad index 61cbd21326..d1f799267d 100644 --- a/tools/srcpad.c +++ b/tools/element-templates/srcpad @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % instance-members GstPad *srcpad; diff --git a/tools/srcpad-simple.c b/tools/element-templates/srcpad-simple similarity index 95% rename from tools/srcpad-simple.c rename to tools/element-templates/srcpad-simple index 42db8d385b..0fca9157ed 100644 --- a/tools/srcpad-simple.c +++ b/tools/element-templates/srcpad-simple @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % instance-members GstPad *srcpad; diff --git a/tools/gsttagdemux.c b/tools/element-templates/tagdemux similarity index 97% rename from tools/gsttagdemux.c rename to tools/element-templates/tagdemux index 6cdfb58d8e..8517c5802f 100644 --- a/tools/gsttagdemux.c +++ b/tools/element-templates/tagdemux @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstTagDemux % TYPE_CLASS_NAME diff --git a/tools/gstvideosink.c b/tools/element-templates/videosink similarity index 95% rename from tools/gstvideosink.c rename to tools/element-templates/videosink index 72a9e88789..d26de559b8 100644 --- a/tools/gstvideosink.c +++ b/tools/element-templates/videosink @@ -1,3 +1,4 @@ +/* vim: set filetype=c: */ % ClassName GstVideoSink % TYPE_CLASS_NAME diff --git a/tools/element-maker b/tools/gst-element-maker similarity index 67% rename from tools/element-maker rename to tools/gst-element-maker index 60dc35d3be..816385d965 100755 --- a/tools/element-maker +++ b/tools/gst-element-maker @@ -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 <