2001-01-01 00:42:10 +00:00
|
|
|
#include <stdlib.h>
|
2000-09-24 22:45:48 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
gboolean playing;
|
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
static void
|
|
|
|
xml_loaded (GstXML *xml, GstObject *object, gpointer data)
|
2000-09-24 22:45:48 +00:00
|
|
|
{
|
2001-01-29 00:06:02 +00:00
|
|
|
if (GST_IS_PAD (object)) {
|
|
|
|
g_print ("pad loaded '%s'\n", gst_pad_get_name (GST_PAD (object)));
|
|
|
|
}
|
|
|
|
else if (GST_IS_ELEMENT (object)) {
|
|
|
|
g_print ("element loaded '%s'\n", gst_element_get_name (GST_ELEMENT (object)));
|
|
|
|
}
|
2000-09-24 22:45:48 +00:00
|
|
|
}
|
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
int main(int argc,char *argv[])
|
2000-09-24 22:45:48 +00:00
|
|
|
{
|
|
|
|
GstXML *xml;
|
|
|
|
GstElement *bin;
|
2001-01-29 00:06:02 +00:00
|
|
|
gboolean ret;
|
2000-09-24 22:45:48 +00:00
|
|
|
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
xml = gst_xml_new ();
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (xml), "object_loaded", xml_loaded, NULL);
|
|
|
|
|
|
|
|
ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
|
|
|
|
g_assert (ret == TRUE);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
|
|
|
bin = gst_xml_get_element(xml, "bin");
|
2001-01-29 00:06:02 +00:00
|
|
|
g_assert (bin != NULL);
|
|
|
|
|
2000-09-24 22:45:48 +00:00
|
|
|
gst_element_set_state(bin, GST_STATE_PLAYING);
|
|
|
|
|
|
|
|
playing = TRUE;
|
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
while (gst_bin_iterate(GST_BIN(bin)));
|
2000-09-24 22:45:48 +00:00
|
|
|
|
|
|
|
gst_element_set_state(bin, GST_STATE_NULL);
|
|
|
|
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|