validate: Only use one debugging category: validate

There's no point in having a different debug category per file, you
can filter it by source filename if you *really* want that.
This commit is contained in:
Edward Hervey 2013-08-20 11:43:07 +02:00
parent 7e5f458e63
commit 529576e69b
13 changed files with 53 additions and 46 deletions

View file

@ -18,6 +18,7 @@ noinst_HEADERS = \
gst-validate-bin-monitor.h \ gst-validate-bin-monitor.h \
gst-validate-element-monitor.h \ gst-validate-element-monitor.h \
gst-validate-i18n-lib.h \ gst-validate-i18n-lib.h \
gst-validate-internal.h \
gst-validate-monitor-factory.h \ gst-validate-monitor-factory.h \
gst-validate-monitor.h \ gst-validate-monitor.h \
gst-validate-override.h \ gst-validate-override.h \

View file

@ -23,6 +23,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-bin-monitor.h" #include "gst-validate-bin-monitor.h"
#include "gst-validate-monitor-factory.h" #include "gst-validate-monitor-factory.h"
@ -33,14 +34,9 @@
* TODO * TODO
*/ */
GST_DEBUG_CATEGORY_STATIC (gst_validate_bin_monitor_debug);
#define GST_CAT_DEFAULT gst_validate_bin_monitor_debug
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_validate_bin_monitor_debug, "qa_bin_monitor", 0, "VALIDATE BinMonitor");
#define gst_validate_bin_monitor_parent_class parent_class #define gst_validate_bin_monitor_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstValidateBinMonitor, gst_validate_bin_monitor, G_DEFINE_TYPE (GstValidateBinMonitor, gst_validate_bin_monitor,
GST_TYPE_VALIDATE_ELEMENT_MONITOR, _do_init); GST_TYPE_VALIDATE_ELEMENT_MONITOR);
static void static void
gst_validate_bin_monitor_wrap_element (GstValidateBinMonitor * monitor, gst_validate_bin_monitor_wrap_element (GstValidateBinMonitor * monitor,

View file

@ -23,6 +23,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-element-monitor.h" #include "gst-validate-element-monitor.h"
#include "gst-validate-pad-monitor.h" #include "gst-validate-pad-monitor.h"
#include "gst-validate-monitor-factory.h" #include "gst-validate-monitor-factory.h"
@ -35,14 +36,9 @@
* TODO * TODO
*/ */
GST_DEBUG_CATEGORY_STATIC (gst_validate_element_monitor_debug);
#define GST_CAT_DEFAULT gst_validate_element_monitor_debug
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_validate_element_monitor_debug, "qa_element_monitor", 0, "VALIDATE ElementMonitor");
#define gst_validate_element_monitor_parent_class parent_class #define gst_validate_element_monitor_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstValidateElementMonitor, G_DEFINE_TYPE (GstValidateElementMonitor, gst_validate_element_monitor,
gst_validate_element_monitor, GST_TYPE_VALIDATE_MONITOR, _do_init); GST_TYPE_VALIDATE_MONITOR);
static void static void
gst_validate_element_monitor_wrap_pad (GstValidateElementMonitor * monitor, gst_validate_element_monitor_wrap_pad (GstValidateElementMonitor * monitor,

View file

@ -0,0 +1,30 @@
/* GStreamer
* Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com>
*
* validate.c - Validate generic functions
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_VALIDATE_INTERNAL_H__
#define __GST_VALIDATE_INTERNAL_H__
#include <gst/gst.h>
GST_DEBUG_CATEGORY_EXTERN (gstvalidate_debug);
#define GST_CAT_DEFAULT gstvalidate_debug
#endif

View file

@ -23,6 +23,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-monitor.h" #include "gst-validate-monitor.h"
/** /**
@ -41,9 +42,6 @@ enum
PROP_LAST PROP_LAST
}; };
GST_DEBUG_CATEGORY_STATIC (gst_validate_monitor_debug);
#define GST_CAT_DEFAULT gst_validate_monitor_debug
static gboolean gst_validate_monitor_do_setup (GstValidateMonitor * monitor); static gboolean gst_validate_monitor_do_setup (GstValidateMonitor * monitor);
static void static void
gst_validate_monitor_get_property (GObject * object, guint prop_id, gst_validate_monitor_get_property (GObject * object, guint prop_id,
@ -60,7 +58,6 @@ static void gst_validate_monitor_intercept_report (GstValidateReporter *
reporter, GstValidateReport * report); reporter, GstValidateReport * report);
#define _do_init \ #define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_validate_monitor_debug, "qa_monitor", 0, "VALIDATE Monitor");\
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, _reporter_iface_init) G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, _reporter_iface_init)
static void static void

View file

@ -28,6 +28,7 @@
#define __USE_GNU #define __USE_GNU
#include <dlfcn.h> #include <dlfcn.h>
#include "gst-validate-internal.h"
#include "gst-validate-override-registry.h" #include "gst-validate-override-registry.h"
typedef struct typedef struct

View file

@ -25,6 +25,7 @@
#include <string.h> #include <string.h>
#include "gst-validate-internal.h"
#include "gst-validate-override.h" #include "gst-validate-override.h"
GstValidateOverride * GstValidateOverride *

View file

@ -23,10 +23,10 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-pad-monitor.h" #include "gst-validate-pad-monitor.h"
#include "gst-validate-element-monitor.h" #include "gst-validate-element-monitor.h"
#include "gst-validate-reporter.h" #include "gst-validate-reporter.h"
#include <gst/gst.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@ -37,14 +37,9 @@
* TODO * TODO
*/ */
GST_DEBUG_CATEGORY_STATIC (gst_validate_pad_monitor_debug);
#define GST_CAT_DEFAULT gst_validate_pad_monitor_debug
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_validate_pad_monitor_debug, "qa_pad_monitor", 0, "VALIDATE PadMonitor");
#define gst_validate_pad_monitor_parent_class parent_class #define gst_validate_pad_monitor_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstValidatePadMonitor, gst_validate_pad_monitor, G_DEFINE_TYPE (GstValidatePadMonitor, gst_validate_pad_monitor,
GST_TYPE_VALIDATE_MONITOR, _do_init); GST_TYPE_VALIDATE_MONITOR);
#define PENDING_FIELDS "pending-fields" #define PENDING_FIELDS "pending-fields"

View file

@ -25,6 +25,7 @@
#include <string.h> #include <string.h>
#include "gst-validate-i18n-lib.h" #include "gst-validate-i18n-lib.h"
#include "gst-validate-internal.h"
#include "gst-validate-report.h" #include "gst-validate-report.h"
#include "gst-validate-reporter.h" #include "gst-validate-reporter.h"

View file

@ -22,14 +22,12 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-reporter.h" #include "gst-validate-reporter.h"
#include "gst-validate-report.h" #include "gst-validate-report.h"
#define REPORTER_PRIVATE "gst-validate-reporter-private" #define REPORTER_PRIVATE "gst-validate-reporter-private"
GST_DEBUG_CATEGORY_STATIC (gst_validate_reporter);
#define GST_CAT_DEFAULT gst_validate_reporter
typedef struct _GstValidateReporterPrivate typedef struct _GstValidateReporterPrivate
{ {
GstValidateRunner *runner; GstValidateRunner *runner;
@ -42,9 +40,6 @@ G_DEFINE_INTERFACE (GstValidateReporter, gst_validate_reporter, G_TYPE_OBJECT);
static void static void
gst_validate_reporter_default_init (GstValidateReporterInterface * iface) gst_validate_reporter_default_init (GstValidateReporterInterface * iface)
{ {
GST_DEBUG_CATEGORY_INIT (gst_validate_reporter, "gstvalidatereporter",
GST_DEBUG_FG_MAGENTA, "gst qa reporter");
g_object_interface_install_property (iface, g_object_interface_install_property (iface,
g_param_spec_object ("qa-runner", "VALIDATE Runner", g_param_spec_object ("qa-runner", "VALIDATE Runner",
"The Validate runner to " "report errors to", "The Validate runner to " "report errors to",

View file

@ -23,6 +23,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include "gst-validate-internal.h"
#include "gst-validate-report.h" #include "gst-validate-report.h"
#include "gst-validate-monitor-factory.h" #include "gst-validate-monitor-factory.h"
#include "gst-validate-override-registry.h" #include "gst-validate-override-registry.h"
@ -35,14 +36,8 @@
* TODO * TODO
*/ */
GST_DEBUG_CATEGORY_STATIC (gst_validate_runner_debug);
#define GST_CAT_DEFAULT gst_validate_runner_debug
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_validate_runner_debug, "qa_runner", 0, "VALIDATE Runner");
#define gst_validate_runner_parent_class parent_class #define gst_validate_runner_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstValidateRunner, gst_validate_runner, G_TYPE_OBJECT, G_DEFINE_TYPE (GstValidateRunner, gst_validate_runner, G_TYPE_OBJECT);
_do_init);
/* signals */ /* signals */
enum enum

View file

@ -37,10 +37,6 @@
#define GST_VALIDATE_SCENARIO_SUFFIX ".xml" #define GST_VALIDATE_SCENARIO_SUFFIX ".xml"
#define GST_VALIDATE_SCENARIO_DIRECTORY "qa-scenario" #define GST_VALIDATE_SCENARIO_DIRECTORY "qa-scenario"
GST_DEBUG_CATEGORY_STATIC (gst_validate_scenario);
#define GST_CAT_DEFAULT gst_validate_scenario
#define DEFAULT_SEEK_TOLERANCE (0.1 * GST_SECOND) /* tolerance seek interval #define DEFAULT_SEEK_TOLERANCE (0.1 * GST_SECOND) /* tolerance seek interval
TODO make it overridable */ TODO make it overridable */
enum enum
@ -652,9 +648,6 @@ gst_validate_scenario_class_init (GstValidateScenarioClass * klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (gst_validate_scenario, "gstvalidatescenario",
GST_DEBUG_FG_MAGENTA, "gst qa scenario");
g_type_class_add_private (klass, sizeof (GstValidateScenarioPrivate)); g_type_class_add_private (klass, sizeof (GstValidateScenarioPrivate));
object_class->dispose = gst_validate_scenario_dispose; object_class->dispose = gst_validate_scenario_dispose;

View file

@ -24,10 +24,16 @@
#endif #endif
#include "validate.h" #include "validate.h"
#include "gst-validate-internal.h"
GST_DEBUG_CATEGORY (gstvalidate_debug);
void void
gst_validate_init (void) gst_validate_init (void)
{ {
GST_DEBUG_CATEGORY_INIT (gstvalidate_debug, "validate", 0,
"Validation library");
/* init the report system (can be called multiple times) */ /* init the report system (can be called multiple times) */
gst_validate_report_init (); gst_validate_report_init ();