From db7243a77bf5fc6cbfe41b10b36a9ec5abc9cb03 Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Mon, 1 Jan 2001 04:53:26 +0000 Subject: [PATCH] Added API to control DEBUG level, updated cmdline code Original commit message from CVS: Added API to control DEBUG level, updated cmdline code --- gst/gst.c | 3 +-- gst/gstinfo.c | 45 ++++++++++++++++++++++++++++----------------- gst/gstinfo.h | 7 +++++++ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/gst/gst.c b/gst/gst.c index cb1b17ae64..7a1391efa6 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -120,8 +120,7 @@ gst_init_check (int *argc, sscanf ((*argv)[i]+16, "%d", &val); } - //FIXME - //gst_info_set_categories (val); + gst_debug_set_categories (val); (*argv)[i] = NULL; } diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 98151169a6..63273b90bc 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -97,14 +97,6 @@ gst_info_get_categories () { return _gst_info_categories; } -const gchar * -gst_get_category_name (gint category) { - if ((category >= 0) && (category < GST_CAT_MAX_CATEGORY)) - return _gst_info_category_strings[category]; - else - return NULL; -} - void gst_info_enable_category (gint category) { _gst_info_categories |= (1 << category); @@ -115,6 +107,34 @@ gst_info_disable_category (gint category) { _gst_info_categories &= ~ (1 << category); } +void +gst_debug_set_categories (guint32 categories) { + _gst_debug_categories = categories; +} + +guint32 +gst_debug_get_categories () { + return _gst_debug_categories; +} + +void +gst_debug_enable_category (gint category) { + _gst_debug_categories |= (1 << category); +} + +void +gst_debug_disable_category (gint category) { + _gst_debug_categories &= ~ (1 << category); +} + +const gchar * +gst_get_category_name (gint category) { + if ((category >= 0) && (category < GST_CAT_MAX_CATEGORY)) + return _gst_info_category_strings[category]; + else + return NULL; +} + /***** ERROR system *****/ @@ -178,12 +198,3 @@ gst_default_error_handler (gchar *file, gchar *function, exit(1); } - -gst_info_init (int *argc, - char ***argv) -{ - - if (argc && argv) { - - } -} diff --git a/gst/gstinfo.h b/gst/gstinfo.h index 352abfdd55..3aecccf52a 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -237,8 +237,15 @@ void gst_info_set_categories (guint32 categories); guint32 gst_info_get_categories (void); void gst_info_enable_category (gint category); void gst_info_disable_category (gint category); + +void gst_debug_set_categories (guint32 categories); +guint32 gst_debug_get_categories (void); +void gst_debug_enable_category (gint category); +void gst_debug_disable_category (gint category); + const gchar * gst_get_category_name (gint category); + enum { GST_CAT_GST_INIT = 0, // Library initialization GST_CAT_COTHREADS, // Cothread creation, etc.