summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-05-15 12:02:02 +0200
committerWim Taymans <wim@metal.(none)>2009-06-01 13:37:27 +0200
commit67752e5adb126319a6d26f402f7230c050f3239e (patch)
tree8f38f7fd1168676751a2e7b06f3eecc9c4bbf72f
parent7a7e9629ce53aa1a054fee89f5656779f4b755ab (diff)
example: print step_done message and sync
Dump the step_done message contents. Sync against the clock when going to PLAYING.
-rw-r--r--tests/examples/stepping/framestep1.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/examples/stepping/framestep1.c b/tests/examples/stepping/framestep1.c
index 6bf7dba027..ee9815715e 100644
--- a/tests/examples/stepping/framestep1.c
+++ b/tests/examples/stepping/framestep1.c
@@ -20,7 +20,8 @@ event_loop (GstElement * pipe)
gst_message_unref (message);
return;
case GST_MESSAGE_WARNING:
- case GST_MESSAGE_ERROR:{
+ case GST_MESSAGE_ERROR:
+ {
GError *gerror;
gchar *debug;
@@ -31,6 +32,22 @@ event_loop (GstElement * pipe)
g_free (debug);
return;
}
+ case GST_MESSAGE_STEP_DONE:
+ {
+ GstFormat format;
+ guint64 amount;
+ gdouble rate;
+ guint64 duration;
+ gboolean intermediate;
+
+ gst_message_parse_step_done (message, &format, &amount, &rate,
+ &duration, &intermediate);
+
+ g_message ("step done: %" GST_TIME_FORMAT " skipped in %"
+ G_GUINT64_FORMAT " frames", GST_TIME_ARGS (duration), amount);
+
+ return;
+ }
default:
gst_message_unref (message);
break;
@@ -72,7 +89,7 @@ main (int argc, char *argv[])
appsink = gst_element_factory_make ("appsink", "appsink");
g_assert (appsink);
g_object_set (appsink, "emit-signals", TRUE, NULL);
- g_object_set (appsink, "sync", FALSE, NULL);
+ g_object_set (appsink, "sync", TRUE, NULL);
g_signal_connect (appsink, "new-preroll", (GCallback) new_preroll, NULL);
/* add objects to the main pipeline */
@@ -92,7 +109,10 @@ main (int argc, char *argv[])
g_assert (gst_element_send_event (bin,
gst_event_new_step (GST_FORMAT_BUFFERS, 2, 1.0, TRUE, FALSE)));
- /* wait for step to complete */
+ /* blocks and returns when we received the step done message */
+ event_loop (bin);
+
+ /* wait for step to really complete */
gst_element_get_state (bin, NULL, NULL, -1);
g_message ("stepped two frames");