Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / tools / gst-inspect.c
index 4084e77..82042d1 100644 (file)
@@ -388,7 +388,7 @@ print_element_properties_info (GstElement * element)
         g_print ("Range: %lu - %lu Default: %lu ",
             pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
 
-        GST_ERROR ("%s: property '%s' of type char: consider changing to "
+        GST_ERROR ("%s: property '%s' of type ulong: consider changing to "
             "uint/uint64", GST_OBJECT_NAME (element),
             g_param_spec_get_name (param));
         break;
@@ -955,7 +955,7 @@ print_blacklist (void)
 
   g_print ("%s\n", _("Blacklisted files:"));
 
-  plugins = gst_default_registry_get_plugin_list ();
+  plugins = gst_registry_get_plugin_list (gst_registry_get ());
   for (cur = plugins; cur != NULL; cur = g_list_next (cur)) {
     GstPlugin *plugin = (GstPlugin *) (cur->data);
     if (plugin->flags & GST_PLUGIN_FLAG_BLACKLISTED) {
@@ -978,7 +978,7 @@ print_element_list (gboolean print_all)
   int plugincount = 0, featurecount = 0, blacklistcount = 0;
   GList *plugins, *orig_plugins;
 
-  orig_plugins = plugins = gst_default_registry_get_plugin_list ();
+  orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
   while (plugins) {
     GList *features, *orig_features;
     GstPlugin *plugin;
@@ -993,7 +993,7 @@ print_element_list (gboolean print_all)
     }
 
     orig_features = features =
-        gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+        gst_registry_get_feature_list_by_plugin (gst_registry_get (),
         plugin->desc.name);
     while (features) {
       GstPluginFeature *feature;
@@ -1013,6 +1013,7 @@ print_element_list (gboolean print_all)
           g_print ("%s:  %s: %s\n", plugin->desc.name,
               GST_OBJECT_NAME (factory),
               gst_element_factory_get_longname (factory));
+#if 0
       } else if (GST_IS_INDEX_FACTORY (feature)) {
         GstIndexFactory *factory;
 
@@ -1020,6 +1021,7 @@ print_element_list (gboolean print_all)
         if (!print_all)
           g_print ("%s:  %s: %s\n", plugin->desc.name,
               GST_OBJECT_NAME (factory), factory->longdesc);
+#endif
       } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
         GstTypeFindFactory *factory;
 
@@ -1075,13 +1077,13 @@ print_all_uri_handlers (void)
 {
   GList *plugins, *p, *features, *f;
 
-  plugins = gst_default_registry_get_plugin_list ();
+  plugins = gst_registry_get_plugin_list (gst_registry_get ());
 
   for (p = plugins; p; p = p->next) {
     GstPlugin *plugin = (GstPlugin *) (p->data);
 
     features =
-        gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+        gst_registry_get_feature_list_by_plugin (gst_registry_get (),
         plugin->desc.name);
 
     for (f = features; f; f = f->next) {
@@ -1191,7 +1193,7 @@ print_plugin_features (GstPlugin * plugin)
   gint num_other = 0;
 
   origlist = features =
-      gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+      gst_registry_get_feature_list_by_plugin (gst_registry_get (),
       plugin->desc.name);
 
   while (features) {
@@ -1206,12 +1208,14 @@ print_plugin_features (GstPlugin * plugin)
       n_print ("  %s: %s\n", GST_OBJECT_NAME (factory),
           gst_element_factory_get_longname (factory));
       num_elements++;
+#if 0
     } else if (GST_IS_INDEX_FACTORY (feature)) {
       GstIndexFactory *factory;
 
       factory = GST_INDEX_FACTORY (feature);
       n_print ("  %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
       num_indexes++;
+#endif
     } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
       GstTypeFindFactory *factory;
 
@@ -1237,6 +1241,7 @@ print_plugin_features (GstPlugin * plugin)
       num_other++;
     }
     num_features++;
+    gst_object_unref (feature);
     features = g_list_next (features);
   }
 
@@ -1262,13 +1267,15 @@ print_element_features (const gchar * element_name)
   GstPluginFeature *feature;
 
   /* FIXME implement other pretty print function for these */
+#if 0
   feature = gst_default_registry_find_feature (element_name,
       GST_TYPE_INDEX_FACTORY);
   if (feature) {
     n_print ("%s: an index\n", element_name);
     return 0;
   }
-  feature = gst_default_registry_find_feature (element_name,
+#endif
+  feature = gst_registry_find_feature (gst_registry_get (), element_name,
       GST_TYPE_TYPE_FIND_FACTORY);
   if (feature) {
     n_print ("%s: a typefind function\n", element_name);
@@ -1295,6 +1302,7 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
 
   element = gst_element_factory_create (factory, NULL);
   if (!element) {
+    gst_object_unref (factory);
     g_print ("couldn't construct element for some reason\n");
     return -1;
   }
@@ -1308,7 +1316,7 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
   if (GST_PLUGIN_FEATURE (factory)->plugin_name) {
     GstPlugin *plugin;
 
-    plugin = gst_registry_find_plugin (gst_registry_get_default (),
+    plugin = gst_registry_find_plugin (gst_registry_get (),
         GST_PLUGIN_FEATURE (factory)->plugin_name);
     if (plugin) {
       print_plugin_info (plugin);
@@ -1441,7 +1449,7 @@ print_plugin_automatic_install_info (GstPlugin * plugin)
   plugin_name = gst_plugin_get_name (plugin);
 
   /* not interested in typefind factories, only element factories */
-  features = gst_registry_get_feature_list (gst_registry_get_default (),
+  features = gst_registry_get_feature_list (gst_registry_get (),
       GST_TYPE_ELEMENT_FACTORY);
 
   for (l = features; l != NULL; l = l->next) {
@@ -1470,7 +1478,7 @@ print_all_plugin_automatic_install_info (void)
 {
   GList *plugins, *orig_plugins;
 
-  orig_plugins = plugins = gst_default_registry_get_plugin_list ();
+  orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
   while (plugins) {
     GstPlugin *plugin;
 
@@ -1520,10 +1528,6 @@ main (int argc, char *argv[])
   textdomain (GETTEXT_PACKAGE);
 #endif
 
-#if !GLIB_CHECK_VERSION (2, 31, 0)
-  g_thread_init (NULL);
-#endif
-
   gst_tools_set_prgname ("gst-inspect");
 
 #ifndef GST_DISABLE_OPTION_PARSING
@@ -1586,7 +1590,7 @@ main (int argc, char *argv[])
 
     /* otherwise check if it's a plugin */
     if (retval) {
-      plugin = gst_default_registry_find_plugin (arg);
+      plugin = gst_registry_find_plugin (gst_registry_get (), arg);
 
       /* if there is such a plugin, print out info */
       if (plugin) {