mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-06 14:32:31 +00:00
validate-monitor: Determine the reporting level at setup.
This commit is contained in:
parent
1d7f15598f
commit
c943a75766
2 changed files with 30 additions and 0 deletions
|
@ -188,10 +188,38 @@ gst_validate_monitor_do_setup (GstValidateMonitor * monitor)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_determine_reporting_level (GstValidateMonitor *monitor)
|
||||||
|
{
|
||||||
|
GstValidateRunner *runner;
|
||||||
|
GstObject *object, *parent;
|
||||||
|
const gchar *object_name;
|
||||||
|
GstValidateReportingLevel level = GST_VALIDATE_REPORTING_LEVEL_UNKNOWN;
|
||||||
|
|
||||||
|
object = gst_object_ref(monitor->target);
|
||||||
|
runner = gst_validate_reporter_get_runner (GST_VALIDATE_REPORTER (monitor));
|
||||||
|
|
||||||
|
do {
|
||||||
|
object_name = gst_object_get_name (object);
|
||||||
|
level = gst_validate_runner_get_reporting_level_for_name (runner, object_name);
|
||||||
|
parent = gst_object_get_parent (object);
|
||||||
|
gst_object_unref (object);
|
||||||
|
object = parent;
|
||||||
|
} while (object && level == GST_VALIDATE_REPORTING_LEVEL_UNKNOWN);
|
||||||
|
|
||||||
|
if (object)
|
||||||
|
gst_object_unref (object);
|
||||||
|
|
||||||
|
monitor->level = level;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_validate_monitor_setup (GstValidateMonitor * monitor)
|
gst_validate_monitor_setup (GstValidateMonitor * monitor)
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (monitor, "Starting monitor setup");
|
GST_DEBUG_OBJECT (monitor, "Starting monitor setup");
|
||||||
|
|
||||||
|
/* For now we just need to do this at setup time */
|
||||||
|
_determine_reporting_level (monitor);
|
||||||
return GST_VALIDATE_MONITOR_GET_CLASS (monitor)->setup (monitor);
|
return GST_VALIDATE_MONITOR_GET_CLASS (monitor)->setup (monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ struct _GstValidateMonitor {
|
||||||
GMutex overrides_mutex;
|
GMutex overrides_mutex;
|
||||||
GQueue overrides;
|
GQueue overrides;
|
||||||
|
|
||||||
|
GstValidateReportingLevel level;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GHashTable *reports;
|
GHashTable *reports;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue