summaryrefslogtreecommitdiffstats
path: root/gst/videofilter/make_filter
blob: 50741e7906088b8c42074d80e173af9731d96f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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;
	# remember to break up the Id: in the line below
	s/\$I[d]: (.*)\$/$1/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;