updated the debug system so it works nicely now
Original commit message from CVS: updated the debug system so it works nicely now
This commit is contained in:
parent
db7243a77b
commit
8cc76f5013
@ -110,14 +110,14 @@ gst_init_check (int *argc,
|
|||||||
|
|
||||||
(*argv)[i] = NULL;
|
(*argv)[i] = NULL;
|
||||||
}
|
}
|
||||||
else if (!strncmp ("--gst-info-mask=", (*argv)[i], 16)) {
|
else if (!strncmp ("--gst-debug-mask=", (*argv)[i], 17)) {
|
||||||
guint32 val;
|
guint32 val;
|
||||||
|
|
||||||
// handle either 0xHEX or dec
|
// handle either 0xHEX or dec
|
||||||
if (*((*argv)[i]+17) == 'x') {
|
if (*((*argv)[i]+18) == 'x') {
|
||||||
sscanf ((*argv)[i]+18, "%08x", &val);
|
sscanf ((*argv)[i]+19, "%08x", &val);
|
||||||
} else {
|
} else {
|
||||||
sscanf ((*argv)[i]+16, "%d", &val);
|
sscanf ((*argv)[i]+17, "%d", &val);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_debug_set_categories (val);
|
gst_debug_set_categories (val);
|
||||||
|
@ -90,6 +90,8 @@ gst_default_info_handler (gint category, gchar *file, gchar *function,
|
|||||||
void
|
void
|
||||||
gst_info_set_categories (guint32 categories) {
|
gst_info_set_categories (guint32 categories) {
|
||||||
_gst_info_categories = categories;
|
_gst_info_categories = categories;
|
||||||
|
if (categories)
|
||||||
|
GST_INFO (0, "setting INFO categories to 0x%08X\n",categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
@ -100,16 +102,28 @@ gst_info_get_categories () {
|
|||||||
void
|
void
|
||||||
gst_info_enable_category (gint category) {
|
gst_info_enable_category (gint category) {
|
||||||
_gst_info_categories |= (1 << category);
|
_gst_info_categories |= (1 << category);
|
||||||
|
if (_gst_info_categories)
|
||||||
|
GST_INFO (0, "setting INFO categories to 0x%08X\n",_gst_info_categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_info_disable_category (gint category) {
|
gst_info_disable_category (gint category) {
|
||||||
_gst_info_categories &= ~ (1 << category);
|
_gst_info_categories &= ~ (1 << category);
|
||||||
|
if (_gst_info_categories)
|
||||||
|
GST_INFO (0, "setting INFO categories to 0x%08X\n",_gst_info_categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***** DEBUG system *****/
|
||||||
|
guint32 _gst_debug_categories = 0x00000000;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_debug_set_categories (guint32 categories) {
|
gst_debug_set_categories (guint32 categories) {
|
||||||
_gst_debug_categories = categories;
|
_gst_debug_categories = categories;
|
||||||
|
if (categories)
|
||||||
|
GST_INFO (0, "setting DEBUG categories to 0x%08X\n",categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
@ -120,11 +134,15 @@ gst_debug_get_categories () {
|
|||||||
void
|
void
|
||||||
gst_debug_enable_category (gint category) {
|
gst_debug_enable_category (gint category) {
|
||||||
_gst_debug_categories |= (1 << category);
|
_gst_debug_categories |= (1 << category);
|
||||||
|
if (_gst_debug_categories)
|
||||||
|
GST_INFO (0, "setting DEBUG categories to 0x%08X\n",_gst_debug_categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_debug_disable_category (gint category) {
|
gst_debug_disable_category (gint category) {
|
||||||
_gst_debug_categories &= ~ (1 << category);
|
_gst_debug_categories &= ~ (1 << category);
|
||||||
|
if (_gst_debug_categories)
|
||||||
|
GST_INFO (0, "setting DEBUG categories to 0x%08X\n",_gst_debug_categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
|
@ -49,9 +49,11 @@ extern guint32 _gst_debug_categories;
|
|||||||
#define GST_DEBUG_ENABLED
|
#define GST_DEBUG_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GST_DEBUG_ENABLE_CATEGORIES
|
//#ifdef GST_DEBUG_ENABLED
|
||||||
#define GST_DEBUG_ENABLE_CATEGORIES 0x00000000
|
#define GST_DEBUG_ENABLE_CATEGORIES 0xffffffff
|
||||||
#endif
|
//#else
|
||||||
|
//#define GST_DEBUG_ENABLE_CATEGORIES 0x00000000
|
||||||
|
//#endif
|
||||||
|
|
||||||
/* fallback, this should probably be a 'weak' symbol or something */
|
/* fallback, this should probably be a 'weak' symbol or something */
|
||||||
G_GNUC_UNUSED static gchar *_debug_string = NULL;
|
G_GNUC_UNUSED static gchar *_debug_string = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user