Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > d620e9f76c810e9fbdaebc304909c8fc > files > 269

lib64gstreamer0.10-devel-0.10.36-7.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Using the Project Stamp</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79;charset=UTF-8"><LINK
REL="HOME"
TITLE="GStreamer Plugin Writer's Guide (0.10.36)"
HREF="index.html"><LINK
REL="UP"
TITLE="Constructing the Boilerplate"
HREF="chapter-building-boiler.html"><LINK
REL="PREVIOUS"
TITLE="Constructing the Boilerplate"
HREF="chapter-building-boiler.html"><LINK
REL="NEXT"
TITLE="Examining the Basic Code"
HREF="section-boiler-examine.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
><SPAN
CLASS="application"
>GStreamer</SPAN
> Plugin Writer's Guide (0.10.36)</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chapter-building-boiler.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Constructing the Boilerplate</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="section-boiler-examine.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="section-boiler-project-stamp"
>3.2. Using the Project Stamp</A
></H1
><P
>&#13;      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 <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>boilerplate</I
></SPAN
>.
    </P
><P
>&#13;      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
      <TT
CLASS="filename"
>./gst-plugins/tools/</TT
> directory.
      This tool, <TT
CLASS="filename"
>make_element</TT
>, is a command line utility
      that creates the boilerplate code for you.
    </P
><P
>&#13;      To use <B
CLASS="command"
>make_element</B
>, first open up a terminal window.
      Change to the <TT
CLASS="filename"
>gst-template/gst-plugin/src</TT
>
      directory, and then run the <B
CLASS="command"
>make_element</B
> command. The
      arguments to the <B
CLASS="command"
>make_element</B
> are:
    </P
><P
></P
><OL
TYPE="1"
><LI
><P
>the name of the plugin, and</P
></LI
><LI
><P
>&#13;          the source file that the tool will use. By default,
          <TT
CLASS="filename"
>gstplugin</TT
> is used.
        </P
></LI
></OL
><P
>&#13;      For example, the following commands create the MyFilter plugin based on
      the plugin template and put the output files in the
      <TT
CLASS="filename"
>gst-template/gst-plugin/src</TT
>
      directory:
    </P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>shell $ </SAMP
><KBD
CLASS="userinput"
>cd gst-template/gst-plugin/src</KBD
>
<SAMP
CLASS="prompt"
>shell $ </SAMP
><KBD
CLASS="userinput"
>../tools/make_element MyFilter</KBD
>
    </PRE
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>&#13;        Capitalization is important for the name of the plugin. Keep in mind
        that under some operating systems, capitalization is also important
        when specifying directory and file names in general.
      </P
></TD
></TR
></TABLE
></DIV
><P
>&#13;      The last command creates two files:
      <TT
CLASS="filename"
>gstexamplefilter.c</TT
> and
      <TT
CLASS="filename"
>gstexamplefilter.h</TT
>.
    </P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>&#13;        It is recommended that you create a copy of the <TT
CLASS="filename"
>gst-plugin</TT
>
	directory before continuing.
      </P
></TD
></TR
></TABLE
></DIV
><P
>&#13;      Now one needs to adjust the <TT
CLASS="filename"
>Makefile.am</TT
> to use the
      new filenames and run <TT
CLASS="filename"
>autogen.sh</TT
> from the parent
      directory to bootstrap the build environment. After that, the project
      can be built and installed using the well known
      <KBD
CLASS="userinput"
>make &#38;&#38; sudo make install</KBD
> commands.
    </P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>&#13;        Be aware that by default <TT
CLASS="filename"
>autogen.sh</TT
> and 
        <TT
CLASS="filename"
>configure</TT
> would choose <TT
CLASS="filename"
>/usr/local</TT
>
        as a default location. One would need to add
        <TT
CLASS="filename"
>/usr/local/lib/gstreamer-0.10</TT
>
        to <CODE
CLASS="symbol"
>GST_PLUGIN_PATH</CODE
> in order to make the new plugin
        show up in gstreamer.
      </P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chapter-building-boiler.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="section-boiler-examine.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Constructing the Boilerplate</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="chapter-building-boiler.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Examining the Basic Code</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>