two more examples

Original commit message from CVS:
two more examples
This commit is contained in:
Thomas Vander Stichele 2004-09-08 21:43:59 +00:00
parent bd2d8d6e6a
commit 00ec0495e1
6 changed files with 60 additions and 19 deletions

View file

@ -1,3 +1,10 @@
2004-09-08 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/gst/tmpl/gstthread.sgml:
* docs/manual/init-api.xml:
* examples/manual/Makefile.am:
convert two code bits to examples
2004-09-06 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstelement.c: (gst_element_change_state):

View file

@ -49,7 +49,7 @@ Thread flags:
@GST_THREAD_STATE_SPINNING: The thread is runnning
@GST_THREAD_STATE_REAPING: The thread is ending.
@GST_THREAD_MUTEX_LOCKED:
@GST_THREAD_STATE_WAITING:
@GST_THREAD_FLAG_LAST: subclass use this to start their enumeration
<!-- ##### FUNCTION gst_thread_new ##### -->

View file

@ -12,21 +12,29 @@
well as parse the GStreamer-specific command line options.
</para>
<para>
A typical program would start like this:
A typical program would have code to initialize GStreamer that
looks like this:
</para>
<programlisting>
#include &lt;gst/gst.h&gt;
/* example-begin init.c */
...
#include &lt;gst/gst.h&gt;
int
main (int argc, char *argv[])
{
...
guint major, minor, micro;
gst_init (&amp;argc, &amp;argv);
...
gst_version (&amp;major, &amp;minor, &amp;micro);
printf ("This program is linked against GStreamer %d.%d.%d\n",
major, minor, micro);
return 0;
}
/* example-end init.c */
</programlisting>
<para>
Use the <symbol>GST_VERSION_MAJOR</symbol>,
@ -44,9 +52,14 @@ main (int argc, char *argv[])
<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:
You can also use a popt table to initialize your own parameters as shown in the
next example:
</para>
<programlisting>
/* example-begin popt.c */
#include &lt;gst/gst.h&gt;
int
main(int argc, char *argv[])
{
@ -62,7 +75,11 @@ main(int argc, char *argv[])
gst_init_with_popt_table (&amp;argc, &amp;argv, options);
...
printf ("Run me with --help to see the Application options appended.\n");
return 0;
}
/* example-end popt.c */
</programlisting>
<para>
As shown in this fragment, you can use a <ulink

View file

@ -12,21 +12,29 @@
well as parse the GStreamer-specific command line options.
</para>
<para>
A typical program would start like this:
A typical program would have code to initialize GStreamer that
looks like this:
</para>
<programlisting>
#include &lt;gst/gst.h&gt;
/* example-begin init.c */
...
#include &lt;gst/gst.h&gt;
int
main (int argc, char *argv[])
{
...
guint major, minor, micro;
gst_init (&amp;argc, &amp;argv);
...
gst_version (&amp;major, &amp;minor, &amp;micro);
printf ("This program is linked against GStreamer %d.%d.%d\n",
major, minor, micro);
return 0;
}
/* example-end init.c */
</programlisting>
<para>
Use the <symbol>GST_VERSION_MAJOR</symbol>,
@ -44,9 +52,14 @@ main (int argc, char *argv[])
<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:
You can also use a popt table to initialize your own parameters as shown in the
next example:
</para>
<programlisting>
/* example-begin popt.c */
#include &lt;gst/gst.h&gt;
int
main(int argc, char *argv[])
{
@ -62,7 +75,11 @@ main(int argc, char *argv[])
gst_init_with_popt_table (&amp;argc, &amp;argv, options);
...
printf ("Run me with --help to see the Application options appended.\n");
return 0;
}
/* example-end popt.c */
</programlisting>
<para>
As shown in this fragment, you can use a <ulink

View file

@ -10,7 +10,7 @@ else
GST_LOADSAVE_SRC = xml-mp3
endif
EXAMPLES = dynamic $(GNOME) helloworld queue threads $(GST_LOADSAVE_SRC)
EXAMPLES = dynamic $(GNOME) helloworld init popt queue threads $(GST_LOADSAVE_SRC)
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_OBJ_LIBS)
@ -29,5 +29,5 @@ EXTRA_DIST = extract.pl
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
dynamic.c gnome.c helloworld.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
dynamic.c gnome.c helloworld.c init.c popt.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(PERL_PATH) $(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml

View file

@ -10,7 +10,7 @@ else
GST_LOADSAVE_SRC = xml-mp3
endif
EXAMPLES = dynamic $(GNOME) helloworld queue threads $(GST_LOADSAVE_SRC)
EXAMPLES = dynamic $(GNOME) helloworld init popt queue threads $(GST_LOADSAVE_SRC)
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_OBJ_LIBS)
@ -29,5 +29,5 @@ EXTRA_DIST = extract.pl
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
dynamic.c gnome.c helloworld.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
dynamic.c gnome.c helloworld.c init.c popt.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(PERL_PATH) $(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml