2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
23 main (gint argc, gchar *argv[])
26 GstElement *fakesrc1, *fakesink1;
27 GstElement *fakesrc2, *fakesink2;
29 gst_init (&argc, &argv);
31 pipeline = gst_pipeline_new ("pipeline");
33 fakesrc1 = gst_element_factory_make ("fakesrc", "fakesrc1");
34 g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
35 fakesink1 = gst_element_factory_make ("fakesink", "fakesink1");
37 gst_bin_add_many (GST_BIN (pipeline), fakesrc1, fakesink1, NULL);
38 gst_element_link_pads (fakesrc1, "src", fakesink1, "sink");
40 fakesrc2 = gst_element_factory_make ("fakesrc", "fakesrc2");
41 g_object_set (G_OBJECT (fakesrc2), "num_buffers", 5, NULL);
42 fakesink2 = gst_element_factory_make ("fakesink", "fakesink2");
44 gst_bin_add_many (GST_BIN (pipeline), fakesrc2, fakesink2, NULL);
45 gst_element_link_pads (fakesrc2, "src", fakesink2, "sink");
47 g_signal_connect (G_OBJECT (pipeline), "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
49 GST_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
50 GST_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE);
52 gst_element_set_state (pipeline, GST_STATE_PLAYING);
53 while (gst_bin_iterate (GST_BIN (pipeline)));
54 gst_element_set_state (pipeline, GST_STATE_READY);
56 g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
58 GST_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
59 GST_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE);
61 gst_element_set_state (pipeline, GST_STATE_PLAYING);
62 while (gst_bin_iterate (GST_BIN (pipeline)));
63 gst_element_set_state (pipeline, GST_STATE_NULL);
65 gst_object_unref (GST_OBJECT (pipeline));