inspect: add support for the new factory
authorStefan Sauer <ensonic@users.sf.net>
Sat, 26 Oct 2013 20:05:13 +0000 (22:05 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Mon, 5 Oct 2015 18:59:39 +0000 (20:59 +0200)
Handle tracer modules.

tools/gst-inspect.c

index bb0129a..845f52e 100644 (file)
@@ -1141,6 +1141,7 @@ print_plugin_features (GstPlugin * plugin)
   GList *features, *origlist;
   gint num_features = 0;
   gint num_elements = 0;
+  gint num_tracers = 0;
   gint num_typefinders = 0;
   gint num_devproviders = 0;
   gint num_other = 0;
@@ -1191,6 +1192,10 @@ print_plugin_features (GstPlugin * plugin)
           gst_device_provider_factory_get_metadata (factory,
               GST_ELEMENT_METADATA_LONGNAME));
       num_devproviders++;
+    } else if (GST_IS_TRACER_FACTORY (feature)) {
+      n_print ("  %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
+          g_type_name (G_OBJECT_TYPE (feature)));
+      num_tracers++;
     } else if (feature) {
       n_print ("  %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
           g_type_name (G_OBJECT_TYPE (feature)));
@@ -1210,6 +1215,8 @@ print_plugin_features (GstPlugin * plugin)
     n_print ("  +-- %d typefinders\n", num_typefinders);
   if (num_devproviders > 0)
     n_print ("  +-- %d device providers\n", num_devproviders);
+  if (num_tracers > 0)
+    n_print ("  +-- %d tracers\n", num_tracers);
   if (num_other > 0)
     n_print ("  +-- %d other objects\n", num_other);
 
@@ -1228,6 +1235,12 @@ print_element_features (const gchar * element_name)
     n_print ("%s: a typefind function\n", element_name);
     return 0;
   }
+  feature = gst_registry_find_feature (gst_registry_get (), element_name,
+      GST_TYPE_TRACER_FACTORY);
+  if (feature) {
+    n_print ("%s: a tracer module\n", element_name);
+    return 0;
+  }
 
   return -1;
 }