make -launch receive and print out errors.

Original commit message from CVS:
make -launch receive and print out errors.
There is also a fix to allow printing gint64 variables. This should be removed when GLib does it. Glib1.3.13 does not.
This commit is contained in:
Benjamin Otte 2002-02-06 19:10:38 +00:00
parent a2c24524e2
commit c3dd1a65b3

View file

@ -51,7 +51,11 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
if (pspec->flags & G_PARAM_READABLE) { if (pspec->flags & G_PARAM_READABLE) {
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_object_get_property (G_OBJECT (orig), pspec->name, &value); g_object_get_property (G_OBJECT (orig), pspec->name, &value);
str = g_strdup_value_contents (&value); /* fix current bug with g_strdup_value_contents not working with gint64 */
if (G_IS_PARAM_SPEC_INT64 (pspec))
str = g_strdup_printf ("%lld", g_value_get_int64 (&value));
else
str = g_strdup_value_contents (&value);
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str); g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
g_free (str); g_free (str);
g_value_unset(&value); g_value_unset(&value);
@ -60,6 +64,12 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
} }
} }
static void
error_callback (GObject *object, GstObject *orig, gchar *error)
{
g_print ("ERROR: %s: %s\n", GST_OBJECT_NAME (orig), error);
}
static GstElement* static GstElement*
xmllaunch_parse_cmdline (const gchar **argv) xmllaunch_parse_cmdline (const gchar **argv)
{ {
@ -166,6 +176,7 @@ main(int argc, char *argv[])
} }
g_signal_connect (pipeline, "deep_notify", G_CALLBACK (property_change_callback), NULL); g_signal_connect (pipeline, "deep_notify", G_CALLBACK (property_change_callback), NULL);
g_signal_connect (pipeline, "error", G_CALLBACK (error_callback), NULL);
#ifndef GST_DISABLE_LOADSAVE #ifndef GST_DISABLE_LOADSAVE
if (save_pipeline) { if (save_pipeline) {