Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / tools / gst-inspect.c
index 222c276..9f54961 100644 (file)
@@ -300,7 +300,7 @@ flags_to_string (GFlagsValue * vals, guint flags)
     --i;
     if (vals[i].value != 0 && (flags_left & vals[i].value) == vals[i].value) {
       if (s->len > 0)
-        g_string_append (s, " | ");
+        g_string_append_c (s, '+');
       g_string_append (s, vals[i].value_nick);
       flags_left -= vals[i].value;
       if (flags_left == 0)
@@ -689,10 +689,8 @@ print_element_flag_info (GstElement * element)
 static void
 print_implementation_info (GstElement * element)
 {
-  GstObjectClass *gstobject_class;
   GstElementClass *gstelement_class;
 
-  gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
   gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
 
   n_print ("\n");
@@ -793,6 +791,7 @@ print_pad_info (GstElement * element)
   pads = element->pads;
   while (pads) {
     gchar *name;
+    GstCaps *caps;
 
     pad = GST_PAD (pads->data);
     pads = g_list_next (pads);
@@ -836,16 +835,9 @@ print_pad_info (GstElement * element)
       n_print ("      Has custom iterintlinkfunc(): %s\n",
           GST_DEBUG_FUNCPTR_NAME (pad->iterintlinkfunc));
 
-    if (pad->bufferallocfunc)
-      n_print ("      Has bufferallocfunc(): %s\n",
-          GST_DEBUG_FUNCPTR_NAME (pad->bufferallocfunc));
-
     if (pad->getcapsfunc)
       n_print ("      Has getcapsfunc(): %s\n",
           GST_DEBUG_FUNCPTR_NAME (pad->getcapsfunc));
-    if (pad->setcapsfunc)
-      n_print ("      Has setcapsfunc(): %s\n",
-          GST_DEBUG_FUNCPTR_NAME (pad->setcapsfunc));
     /* gst_pad_acceptcaps_default is static :/ */
     if (pad->acceptcapsfunc)
       n_print ("      Has acceptcapsfunc(): %s\n",
@@ -858,9 +850,11 @@ print_pad_info (GstElement * element)
     if (pad->padtemplate)
       n_print ("    Pad Template: '%s'\n", pad->padtemplate->name_template);
 
-    if (pad->caps) {
+    caps = gst_pad_get_current_caps (pad);
+    if (caps) {
       n_print ("    Capabilities:\n");
-      print_caps (pad->caps, "      ");
+      print_caps (caps, "      ");
+      gst_caps_unref (caps);
     }
   }
 }
@@ -1071,7 +1065,7 @@ print_element_list (gboolean print_all)
           print_element_info (factory, TRUE);
         else
           g_print ("%s:  %s: %s\n", plugin->desc.name,
-              GST_PLUGIN_FEATURE_NAME (factory),
+              GST_OBJECT_NAME (factory),
               gst_element_factory_get_longname (factory));
       } else if (GST_IS_INDEX_FACTORY (feature)) {
         GstIndexFactory *factory;
@@ -1079,7 +1073,7 @@ print_element_list (gboolean print_all)
         factory = GST_INDEX_FACTORY (feature);
         if (!print_all)
           g_print ("%s:  %s: %s\n", plugin->desc.name,
-              GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
+              GST_OBJECT_NAME (factory), factory->longdesc);
       } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
         GstTypeFindFactory *factory;
 
@@ -1104,8 +1098,7 @@ print_element_list (gboolean print_all)
       } else {
         if (!print_all)
           n_print ("%s:  %s (%s)\n", plugin->desc.name,
-              GST_PLUGIN_FEATURE_NAME (feature),
-              g_type_name (G_OBJECT_TYPE (feature)));
+              GST_OBJECT_NAME (feature), g_type_name (G_OBJECT_TYPE (feature)));
       }
 
     next:
@@ -1243,14 +1236,14 @@ print_plugin_info (GstPlugin * plugin)
 static void
 print_plugin_features (GstPlugin * plugin)
 {
-  GList *features;
+  GList *features, *origlist;
   gint num_features = 0;
   gint num_elements = 0;
   gint num_typefinders = 0;
   gint num_indexes = 0;
   gint num_other = 0;
 
-  features =
+  origlist = features =
       gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
       plugin->desc.name);
 
@@ -1263,7 +1256,7 @@ print_plugin_features (GstPlugin * plugin)
       GstElementFactory *factory;
 
       factory = GST_ELEMENT_FACTORY (feature);
-      n_print ("  %s: %s\n", GST_PLUGIN_FEATURE_NAME (factory),
+      n_print ("  %s: %s\n", GST_OBJECT_NAME (factory),
           gst_element_factory_get_longname (factory));
       num_elements++;
     } else if (GST_IS_INDEX_FACTORY (feature)) {
@@ -1299,6 +1292,9 @@ print_plugin_features (GstPlugin * plugin)
     num_features++;
     features = g_list_next (features);
   }
+
+  gst_plugin_feature_list_free (origlist);
+
   n_print ("\n");
   n_print ("  %d features:\n", num_features);
   if (num_elements > 0)
@@ -1357,7 +1353,7 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
   }
 
   if (print_names)
-    _name = g_strdup_printf ("%s: ", GST_PLUGIN_FEATURE (factory)->name);
+    _name = g_strdup_printf ("%s: ", GST_OBJECT_NAME (factory));
   else
     _name = NULL;
 
@@ -1435,7 +1431,7 @@ print_plugin_automatic_install_info_codecs (GstElementFactory * factory)
 
   if (caps == NULL) {
     g_printerr ("Couldn't find static pad template for %s '%s'\n",
-        type_name, GST_PLUGIN_FEATURE_NAME (factory));
+        type_name, GST_OBJECT_NAME (factory));
     return;
   }