From 53c122df2b167b170271fa33fd4f76b6411d86af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 1 Jun 2010 11:46:17 +0100 Subject: [PATCH] check: log plugins available to unit tests and their paths --- libs/gst/check/gstcheck.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index a96097978c..e2ac0988d5 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -82,6 +82,35 @@ static void gst_check_log_critical_func _gst_check_raised_warning = TRUE; } +static gint +sort_plugins (GstPlugin * a, GstPlugin * b) +{ + int ret; + + ret = strcmp (gst_plugin_get_source (a), gst_plugin_get_source (b)); + if (ret == 0) + ret = strcmp (gst_plugin_get_name (a), gst_plugin_get_name (b)); + return ret; +} + +static void +print_plugins (void) +{ + GList *plugins, *l; + + plugins = gst_default_registry_get_plugin_list (); + plugins = g_list_sort (plugins, (GCompareFunc) sort_plugins); + for (l = plugins; l != NULL; l = l->next) { + GstPlugin *plugin = GST_PLUGIN (l->data); + + if (strcmp (gst_plugin_get_source (plugin), "BLACKLIST") != 0) { + GST_LOG ("%20s@%s", gst_plugin_get_name (plugin), + GST_STR_NULL (gst_plugin_get_filename (plugin))); + } + } + gst_plugin_list_free (plugins); +} + /* initialize GStreamer testing */ void gst_check_init (int *argc, char **argv[]) @@ -104,6 +133,8 @@ gst_check_init (int *argc, char **argv[]) g_log_set_handler ("Gst-Phonon", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING, gst_check_log_critical_func, NULL); + print_plugins (); + check_cond = g_cond_new (); check_mutex = g_mutex_new (); }