gstreamer/docs/manual/init.xml
Wim Taymans 4afbf577a2 Documentation updates
Original commit message from CVS:
Documentation updates
2002-07-24 19:46:42 +00:00

63 lines
1.8 KiB
XML

<chapter id="cha-initialisation">
<title>Initializing <application>GStreamer</application></title>
<para>
When writing a <application>GStreamer</application> application, you can
simply include gst/gst.h to get access to the library functions.
</para>
<para>
Before the <application>GStreamer</application> libraries can be used
gst_init () has to be performed from the main app. this call will perform
first initialisation and will parse the GStreamer specific command line
options.
</para>
<para>
A typical program would start like this:
</para>
<programlisting>
#include &lt;gst/gst.h&gt;
...
int
main (int argc, char *argv[])
{
...
gst_init (&amp;argc, &amp;argv);
...
}
</programlisting>
<para>
It is also possible to call the gst_init method with two NULL arguments.
</para>
<para>
Use the GST_VERSION_MAJOR, GST_VERSION_MINOR and GST_VERSION_MICRO macros to
get the <application>GStreamer</application> version you are building against or
use gst_version() to get the version you are linked against.
</para>
<sect1>
<title>The popt interface</title>
<para>
You can also use a popt table to initialize your own parameters as shown in the next code fragment:
</para>
<programlisting>
int
main(int argc, char *argv[])
{
gboolean silent = FALSE;
gchar *savefile = NULL;
struct poptOption options[] = {
{"silent", 's', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &amp;silent, 0,
"do not output status information", NULL},
{"output", 'o', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, &amp;savefile, 0,
"save xml representation of pipeline to FILE and exit", "FILE"},
POPT_TABLEEND
};
gst_init_with_popt_table (&amp;argc, &amp;argv, options);
...
</programlisting>
</sect1>
</chapter>