From ab8fc54334519ab0738e190f8e431d63f25dd931 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 29 Apr 2004 01:44:13 +0000 Subject: [PATCH] gst/: remove useless _gst_progname stuff Original commit message from CVS: * gst/gst.c: (init_post): * gst/gstinfo.c: remove useless _gst_progname stuff * tools/gst-inspect.c: (print_field), (print_caps): improve caps output --- ChangeLog | 8 ++++++++ gst/gst.c | 5 ----- gst/gstinfo.c | 2 -- tools/gst-inspect.c | 50 +++++++++++++++++++++++++++++--------------------- 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index bed3958..764b321 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-04-29 Benjamin Otte + + * gst/gst.c: (init_post): + * gst/gstinfo.c: + remove useless _gst_progname stuff + * tools/gst-inspect.c: (print_field), (print_caps): + improve caps output + 2004-04-28 David Schleef Disable parsing of a lot of files that aren't part of the diff --git a/gst/gst.c b/gst/gst.c index 8871de0..2d30043 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -39,8 +39,6 @@ #define MAX_PATH_SPLIT 16 #define GST_PLUGIN_SEPARATOR "," -gchar *_gst_progname; - #ifndef GST_DISABLE_REGISTRY gboolean _gst_registry_auto_load = TRUE; static GstRegistry *_global_registry; @@ -636,9 +634,6 @@ init_post (void) gst_trace_set_default (gst_trace); } #endif /* GST_DISABLE_TRACE */ - if (_gst_progname == NULL) { - _gst_progname = g_strdup ("gstprog"); - } return TRUE; } diff --git a/gst/gstinfo.c b/gst/gstinfo.c index f27e8b2..a0d0d5f 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -81,8 +81,6 @@ dladdr (void *address, Dl_info * dl) #endif /* __sgi__ */ #endif -extern gchar *_gst_progname; - static void gst_debug_reset_threshold (gpointer category, gpointer unused); static void gst_debug_reset_all_thresholds (void); diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index c11f620..4f2495e 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -33,30 +33,38 @@ #include #include +static gboolean +print_field (GQuark field, GValue * value, gpointer pfx) +{ + gchar *str = gst_value_serialize (value); + + g_print ("%s %15s: %s\n", (gchar *) pfx, g_quark_to_string (field), str); + g_free (str); + return TRUE; +} + static void print_caps (const GstCaps * caps, const gchar * pfx) { - char *s, *tmp; - char **v; - - s = gst_caps_to_string (caps); - - tmp = g_strdup_printf ("\n %s", pfx); - v = g_strsplit (s, ", ", -1); - g_free (s); - s = g_strjoinv (tmp, v); - g_strfreev (v); - g_free (tmp); - - tmp = g_strdup_printf ("\n%s", pfx); - v = g_strsplit (s, "; ", -1); - g_free (s); - s = g_strjoinv (tmp, v); - g_free (tmp); - g_strfreev (v); - - g_print ("%s%s\n", pfx, s); - g_free (s); + guint i; + + g_return_if_fail (caps != NULL); + + if (gst_caps_is_any (caps)) { + g_print ("%sANY\n", pfx); + return; + } + if (gst_caps_is_empty (caps)) { + g_print ("%sEMPTY\n", pfx); + return; + } + + for (i = 0; i < gst_caps_get_size (caps); i++) { + GstStructure *structure = gst_caps_get_structure (caps, i); + + g_print ("%s%s\n", pfx, gst_structure_get_name (structure)); + gst_structure_foreach (structure, print_field, (gpointer) pfx); + } } static void -- 2.7.4