diff --git a/docs/Makefile.am b/docs/Makefile.am
index 0467b184da..f6fd3b4500 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = manual fwg gst libs
+SUBDIRS = manual fwg gst libs
EXTRA_DIST = random slides manuals.mak
diff --git a/docs/manual/components.sgml b/docs/manual/components.sgml
index 01261e7e09..a4272342f8 100644
--- a/docs/manual/components.sgml
+++ b/docs/manual/components.sgml
@@ -1,11 +1,14 @@
Components
+ GStreamer includes components that people can include
+ in their programs.
GstPlay
+ GstPlay is a GtkWidget with a simple API to play, pause and stop a media file.
@@ -13,6 +16,7 @@
GstMediaPlay
+ GstMediaply is a complete player widget.
@@ -20,6 +24,8 @@
GstEditor
+ GstEditor is a set of widgets to display a graphical representation of a
+ pipeline.
diff --git a/docs/manual/queues.sgml b/docs/manual/queues.sgml
index 93d25b60f4..e057f2e8d7 100644
--- a/docs/manual/queues.sgml
+++ b/docs/manual/queues.sgml
@@ -8,13 +8,13 @@
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
- element as soon as gst_connection_push () is called.
+ element as soon as a gst_pad_pull () is called on the queues srcpad.
Queues are mostly used in conjunction with a GstThread to
provide an external connection for the thread elements. You could have one
thread feeding buffers into a GstQueue and another
- thread repeadedly calling gst_connection_push () on the queue to feed its
+ thread repeadedly calling gst_pad_pull () on the queue to feed its
internal elements.
@@ -27,6 +27,110 @@
+
+ The standard GStreamer queue implementation has some
+ properties that can be changed using the gtk_objet_set () method. To set the
+ maximum number of buffers that can be queued to 30, do:
+
+
+ gtk_object_set (GTK_OBJECT (queue), "max_level", 30, NULL);
+
+
+
+ The following mp3 player shows you how to create the above pipeline using a
+ thread and a queue.
+
+
+
+#include <stdlib.h>
+#include <gst/gst.h>
+
+gboolean playing;
+
+/* eos will be called when the src element has an end of stream */
+void
+eos (GstElement *element, gpointer data)
+{
+ g_print ("have eos, quitting\n");
+
+ playing = FALSE;
+}
+
+int
+main (int argc, char *argv[])
+{
+ GstElement *disksrc, *audiosink, *queue, *parse, *decode;
+ GstElement *bin;
+ GstElement *thread;
+
+ gst_init (&argc,&argv);
+
+ if (argc != 2) {
+ g_print ("usage: %s <filename>\n", argv[0]);
+ exit (-1);
+ }
+
+ /* create a new thread to hold the elements */
+ thread = gst_thread_new ("thread");
+ g_assert (thread != NULL);
+
+ /* create a new bin to hold the elements */
+ bin = gst_bin_new ("bin");
+ g_assert (bin != NULL);
+
+ /* create a disk reader */
+ disksrc = gst_elementfactory_make ("disksrc", "disk_source");
+ g_assert (disksrc != NULL);
+ gtk_object_set (GTK_OBJECT (disksrc), "location", argv[1], NULL);
+ gtk_signal_connect (GTK_OBJECT (disksrc), "eos",
+ GTK_SIGNAL_FUNC (eos), thread);
+
+ queue = gst_elementfactory_make ("queue", "queue");
+
+ /* and an audio sink */
+ audiosink = gst_elementfactory_make ("audiosink", "play_audio");
+ g_assert (audiosink != NULL);
+
+ parse = gst_elementfactory_make ("mp3parse", "parse");
+ decode = gst_elementfactory_make ("mpg123", "decode");
+
+ /* add objects to the main bin */
+ gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), queue);
+
+ gst_bin_add (GST_BIN (thread), parse);
+ gst_bin_add (GST_BIN (thread), decode);
+ gst_bin_add (GST_BIN (thread), audiosink);
+
+ gst_pad_connect (gst_element_get_pad (disksrc,"src"),
+ gst_element_get_pad (queue,"sink"));
+
+ gst_pad_connect (gst_element_get_pad (queue, "src"),
+ gst_element_get_pad (parse, "sink"));
+ gst_pad_connect (gst_element_get_pad (parse, "src"),
+ gst_element_get_pad (decode, "sink"));
+ gst_pad_connect (gst_element_get_pad (decode, "src"),
+ gst_element_get_pad (audiosink, "sink"));
+
+ gst_bin_add (GST_BIN (bin), thread);
+
+ /* make it ready */
+ gst_element_set_state (GST_ELEMENT (bin), GST_STATE_READY);
+ /* start playing */
+ gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
+
+ playing = TRUE;
+
+ while (playing) {
+ gst_bin_iterate (GST_BIN (bin));
+ }
+
+ gst_element_set_state (GST_ELEMENT (bin), GST_STATE_NULL);
+
+ exit (0);
+}
+
+
diff --git a/docs/manual/quotes.sgml b/docs/manual/quotes.sgml
index 30eff6c736..dc5f82f3f7 100644
--- a/docs/manual/quotes.sgml
+++ b/docs/manual/quotes.sgml
@@ -44,6 +44,38 @@
+
+ 5/6 Jan 2001
+
+
+ wtay:
+ we need to cut down the time to create an mp3 player down to
+ seconds...
+
+
+ richardb:
+ :)
+
+
+ Omega:
+ I'm wanting to something more interesting soon, I did the "draw an mp3
+ player in 15sec" back in October '99.
+
+
+ wtay:
+ by the time Omega gets his hands on the editor, you'll see a
+ complete audio mixer in the editor :-)
+
+
+ richardb:
+ Well, it clearly has the potential...
+
+
+ Omega:
+ Working on it... ;-)
+
+
+
28 Dec 2000
diff --git a/docs/manual/states.sgml b/docs/manual/states.sgml
index 1ab5e10047..e038f8585f 100644
--- a/docs/manual/states.sgml
+++ b/docs/manual/states.sgml
@@ -41,6 +41,55 @@
+
+ The state of an element can be changed with the following code:
+
+
+ GstElement *bin;
+
+ // create a bin, put elements in it and connect them
+ ...
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+ ...
+
+
+
+ You can set the following states to an element:
+
+
+
+
+
+
+
+ GST_STATE_NONE_PENDING
+ The element is in the desired state.
+
+
+
+ GST_STATE_NULL
+ Reset the state of an element.
+
+
+
+ GST_STATE_READY
+ will make the element ready to start processing data.
+
+
+
+ GST_STATE_PLAYING
+ means there really is data flowing through the graph.
+
+
+
+ GST_STATE_PAUSED
+ temporary stops the data flow.
+
+
+
+
+
+
diff --git a/docs/manual/xml.sgml b/docs/manual/xml.sgml
index 5099bcd11b..399a90739a 100644
--- a/docs/manual/xml.sgml
+++ b/docs/manual/xml.sgml
@@ -1,6 +1,178 @@
- XML in GStreamer
+ XML in GStreamer
+ GStreamer uses XML to store and load
+ its pipeline definitions. XML is also used internally to manage the
+ plugin registry. The plugin registry is a file that contains the definition
+ of all the plugins GStreamer knows about to have
+ quick access to the specifics of the plugins.
+
+ We will show you how you can save a pipeline to XML and how you can reload that
+ XML file again for later use.
+
+
+
+ Turning GstElements into XML
+
+
+ We create a simple pipeline and save it to disk with gst_xml_write (). The following
+ code constructs an mp3 player pipeline with two threads and finaly writes it to disk.
+ use this program with one argument: the mp3 file on disk.
+
+
+
+#include <stdlib.h>
+#include <gst/gst.h>
+
+gboolean playing;
+
+int
+main (int argc, char *argv[])
+{
+ GstElement *disksrc, *audiosink, *queue, *queue2, *parse, *decode;
+ GstElement *bin;
+ GstElement *thread, *thread2;
+
+ gst_init (&argc,&argv);
+
+ if (argc != 2) {
+ g_print ("usage: %s <filename>\n", argv[0]);
+ exit (-1);
+ }
+
+ /* create a new thread to hold the elements */
+ thread = gst_elementfactory_make ("thread", "thread");
+ g_assert (thread != NULL);
+ thread2 = gst_elementfactory_make ("thread", "thread2");
+ g_assert (thread2 != NULL);
+
+ /* create a new bin to hold the elements */
+ bin = gst_bin_new ("bin");
+ g_assert (bin != NULL);
+
+ /* create a disk reader */
+ disksrc = gst_elementfactory_make ("disksrc", "disk_source");
+ g_assert (disksrc != NULL);
+ gtk_object_set (GTK_OBJECT (disksrc), "location", argv[1], NULL);
+
+ queue = gst_elementfactory_make ("queue", "queue");
+ queue2 = gst_elementfactory_make ("queue", "queue2");
+
+ /* and an audio sink */
+ audiosink = gst_elementfactory_make ("audiosink", "play_audio");
+ g_assert (audiosink != NULL);
+
+ parse = gst_elementfactory_make ("mp3parse", "parse");
+ decode = gst_elementfactory_make ("mpg123", "decode");
+
+ /* add objects to the main bin */
+ gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), queue);
+
+ gst_bin_add (GST_BIN (thread), parse);
+ gst_bin_add (GST_BIN (thread), decode);
+ gst_bin_add (GST_BIN (thread), queue2);
+
+ gst_bin_add (GST_BIN (thread2), audiosink);
+
+ gst_pad_connect (gst_element_get_pad (disksrc,"src"),
+ gst_element_get_pad (queue,"sink"));
+
+ gst_pad_connect (gst_element_get_pad (queue,"src"),
+ gst_element_get_pad (parse,"sink"));
+ gst_pad_connect (gst_element_get_pad (parse,"src"),
+ gst_element_get_pad (decode,"sink"));
+ gst_pad_connect (gst_element_get_pad (decode,"src"),
+ gst_element_get_pad (queue2,"sink"));
+
+ gst_pad_connect (gst_element_get_pad (queue2,"src"),
+ gst_element_get_pad (audiosink,"sink"));
+
+ gst_bin_add (GST_BIN (bin), thread);
+ gst_bin_add (GST_BIN (bin), thread2);
+
+ // write the bin to disk
+ xmlSaveFile ("xmlTest.gst", gst_xml_write (GST_ELEMENT (bin)));
+
+ exit (0);
+}
+
+
+ The most important line is:
+
+
+ xmlSaveFile ("xmlTest.gst", gst_xml_write (GST_ELEMENT (bin)));
+
+
+ gst_xml_write () will turn the given element into and xmlDocPtr that
+ can be saved with the xmlSaveFile () function found in the gnome-xml
+ package. The result is an XML file named xmlTest.gst.
+
+
+ The complete element hierarchy will be saved along with the inter element
+ pad connections and the element parameters. Future GStreamer
+ versions will also allow you to store the signals in the XML file.
+
+
+
+
+ Loading a GstElement from an XML file
+
+ A saved XML file can be loade with the gst_xml_new (filename, rootelement).
+ The root element can optionally left NULL. The following code example loads
+ the previously created XML file and runs it.
+
+
+#include <stdlib.h>
+#include <gst/gst.h>
+
+gboolean playing;
+
+/* eos will be called when the src element has an end of stream */
+void
+eos (GstElement *element, gpointer data)
+{
+ g_print ("have eos, quitting\n");
+
+ playing = FALSE;
+}
+
+int
+main(int argc, char *argv[])
+{
+ GstXML *xml;
+ GstElement *bin;
+ GstElement *disk;
+
+ gst_init (&argc, &argv);
+
+ xml = gst_xml_new ("xmlTest.gst", NULL);
+
+ bin = gst_xml_get_element (xml, "bin");
+
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+
+ playing = TRUE;
+
+ while (playing) {
+ gst_bin_iterate (GST_BIN (bin));
+ }
+
+ gst_element_set_state (bin, GST_STATE_NULL);
+
+ exit (0);
+}
+
+
+ gst_xml_get_element (xml, "name") can be used to get a specific element
+ from the XML file.
+
+
+ gst_xml_get_topelements (xml) can be used to get a list of all toplevel elements
+ in the XML file.
+
+
+
diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am
index e5e1277ffa..d77adb816a 100644
--- a/docs/plugins/Makefile.am
+++ b/docs/plugins/Makefile.am
@@ -15,7 +15,7 @@ LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/gst/libgst.la
CFLAGS = `gstreamer-config --cflags` -Wall -g
LDFLAGS = `gstreamer-config --libs`
-EXTRA_DIST=$(DOC_MODULE).types.in
+EXTRA_DIST=$(DOC_MODULE).types.in $(DOC_MODULE)-sections.txt $(DOC_MAIN_SGML_FILE) gstdoc-mkdb gstdoc-mktmpl gstdoc-scanobj
HTML_DIR=$(datadir)/$(DOC_MODULE)/html
diff --git a/docs/plugins/gstdoc-scanobj b/docs/plugins/gstdoc-scanobj
index 6c058216b4..0faac08c69 100755
--- a/docs/plugins/gstdoc-scanobj
+++ b/docs/plugins/gstdoc-scanobj
@@ -835,7 +835,8 @@ output_widget_pads (FILE *fp, GstElement *element)
GstPad *pad = (GstPad *)pads->data;
GstType *type;
- type = gst_type_find_by_id(pad->type);
+ //type = gst_type_find_by_id(pad->type);
+ type = gst_type_find_by_id(1);
fprintf (fp, "\n%s::%s\n",
gtk_type_name(factory->type), pad->name);
diff --git a/docs/random/testing/syntax b/docs/random/testing/syntax
index 72704c5c10..3e6c6f7342 100644
--- a/docs/random/testing/syntax
+++ b/docs/random/testing/syntax
@@ -21,6 +21,7 @@ tcS: id1, element, signalname (attach to signal in an element)
tcS: id2, element, signalname
...
tcI: the number of iterations on the top bin
+tcT: a timeout value in mSecs
tcR: id1,1,id2,1,.. (the pattern of signals trigered)
or
tcR: id1==id2,... (denote an equal number of signals)
diff --git a/examples/xml/runxml.c b/examples/xml/runxml.c
index 57f4b47ea6..025508fc17 100644
--- a/examples/xml/runxml.c
+++ b/examples/xml/runxml.c
@@ -23,7 +23,6 @@ int main(int argc,char *argv[])
bin = gst_xml_get_element(xml, "bin");
- gst_element_set_state(bin, GST_STATE_READY);
gst_element_set_state(bin, GST_STATE_PLAYING);
playing = TRUE;
diff --git a/gst/gstxml.c b/gst/gstxml.c
index 99afd25702..f72552a670 100644
--- a/gst/gstxml.c
+++ b/gst/gstxml.c
@@ -23,6 +23,7 @@
#include "gst_private.h"
#include "gstxml.h"
+#include "gstbin.h"
static void gst_xml_class_init (GstXMLClass *klass);
@@ -175,13 +176,30 @@ GstElement*
gst_xml_get_element (GstXML *xml, const guchar *name)
{
GstElement *element;
+ GList *topelements;
g_return_val_if_fail(xml != NULL, NULL);
g_return_val_if_fail(name != NULL, NULL);
GST_DEBUG (0,"gstxml: getting element \"%s\"\n", name);
- element = g_hash_table_lookup(xml->elements, name);
+ topelements = gst_xml_get_topelements (xml);
- return element;
+ while (topelements) {
+ GstElement *top = GST_ELEMENT (topelements->data);
+
+ if (!strcmp (gst_element_get_name (top), name)) {
+ return top;
+ }
+ else {
+ if (GST_IS_BIN (top)) {
+ element = gst_bin_get_by_name (GST_BIN (top), name);
+
+ if (element)
+ return element;
+ }
+ }
+ topelements = g_list_next (topelements);
+ }
+ return NULL;
}
diff --git a/tests/old/examples/xml/runxml.c b/tests/old/examples/xml/runxml.c
index 57f4b47ea6..025508fc17 100644
--- a/tests/old/examples/xml/runxml.c
+++ b/tests/old/examples/xml/runxml.c
@@ -23,7 +23,6 @@ int main(int argc,char *argv[])
bin = gst_xml_get_element(xml, "bin");
- gst_element_set_state(bin, GST_STATE_READY);
gst_element_set_state(bin, GST_STATE_PLAYING);
playing = TRUE;
diff --git a/tests/sched/testcases1.tc b/tests/sched/testcases1.tc
index cdbdc7deb8..28ee331091 100644
--- a/tests/sched/testcases1.tc
+++ b/tests/sched/testcases1.tc
@@ -3,6 +3,7 @@ tcP: fakesrc ! fakesink
tcS: A, fakesrc0, handoff
tcS: B, fakesink0, handoff
tcI: 2
+tcT: 2000
tcR: A,1,B,1,A,1,B,1
@@ -12,5 +13,6 @@ tcS: A, fakesrc0, handoff
tcS: B, identity, handoff
tcS: C, fakesink0, handoff
tcI: 2
+tcT: 2000
tcR: A,1,B,1,C,1,A,1,B,1,C,1