mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 05:46:36 +00:00
70cfc6cb4d
Original commit message from CVS: * new parser that uses flex and bison - doesn't do dynamic pipelines yet... * added GErrors to the gst_parse_launch[v] api * added --gst-mask-help command line option * fixed -o option for gst-launch * GstElement api change: - gst_element_get_pad - gst_element_get_request_pad, gst_element_get_static_pad - gst_element_get_compatible_pad - gst_element_get_compatible_static_pad, gst_element_get_compatible_request_pad - gst_element_[dis]connect -> gst_element_[dis]connect_pads - gst_element_[dis]connect_elements -> gst_element_[dis]connect * manual update * example, tool, and doc updates for the api changes - no more plugin docs in the core docs, plugins require a more extensive doc system
62 lines
1.6 KiB
XML
62 lines
1.6 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 <gst/gst.h>
|
|
|
|
...
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
...
|
|
gst_init (&argc, &argv);
|
|
...
|
|
}
|
|
</programlisting>
|
|
<para>
|
|
It is also possible to call the gst_init method with two NULL argumants.
|
|
</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.
|
|
</para>
|
|
<sect1>
|
|
<title>The popt interface</title>
|
|
<para>
|
|
more info here
|
|
</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, &silent, 0,
|
|
"do not output status information", NULL},
|
|
{"output", 'o', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, &savefile, 0,
|
|
"save xml representation of pipeline to FILE and exit", "FILE"},
|
|
POPT_TABLEEND
|
|
};
|
|
|
|
gst_init_with_popt_table (&argc, &argv, options);
|
|
|
|
...
|
|
</programlisting>
|
|
</sect1>
|
|
|
|
</chapter>
|