GStreamer Plugin Writer's Guide (0.8.9.2) | ||
---|---|---|
<<< Previous | Constructing the Boilerplate | Next >>> |
The first thing to do when making a new element is to specify some basic details about it: what its name is, who wrote it, what version number it is, etc. We also need to define an object to represent the element and to store the data the element needs. These details are collectively known as the boilerplate.
The standard way of defining the boilerplate is simply to write some code, and fill in some structures. As mentioned in the previous section, the easiest way to do this is to copy a template and add functionality according to your needs. To help you do so, there are some tools in the ./gst-plugins/tools/ directory. One tool, gst-quick-stamp, is a quick command line tool. The other, gst-project-stamp, is a full GNOME druid application that takes you through the steps of creating a new project (either a plugin or an application).
To use pluginstamp.sh, first open up a terminal window. Change to the gst-template directory, and then run the pluginstamp.sh command. The arguments to the pluginstamp.sh are:
the name of the plugin, and
the directory that should hold a new subdirectory for the source tree of the plugin.
Note that capitalization is important for the name of the plugin. Under some operating systems, capitalization is also important when specifying directory names. For example, the following commands create the ExampleFilter plugin based on the plugin template and put the output files in a new directory called ~/src/examplefilter/:
shell $ cd gst-template shell $ tools/pluginstamp.sh ExampleFilter ~/src |
<<< Previous | Home | Next >>> |
Constructing the Boilerplate | Up | Examining the Basic Code |