From: Thomas Vander Stichele Date: Thu, 6 Oct 2005 09:49:42 +0000 (+0000) Subject: gst/: widen the debug category in output to fit the biggest one we have add a bus... X-Git-Tag: RELEASE-0_9_4~225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93c6b880364fa831dbb6d802e356165121767fa1;p=platform%2Fupstream%2Fgstreamer.git gst/: widen the debug category in output to fit the biggest one we have add a bus category and use it play with the c... Original commit message from CVS: * gst/gst_private.h: * gst/gstbus.c: * gst/gstelement.c: * gst/gstinfo.c: * gst/gstpluginfeature.c: widen the debug category in output to fit the biggest one we have add a bus category and use it play with the colors fix up some categories --- diff --git a/ChangeLog b/ChangeLog index 9405030..5dbe6e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2005-10-06 Thomas Vander Stichele + * gst/gst_private.h: + * gst/gstbus.c: + * gst/gstelement.c: + * gst/gstinfo.c: + * gst/gstpluginfeature.c: + widen the debug category in output to fit the biggest one we have + add a bus category and use it + play with the colors + fix up some categories + +2005-10-06 Thomas Vander Stichele + * gst/gstghostpad.c: (gst_ghost_pad_internal_do_activate_push): add push activation of sink ghost pads. Andye, please verify diff --git a/gst/gst_private.h b/gst/gst_private.h index a707c14..39cb256 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -52,6 +52,7 @@ extern GstDebugCategory *GST_CAT_PARENTAGE; extern GstDebugCategory *GST_CAT_STATES; extern GstDebugCategory *GST_CAT_SCHEDULING; extern GstDebugCategory *GST_CAT_BUFFER; +extern GstDebugCategory *GST_CAT_BUS; extern GstDebugCategory *GST_CAT_CAPS; extern GstDebugCategory *GST_CAT_CLOCK; extern GstDebugCategory *GST_CAT_ELEMENT_PADS; @@ -83,6 +84,7 @@ extern GstDebugCategory *GST_CAT_REGISTRY; #define GST_CAT_SCHEDULING NULL #define GST_CAT_DATAFLOW NULL #define GST_CAT_BUFFER NULL +#define GST_CAT_BUS NULL #define GST_CAT_CAPS NULL #define GST_CAT_CLOCK NULL #define GST_CAT_ELEMENT_PADS NULL diff --git a/gst/gstbus.c b/gst/gstbus.c index a78b0e1..4ae6b32 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -67,6 +67,7 @@ #include "gstbus.h" +#define GST_CAT_DEFAULT GST_CAT_BUS /* bus signals */ enum { diff --git a/gst/gstelement.c b/gst/gstelement.c index c611b53..4732805 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1837,7 +1837,7 @@ gst_element_set_state (GstElement * element, GstState state) g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_CHANGE_FAILURE); - GST_DEBUG_OBJECT (element, "set_state to %s", + GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "set_state to %s", gst_element_state_get_name (state)); /* get current element state, need to call the method so that * we call the virtual method and subclasses can implement their diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 5d45ce9..c1a0804 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -28,16 +28,17 @@ * * GStreamer's debugging subsystem is an easy way to get information about what * the application is doing. - * It is not meant for programming errors. Use GLibs methods (g_warning and so - * on for that. + * It is not meant for programming errors. Use GLib methods (g_warning and + * friends) for that. * - * The debugging subsystem works only after GStreamer has been initilized + * The debugging subsystem works only after GStreamer has been initialized * - for example by calling gst_init(). * * The debugging subsystem is used to log informational messages while the * application runs. * Each messages has some properties attached to it. Among these properties - * are the debugging category, the severity (called "level" here) and an obtional + * are the debugging category, the severity (called "level" here) and an + * optional * #GObject it belongs to. Each of these messages is sent to all registered * debugging handlers, which then handle the messages. GStreamer attaches a * default handler on startup, which outputs requested messages to stderr. @@ -46,30 +47,37 @@ * #GST_CAT_ERROR_OBJECT or similar. These all expand to calling gst_debug_log() * with the right parameters. * The only thing a developer will probably want to do is define his own - * categories. This is easily done with 3 lines. At the top of your code, declare + * categories. This is easily done with 3 lines. At the top of your code, + * declare * the variables and set the default category. * * - * GST_DEBUG_CATEGORY (my_category); // define category + * GST_DEBUG_CATEGORY (my_category); // define category * &hash;define GST_CAT_DEFAULT my_category // set as default * * * After that you only need to initialize the category. * * - * GST_DEBUG_CATEGORY_INIT (my_category, "my category", 0, "This is my very own"); + * GST_DEBUG_CATEGORY_INIT (my_category, "my category", + * 0, "This is my very own"); * * - * Initialization must be done before the category is used first. Plugins do this + * Initialization must be done before the category is used first. + * Plugins do this * in their plugin_init function, libraries and applications should do that * during their initialization. * * The whole debugging subsystem can be disabled at build time with passing the - * --disable-gst-debug switch to configure. If this is done, every function, macro - * and even structs described in this file evaluate to default values or nothing + * --disable-gst-debug switch to configure. If this is done, every function, + * macro + * and even structs described in this file evaluate to default values or + * nothing * at all. So don't take addresses of these functions or use other tricks. - * If you must do that for some reason, there is still an option. If the debugging - * subsystem was compiled out, #GST_DISABLE_GST_DEBUG is defined in <gst/gst.h>, + * If you must do that for some reason, there is still an option. + * If the debugging + * subsystem was compiled out, #GST_DISABLE_GST_DEBUG is defined in + * <gst/gst.h>, * so you can check that before doing your trick. * Disabling the debugging subsystem will give you a slight (read: unnoticable) * speed increase and will reduce the size of your compiled code. The GStreamer @@ -192,6 +200,7 @@ GstDebugCategory *GST_CAT_STATES = NULL; GstDebugCategory *GST_CAT_SCHEDULING = NULL; GstDebugCategory *GST_CAT_BUFFER = NULL; +GstDebugCategory *GST_CAT_BUS = NULL; GstDebugCategory *GST_CAT_CAPS = NULL; GstDebugCategory *GST_CAT_CLOCK = NULL; GstDebugCategory *GST_CAT_ELEMENT_PADS = NULL; @@ -294,7 +303,8 @@ _gst_debug_init (void) GST_CAT_SCHEDULING = _gst_debug_category_new ("GST_SCHEDULING", GST_DEBUG_BOLD | GST_DEBUG_FG_MAGENTA, NULL); GST_CAT_BUFFER = _gst_debug_category_new ("GST_BUFFER", - GST_DEBUG_BOLD | GST_DEBUG_FG_GREEN, NULL); + GST_DEBUG_BOLD | GST_DEBUG_BG_GREEN, NULL); + GST_CAT_BUS = _gst_debug_category_new ("GST_BUS", GST_DEBUG_BG_YELLOW, NULL); GST_CAT_CAPS = _gst_debug_category_new ("GST_CAPS", GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE, NULL); GST_CAT_CLOCK = _gst_debug_category_new ("GST_CLOCK", @@ -578,7 +588,7 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level, g_get_current_time (&now); elapsed = GST_TIMEVAL_TO_TIME (now) - start_time; g_printerr ("%s (%p - %" GST_TIME_FORMAT - ") %s%15s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n", + ") %s%20s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n", gst_debug_level_get_name (level), g_thread_self (), GST_TIME_ARGS (elapsed), color, gst_debug_category_get_name (category), clear, pidcolor, pid, clear, diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c index 78b4734..c665f2c 100644 --- a/gst/gstpluginfeature.c +++ b/gst/gstpluginfeature.c @@ -36,6 +36,8 @@ #include +#define GST_CAT_DEFAULT GST_CAT_PLUGIN_LOADING + static void gst_plugin_feature_class_init (GstPluginFeatureClass * klass); static void gst_plugin_feature_init (GstPluginFeature * feature); static void gst_plugin_feature_finalize (GObject * object);