diff --git a/validate/gst/validate/Makefile.am b/validate/gst/validate/Makefile.am index 2a616090af..6b49577272 100644 --- a/validate/gst/validate/Makefile.am +++ b/validate/gst/validate/Makefile.am @@ -18,6 +18,7 @@ noinst_HEADERS = \ gst-validate-bin-monitor.h \ gst-validate-element-monitor.h \ gst-validate-i18n-lib.h \ + gst-validate-internal.h \ gst-validate-monitor-factory.h \ gst-validate-monitor.h \ gst-validate-override.h \ diff --git a/validate/gst/validate/gst-validate-bin-monitor.c b/validate/gst/validate/gst-validate-bin-monitor.c index 3731c1af9c..e3752cb3c8 100644 --- a/validate/gst/validate/gst-validate-bin-monitor.c +++ b/validate/gst/validate/gst-validate-bin-monitor.c @@ -23,6 +23,7 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-bin-monitor.h" #include "gst-validate-monitor-factory.h" @@ -33,14 +34,9 @@ * 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 -G_DEFINE_TYPE_WITH_CODE (GstValidateBinMonitor, gst_validate_bin_monitor, - GST_TYPE_VALIDATE_ELEMENT_MONITOR, _do_init); +G_DEFINE_TYPE (GstValidateBinMonitor, gst_validate_bin_monitor, + GST_TYPE_VALIDATE_ELEMENT_MONITOR); static void gst_validate_bin_monitor_wrap_element (GstValidateBinMonitor * monitor, diff --git a/validate/gst/validate/gst-validate-element-monitor.c b/validate/gst/validate/gst-validate-element-monitor.c index 9499b1176c..220f42da78 100644 --- a/validate/gst/validate/gst-validate-element-monitor.c +++ b/validate/gst/validate/gst-validate-element-monitor.c @@ -23,6 +23,7 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-element-monitor.h" #include "gst-validate-pad-monitor.h" #include "gst-validate-monitor-factory.h" @@ -35,14 +36,9 @@ * 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 -G_DEFINE_TYPE_WITH_CODE (GstValidateElementMonitor, - gst_validate_element_monitor, GST_TYPE_VALIDATE_MONITOR, _do_init); +G_DEFINE_TYPE (GstValidateElementMonitor, gst_validate_element_monitor, + GST_TYPE_VALIDATE_MONITOR); static void gst_validate_element_monitor_wrap_pad (GstValidateElementMonitor * monitor, diff --git a/validate/gst/validate/gst-validate-internal.h b/validate/gst/validate/gst-validate-internal.h new file mode 100644 index 0000000000..3d2304701a --- /dev/null +++ b/validate/gst/validate/gst-validate-internal.h @@ -0,0 +1,30 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos + * + * 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_DEBUG_CATEGORY_EXTERN (gstvalidate_debug); +#define GST_CAT_DEFAULT gstvalidate_debug + +#endif diff --git a/validate/gst/validate/gst-validate-monitor.c b/validate/gst/validate/gst-validate-monitor.c index 22d83b0c39..2c2c99a3c3 100644 --- a/validate/gst/validate/gst-validate-monitor.c +++ b/validate/gst/validate/gst-validate-monitor.c @@ -23,6 +23,7 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-monitor.h" /** @@ -41,9 +42,6 @@ enum 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 void 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); #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) static void diff --git a/validate/gst/validate/gst-validate-override-registry.c b/validate/gst/validate/gst-validate-override-registry.c index 4f1ffee366..20943fef46 100644 --- a/validate/gst/validate/gst-validate-override-registry.c +++ b/validate/gst/validate/gst-validate-override-registry.c @@ -28,6 +28,7 @@ #define __USE_GNU #include +#include "gst-validate-internal.h" #include "gst-validate-override-registry.h" typedef struct diff --git a/validate/gst/validate/gst-validate-override.c b/validate/gst/validate/gst-validate-override.c index 7e1fcc45e9..02c5105e44 100644 --- a/validate/gst/validate/gst-validate-override.c +++ b/validate/gst/validate/gst-validate-override.c @@ -25,6 +25,7 @@ #include +#include "gst-validate-internal.h" #include "gst-validate-override.h" GstValidateOverride * diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 1a0136abd6..b804fc389d 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -23,10 +23,10 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-pad-monitor.h" #include "gst-validate-element-monitor.h" #include "gst-validate-reporter.h" -#include #include #include @@ -37,14 +37,9 @@ * 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 -G_DEFINE_TYPE_WITH_CODE (GstValidatePadMonitor, gst_validate_pad_monitor, - GST_TYPE_VALIDATE_MONITOR, _do_init); +G_DEFINE_TYPE (GstValidatePadMonitor, gst_validate_pad_monitor, + GST_TYPE_VALIDATE_MONITOR); #define PENDING_FIELDS "pending-fields" diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index 522097e044..adbe4e4132 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -25,6 +25,7 @@ #include #include "gst-validate-i18n-lib.h" +#include "gst-validate-internal.h" #include "gst-validate-report.h" #include "gst-validate-reporter.h" diff --git a/validate/gst/validate/gst-validate-reporter.c b/validate/gst/validate/gst-validate-reporter.c index ddd6c6d074..e53157e567 100644 --- a/validate/gst/validate/gst-validate-reporter.c +++ b/validate/gst/validate/gst-validate-reporter.c @@ -22,14 +22,12 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-reporter.h" #include "gst-validate-report.h" #define REPORTER_PRIVATE "gst-validate-reporter-private" -GST_DEBUG_CATEGORY_STATIC (gst_validate_reporter); -#define GST_CAT_DEFAULT gst_validate_reporter - typedef struct _GstValidateReporterPrivate { GstValidateRunner *runner; @@ -42,9 +40,6 @@ G_DEFINE_INTERFACE (GstValidateReporter, gst_validate_reporter, G_TYPE_OBJECT); static void 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_param_spec_object ("qa-runner", "VALIDATE Runner", "The Validate runner to " "report errors to", diff --git a/validate/gst/validate/gst-validate-runner.c b/validate/gst/validate/gst-validate-runner.c index a7d2e1d15c..f61f03cac7 100644 --- a/validate/gst/validate/gst-validate-runner.c +++ b/validate/gst/validate/gst-validate-runner.c @@ -23,6 +23,7 @@ # include "config.h" #endif +#include "gst-validate-internal.h" #include "gst-validate-report.h" #include "gst-validate-monitor-factory.h" #include "gst-validate-override-registry.h" @@ -35,14 +36,8 @@ * 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 -G_DEFINE_TYPE_WITH_CODE (GstValidateRunner, gst_validate_runner, G_TYPE_OBJECT, - _do_init); +G_DEFINE_TYPE (GstValidateRunner, gst_validate_runner, G_TYPE_OBJECT); /* signals */ enum diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index a9c1c383a6..1f65a34c64 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -37,10 +37,6 @@ #define GST_VALIDATE_SCENARIO_SUFFIX ".xml" #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 TODO make it overridable */ enum @@ -652,9 +648,6 @@ gst_validate_scenario_class_init (GstValidateScenarioClass * 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)); object_class->dispose = gst_validate_scenario_dispose; diff --git a/validate/gst/validate/validate.c b/validate/gst/validate/validate.c index 9094016dc0..10ce474722 100644 --- a/validate/gst/validate/validate.c +++ b/validate/gst/validate/validate.c @@ -24,10 +24,16 @@ #endif #include "validate.h" +#include "gst-validate-internal.h" + +GST_DEBUG_CATEGORY (gstvalidate_debug); void gst_validate_init (void) { + GST_DEBUG_CATEGORY_INIT (gstvalidate_debug, "validate", 0, + "Validation library"); + /* init the report system (can be called multiple times) */ gst_validate_report_init ();