tracer: latency: Show element id, element name and pad name
[platform/upstream/gstreamer.git] / gst / gstregistrychunks.c
index 7712fcf..6801a18 100644 (file)
@@ -35,6 +35,7 @@
 #include <gst/gsttypefind.h>
 #include <gst/gsttypefindfactory.h>
 #include <gst/gstdeviceproviderfactory.h>
+#include <gst/gstdynamictypefactory.h>
 #include <gst/gsturi.h>
 #include <gst/gstinfo.h>
 #include <gst/gstenumtypes.h>
@@ -209,16 +210,6 @@ gst_registry_chunks_save_pad_template (GList ** list,
   return TRUE;
 }
 
-#define VALIDATE_UTF8(__details, __entry)                                   \
-G_STMT_START {                                                              \
-  if (!g_utf8_validate (__details->__entry, -1, NULL)) {                    \
-    g_warning ("Invalid UTF-8 in " G_STRINGIFY (__entry) ": %s",            \
-        __details->__entry);                                                \
-    g_free (__details->__entry);                                            \
-    __details->__entry = g_strdup ("[ERROR: invalid UTF-8]");               \
-  }                                                                         \
-} G_STMT_END
-
 /*
  * gst_registry_chunks_save_feature:
  *
@@ -245,7 +236,7 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
     GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
 
     /* Initialize with zeroes because of struct padding and
-     * valgrind complaining about copying unitialized memory
+     * valgrind complaining about copying uninitialized memory
      */
     ef = g_slice_new0 (GstRegistryChunkElementFactory);
     pf_size = sizeof (GstRegistryChunkElementFactory);
@@ -305,7 +296,7 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
     gchar *str;
 
     /* Initialize with zeroes because of struct padding and
-     * valgrind complaining about copying unitialized memory
+     * valgrind complaining about copying uninitialized memory
      */
     tff = g_slice_new0 (GstRegistryChunkTypeFindFactory);
     pf_size = sizeof (GstRegistryChunkTypeFindFactory);
@@ -339,7 +330,7 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
     GstDeviceProviderFactory *factory = GST_DEVICE_PROVIDER_FACTORY (feature);
 
     /* Initialize with zeroes because of struct padding and
-     * valgrind complaining about copying unitialized memory
+     * valgrind complaining about copying uninitialized memory
      */
     tff = g_slice_new0 (GstRegistryChunkDeviceProviderFactory);
     chk =
@@ -353,11 +344,19 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
         gst_structure_to_string (factory->metadata));
   } else if (GST_IS_TRACER_FACTORY (feature)) {
     /* Initialize with zeroes because of struct padding and
-     * valgrind complaining about copying unitialized memory
+     * valgrind complaining about copying uninitialized memory
      */
     pf = g_slice_new0 (GstRegistryChunkPluginFeature);
     pf_size = sizeof (GstRegistryChunkPluginFeature);
     chk = gst_registry_chunks_make_data (pf, pf_size);
+  } else if (GST_IS_DYNAMIC_TYPE_FACTORY (feature)) {
+    GstRegistryChunkDynamicTypeFactory *tmp;
+
+    tmp = g_slice_new0 (GstRegistryChunkDynamicTypeFactory);
+    chk =
+        gst_registry_chunks_make_data (tmp,
+        sizeof (GstRegistryChunkDynamicTypeFactory));
+    pf = (GstRegistryChunkPluginFeature *) tmp;
   } else {
     GST_WARNING_OBJECT (feature, "unhandled feature type '%s'", type_name);
   }
@@ -577,7 +576,7 @@ gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
         plugin_name);
     return FALSE;
   }
-  if (G_UNLIKELY ((feature = g_object_newv (type, 0, NULL)) == NULL)) {
+  if (G_UNLIKELY ((feature = g_object_new (type, NULL)) == NULL)) {
     GST_ERROR ("Can't create feature from type");
     return FALSE;
   }
@@ -707,6 +706,13 @@ gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
         ("Reading/casting for GstRegistryChunkPluginFeature at address %p",
         *in);
     unpack_element (*in, pf, GstRegistryChunkPluginFeature, end, fail);
+  } else if (GST_IS_DYNAMIC_TYPE_FACTORY (feature)) {
+    GstRegistryChunkDynamicTypeFactory *tmp;
+
+    align (*in);
+    unpack_element (*in, tmp, GstRegistryChunkDynamicTypeFactory, end, fail);
+
+    pf = (GstRegistryChunkPluginFeature *) tmp;
   } else {
     GST_WARNING ("unhandled factory type : %s", G_OBJECT_TYPE_NAME (feature));
     goto fail;
@@ -753,6 +759,7 @@ gst_registry_chunks_load_plugin_dep_strv (gchar ** in, gchar * end, guint n)
   return arr;
 fail:
   GST_INFO ("Reading plugin dependency strings failed");
+  g_strfreev (arr);
   return NULL;
 }
 
@@ -822,7 +829,7 @@ _priv_gst_registry_chunks_load_plugin (GstRegistry * registry, gchar ** in,
       *in);
   unpack_element (*in, pe, GstRegistryChunkPluginElement, end, fail);
 
-  plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+  plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
 
   /* TODO: also set GST_PLUGIN_FLAG_CONST */
   GST_OBJECT_FLAG_SET (plugin, GST_PLUGIN_FLAG_CACHED);