2004-01-28 15:08:17 +00:00
|
|
|
<chapter id="chapter-bins">
|
2000-08-16 21:38:57 +00:00
|
|
|
<title>Bins</title>
|
|
|
|
<para>
|
2003-10-09 12:42:49 +00:00
|
|
|
A bin is a container element. You can add elements to a bin. Since a bin is
|
|
|
|
an element itself, it can also be added to another bin.
|
2000-08-16 21:38:57 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2003-10-09 12:42:49 +00:00
|
|
|
Bins allow you to combine a group of linked elements into one logical element. You do
|
2000-08-16 21:38:57 +00:00
|
|
|
not deal with the individual elements anymore but with just one element, the bin.
|
2002-04-07 23:32:16 +00:00
|
|
|
We will see that this is extremely powerful when you are going to construct
|
2000-08-16 21:38:57 +00:00
|
|
|
complex pipelines since it allows you to break up the pipeline in smaller chunks.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The bin will also manage the elements contained in it. It will figure out how
|
2001-01-04 23:35:50 +00:00
|
|
|
the data will flow in the bin and generate an optimal plan for that data flow. Plan
|
|
|
|
generation is one of the most complicated procedures in GStreamer.
|
2000-08-16 21:38:57 +00:00
|
|
|
</para>
|
|
|
|
|
2004-01-28 15:08:17 +00:00
|
|
|
<figure float="1" id="section-bin-img">
|
2003-10-09 12:42:49 +00:00
|
|
|
<title>Visualisation of a bin with some elements in it</title>
|
2001-12-13 15:24:00 +00:00
|
|
|
<mediaobject>
|
|
|
|
<imageobject>
|
2003-10-08 14:34:09 +00:00
|
|
|
<imagedata fileref="images/bin-element.ℑ" format="&IMAGE;" />
|
2001-12-13 15:24:00 +00:00
|
|
|
</imageobject>
|
|
|
|
</mediaobject>
|
2000-08-16 21:38:57 +00:00
|
|
|
</figure>
|
|
|
|
|
|
|
|
<para>
|
2003-10-09 12:42:49 +00:00
|
|
|
There are two specialized bins available to the GStreamer programmer:
|
2000-08-16 21:38:57 +00:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2003-10-09 12:42:49 +00:00
|
|
|
a pipeline: a generic container that allows scheduling of the
|
|
|
|
containing elements. The toplevel bin has to be a pipeline.
|
|
|
|
Every application thus needs at least one of these.
|
2000-08-16 21:38:57 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2003-10-09 12:42:49 +00:00
|
|
|
a thread: a bin that will be run in a separate execution thread.
|
|
|
|
You will have to use this bin if you have to carefully
|
|
|
|
synchronize audio and video, or for buffering. You will learn
|
2004-01-28 15:08:17 +00:00
|
|
|
more about threads in <xref linkend="chapter-threads"/>.
|
2000-08-16 21:38:57 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
</chapter>
|