summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2013-04-01 20:12:57 -0700
committerDavid Schleef <ds@schleef.org>2013-04-09 15:36:17 -0700
commit5a70924251c257e9c7dbdb718421a2b68fa21a83 (patch)
tree96d1a1c5c11689421a3d4db1fd693f8dfe8f8bd8 /tools
parent9fd00c01a3716312636fa101eebd46a9951c3b5f (diff)
downloadgstreamer-plugins-bad-5a70924251c257e9c7dbdb718421a2b68fa21a83.tar.gz
gst-element-maker: create better element name when using --prefix
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gst-element-maker11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gst-element-maker b/tools/gst-element-maker
index 8a9b29ef1..facb242ea 100755
--- a/tools/gst-element-maker
+++ b/tools/gst-element-maker
@@ -64,6 +64,11 @@ GstReplace=${Prefix}${Name}
gst_replace=${prefix}_${name}
gstreplace=${prefix}$(echo $name | sed -e 's/_//g')
replace=$(echo $name | sed -e 's/_//g')
+if [ "${prefix}" = gst ] ; then
+ prefixreplace=$replace
+else
+ prefixreplace=$gstreplace
+fi
if [ "$REAL_NAME" = "" ] ; then
REAL_NAME=FIXME
@@ -169,7 +174,7 @@ cat <<EOF
/* class initialization */
G_DEFINE_TYPE_WITH_CODE (GstReplace, gst_replace, GST_TYPE_BASE_REPLACE,
- GST_DEBUG_CATEGORY_INIT (gst_replace_debug_category, "replace", 0,
+ GST_DEBUG_CATEGORY_INIT (gst_replace_debug_category, "prefixreplace", 0,
"debug category for replace element"));
static void
@@ -235,7 +240,7 @@ plugin_init (GstPlugin * plugin)
/* FIXME Remember to set the rank if it's an element that is meant
to be autoplugged by decodebin. */
- return gst_element_register (plugin, "replace", GST_RANK_NONE,
+ return gst_element_register (plugin, "prefixreplace", GST_RANK_NONE,
GST_TYPE_REPLACE);
}
@@ -359,6 +364,7 @@ generate | sed \
-e "s/GstReplace/$GstReplace/g" \
-e "s/gst_replace/$gst_replace/g" \
-e "s/gstreplace/$gstreplace/g" \
+ -e "s/prefixreplace/$prefixreplace/g" \
-e "s/replace/$replace/g" >$gstreplace.c
generate_header | sed \
@@ -371,6 +377,7 @@ generate_header | sed \
-e "s/GstReplace/$GstReplace/g" \
-e "s/gst_replace/$gst_replace/g" \
-e "s/gstreplace/$gstreplace/g" \
+ -e "s/prefixreplace/$prefixreplace/g" \
-e "s/replace/$replace/g" >$gstreplace.h
gst-indent $gstreplace.c