5 static guint outcount, incount;
8 buffer_handoff_sink (GstElement *src, GstElement *bin)
10 g_print ("\n\n *** buffer arrived in sink ***\n\n");
11 gst_element_set_state(bin, GST_STATE_NULL);
17 buffer_handoff_src (GstElement *src, GstElement *bin)
19 g_print ("\n\n *** buffer started in src ***\n\n");
23 /* eos will be called when the src element has an end of stream */
24 void eos(GstElement *element, gpointer data)
26 g_print("have eos, quitting\n");
29 int main(int argc,char *argv[])
32 GList *toplevelelements;
35 gst_init(&argc,&argv);
38 g_print ("usage: %s <xml file>\n", argv[0]);
42 g_print ("\n *** using testfile %s\n", argv[1]);
45 xml = gst_xml_parse_file (xml, argv[1], NULL);
47 toplevelelements = gst_xml_get_topelements (xml);
49 while (toplevelelements) {
50 GstElement *bin = (GstElement *)toplevelelements->data;
51 GstElement *src, *sink;
53 g_print ("\n ***** testcase %d\n", i++);
55 src = gst_bin_get_by_name (GST_BIN (bin), "fakesrc");
57 gtk_signal_connect (GTK_OBJECT(src), "handoff",
58 GTK_SIGNAL_FUNC(buffer_handoff_src), bin);
61 g_print ("could not find src element\n");
65 sink = gst_bin_get_by_name (GST_BIN (bin), "fakesink");
67 gtk_signal_connect (GTK_OBJECT(sink), "handoff",
68 GTK_SIGNAL_FUNC(buffer_handoff_sink), bin);
71 g_print ("could not find sink element\n");
78 // gst_element_set_state(bin, GST_STATE_READY);
79 gst_element_set_state(bin, GST_STATE_PLAYING);
81 if (GST_IS_THREAD (bin)) {
85 gst_bin_iterate(GST_BIN(bin));
88 if (outcount != 1 && incount != 1) {
89 g_print ("test failed\n");
93 toplevelelements = g_list_next (toplevelelements);