2000-08-22 21:18:18 +00:00
|
|
|
<chapter id="cha-queues">
|
|
|
|
<title>Queues</title>
|
|
|
|
<para>
|
2001-01-05 18:50:41 +00:00
|
|
|
A <classname>GstQueue</classname> is a filter element.
|
2000-09-09 16:36:10 +00:00
|
|
|
Queues can be used to connect two elements in such way that the data can
|
|
|
|
be buffered.
|
2000-08-22 21:18:18 +00:00
|
|
|
</para>
|
2000-09-09 16:36:10 +00:00
|
|
|
<para>
|
|
|
|
A buffer that is sinked to a Queue will not automatically be pushed to the
|
|
|
|
next connected element but will be buffered. It will be pushed to the next
|
2001-01-05 18:50:41 +00:00
|
|
|
element as soon as gst_connection_push () is called.
|
2000-09-09 16:36:10 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Queues are mostly used in conjunction with a <classname>GstThread</classname> to
|
|
|
|
provide an external connection for the thread elements. You could have one
|
|
|
|
thread feeding buffers into a <classname>GstQueue</classname> and another
|
2001-01-05 18:50:41 +00:00
|
|
|
thread repeadedly calling gst_connection_push () on the queue to feed its
|
2000-09-09 16:36:10 +00:00
|
|
|
internal elements.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Below is a figure of a two-threaded decoder. We have one thread (the main execution
|
|
|
|
thread) reading the data from a file, and another thread decoding the data.
|
|
|
|
</para>
|
|
|
|
<figure float="1" id="sec-queues-img">
|
|
|
|
<title>a two-threaded decoder with a queue</title>
|
|
|
|
<graphic fileref="images/queue" format="png"></graphic>
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
|
2000-08-22 21:18:18 +00:00
|
|
|
|
|
|
|
</chapter>
|