summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-20 09:28:07 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-23 08:06:48 +0100
commitca613568eac4dea2ad6bd4d3e247e3e447759386 (patch)
tree5adfe2f10ff7a7c8173014c409bdedbfc8d87256
parent9abdf042317c7ccdb36971a45e8ff71207a3703e (diff)
-rw-r--r--gst/playback/test7.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gst/playback/test7.c b/gst/playback/test7.c
index 31b973001..6efc64d53 100644
--- a/gst/playback/test7.c
+++ b/gst/playback/test7.c
@@ -24,7 +24,7 @@
#endif
#include <gst/gst.h>
-#define UPDATE_INTERVAL 500
+#define UPDATE_INTERVAL 125
static int arg_count;
static int max_count;
@@ -94,6 +94,16 @@ eos_cb (GstBus * bus, GstMessage * msg, GMainLoop * main_loop)
}
static void
+element_message_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
+{
+ const GstStructure *s = gst_message_get_structure (msg);
+ const gchar *name = gst_structure_get_name (s);
+
+ if (g_str_equal (name, "playbin2-stream-changed"))
+ g_print ("stream changed\n");
+}
+
+static void
about_to_finish_cb (GstElement * element, gchar * uri[])
{
if (arg_count < max_count) {
@@ -128,6 +138,8 @@ main (gint argc, gchar * argv[])
g_signal_connect (bus, "message::eos", G_CALLBACK (eos_cb), loop);
g_signal_connect (bus, "message::error", G_CALLBACK (error_cb), loop);
g_signal_connect (bus, "message::warning", G_CALLBACK (warning_cb), NULL);
+ g_signal_connect (bus, "message::element", G_CALLBACK (element_message_cb),
+ NULL);
g_object_set (G_OBJECT (player), "uri", argv[1], NULL);