benchmarks: Fix the complexity and mass-elements benchmarks
authorJan Schmidt <thaytan@noraisin.net>
Thu, 8 Oct 2009 01:42:16 +0000 (02:42 +0100)
committerJan Schmidt <thaytan@noraisin.net>
Thu, 8 Oct 2009 01:42:16 +0000 (02:42 +0100)
tests/benchmarks/complexity.c
tests/benchmarks/mass-elements.c

index c1f2670..d1ed522 100644 (file)
@@ -114,7 +114,10 @@ main (gint argc, gchar * argv[])
 
   start = gst_get_current_time ();
   if (gst_element_set_state (pipeline,
-          GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS)
+          GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE)
+    g_assert_not_reached ();
+  if (gst_element_get_state (pipeline, NULL, NULL,
+          GST_CLOCK_TIME_NONE) == GST_STATE_CHANGE_FAILURE)
     g_assert_not_reached ();
   end = gst_get_current_time ();
   g_print ("%" GST_TIME_FORMAT " - setting pipeline to playing\n",
@@ -129,6 +132,14 @@ main (gint argc, gchar * argv[])
       GST_TIME_ARGS (end - start), BUFFER_COUNT);
 
   start = gst_get_current_time ();
+  if (gst_element_set_state (pipeline,
+          GST_STATE_NULL) != GST_STATE_CHANGE_SUCCESS)
+    g_assert_not_reached ();
+  end = gst_get_current_time ();
+  g_print ("%" GST_TIME_FORMAT " - setting pipeline to NULL\n",
+      GST_TIME_ARGS (end - start));
+
+  start = gst_get_current_time ();
   g_object_unref (pipeline);
   end = gst_get_current_time ();
   g_print ("%" GST_TIME_FORMAT " - unreffing pipeline\n",
index 11839fd..fc0f17c 100644 (file)
@@ -92,7 +92,10 @@ main (gint argc, gchar * argv[])
 
   start = gst_get_current_time ();
   if (gst_element_set_state (pipeline,
-          GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS)
+          GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE)
+    g_assert_not_reached ();
+  if (gst_element_get_state (pipeline, NULL, NULL,
+          GST_CLOCK_TIME_NONE) == GST_STATE_CHANGE_FAILURE)
     g_assert_not_reached ();
   end = gst_get_current_time ();
   g_print ("%" GST_TIME_FORMAT " - setting pipeline to playing\n",
@@ -107,6 +110,14 @@ main (gint argc, gchar * argv[])
       GST_TIME_ARGS (end - start), buffers);
 
   start = gst_get_current_time ();
+  if (gst_element_set_state (pipeline,
+          GST_STATE_NULL) != GST_STATE_CHANGE_SUCCESS)
+    g_assert_not_reached ();
+  end = gst_get_current_time ();
+  g_print ("%" GST_TIME_FORMAT " - setting pipeline to NULL\n",
+      GST_TIME_ARGS (end - start));
+
+  start = gst_get_current_time ();
   g_object_unref (pipeline);
   end = gst_get_current_time ();
   g_print ("%" GST_TIME_FORMAT " - unreffing pipeline\n",