5 main (int argc, char **argv)
7 GstElement *src, *sink, *enc, *tee;
12 gst_init (&argc, &argv);
13 pipeline = gst_element_factory_make ("pipeline", "pipeline");
15 src = gst_element_factory_make ("fakesrc", "src");
17 tee = gst_element_factory_make ("tee", "tee1");
19 enc = gst_element_factory_make ("identity", "enc");
21 sink = gst_element_factory_make ("fakesink", "sink");
24 gst_bin_add_many (GST_BIN (pipeline), src, tee, enc, sink, NULL);
25 if (!gst_element_link_many (src, tee, enc, sink, NULL))
26 g_assert_not_reached ();
27 if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS)
28 g_assert_not_reached ();
30 for (i = 0; i < 5; i++) {
31 if (!gst_bin_iterate (GST_BIN (pipeline)))
32 g_assert_not_reached ();
36 if (gst_element_set_state (pipeline, GST_STATE_PAUSED) != GST_STATE_SUCCESS)
37 g_assert_not_reached ();
38 gst_element_unlink_many (tee, enc, sink, NULL);
39 gst_bin_remove_many (GST_BIN (pipeline), enc, sink, NULL);
41 enc = gst_element_factory_make ("identity", "enc");
43 sink = gst_element_factory_make ("fakesink", "sink");
45 gst_bin_add_many (GST_BIN (pipeline), enc, sink, NULL);
46 if (!gst_element_link_many (tee, enc, sink, NULL))
47 g_assert_not_reached ();
48 if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS)
49 g_assert_not_reached ();
51 for (i = 5; i < 10; i++) {
52 if (!gst_bin_iterate (GST_BIN (pipeline)))
53 g_assert_not_reached ();
56 g_print ("cleaning up...\n");
57 gst_object_unref (GST_OBJECT (pipeline));