- Added dir to hold state change related testsuites
authorWim Taymans <wim.taymans@gmail.com>
Tue, 25 Mar 2003 19:41:23 +0000 (19:41 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 25 Mar 2003 19:41:23 +0000 (19:41 +0000)
Original commit message from CVS:
- Added dir to hold state change related testsuites
- Added _LOCKED_STATE test

tests/old/testsuite/states/.gitignore [new file with mode: 0644]
tests/old/testsuite/states/Makefile.am [new file with mode: 0644]
tests/old/testsuite/states/locked.c [new file with mode: 0644]
testsuite/states/.gitignore [new file with mode: 0644]
testsuite/states/Makefile.am [new file with mode: 0644]
testsuite/states/locked.c [new file with mode: 0644]

diff --git a/tests/old/testsuite/states/.gitignore b/tests/old/testsuite/states/.gitignore
new file mode 100644 (file)
index 0000000..70b8e22
--- /dev/null
@@ -0,0 +1,8 @@
+Makefile
+Makefile.in
+*.o
+*.lo
+*.la
+.deps
+.libs
+locked
diff --git a/tests/old/testsuite/states/Makefile.am b/tests/old/testsuite/states/Makefile.am
new file mode 100644 (file)
index 0000000..8f8ee10
--- /dev/null
@@ -0,0 +1,12 @@
+GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
+TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
+
+testprogs = locked
+
+TESTS = $(testprogs)
+
+check_PROGRAMS = $(testprogs)
+
+locked_LDADD = $(GST_LIBS) 
+locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+
diff --git a/tests/old/testsuite/states/locked.c b/tests/old/testsuite/states/locked.c
new file mode 100644 (file)
index 0000000..550aee5
--- /dev/null
@@ -0,0 +1,68 @@
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gst/gst.h>
+
+gint
+main (gint argc, gchar *argv[]) 
+{
+  GstElement *pipeline;
+  GstElement *fakesrc1, *fakesink1; 
+  GstElement *fakesrc2, *fakesink2; 
+
+  gst_init (&argc, &argv);
+
+  pipeline = gst_pipeline_new ("pipeline");
+  
+  fakesrc1 = gst_element_factory_make ("fakesrc", "fakesrc1");
+  g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
+  fakesink1 = gst_element_factory_make ("fakesink", "fakesink1");
+  
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc1, fakesink1, NULL);
+  gst_element_link_pads (fakesrc1, "src", fakesink1, "sink");
+
+  fakesrc2 = gst_element_factory_make ("fakesrc", "fakesrc2");
+  g_object_set (G_OBJECT (fakesrc2), "num_buffers", 5, NULL);
+  fakesink2 = gst_element_factory_make ("fakesink", "fakesink2");
+
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc2, fakesink2, NULL);
+  gst_element_link_pads (fakesrc2, "src", fakesink2, "sink");
+
+  g_signal_connect (G_OBJECT (pipeline), "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
+
+  GST_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
+  GST_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE);
+
+  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  while (gst_bin_iterate (GST_BIN (pipeline)));
+  gst_element_set_state (pipeline, GST_STATE_READY);
+
+  g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
+
+  GST_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
+  GST_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE);
+
+  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  while (gst_bin_iterate (GST_BIN (pipeline)));
+  gst_element_set_state (pipeline, GST_STATE_NULL);
+
+  gst_object_unref (GST_OBJECT (pipeline));
+  
+  return 0;
+}
diff --git a/testsuite/states/.gitignore b/testsuite/states/.gitignore
new file mode 100644 (file)
index 0000000..70b8e22
--- /dev/null
@@ -0,0 +1,8 @@
+Makefile
+Makefile.in
+*.o
+*.lo
+*.la
+.deps
+.libs
+locked
diff --git a/testsuite/states/Makefile.am b/testsuite/states/Makefile.am
new file mode 100644 (file)
index 0000000..8f8ee10
--- /dev/null
@@ -0,0 +1,12 @@
+GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
+TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
+
+testprogs = locked
+
+TESTS = $(testprogs)
+
+check_PROGRAMS = $(testprogs)
+
+locked_LDADD = $(GST_LIBS) 
+locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+
diff --git a/testsuite/states/locked.c b/testsuite/states/locked.c
new file mode 100644 (file)
index 0000000..550aee5
--- /dev/null
@@ -0,0 +1,68 @@
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gst/gst.h>
+
+gint
+main (gint argc, gchar *argv[]) 
+{
+  GstElement *pipeline;
+  GstElement *fakesrc1, *fakesink1; 
+  GstElement *fakesrc2, *fakesink2; 
+
+  gst_init (&argc, &argv);
+
+  pipeline = gst_pipeline_new ("pipeline");
+  
+  fakesrc1 = gst_element_factory_make ("fakesrc", "fakesrc1");
+  g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
+  fakesink1 = gst_element_factory_make ("fakesink", "fakesink1");
+  
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc1, fakesink1, NULL);
+  gst_element_link_pads (fakesrc1, "src", fakesink1, "sink");
+
+  fakesrc2 = gst_element_factory_make ("fakesrc", "fakesrc2");
+  g_object_set (G_OBJECT (fakesrc2), "num_buffers", 5, NULL);
+  fakesink2 = gst_element_factory_make ("fakesink", "fakesink2");
+
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc2, fakesink2, NULL);
+  gst_element_link_pads (fakesrc2, "src", fakesink2, "sink");
+
+  g_signal_connect (G_OBJECT (pipeline), "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
+
+  GST_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
+  GST_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE);
+
+  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  while (gst_bin_iterate (GST_BIN (pipeline)));
+  gst_element_set_state (pipeline, GST_STATE_READY);
+
+  g_object_set (G_OBJECT (fakesrc1), "num_buffers", 5, NULL);
+
+  GST_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE);
+  GST_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE);
+
+  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  while (gst_bin_iterate (GST_BIN (pipeline)));
+  gst_element_set_state (pipeline, GST_STATE_NULL);
+
+  gst_object_unref (GST_OBJECT (pipeline));
+  
+  return 0;
+}