Using the Project Stamp

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 is a tool in the ./gst-plugins/tools/ directory. This tool, make_element, is a command line utillity that creates the boilerplate code for you.

To use make_element, first open up a terminal window. Change to the gst-template/gst-plugin/src directory, and then run the make_element command. The arguments to the make_element are:

  1. the name of the plugin, and

  2. the source file that the tool will use. By default, gstplugin is used.

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 the gst-template/gst-plugin/src directory:


shell $ cd gst-template/gst-plugin/src
shell $ ../tools/make_element ExampleFilter
    

The last command creates two files: gstexamplefilter.c and gstexamplefilter.h.

Note

It is recommened that you reate a copy of the gst-plugin directory before continuing. Do not copy the CVS direcories though.