whitespace fixes

Original commit message from CVS:
whitespace fixes
This commit is contained in:
Thomas Vander Stichele 2002-09-08 21:17:16 +00:00
parent b9b6c6890a
commit 9f8ab3ed2f
30 changed files with 364 additions and 317 deletions

View file

@ -28,11 +28,11 @@
<para> <para>
While this mechanism is quite effective it also has some big problems: While this mechanism is quite effective it also has some big problems:
The elements are created based on their name. Indeed, we create an The elements are created based on their name. Indeed, we create an
element mad by explicitly stating the mad element's name. element mad by explicitly stating the mad element's name. Our little
Our little program therefore always uses the mad decoder element program therefore always uses the mad decoder element to decode
to decode the MP3 audio stream, even if there are 3 other MP3 decoders the MP3 audio stream, even if there are 3 other MP3 decoders in the
in the system. We will see how we can use a more general way to create system. We will see how we can use a more general way to create an
an MP3 decoder element. MP3 decoder element.
</para> </para>
<para> <para>
We have to introduce the concept of MIME types and capabilities We have to introduce the concept of MIME types and capabilities
@ -124,8 +124,8 @@
the given MIME type. the given MIME type.
</para> </para>
<para> <para>
There is also an association between a MIME type and a file extension, but the use of typefind There is also an association between a MIME type and a file extension,
functions (similar to file(1)) is preferred.. but the use of typefind functions (similar to file(1)) is preferred..
</para> </para>
<para> <para>
The type information is maintained in a list of The type information is maintained in a list of
@ -147,9 +147,10 @@ struct _GstType {
}; };
</programlisting> </programlisting>
<para> <para>
All operations on <classname>GstType</classname> occur via their All operations on <classname>GstType</classname> occur
<classname>guint16 id</classname> numbers, with <classname>GstType</classname> via their <classname>guint16 id</classname> numbers, with
structure private to the GStreamer library. <classname>GstType</classname> structure private to the GStreamer
library.
</para> </para>
<sect2> <sect2>

View file

@ -4,7 +4,8 @@
<sect1> <sect1>
<title>Getting Started</title> <title>Getting Started</title>
<para> <para>
The dparams subsystem is contained within the <filename>gstcontrol</filename> library. The dparams subsystem is contained within the
<filename>gstcontrol</filename> library.
You need to include the header in your applications's source file: You need to include the header in your applications's source file:
</para> </para>
@ -18,8 +19,9 @@
Your application should link to the shared library <filename>gstcontrol</filename>. Your application should link to the shared library <filename>gstcontrol</filename>.
</para> </para>
<para> <para>
The <filename>gstcontrol</filename> library needs to be initialised when your application is run. The <filename>gstcontrol</filename> library needs to be initialised
This can be done after the the GStreamer library has been initialised. when your application is run. This can be done after the the GStreamer
library has been initialised.
</para> </para>
<programlisting> <programlisting>
... ...

View file

@ -28,15 +28,15 @@
</itemizedlist> </itemizedlist>
</para> </para>
<para> <para>
The scheduler is a plugable component, this means that alternative schedulers The scheduler is a plugable component, this means that alternative
can be written and plugged into GStreamer. The default scheduler uses cothreads schedulers can be written and plugged into GStreamer. The default scheduler
to schedule the plugins in a pipeline. Cothreads are fast and lightweight uses cothreads to schedule the plugins in a pipeline. Cothreads are fast
user-space threads. and lightweight user-space threads.
</para> </para>
<para> <para>
There is usually no need to interact with the scheduler directly, however it some There is usually no need to interact with the scheduler directly, however
cases it is feasable to set a specific clock or force a specific plugin as the it some cases it is feasable to set a specific clock or force a specific
entry point in the pipeline. plugin as the entry point in the pipeline.
</para> </para>
</chapter> </chapter>

View file

@ -31,22 +31,24 @@
</programlisting> </programlisting>
<para> <para>
The above program will create a thread with two elements in it. As soon as it is set to the The above program will create a thread with two elements in it. As soon
PLAYING state, the thread will start to iterate itself. You never need to manually iterate a as it is set to the PLAYING state, the thread will start to iterate
thread. itself. You never need to manually iterate a thread.
</para> </para>
<sect2> <sect2>
<title>Constraints placed on the pipeline by the GstThread</title> <title>Constraints placed on the pipeline by the GstThread</title>
<para> <para>
Within the pipeline, everything is the same as in any other bin. The difference lies at the Within the pipeline, everything is the same as in any other bin. The
thread boundary, at the connection between the thread and the outside world (containing bin). difference lies at the thread boundary, at the connection between the
Since GStreamer is fundamentally buffer-oriented rather than byte-oriented, the natural thread and the outside world (containing bin). Since GStreamer is
solution to this problem is an element that can "buffer" the buffers between the threads, in a fundamentally buffer-oriented rather than byte-oriented, the natural
thread-safe fashion. This element is the queue, described more fully in <xref solution to this problem is an element that can "buffer" the buffers
linkend="cha-queues"/>. It doesn't matter if the queue is placed in the containing bin or in between the threads, in a thread-safe fashion. This element is the
the thread itself, but it needs to be present on one side of the other to enable inter-thread queue, described more fully in <xref linkend="cha-queues"/>. It doesn't
communication. matter if the queue is placed in the containing bin or in the thread
itself, but it needs to be present on one side of the other to enable
inter-thread communication.
</para> </para>
</sect2> </sect2>
<sect2> <sect2>

View file

@ -35,10 +35,11 @@ gst-launch filesrc location=redpill.vob ! mpegdemux name=demux \
</para> </para>
<para> <para>
You can also use the the parser in you own code. <application>GStreamer</application> You can also use the the parser in you own
provides a function gst_parse_launch () that you can use to construt a pipeline. code. <application>GStreamer</application> provides a function
The following programs lets you create an mp3 pipeline using the gst_parse_launch () gst_parse_launch () that you can use to construt a pipeline.
function: The following programs lets you create an mp3 pipeline using the
gst_parse_launch () function:
</para> </para>
<programlisting> <programlisting>
#include &lt;gst/gst.h&gt; #include &lt;gst/gst.h&gt;
@ -92,10 +93,10 @@ main (int argc, char *argv[])
... mad ... ... mad ...
</screen> </screen>
<para> <para>
A bare identifier (a string beginning with a letter and containing only letters, A bare identifier (a string beginning with a letter and containing
numbers, dashes, underscores, percent signs, or colons) will create an element from a only letters, numbers, dashes, underscores, percent signs, or colons)
given elementfactory. In this example, an instance of the "mad" mp3 decoding plugin will will create an element from a given elementfactory. In this example,
be created. an instance of the "mad" mp3 decoding plugin will be created.
</para> </para>
</sect3> </sect3>
<sect3> <sect3>

View file

@ -9,12 +9,13 @@
elements needed for the conversion. elements needed for the conversion.
</para> </para>
<para> <para>
The autoplugger API is implemented in an abstract class. Autoplugger implementations The autoplugger API is implemented in an abstract class. Autoplugger
reside in plugins and are therefore optional and can be optimized for a specific implementations reside in plugins and are therefore optional and can be
task. Two types of autopluggers exist: renderer ones and non optimized for a specific task. Two types of autopluggers exist: renderer
renderer ones. the renderer autopluggers will not have any src pads while the ones and non renderer ones. the renderer autopluggers will not have any
non renderer ones do. The renderer autopluggers are mainly used for media src pads while the non renderer ones do. The renderer autopluggers are
playback while the non renderer ones are used for arbitrary format conversion. mainly used for media playback while the non renderer ones are used for
arbitrary format conversion.
</para> </para>
<sect1> <sect1>
@ -27,9 +28,10 @@
A list of all available autopluggers can be obtained with gst_autoplug_factory_get_list(). A list of all available autopluggers can be obtained with gst_autoplug_factory_get_list().
</para> </para>
<para> <para>
If the autoplugger supports the RENDERER API, use gst_autoplug_to_renderers() call to If the autoplugger supports the RENDERER API, use
create a bin that connects the src caps to the specified render elements. You can gst_autoplug_to_renderers() call to create a bin that connects the
then add the bin to a pipeline and run it. src caps to the specified render elements. You can then add the bin
to a pipeline and run it.
<programlisting> <programlisting>
@ -58,9 +60,9 @@
</programlisting> </programlisting>
</para> </para>
<para> <para>
If the autoplugger supports the CAPS API, use the gst_autoplug_to_caps() function to If the autoplugger supports the CAPS API, use the gst_autoplug_to_caps()
connect the src caps to the destination caps. The created bin will have src and sink function to connect the src caps to the destination caps. The created
pads compatible with the provided caps. bin will have src and sink pads compatible with the provided caps.
<programlisting> <programlisting>
@ -105,14 +107,14 @@
<orderedlist> <orderedlist>
<listitem> <listitem>
<para> <para>
Add the autoplugcache element to a bin and connect the sink pad to the src Add the autoplugcache element to a bin and connect the sink pad
pad of an element with unknown caps. to the src pad of an element with unknown caps.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Connect the src pad of the autoplugcache to the sink pad of the typefind Connect the src pad of the autoplugcache to the sink pad of the
element. typefind element.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -122,8 +124,8 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Remove the typefind element and add the plugins needed to play back the discovered Remove the typefind element and add the plugins needed to play
media type to the autoplugcache src pad. back the discovered media type to the autoplugcache src pad.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -148,9 +150,10 @@
<sect1> <sect1>
<title>Another approach to autoplugging</title> <title>Another approach to autoplugging</title>
<para> <para>
The autoplug API is interesting, but often impractical. It is static; it cannot deal with The autoplug API is interesting, but often impractical. It is static;
dynamic pipelines (insert ref here). What one often wants is just an element to stick into a it cannot deal with dynamic pipelines (insert ref here). What one
pipeline that will DWIM (ref). Enter the spider. often wants is just an element to stick into a pipeline that will DWIM
(ref). Enter the spider.
</para> </para>
<sect2> <sect2>
<title>The spider element</title> <title>The spider element</title>
@ -176,9 +179,11 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Has request pads on the src side. This means that it can autoplug one source stream Has request pads on the src side. This means that it can autoplug
into many sink streams. For example, a MPEG1 system stream can have audio as well as one source stream into many sink streams. For example, a MPEG1
video; that pipeline would be represented in gst-launch syntax as system stream can have audio as well as video; that pipeline
would be represented in gst-launch syntax as
<programlisting> <programlisting>
$ gst-launch filesrc location=my.mpeg1 ! spider ! { queue ! osssink } spider.src_%d! $ gst-launch filesrc location=my.mpeg1 ! spider ! { queue ! osssink } spider.src_%d!
{ queue ! xvideosink } { queue ! xvideosink }

View file

@ -49,7 +49,8 @@
<sect1 id="sec-bin-create"> <sect1 id="sec-bin-create">
<title>Creating a bin</title> <title>Creating a bin</title>
<para> <para>
Bins register themselves in the GStreamer registry, so they can be created in the normal way: Bins register themselves in the GStreamer registry, so they can be
created in the normal way:
</para> </para>
<programlisting> <programlisting>
GstElement *bin, *thread, *pipeline; GstElement *bin, *thread, *pipeline;
@ -97,9 +98,9 @@
... ...
</programlisting> </programlisting>
<para> <para>
You can see that the name of the element becomes very handy for retrieving the You can see that the name of the element becomes very handy
element from an bin by using the element's name. gst_bin_get_by_name () will for retrieving the element from an bin by using the element's
recursively search nested bins. name. gst_bin_get_by_name () will recursively search nested bins.
</para> </para>
<para> <para>
To get a list of elements in a bin, use: To get a list of elements in a bin, use:
@ -128,8 +129,8 @@
... ...
</programlisting> </programlisting>
<para> <para>
To add many elements to a bin at the same time, try the gst_bin_add_many () API. Remember to To add many elements to a bin at the same time, try the gst_bin_add_many
pass NULL as the last argument. () API. Remember to pass NULL as the last argument.
</para> </para>
<programlisting> <programlisting>
GstElement *filesrc, *decoder, *audiosink; GstElement *filesrc, *decoder, *audiosink;
@ -144,9 +145,9 @@
<sect1 id="sec-bin-custom"> <sect1 id="sec-bin-custom">
<title>Custom bins</title> <title>Custom bins</title>
<para> <para>
The application programmer can create custom bins packed with elements to perform a The application programmer can create custom bins packed with elements
specific task. This allow you to write an MPEG audio decoder with just the follwing lines to perform a specific task. This allow you to write an MPEG audio
of code: decoder with just the follwing lines of code:
</para> </para>
<programlisting> <programlisting>
@ -164,13 +165,14 @@
gst_element_set_state (GST_ELEMENT (mp3player), GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (mp3player), GST_STATE_NULL);
</programlisting> </programlisting>
<para> <para>
Note that the above code assumes that the mp3player bin derives itself from a Note that the above code assumes that the mp3player bin derives itself
<classname>GstThread</classname>, which begins to play as soon as its state is set to PLAYING. from a <classname>GstThread</classname>, which begins to play as soon
Other bin types may need explicit iteration. For more information, see <xref as its state is set to PLAYING. Other bin types may need explicit
linkend="cha-threads"/>. iteration. For more information, see <xref linkend="cha-threads"/>.
Custom bins can be created with a plugin or an XML description. You will find more Custom bins can be created with a plugin or an XML description. You
information about creating custom bin in the Plugin Writers Guide (FIXME ref). will find more information about creating custom bin in the Plugin
Writers Guide (FIXME ref).
</para> </para>
</sect1> </sect1>
@ -224,9 +226,9 @@
</programlisting> </programlisting>
<para> <para>
In the above example, the bin now also has a pad: the pad called 'sink' of the In the above example, the bin now also has a pad: the pad called 'sink'
given element. We can now, for example, connect the srcpad of a filesrc to the of the given element. We can now, for example, connect the srcpad of
bin with: a filesrc to the bin with:
</para> </para>
<programlisting> <programlisting>
GstElement *filesrc; GstElement *filesrc;

View file

@ -1,10 +1,10 @@
<chapter id="cha-buffers"> <chapter id="cha-buffers">
<title>Buffers</title> <title>Buffers</title>
<para> <para>
Buffers contain the data that will flow through the pipeline you have created. A source Buffers contain the data that will flow through the pipeline you have
element will typically create a new buffer and pass it through the pad to the next created. A source element will typically create a new buffer and pass
element in the chain. it through the pad to the next element in the chain. When using the
When using the GStreamer infrastructure to create a media pipeline you will not have GStreamer infrastructure to create a media pipeline you will not have
to deal with buffers yourself; the elements will do that for you. to deal with buffers yourself; the elements will do that for you.
</para> </para>
<para> <para>
@ -23,8 +23,9 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A refcount that indicates how many elements are using this buffer. This refcount A refcount that indicates how many elements are using this
will be used to destroy the buffer when no element is having a reference to it. buffer. This refcount will be used to destroy the buffer when no
element is having a reference to it.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>

View file

@ -39,9 +39,9 @@
</mediaobject> </mediaobject>
</figure> </figure>
<para> <para>
Source elements do not accept data, they only generate data. You can see Source elements do not accept data, they only generate data. You can
this in the figure because it only has a src pad. A src pad can only see this in the figure because it only has a src pad. A src pad can
generate data. only generate data.
</para> </para>
</sect2> </sect2>

View file

@ -1,17 +1,18 @@
<chapter id="cha-hello"> <chapter id="cha-hello">
<title>Your first application</title> <title>Your first application</title>
<para> <para>
This chapter describes the most rudimentary aspects of a <application>GStreamer</application> application, This chapter describes the most rudimentary aspects of a
including initializing the libraries, creating elements, packing them into <application>GStreamer</application> application, including initializing
a pipeline and playing, pause and stop the pipeline. the libraries, creating elements, packing them into a pipeline and playing,
pause and stop the pipeline.
</para> </para>
<sect1> <sect1>
<title>Hello world</title> <title>Hello world</title>
<para> <para>
We will create a simple first application, a complete MP3 player, using standard We will create a simple first application, a complete MP3 player, using
<application>GStreamer</application> components. The player will read from a file that is standard <application>GStreamer</application> components. The player
given as the first argument of the program. will read from a file that is given as the first argument of the program.
</para> </para>
<programlisting> <programlisting>
@ -90,8 +91,9 @@ main (int argc, char *argv[])
</programlisting> </programlisting>
<para> <para>
We are going to create 3 elements and one pipeline. Since all elements share the same base We are going to create 3 elements and one pipeline. Since all elements
type, <classname>GstElement</classname>, we can define them as: share the same base type, <classname>GstElement</classname>, we can
define them as:
</para> </para>
<programlisting> <programlisting>
... ...
@ -100,9 +102,9 @@ main (int argc, char *argv[])
</programlisting> </programlisting>
<para> <para>
Next, we are going to create an empty pipeline. As you have seen in the basic Next, we are going to create an empty pipeline. As you have seen in
introduction, this pipeline will hold and manage all the elements we are the basic introduction, this pipeline will hold and manage all the
going to stuff into it. elements we are going to stuff into it.
</para> </para>
<programlisting> <programlisting>
/* create a new pipeline to hold the elements */ /* create a new pipeline to hold the elements */
@ -208,9 +210,9 @@ main (int argc, char *argv[])
while (gst_bin_iterate (GST_BIN (pipeline))); while (gst_bin_iterate (GST_BIN (pipeline)));
</programlisting> </programlisting>
<para> <para>
The gst_bin_iterate() function will return TRUE as long as something interesting The gst_bin_iterate() function will return TRUE as long as something
happended inside the pipeline. When the end-of-file has been reached the _iterate interesting happended inside the pipeline. When the end-of-file has been
function will return FALSE and we can end the loop. reached the _iterate function will return FALSE and we can end the loop.
</para> </para>
<programlisting> <programlisting>
/* stop the pipeline */ /* stop the pipeline */

View file

@ -24,8 +24,9 @@
This function will get the pad named "src" from the given element. This function will get the pad named "src" from the given element.
</para> </para>
<para> <para>
Alternatively, you can also request a GList of pads from the element. The following Alternatively, you can also request a GList of pads from the element. The
code example will print the names of all the pads of an element. following code example will print the names of all the pads of an
element.
</para> </para>
<programlisting> <programlisting>
GList *pads; GList *pads;
@ -47,9 +48,9 @@
get_pad_set_name(). get_pad_set_name().
</para> </para>
<para> <para>
gst_pad_get_direction (GstPad *pad) can be used to query if the pad is a sink gst_pad_get_direction (GstPad *pad) can be used to query if the pad
or a src pad. Remember a src pad is a pad that can output data and a sink pad is is a sink or a src pad. Remember a src pad is a pad that can output
one that accepts data. data and a sink pad is one that accepts data.
</para> </para>
<para> <para>
You can get the parent of the pad, this is the element that this pad belongs to, You can get the parent of the pad, this is the element that this pad belongs to,
@ -60,10 +61,10 @@
<sect2 id="sec-pads-dynamic"> <sect2 id="sec-pads-dynamic">
<title>Dynamic pads</title> <title>Dynamic pads</title>
<para> <para>
Some elements might not have their pads when they are created. This can, for Some elements might not have their pads when they are created. This
example, happen with an MPEG2 system demuxer. The demuxer will create its can, for example, happen with an MPEG2 system demuxer. The demuxer will
pads at runtime when it detects the different elementary streams in the MPEG2 create its pads at runtime when it detects the different elementary
system stream. streams in the MPEG2 system stream.
</para> </para>
<para> <para>
Running <application>gst-inspect mpegdemux</application> will show that Running <application>gst-inspect mpegdemux</application> will show that
@ -122,9 +123,9 @@ main(int argc, char *argv[])
<sect2 id="sec-pads-request"> <sect2 id="sec-pads-request">
<title>Request pads</title> <title>Request pads</title>
<para> <para>
An element can also have request pads. These pads are not created automatically An element can also have request pads. These pads are not created
but are only created on demand. This is very usefull for muxers, aggregators automatically but are only created on demand. This is very usefull
and tee elements. for muxers, aggregators and tee elements.
</para> </para>
<para> <para>
The tee element, for example, has one input pad and a request padtemplate for the The tee element, for example, has one input pad and a request padtemplate for the
@ -153,8 +154,8 @@ main(int argc, char *argv[])
It is also possible to request a pad that is compatible with another It is also possible to request a pad that is compatible with another
padtemplate. This is very usefull if you want to connect an element to padtemplate. This is very usefull if you want to connect an element to
a muxer element and you need to request a pad that is compatible. The a muxer element and you need to request a pad that is compatible. The
gst_element_get_compatible_pad is used to request a compatible pad, as gst_element_get_compatible_pad is used to request a compatible pad,
is shown in the next example. as is shown in the next example.
</para> </para>
<programlisting> <programlisting>
... ...
@ -216,8 +217,9 @@ struct _GstCaps {
three properties: layer, bitrate and framed. three properties: layer, bitrate and framed.
</para> </para>
<para> <para>
The src pad (output pad) is called 'src' and outputs data of MIME type 'audio/raw'. It also has The src pad (output pad) is called 'src' and outputs data of MIME
four properties: format, depth, rate and channels. type 'audio/raw'. It also has four properties: format, depth, rate
and channels.
</para> </para>
<programlisting> <programlisting>
Pads: Pads:
@ -245,9 +247,9 @@ Pads:
<sect2 id="sec-pads-props"> <sect2 id="sec-pads-props">
<title>What are properties</title> <title>What are properties</title>
<para> <para>
Properties are used to describe extra information for the capabilities. The properties Properties are used to describe extra information for the
basically exist of a key (a string) and a value. There are different possibile value types capabilities. The properties basically exist of a key (a string) and
that can be used: a value. There are different possibile value types that can be used:
</para> </para>
<itemizedlist> <itemizedlist>
@ -258,8 +260,9 @@ Pads:
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
An integer range value. The property denotes a range of possible values. In the case An integer range value. The property denotes a range of possible
of the mad element: the src pad has a property rate that can go from 11025 to 48000. values. In the case of the mad element: the src pad has a property
rate that can go from 11025 to 48000.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -342,13 +345,16 @@ Pads:
<sect2 id="sec-pads-caps-create"> <sect2 id="sec-pads-caps-create">
<title>Creating capabilities structures</title> <title>Creating capabilities structures</title>
<para> <para>
While the capabilities are mainly used inside the plugin to describe the media type of the While the capabilities are mainly used inside the plugin to describe
pads, the application programmer also has to have basic understanding of caps in order to the media type of the pads, the application programmer also has
interface with the plugins, specially when using the autopluggers. to have basic understanding of caps in order to interface with the
plugins, specially when using the autopluggers.
</para> </para>
<para> <para>
As we said, a capability has a name, a mime-type and some properties. The signature of the As we said, a capability has a name, a mime-type and some
function to create a new <classname>GstCaps</classname> structure is like: properties. The signature of the function to create a new
<classname>GstCaps</classname> structure is like:
<programlisting> <programlisting>
GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props); GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props);
</programlisting> </programlisting>

View file

@ -49,7 +49,8 @@
<sect1 id="sec-bin-create"> <sect1 id="sec-bin-create">
<title>Creating a bin</title> <title>Creating a bin</title>
<para> <para>
Bins register themselves in the GStreamer registry, so they can be created in the normal way: Bins register themselves in the GStreamer registry, so they can be
created in the normal way:
</para> </para>
<programlisting> <programlisting>
GstElement *bin, *thread, *pipeline; GstElement *bin, *thread, *pipeline;
@ -97,9 +98,9 @@
... ...
</programlisting> </programlisting>
<para> <para>
You can see that the name of the element becomes very handy for retrieving the You can see that the name of the element becomes very handy
element from an bin by using the element's name. gst_bin_get_by_name () will for retrieving the element from an bin by using the element's
recursively search nested bins. name. gst_bin_get_by_name () will recursively search nested bins.
</para> </para>
<para> <para>
To get a list of elements in a bin, use: To get a list of elements in a bin, use:
@ -128,8 +129,8 @@
... ...
</programlisting> </programlisting>
<para> <para>
To add many elements to a bin at the same time, try the gst_bin_add_many () API. Remember to To add many elements to a bin at the same time, try the gst_bin_add_many
pass NULL as the last argument. () API. Remember to pass NULL as the last argument.
</para> </para>
<programlisting> <programlisting>
GstElement *filesrc, *decoder, *audiosink; GstElement *filesrc, *decoder, *audiosink;
@ -144,9 +145,9 @@
<sect1 id="sec-bin-custom"> <sect1 id="sec-bin-custom">
<title>Custom bins</title> <title>Custom bins</title>
<para> <para>
The application programmer can create custom bins packed with elements to perform a The application programmer can create custom bins packed with elements
specific task. This allow you to write an MPEG audio decoder with just the follwing lines to perform a specific task. This allow you to write an MPEG audio
of code: decoder with just the follwing lines of code:
</para> </para>
<programlisting> <programlisting>
@ -164,13 +165,14 @@
gst_element_set_state (GST_ELEMENT (mp3player), GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (mp3player), GST_STATE_NULL);
</programlisting> </programlisting>
<para> <para>
Note that the above code assumes that the mp3player bin derives itself from a Note that the above code assumes that the mp3player bin derives itself
<classname>GstThread</classname>, which begins to play as soon as its state is set to PLAYING. from a <classname>GstThread</classname>, which begins to play as soon
Other bin types may need explicit iteration. For more information, see <xref as its state is set to PLAYING. Other bin types may need explicit
linkend="cha-threads"/>. iteration. For more information, see <xref linkend="cha-threads"/>.
Custom bins can be created with a plugin or an XML description. You will find more Custom bins can be created with a plugin or an XML description. You
information about creating custom bin in the Plugin Writers Guide (FIXME ref). will find more information about creating custom bin in the Plugin
Writers Guide (FIXME ref).
</para> </para>
</sect1> </sect1>
@ -224,9 +226,9 @@
</programlisting> </programlisting>
<para> <para>
In the above example, the bin now also has a pad: the pad called 'sink' of the In the above example, the bin now also has a pad: the pad called 'sink'
given element. We can now, for example, connect the srcpad of a filesrc to the of the given element. We can now, for example, connect the srcpad of
bin with: a filesrc to the bin with:
</para> </para>
<programlisting> <programlisting>
GstElement *filesrc; GstElement *filesrc;

View file

@ -1,10 +1,10 @@
<chapter id="cha-buffers"> <chapter id="cha-buffers">
<title>Buffers</title> <title>Buffers</title>
<para> <para>
Buffers contain the data that will flow through the pipeline you have created. A source Buffers contain the data that will flow through the pipeline you have
element will typically create a new buffer and pass it through the pad to the next created. A source element will typically create a new buffer and pass
element in the chain. it through the pad to the next element in the chain. When using the
When using the GStreamer infrastructure to create a media pipeline you will not have GStreamer infrastructure to create a media pipeline you will not have
to deal with buffers yourself; the elements will do that for you. to deal with buffers yourself; the elements will do that for you.
</para> </para>
<para> <para>
@ -23,8 +23,9 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A refcount that indicates how many elements are using this buffer. This refcount A refcount that indicates how many elements are using this
will be used to destroy the buffer when no element is having a reference to it. buffer. This refcount will be used to destroy the buffer when no
element is having a reference to it.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>

View file

@ -14,16 +14,17 @@
</mediaobject> </mediaobject>
</figure> </figure>
<para> <para>
By connecting these three elements, we have created a very simple pipeline. The effect By connecting these three elements, we have created a very simple
of this will be that the output of the source element (element1) will be used as input pipeline. The effect of this will be that the output of the source element
for the filter element (element2). The filter element will do something with the data and (element1) will be used as input for the filter element (element2). The
send the result to the final sink element (element3). filter element will do something with the data and send the result to
the final sink element (element3).
</para> </para>
<para> <para>
Imagine the above graph as a simple mpeg audio decoder. The source element is a Imagine the above graph as a simple mpeg audio decoder. The source
disk source, the filter element is the mpeg decoder and the sink element is your element is a disk source, the filter element is the mpeg decoder and
audiocard. We will use this simple graph to construct an mpeg player later the sink element is your audiocard. We will use this simple graph to
in this manual. construct an mpeg player later in this manual.
</para> </para>
<sect1 id="sec-conn-basic"> <sect1 id="sec-conn-basic">
@ -87,8 +88,8 @@
You can query if a pad is connected with GST_PAD_IS_CONNECTED (pad). You can query if a pad is connected with GST_PAD_IS_CONNECTED (pad).
</para> </para>
<para> <para>
To query for the <classname>GstPad</classname> this srcpad is connected to, use To query for the <classname>GstPad</classname> this srcpad is connected
gst_pad_get_peer (srcpad). to, use gst_pad_get_peer (srcpad).
</para> </para>
</sect1> </sect1>

View file

@ -97,20 +97,24 @@ chain_function (GstPad *pad, GstBuffer *buffer)
</para> </para>
<para> <para>
When the request for a buffer cannot immediatly satisfied, the control will be given to the When the request for a buffer cannot immediatly satisfied, the control
source element of the loop-based element until it performs a push on its source pad. At that will be given to the source element of the loop-based element until it
time the control is handed back to the loop-based element, etc... The the execution trace can performs a push on its source pad. At that time the control is handed
get fairly complex using cothreads when there are multiple input/output pads for the back to the loop-based element, etc... The the execution trace can get
loop-based element. Cothread switches are performed within the call to gst_pad_pull and fairly complex using cothreads when there are multiple input/output
gst_pad_push; from the perspective of the loop-based element, it just "appears" that pads for the loop-based element. Cothread switches are performed within
gst_pad_push (or _pull) might take a long time to return. the call to gst_pad_pull and gst_pad_push; from the perspective of
the loop-based element, it just "appears" that gst_pad_push (or _pull)
might take a long time to return.
</para> </para>
<para> <para>
Loop based elements are mainly used for the more complex elements that need a specific amount Loop based elements are mainly used for the more complex elements
of data before they can start to produce output. An example of such an element is the mpeg that need a specific amount of data before they can start to produce
video decoder. the element will pull a buffer, performs some decoding on it and optionally output. An example of such an element is the mpeg video decoder. the
requests more buffers to decode, when a complete video frame has been decoded, a buffer is element will pull a buffer, performs some decoding on it and optionally
send out. For example, any plugin using the bytestream library will need to be loop-based. requests more buffers to decode, when a complete video frame has
been decoded, a buffer is send out. For example, any plugin using the
bytestream library will need to be loop-based.
</para> </para>
<para> <para>
There is no problem in putting cothreaded elements into a <classname>GstThread</classname> to There is no problem in putting cothreaded elements into a <classname>GstThread</classname> to

View file

@ -4,7 +4,8 @@
<sect1> <sect1>
<title>Getting Started</title> <title>Getting Started</title>
<para> <para>
The dparams subsystem is contained within the <filename>gstcontrol</filename> library. The dparams subsystem is contained within the
<filename>gstcontrol</filename> library.
You need to include the header in your applications's source file: You need to include the header in your applications's source file:
</para> </para>
@ -18,8 +19,9 @@
Your application should link to the shared library <filename>gstcontrol</filename>. Your application should link to the shared library <filename>gstcontrol</filename>.
</para> </para>
<para> <para>
The <filename>gstcontrol</filename> library needs to be initialised when your application is run. The <filename>gstcontrol</filename> library needs to be initialised
This can be done after the the GStreamer library has been initialised. when your application is run. This can be done after the the GStreamer
library has been initialised.
</para> </para>
<programlisting> <programlisting>
... ...

View file

@ -1,12 +1,12 @@
<chapter id="cha-dynamic"> <chapter id="cha-dynamic">
<title>Dynamic pipelines</title> <title>Dynamic pipelines</title>
<para> <para>
In this chapter we will see how you can create a dynamic pipeline. A dynamic In this chapter we will see how you can create a dynamic pipeline. A
pipeline is a pipeline that is updated or created while media is flowing dynamic pipeline is a pipeline that is updated or created while media
through it. We will create a partial pipeline first and add more elements is flowing through it. We will create a partial pipeline first and add
while the pipeline is playing. Dynamic pipelines cause all sorts of more elements while the pipeline is playing. Dynamic pipelines cause
scheduling issues and will remain a topic of research for a long time in all sorts of scheduling issues and will remain a topic of research for
GStreamer. a long time in GStreamer.
</para> </para>
<para> <para>
We will show how to create an mpeg1 video player using dynamic pipelines. We will show how to create an mpeg1 video player using dynamic pipelines.

View file

@ -39,9 +39,9 @@
</mediaobject> </mediaobject>
</figure> </figure>
<para> <para>
Source elements do not accept data, they only generate data. You can see Source elements do not accept data, they only generate data. You can
this in the figure because it only has a src pad. A src pad can only see this in the figure because it only has a src pad. A src pad can
generate data. only generate data.
</para> </para>
</sect2> </sect2>

View file

@ -28,11 +28,11 @@
<para> <para>
While this mechanism is quite effective it also has some big problems: While this mechanism is quite effective it also has some big problems:
The elements are created based on their name. Indeed, we create an The elements are created based on their name. Indeed, we create an
element mad by explicitly stating the mad element's name. element mad by explicitly stating the mad element's name. Our little
Our little program therefore always uses the mad decoder element program therefore always uses the mad decoder element to decode
to decode the MP3 audio stream, even if there are 3 other MP3 decoders the MP3 audio stream, even if there are 3 other MP3 decoders in the
in the system. We will see how we can use a more general way to create system. We will see how we can use a more general way to create an
an MP3 decoder element. MP3 decoder element.
</para> </para>
<para> <para>
We have to introduce the concept of MIME types and capabilities We have to introduce the concept of MIME types and capabilities
@ -124,8 +124,8 @@
the given MIME type. the given MIME type.
</para> </para>
<para> <para>
There is also an association between a MIME type and a file extension, but the use of typefind There is also an association between a MIME type and a file extension,
functions (similar to file(1)) is preferred.. but the use of typefind functions (similar to file(1)) is preferred..
</para> </para>
<para> <para>
The type information is maintained in a list of The type information is maintained in a list of
@ -147,9 +147,10 @@ struct _GstType {
}; };
</programlisting> </programlisting>
<para> <para>
All operations on <classname>GstType</classname> occur via their All operations on <classname>GstType</classname> occur
<classname>guint16 id</classname> numbers, with <classname>GstType</classname> via their <classname>guint16 id</classname> numbers, with
structure private to the GStreamer library. <classname>GstType</classname> structure private to the GStreamer
library.
</para> </para>
<sect2> <sect2>

View file

@ -231,8 +231,8 @@
<partintro> <partintro>
<para> <para>
<application>GStreamer</application> comes prepackaged with a few programs. <application>GStreamer</application> comes prepackaged with a few
and some usefull debugging options. programs. and some usefull debugging options.
</para> </para>
</partintro> </partintro>

View file

@ -1,17 +1,18 @@
<chapter id="cha-hello"> <chapter id="cha-hello">
<title>Your first application</title> <title>Your first application</title>
<para> <para>
This chapter describes the most rudimentary aspects of a <application>GStreamer</application> application, This chapter describes the most rudimentary aspects of a
including initializing the libraries, creating elements, packing them into <application>GStreamer</application> application, including initializing
a pipeline and playing, pause and stop the pipeline. the libraries, creating elements, packing them into a pipeline and playing,
pause and stop the pipeline.
</para> </para>
<sect1> <sect1>
<title>Hello world</title> <title>Hello world</title>
<para> <para>
We will create a simple first application, a complete MP3 player, using standard We will create a simple first application, a complete MP3 player, using
<application>GStreamer</application> components. The player will read from a file that is standard <application>GStreamer</application> components. The player
given as the first argument of the program. will read from a file that is given as the first argument of the program.
</para> </para>
<programlisting> <programlisting>
@ -90,8 +91,9 @@ main (int argc, char *argv[])
</programlisting> </programlisting>
<para> <para>
We are going to create 3 elements and one pipeline. Since all elements share the same base We are going to create 3 elements and one pipeline. Since all elements
type, <classname>GstElement</classname>, we can define them as: share the same base type, <classname>GstElement</classname>, we can
define them as:
</para> </para>
<programlisting> <programlisting>
... ...
@ -100,9 +102,9 @@ main (int argc, char *argv[])
</programlisting> </programlisting>
<para> <para>
Next, we are going to create an empty pipeline. As you have seen in the basic Next, we are going to create an empty pipeline. As you have seen in
introduction, this pipeline will hold and manage all the elements we are the basic introduction, this pipeline will hold and manage all the
going to stuff into it. elements we are going to stuff into it.
</para> </para>
<programlisting> <programlisting>
/* create a new pipeline to hold the elements */ /* create a new pipeline to hold the elements */
@ -208,9 +210,9 @@ main (int argc, char *argv[])
while (gst_bin_iterate (GST_BIN (pipeline))); while (gst_bin_iterate (GST_BIN (pipeline)));
</programlisting> </programlisting>
<para> <para>
The gst_bin_iterate() function will return TRUE as long as something interesting The gst_bin_iterate() function will return TRUE as long as something
happended inside the pipeline. When the end-of-file has been reached the _iterate interesting happended inside the pipeline. When the end-of-file has been
function will return FALSE and we can end the loop. reached the _iterate function will return FALSE and we can end the loop.
</para> </para>
<programlisting> <programlisting>
/* stop the pipeline */ /* stop the pipeline */

View file

@ -17,9 +17,10 @@
<title>Turning GstElements into XML</title> <title>Turning GstElements into XML</title>
<para> <para>
We create a simple pipeline and write it to stdout with gst_xml_write_file (). The following We create a simple pipeline and write it to stdout with
code constructs an mp3 player pipeline with two threads and then writes out the XML both to gst_xml_write_file (). The following code constructs an mp3 player
stdout and to a file. Use this program with one argument: the mp3 file on disk. pipeline with two threads and then writes out the XML both to stdout
and to a file. Use this program with one argument: the mp3 file on disk.
</para> </para>
<programlisting> <programlisting>
@ -167,8 +168,8 @@ main(int argc, char *argv[])
<para> <para>
In addition to loading a file, you can also load a from a xmlDocPtr and In addition to loading a file, you can also load a from a xmlDocPtr and
an in memory buffer using gst_xml_parse_doc and gst_xml_parse_memory an in memory buffer using gst_xml_parse_doc and gst_xml_parse_memory
respectivily. both of these methods return a gboolean indicating success respectivily. both of these methods return a gboolean indicating
or failure of the requested action. success or failure of the requested action.
</para> </para>
</sect1> </sect1>
<sect1 id="sec-xml-custom"> <sect1 id="sec-xml-custom">
@ -254,8 +255,8 @@ object_saved (GstObject *object, xmlNodePtr parent, gpointer data)
</programlisting> </programlisting>
<para> <para>
Whenever a new object has been loaded, the xml_loaded function will be Whenever a new object has been loaded, the xml_loaded function will
called. this function looks like: be called. this function looks like:
</para> </para>
<programlisting> <programlisting>
static void static void

View file

@ -24,8 +24,9 @@
This function will get the pad named "src" from the given element. This function will get the pad named "src" from the given element.
</para> </para>
<para> <para>
Alternatively, you can also request a GList of pads from the element. The following Alternatively, you can also request a GList of pads from the element. The
code example will print the names of all the pads of an element. following code example will print the names of all the pads of an
element.
</para> </para>
<programlisting> <programlisting>
GList *pads; GList *pads;
@ -47,9 +48,9 @@
get_pad_set_name(). get_pad_set_name().
</para> </para>
<para> <para>
gst_pad_get_direction (GstPad *pad) can be used to query if the pad is a sink gst_pad_get_direction (GstPad *pad) can be used to query if the pad
or a src pad. Remember a src pad is a pad that can output data and a sink pad is is a sink or a src pad. Remember a src pad is a pad that can output
one that accepts data. data and a sink pad is one that accepts data.
</para> </para>
<para> <para>
You can get the parent of the pad, this is the element that this pad belongs to, You can get the parent of the pad, this is the element that this pad belongs to,
@ -60,10 +61,10 @@
<sect2 id="sec-pads-dynamic"> <sect2 id="sec-pads-dynamic">
<title>Dynamic pads</title> <title>Dynamic pads</title>
<para> <para>
Some elements might not have their pads when they are created. This can, for Some elements might not have their pads when they are created. This
example, happen with an MPEG2 system demuxer. The demuxer will create its can, for example, happen with an MPEG2 system demuxer. The demuxer will
pads at runtime when it detects the different elementary streams in the MPEG2 create its pads at runtime when it detects the different elementary
system stream. streams in the MPEG2 system stream.
</para> </para>
<para> <para>
Running <application>gst-inspect mpegdemux</application> will show that Running <application>gst-inspect mpegdemux</application> will show that
@ -122,9 +123,9 @@ main(int argc, char *argv[])
<sect2 id="sec-pads-request"> <sect2 id="sec-pads-request">
<title>Request pads</title> <title>Request pads</title>
<para> <para>
An element can also have request pads. These pads are not created automatically An element can also have request pads. These pads are not created
but are only created on demand. This is very usefull for muxers, aggregators automatically but are only created on demand. This is very usefull
and tee elements. for muxers, aggregators and tee elements.
</para> </para>
<para> <para>
The tee element, for example, has one input pad and a request padtemplate for the The tee element, for example, has one input pad and a request padtemplate for the
@ -153,8 +154,8 @@ main(int argc, char *argv[])
It is also possible to request a pad that is compatible with another It is also possible to request a pad that is compatible with another
padtemplate. This is very usefull if you want to connect an element to padtemplate. This is very usefull if you want to connect an element to
a muxer element and you need to request a pad that is compatible. The a muxer element and you need to request a pad that is compatible. The
gst_element_get_compatible_pad is used to request a compatible pad, as gst_element_get_compatible_pad is used to request a compatible pad,
is shown in the next example. as is shown in the next example.
</para> </para>
<programlisting> <programlisting>
... ...
@ -216,8 +217,9 @@ struct _GstCaps {
three properties: layer, bitrate and framed. three properties: layer, bitrate and framed.
</para> </para>
<para> <para>
The src pad (output pad) is called 'src' and outputs data of MIME type 'audio/raw'. It also has The src pad (output pad) is called 'src' and outputs data of MIME
four properties: format, depth, rate and channels. type 'audio/raw'. It also has four properties: format, depth, rate
and channels.
</para> </para>
<programlisting> <programlisting>
Pads: Pads:
@ -245,9 +247,9 @@ Pads:
<sect2 id="sec-pads-props"> <sect2 id="sec-pads-props">
<title>What are properties</title> <title>What are properties</title>
<para> <para>
Properties are used to describe extra information for the capabilities. The properties Properties are used to describe extra information for the
basically exist of a key (a string) and a value. There are different possibile value types capabilities. The properties basically exist of a key (a string) and
that can be used: a value. There are different possibile value types that can be used:
</para> </para>
<itemizedlist> <itemizedlist>
@ -258,8 +260,9 @@ Pads:
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
An integer range value. The property denotes a range of possible values. In the case An integer range value. The property denotes a range of possible
of the mad element: the src pad has a property rate that can go from 11025 to 48000. values. In the case of the mad element: the src pad has a property
rate that can go from 11025 to 48000.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -342,13 +345,16 @@ Pads:
<sect2 id="sec-pads-caps-create"> <sect2 id="sec-pads-caps-create">
<title>Creating capabilities structures</title> <title>Creating capabilities structures</title>
<para> <para>
While the capabilities are mainly used inside the plugin to describe the media type of the While the capabilities are mainly used inside the plugin to describe
pads, the application programmer also has to have basic understanding of caps in order to the media type of the pads, the application programmer also has
interface with the plugins, specially when using the autopluggers. to have basic understanding of caps in order to interface with the
plugins, specially when using the autopluggers.
</para> </para>
<para> <para>
As we said, a capability has a name, a mime-type and some properties. The signature of the As we said, a capability has a name, a mime-type and some
function to create a new <classname>GstCaps</classname> structure is like: properties. The signature of the function to create a new
<classname>GstCaps</classname> structure is like:
<programlisting> <programlisting>
GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props); GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props);
</programlisting> </programlisting>

View file

@ -35,10 +35,11 @@ gst-launch filesrc location=redpill.vob ! mpegdemux name=demux \
</para> </para>
<para> <para>
You can also use the the parser in you own code. <application>GStreamer</application> You can also use the the parser in you own
provides a function gst_parse_launch () that you can use to construt a pipeline. code. <application>GStreamer</application> provides a function
The following programs lets you create an mp3 pipeline using the gst_parse_launch () gst_parse_launch () that you can use to construt a pipeline.
function: The following programs lets you create an mp3 pipeline using the
gst_parse_launch () function:
</para> </para>
<programlisting> <programlisting>
#include &lt;gst/gst.h&gt; #include &lt;gst/gst.h&gt;
@ -92,10 +93,10 @@ main (int argc, char *argv[])
... mad ... ... mad ...
</screen> </screen>
<para> <para>
A bare identifier (a string beginning with a letter and containing only letters, A bare identifier (a string beginning with a letter and containing
numbers, dashes, underscores, percent signs, or colons) will create an element from a only letters, numbers, dashes, underscores, percent signs, or colons)
given elementfactory. In this example, an instance of the "mad" mp3 decoding plugin will will create an element from a given elementfactory. In this example,
be created. an instance of the "mad" mp3 decoding plugin will be created.
</para> </para>
</sect3> </sect3>
<sect3> <sect3>

View file

@ -41,8 +41,8 @@
</programlisting> </programlisting>
<para> <para>
The following mp3 player shows you how to create the above pipeline using a The following mp3 player shows you how to create the above pipeline
thread and a queue. using a thread and a queue.
</para> </para>
<programlisting> <programlisting>

View file

@ -28,15 +28,15 @@
</itemizedlist> </itemizedlist>
</para> </para>
<para> <para>
The scheduler is a plugable component, this means that alternative schedulers The scheduler is a plugable component, this means that alternative
can be written and plugged into GStreamer. The default scheduler uses cothreads schedulers can be written and plugged into GStreamer. The default scheduler
to schedule the plugins in a pipeline. Cothreads are fast and lightweight uses cothreads to schedule the plugins in a pipeline. Cothreads are fast
user-space threads. and lightweight user-space threads.
</para> </para>
<para> <para>
There is usually no need to interact with the scheduler directly, however it some There is usually no need to interact with the scheduler directly, however
cases it is feasable to set a specific clock or force a specific plugin as the it some cases it is feasable to set a specific clock or force a specific
entry point in the pipeline. plugin as the entry point in the pipeline.
</para> </para>
</chapter> </chapter>

View file

@ -1,8 +1,8 @@
<chapter id="cha-states"> <chapter id="cha-states">
<title>Element states</title> <title>Element states</title>
<para> <para>
One you have created a pipeline packed with elements, nothing will happen yet. One you have created a pipeline packed with elements, nothing will
This is where the different states come into play. happen yet. This is where the different states come into play.
</para> </para>
<sect1 id="sec-states"> <sect1 id="sec-states">
@ -35,9 +35,10 @@
</para> </para>
<para> <para>
All elements start with the NULL state. The elements will go throught the following state changes: All elements start with the NULL state. The elements will go throught
NULL -&gt; READY -&gt; PAUSED -&gt; PLAYING. Remember when going from PLAYING to READY GStreamer the following state changes: NULL -&gt; READY -&gt; PAUSED -&gt;
will internally go throught the intermediate states. PLAYING. Remember when going from PLAYING to READY GStreamer will
internally go throught the intermediate states.
</para> </para>
<para> <para>
The state of an element can be changed with the following code: The state of an element can be changed with the following code:
@ -111,9 +112,9 @@
</para> </para>
<note> <note>
<para> <para>
You can also go from the NULL to PLAYING state directly without going through the READY You can also go from the NULL to PLAYING state directly without
state. this is a shortcut, the framework will internally go through the READY and the going through the READY state. this is a shortcut, the framework
PAUSED state for you. will internally go through the READY and the PAUSED state for you.
</para> </para>
</note> </note>
</sect1> </sect1>

View file

@ -31,22 +31,24 @@
</programlisting> </programlisting>
<para> <para>
The above program will create a thread with two elements in it. As soon as it is set to the The above program will create a thread with two elements in it. As soon
PLAYING state, the thread will start to iterate itself. You never need to manually iterate a as it is set to the PLAYING state, the thread will start to iterate
thread. itself. You never need to manually iterate a thread.
</para> </para>
<sect2> <sect2>
<title>Constraints placed on the pipeline by the GstThread</title> <title>Constraints placed on the pipeline by the GstThread</title>
<para> <para>
Within the pipeline, everything is the same as in any other bin. The difference lies at the Within the pipeline, everything is the same as in any other bin. The
thread boundary, at the connection between the thread and the outside world (containing bin). difference lies at the thread boundary, at the connection between the
Since GStreamer is fundamentally buffer-oriented rather than byte-oriented, the natural thread and the outside world (containing bin). Since GStreamer is
solution to this problem is an element that can "buffer" the buffers between the threads, in a fundamentally buffer-oriented rather than byte-oriented, the natural
thread-safe fashion. This element is the queue, described more fully in <xref solution to this problem is an element that can "buffer" the buffers
linkend="cha-queues"/>. It doesn't matter if the queue is placed in the containing bin or in between the threads, in a thread-safe fashion. This element is the
the thread itself, but it needs to be present on one side of the other to enable inter-thread queue, described more fully in <xref linkend="cha-queues"/>. It doesn't
communication. matter if the queue is placed in the containing bin or in the thread
itself, but it needs to be present on one side of the other to enable
inter-thread communication.
</para> </para>
</sect2> </sect2>
<sect2> <sect2>

View file

@ -1,10 +1,10 @@
<chapter id="cha-typedetection"> <chapter id="cha-typedetection">
<title>Typedetection</title> <title>Typedetection</title>
<para> <para>
Sometimes the capabilities of a pad are not specificied. The filesrc, for Sometimes the capabilities of a pad are not specificied. The filesrc,
example, does not know what type of file it is reading. Before you can attach for example, does not know what type of file it is reading. Before you
an element to the pad of the filesrc, you need to determine the media type in can attach an element to the pad of the filesrc, you need to determine
order to be able to choose a compatible element. the media type in order to be able to choose a compatible element.
</para> </para>
<para> <para>
To solve this problem, a plugin can provide the <application>GStreamer</application> To solve this problem, a plugin can provide the <application>GStreamer</application>
@ -102,18 +102,18 @@ main(int argc, char *argv[])
} }
</programlisting> </programlisting>
<para> <para>
We create a very simple pipeline with only a filesrc and the typefind element We create a very simple pipeline with only a filesrc and the typefind
in it. The sinkpad of the typefind element has been connected to the src pad element in it. The sinkpad of the typefind element has been connected
of the filesrc. to the src pad of the filesrc.
</para> </para>
<para> <para>
We attached a signal 'have_type' to the typefind element which will be called We attached a signal 'have_type' to the typefind element which will be called
when the type of the media stream as been detected. when the type of the media stream as been detected.
</para> </para>
<para> <para>
the typefind function will loop over all the registered types and will execute the typefind function will loop over all the registered types and will
each of the typefind functions. As soon as a function returns a GstCaps pointer, execute each of the typefind functions. As soon as a function returns
the type_found function will be called: a GstCaps pointer, the type_found function will be called:
</para> </para>
<programlisting> <programlisting>

View file

@ -17,9 +17,10 @@
<title>Turning GstElements into XML</title> <title>Turning GstElements into XML</title>
<para> <para>
We create a simple pipeline and write it to stdout with gst_xml_write_file (). The following We create a simple pipeline and write it to stdout with
code constructs an mp3 player pipeline with two threads and then writes out the XML both to gst_xml_write_file (). The following code constructs an mp3 player
stdout and to a file. Use this program with one argument: the mp3 file on disk. pipeline with two threads and then writes out the XML both to stdout
and to a file. Use this program with one argument: the mp3 file on disk.
</para> </para>
<programlisting> <programlisting>
@ -167,8 +168,8 @@ main(int argc, char *argv[])
<para> <para>
In addition to loading a file, you can also load a from a xmlDocPtr and In addition to loading a file, you can also load a from a xmlDocPtr and
an in memory buffer using gst_xml_parse_doc and gst_xml_parse_memory an in memory buffer using gst_xml_parse_doc and gst_xml_parse_memory
respectivily. both of these methods return a gboolean indicating success respectivily. both of these methods return a gboolean indicating
or failure of the requested action. success or failure of the requested action.
</para> </para>
</sect1> </sect1>
<sect1 id="sec-xml-custom"> <sect1 id="sec-xml-custom">
@ -254,8 +255,8 @@ object_saved (GstObject *object, xmlNodePtr parent, gpointer data)
</programlisting> </programlisting>
<para> <para>
Whenever a new object has been loaded, the xml_loaded function will be Whenever a new object has been loaded, the xml_loaded function will
called. this function looks like: be called. this function looks like:
</para> </para>
<programlisting> <programlisting>
static void static void