diff options
Diffstat (limited to 'gst/videofilter/make_filter')
-rwxr-xr-x | gst/videofilter/make_filter | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gst/videofilter/make_filter b/gst/videofilter/make_filter new file mode 100755 index 00000000..06bb1fed --- /dev/null +++ b/gst/videofilter/make_filter @@ -0,0 +1,42 @@ +#!/usr/bin/perl +# + +if(scalar(@ARGV) < 1){ + print "$0 Objectname\n"; + print " creates gstobjectname.{c,h} implementing GstObjectname,\n"; + print " subclassing GstVideofilter.\n"; + exit(0); +} + +$Template = $ARGV[0]; +($TEMPLATE = $Template) =~ tr/a-z/A-Z/; +($template = $Template) =~ tr/A-Z/a-z/; + +open IN, "gstvideotemplate.c"; +open OUT, ">gst$template.c"; + +@lines = <IN>; +map { s/Videotemplate/$Template/g; + s/videotemplate/$template/g; + s/VIDEOTEMPLATE/$TEMPLATE/g; +} @lines; + +print OUT @lines; + +close IN; +close OUT; + +open IN, "gstvideotemplate.h"; +open OUT, ">gst$template.h"; + +@lines = <IN>; +map { s/Videotemplate/$Template/g; + s/videotemplate/$template/g; + s/VIDEOTEMPLATE/$TEMPLATE/g; +} @lines; + +print OUT @lines; + +close IN; +close OUT; + |