diff options
author | Benjamin Otte <otte@gnome.org> | 2005-05-29 13:57:00 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2005-05-29 13:57:00 +0000 |
commit | c50aa69137dec1ecd95c82302081aea9d2fab39c (patch) | |
tree | 35e187ffbd065bf6a8dd9e1c03b3387d98a164e9 /tests/sched/runxml.c | |
parent | 27c43157156a24237285130f2d80fca41447c760 (diff) | |
download | gstreamer-BRANCH-COMPANY.tar.gz |
add actions. see ChangeLog for detailsBRANCH-COMPANY
Original commit message from CVS:
add actions. see ChangeLog for details
Diffstat (limited to 'tests/sched/runxml.c')
-rw-r--r-- | tests/sched/runxml.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/tests/sched/runxml.c b/tests/sched/runxml.c deleted file mode 100644 index 20fca1c148..0000000000 --- a/tests/sched/runxml.c +++ /dev/null @@ -1,96 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static guint outcount, incount; - -static void -buffer_handoff_sink (GstElement * src, GstBuffer * buf, GstElement * bin) -{ - g_print ("\n\n *** buffer arrived in sink ***\n\n"); - gst_element_set_state (bin, GST_STATE_NULL); - - outcount++; -} - -static void -buffer_handoff_src (GstElement * src, GstBuffer * buf, GstElement * bin) -{ - g_print ("\n\n *** buffer started in src ***\n\n"); - incount++; -} - -/* 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"); -} - -int -main (int argc, char *argv[]) -{ - GstXML *xml; - GList *toplevelelements; - gint i = 1; - - gst_init (&argc, &argv); - - if (argc < 2) { - g_print ("usage: %s <xml file>\n", argv[0]); - exit (-1); - } - - g_print ("\n *** using testfile %s\n", argv[1]); - - xml = gst_xml_new (); - gst_xml_parse_file (xml, (guchar *) argv[1], NULL); - - toplevelelements = gst_xml_get_topelements (xml); - - while (toplevelelements) { - GstElement *bin = (GstElement *) toplevelelements->data; - GstElement *src, *sink; - - g_print ("\n ***** testcase %d\n", i++); - - src = gst_bin_get_by_name (GST_BIN (bin), "fakesrc"); - if (src) { - g_signal_connect (G_OBJECT (src), "handoff", - G_CALLBACK (buffer_handoff_src), bin); - } else { - g_print ("could not find src element\n"); - exit (-1); - } - - sink = gst_bin_get_by_name (GST_BIN (bin), "fakesink"); - if (sink) { - g_signal_connect (G_OBJECT (sink), "handoff", - G_CALLBACK (buffer_handoff_sink), bin); - } else { - g_print ("could not find sink element\n"); - exit (-1); - } - - incount = 0; - outcount = 0; - -/* gst_element_set_state(bin, GST_STATE_READY); */ - gst_element_set_state (bin, GST_STATE_PLAYING); - - if (GST_IS_THREAD (bin)) { - g_usleep (G_USEC_PER_SEC); - } else { - gst_bin_iterate (GST_BIN (bin)); - } - - if (outcount != 1 && incount != 1) { - g_print ("test failed\n"); - exit (-1); - } - - toplevelelements = g_list_next (toplevelelements); - } - - exit (0); -} |