23,772
edits
mNo edit summary |
|||
Line 1: | Line 1: | ||
{{#seo: | |||
|title=Creating a GStreamer Element using Templates | |||
|title_mode=replace | |||
|description={{{description|Learn more about how to create a new GStreamer Element or Application Using Templates.}}} | |||
}} | |||
This wiki describes how to make use of the rather hidden tools included with GStreamer to create empty skeletons for different GStreamer elements. | This wiki describes how to make use of the rather hidden tools included with GStreamer to create empty skeletons for different GStreamer elements. | ||
{| | |||
| style="text-align:right; vertical-align:top;" | __TOC__ | |||
| {{ContactUs Button}} | |||
|} | |||
{{ContactUs Button}} | |||
== Preparation for Creating a new GStreamer Element or GStreamer application using Templates == | == Preparation for Creating a new GStreamer Element or GStreamer application using Templates == | ||
Line 16: | Line 14: | ||
All the utilities described in this wiki are included within the GStreamer monorepo, so start by cloning it. The steps shown were tested on Ubuntu 22.04. | All the utilities described in this wiki are included within the GStreamer monorepo, so start by cloning it. The steps shown were tested on Ubuntu 22.04. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
git clone https://github.com/GStreamer/gstreamer.git | git clone https://github.com/GStreamer/gstreamer.git | ||
Line 29: | Line 27: | ||
If you are going to be developing a new plugin, then you most likely need to install the GStreamer development libraries as well. | If you are going to be developing a new plugin, then you most likely need to install the GStreamer development libraries as well. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev indent | sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev indent | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 38: | Line 36: | ||
The <tt>gst-project-maker</tt> tool creates a barebones Meson project to hold your new plugin. | The <tt>gst-project-maker</tt> tool creates a barebones Meson project to hold your new plugin. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
cd subprojects/gst-plugins-bad/tools/ | cd subprojects/gst-plugins-bad/tools/ | ||
./gst-project-maker my_project | ./gst-project-maker my_project | ||
Line 44: | Line 42: | ||
Now, you should see a new directory called '''gst-my_project'''. You may move this directory to wherever you want and you should be able to build it: | Now, you should see a new directory called '''gst-my_project'''. You may move this directory to wherever you want and you should be able to build it: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
cd gst-my_project | cd gst-my_project | ||
meson setup builddir --werror --prefix /usr/ | meson setup builddir --werror --prefix /usr/ | ||
Line 51: | Line 49: | ||
There are a few additional options you may check by running: | There are a few additional options you may check by running: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
./gst-project-maker --help | ./gst-project-maker --help | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 88: | Line 86: | ||
To create a new element/object using the BASE_CLASS parameter (for example BASE_CLASS=videofilter), you may run the following: | To create a new element/object using the BASE_CLASS parameter (for example BASE_CLASS=videofilter), you may run the following: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
cd subprojects/gst-plugins-bad/tools | cd subprojects/gst-plugins-bad/tools | ||
Line 122: | Line 120: | ||
This tool creates a barebones GStreamer application. | This tool creates a barebones GStreamer application. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang="bash"> | ||
cd subprojects/gst-plugins-bad/tools | cd subprojects/gst-plugins-bad/tools | ||