Commit 8b20bbc3 authored by Stéphane Cerveau's avatar Stéphane Cerveau 🤸🏻
Browse files

template: update make_element

update make_element script to work with
gstplugin.c and gsttransform.c

Part-of: <!8>
parent 506d95cd
......@@ -37,3 +37,16 @@ gstaudiofilterexample = library('gstaudiofilterexample',
install : true,
install_dir : plugins_install_dir,
)
# The TEMPLATE Plugin
### gstTEMPLATE_sources = [
### 'src/gstTEMPLATE.c',
### ]
###gstTEMPLATEexample = library('gstTEMPLATE',
### gstTEMPLATE_sources,
### c_args: plugin_c_args,
### dependencies : [gst_dep, gstbase_dep],
### install : true,
### install_dir : plugins_install_dir,
###)
......@@ -99,8 +99,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
#define gst_plugin_template_parent_class parent_class
G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE (myfirstplugin, "myfirstplugin", GST_RANK_NONE,
GST_TYPE_PLUGIN);
GST_ELEMENT_REGISTER_DEFINE (plugin_template, "plugin_template", GST_RANK_NONE,
GST_TYPE_PLUGIN_TEMPLATE);
static void gst_plugin_template_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
......@@ -263,7 +263,7 @@ plugin_init (GstPlugin * plugin)
GST_DEBUG_CATEGORY_INIT (gst_plugin_template_debug, "plugin",
0, "Template plugin");
return GST_ELEMENT_REGISTER (myfirstplugin, plugin);
return GST_ELEMENT_REGISTER (plugin_template, plugin);
}
/* PACKAGE: this is usually set by meson depending on some _INIT macro
......@@ -282,6 +282,6 @@ plugin_init (GstPlugin * plugin)
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
plugin,
"Template plugin",
"plugin_template",
plugin_init,
PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
......@@ -76,8 +76,8 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
#define gst_plugin_template_parent_class parent_class
G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_BASE_TRANSFORM);
GST_ELEMENT_REGISTER_DEFINE (myfirstplugin, "myfirstplugin", GST_RANK_NONE,
GST_TYPE_PLUGIN);
GST_ELEMENT_REGISTER_DEFINE (plugin_template, "plugin_template", GST_RANK_NONE,
GST_TYPE_PLUGIN_TEMPLATE);
static void gst_plugin_template_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
......@@ -197,7 +197,7 @@ gst_plugin_template_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (myfirstplugin, plugin);
return GST_ELEMENT_REGISTER (plugin_template, plugin);
}
/* gstreamer looks for this structure to register plugins
......@@ -207,6 +207,6 @@ plugin_init (GstPlugin * plugin)
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
plugin,
"Template plugin",
"plugin_template",
plugin_init,
PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
......@@ -3,6 +3,7 @@
Template=$1;
srcfile=$2.c;
srcfile_h=$2.h;
meson_build=../meson.build;
if test x"$1" = x ; then
echo "$0 Objectname [srcfile]\n";
......@@ -45,8 +46,7 @@ sed \
-e "s/gstplugin\.h/gst$filename.h/g" \
-e "s/gsttransform\.h/gst$filename.h/g" \
-e "s/GstPluginTemplate/Gst$Template/g" \
-e "s/gst_plugin_template/gst_$template_/g" \
-e "s/gst_type_plugin_template/gst_$template_/g" \
-e "s/plugin_template/$template_/g" \
-e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
-e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
-e 's/\$I[d]: \([^$]*\)\$/\1/g' \
......@@ -63,9 +63,9 @@ if [ -e $srcfile_h ]; then
sed \
-e 's/gstplugin\.c/SOURCEFILE/g' \
-e "s/GstPluginTemplate/Gst$Template/g" \
-e "s/gst_plugin_template/gst_$template_/g" \
-e "s/plugin_template/$template_/g" \
-e "s/gst_type_plugin_template/gst_$template_/g" \
-e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
-e "s/PLUGIN_TEMPLATE/$TEMPLATE/g" \
-e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
-e "s/GST_IS_PLUGIN_TEMPLATE/GST_IS_$TEMPLATE/g" \
-e 's/\$I[d]: \([^$]*\)\$/\1/g' \
......@@ -79,3 +79,9 @@ if [ -e $srcfile_h ]; then
$srcfile_h >gst$filename.h.tmp && mv gst$filename.h.tmp gst$filename.h
fi
if [ -e $meson_build ]; then
sed \
-e "s/TEMPLATE/$Template/g" \
-e "s/###//g" \
$meson_build > $meson_build.tmp && mv $meson_build.tmp $meson_build
fi
\ No newline at end of file
......@@ -10,6 +10,8 @@ api_version = '1.0'
gst_dep = dependency('gstreamer-1.0', version : '>=1.19',
required : true, fallback : ['gstreamer', 'gst_dep'])
gstbase_dep = dependency('gstreamer-base-1.0', version : '>=1.19',
fallback : ['gstreamer', 'gst_base_dep'])
subdir('gst-app')
subdir('gst-plugin')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment