tests: use g_timeout_add_seconds wherever possible.
authorB.Prathibha <prathibhab@cdac.in>
Sun, 27 Jan 2013 04:15:59 +0000 (09:45 +0530)
committerTim-Philipp Müller <tim@centricular.net>
Sun, 27 Jan 2013 13:37:29 +0000 (13:37 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=692613

tests/check/pipelines/basetime.c
tests/examples/dynamic/addstream.c
tests/examples/dynamic/codec-select.c
tests/icles/output-selector-test.c
tests/icles/position-formats.c
tests/icles/stress-videooverlay.c

index 401b1b8..180935f 100644 (file)
@@ -97,7 +97,7 @@ GST_START_TEST (test_basetime_calculation)
 
   /* Run main pipeline first */
   gst_element_set_state (p1, GST_STATE_PLAYING);
-  g_timeout_add (2 * 1000, break_mainloop, loop);
+  g_timeout_add_seconds (2, break_mainloop, loop);
   g_main_loop_run (loop);
 
   /* Now activate the audio pipeline */
@@ -111,7 +111,7 @@ GST_START_TEST (test_basetime_calculation)
   /* At this point a new clock is selected */
   gst_element_set_state (p1, GST_STATE_PLAYING);
 
-  g_timeout_add (2 * 1000, break_mainloop, loop);
+  g_timeout_add_seconds (2, break_mainloop, loop);
   g_main_loop_run (loop);
 
   gst_object_unref (pad);
index 06580d1..b58b5cc 100644 (file)
@@ -151,7 +151,7 @@ perform_step (gpointer pstep)
           create_stream
           ("( v4l2src ! videoconvert ! timeoverlay ! queue ! xvimagesink name=v4llive )");
       pause_play_stream (bin1, 0);
-      g_timeout_add (1000, (GSourceFunc) perform_step, GINT_TO_POINTER (1));
+      g_timeout_add_seconds (1, (GSourceFunc) perform_step, GINT_TO_POINTER (1));
       break;
     case 1:
       /* live stream locks on to running_time, pipeline reconfigures latency
@@ -159,14 +159,14 @@ perform_step (gpointer pstep)
       g_print ("creating bin2\n");
       bin2 = create_stream ("( alsasrc ! queue ! alsasink name=alsalive )");
       pause_play_stream (bin2, 0);
-      g_timeout_add (1000, (GSourceFunc) perform_step, GINT_TO_POINTER (2));
+      g_timeout_add_seconds (1, (GSourceFunc) perform_step, GINT_TO_POINTER (2));
       break;
     case 2:
       /* non-live stream, need base_time to align with current running live sources. */
       g_print ("creating bin3\n");
       bin3 = create_stream ("( audiotestsrc ! alsasink name=atnonlive )");
       pause_play_stream (bin3, 0);
-      g_timeout_add (1000, (GSourceFunc) perform_step, GINT_TO_POINTER (3));
+      g_timeout_add_seconds (1, (GSourceFunc) perform_step, GINT_TO_POINTER (3));
       break;
     case 3:
       g_print ("creating bin4\n");
@@ -174,7 +174,7 @@ perform_step (gpointer pstep)
           create_stream
           ("( videotestsrc ! timeoverlay ! videoconvert ! ximagesink name=vtnonlive )");
       pause_play_stream (bin4, 0);
-      g_timeout_add (1000, (GSourceFunc) perform_step, GINT_TO_POINTER (4));
+      g_timeout_add_seconds (1, (GSourceFunc) perform_step, GINT_TO_POINTER (4));
       break;
     case 4:
       /* live stream locks on to running_time */
@@ -183,7 +183,7 @@ perform_step (gpointer pstep)
           create_stream
           ("( videotestsrc is-live=1 ! timeoverlay ! videoconvert ! ximagesink name=vtlive )");
       pause_play_stream (bin5, 0);
-      g_timeout_add (1000, (GSourceFunc) perform_step, GINT_TO_POINTER (5));
+      g_timeout_add_seconds (1, (GSourceFunc) perform_step, GINT_TO_POINTER (5));
       break;
     case 5:
       /* pause the fist live stream for 2 seconds */
@@ -196,7 +196,7 @@ perform_step (gpointer pstep)
       g_print ("PAUSE bin5 for 2 seconds\n");
       pause_play_stream (bin5, 2);
       g_print ("Waiting 5 seconds\n");
-      g_timeout_add (5000, (GSourceFunc) perform_step, GINT_TO_POINTER (6));
+      g_timeout_add_seconds (5, (GSourceFunc) perform_step, GINT_TO_POINTER (6));
       break;
     case 6:
       g_print ("quiting\n");
index 6cd3664..48d5c83 100644 (file)
@@ -279,7 +279,7 @@ main (gint argc, gchar * argv[])
   gst_element_set_state (pipeline, GST_STATE_PLAYING);
 
   /* add a timeout to cycle between the formats */
-  g_timeout_add (1000, (GSourceFunc) do_switch, pipeline);
+  g_timeout_add_seconds (1, (GSourceFunc) do_switch, pipeline);
 
   /* now run */
   g_main_loop_run (loop);
index cc9cf7e..b9d3910 100644 (file)
@@ -1,6 +1,6 @@
 #include <gst/gst.h>
 
-#define SWITCH_TIMEOUT 1000
+#define SWITCH_TIMEOUT 1
 #define NUM_VIDEO_BUFFERS 500
 
 static GMainLoop *loop;
@@ -151,7 +151,7 @@ main (gint argc, gchar * argv[])
   }
 
   /* add switch callback */
-  g_timeout_add (SWITCH_TIMEOUT, switch_cb, osel);
+  g_timeout_add_seconds (SWITCH_TIMEOUT, switch_cb, osel);
 
   /* change to playing */
   bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
index 3530f53..2263520 100644 (file)
@@ -131,7 +131,7 @@ main (gint argc, gchar ** argv)
   gst_object_unref (bus);
 
   /* add timeout for queries */
-  g_timeout_add (1000, (GSourceFunc) run_queries, (gpointer) bin);
+  g_timeout_add_seconds (1, (GSourceFunc) run_queries, (gpointer) bin);
 
   /* run the show */
   if (gst_element_set_state (bin,
index 42d55f5..433aca2 100644 (file)
@@ -156,7 +156,7 @@ create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
   g_timeout_add (50, (GSourceFunc) resize_window, pipeline);
   g_timeout_add (50, (GSourceFunc) move_window, pipeline);
   g_timeout_add (100, (GSourceFunc) cycle_window, ov);
-  g_timeout_add (2000, (GSourceFunc) toggle_events, ov);
+  g_timeout_add_seconds (2, (GSourceFunc) toggle_events, ov);
 
   gst_message_unref (message);
   return GST_BUS_DROP;
@@ -233,8 +233,8 @@ main (int argc, char **argv)
 
   /* We want to get out after */
   //g_timeout_add (500000, (GSourceFunc) terminate_playback, pipeline);
-  g_timeout_add (10000, (GSourceFunc) pause_playback, pipeline);
-  g_timeout_add (20000, (GSourceFunc) start_playback, pipeline);
+  g_timeout_add_seconds (10, (GSourceFunc) pause_playback, pipeline);
+  g_timeout_add_seconds (20, (GSourceFunc) start_playback, pipeline);
 
   g_main_loop_run (loop);