Commit a1085c3b authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

tools: gst-play: improve verbose output of property notifications

Use new message notify API and print caps and taglists in a nicer
to read way, just like gst-launch-1.0 does nowadays, without
escaping everything three times.
parent 052d3447
......@@ -194,8 +194,8 @@ play_new (gchar ** uris, const gchar * audio_sink, const gchar * video_sink,
if (verbose) {
play->deep_notify_id = g_signal_connect (play->playbin, "deep-notify",
G_CALLBACK (gst_object_default_deep_notify), NULL);
play->deep_notify_id =
gst_element_add_property_deep_notify_watch (play->playbin, NULL, TRUE);
play->loop = g_main_loop_new (NULL, FALSE);
......@@ -470,6 +470,34 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
const GValue *val;
const gchar *name;
GstObject *obj;
gchar *val_str = NULL;
gchar *obj_name;
gst_message_parse_property_notify (msg, &obj, &name, &val);
obj_name = gst_object_get_path_string (GST_OBJECT (obj));
if (val != NULL) {
val_str = g_value_dup_string (val);
else if (G_VALUE_TYPE (val) == GST_TYPE_CAPS)
val_str = gst_caps_to_string (g_value_get_boxed (val));
else if (G_VALUE_TYPE (val) == GST_TYPE_TAG_LIST)
val_str = gst_tag_list_to_string (g_value_get_boxed (val));
val_str = gst_value_serialize (val);
} else {
val_str = g_strdup ("(no value)");
gst_play_printf ("%s: %s = %s\n", obj_name, name, val_str);
g_free (obj_name);
g_free (val_str);
if (gst_is_missing_plugin_message (msg)) {
gchar *desc;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment