}
+/*
+ * gst_registry_binary_save_const_string:
+ *
+ * Store a const string in a binary chunk.
+ *
+ * Returns: %TRUE for success
+ */
+inline static gboolean
+gst_registry_binary_save_const_string (GList ** list, gchar * str)
+{
+ GstBinaryChunk *chunk;
+
+ chunk = g_malloc (sizeof (GstBinaryChunk));
+ chunk->data = str;
+ chunk->size = strlen ((gchar *) chunk->data) + 1;
+ chunk->flags = GST_BINARY_REGISTRY_FLAG_CONST;
+ chunk->align = FALSE;
+ *list = g_list_prepend (*list, chunk);
+ return TRUE;
+}
+
/*
* gst_registry_binary_save_string:
*
chunk = g_malloc (sizeof (GstBinaryChunk));
chunk->data = str;
chunk->size = strlen ((gchar *) chunk->data) + 1;
- chunk->flags = GST_BINARY_REGISTRY_FLAG_CONST;
+ chunk->flags = GST_BINARY_REGISTRY_FLAG_NONE;
chunk->align = FALSE;
*list = g_list_prepend (*list, chunk);
return TRUE;
pt->direction = template->direction;
/* pack pad template strings */
- gst_registry_binary_save_string (list,
+ gst_registry_binary_save_const_string (list,
(gchar *) (template->static_caps.string));
- gst_registry_binary_save_string (list, template->name_template);
+ gst_registry_binary_save_const_string (list, template->name_template);
*list = g_list_prepend (*list, chk);
/* save interfaces */
for (walk = factory->interfaces; walk;
walk = g_list_next (walk), ef->ninterfaces++) {
- gst_registry_binary_save_string (list, (gchar *) walk->data);
+ gst_registry_binary_save_const_string (list, (gchar *) walk->data);
}
GST_DEBUG ("Saved %d Interfaces", ef->ninterfaces);
/* save uritypes */
protocol = factory->uri_protocols;
while (*protocol) {
- gst_registry_binary_save_string (list, *protocol++);
+ gst_registry_binary_save_const_string (list, *protocol++);
ef->nuriprotocols++;
}
*list = g_list_prepend (*list, subchk);
}
/* pack element factory strings */
- gst_registry_binary_save_string (list, factory->details.author);
- gst_registry_binary_save_string (list, factory->details.description);
- gst_registry_binary_save_string (list, factory->details.klass);
- gst_registry_binary_save_string (list, factory->details.longname);
+ gst_registry_binary_save_const_string (list, factory->details.author);
+ gst_registry_binary_save_const_string (list, factory->details.description);
+ gst_registry_binary_save_const_string (list, factory->details.klass);
+ gst_registry_binary_save_const_string (list, factory->details.longname);
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstBinaryTypeFindFactory *tff;
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
/* save extensions */
if (factory->extensions) {
while (factory->extensions[tff->nextensions]) {
- gst_registry_binary_save_string (list,
+ gst_registry_binary_save_const_string (list,
factory->extensions[tff->nextensions++]);
}
}
pf->rank = feature->rank;
/* pack element factory strings */
- gst_registry_binary_save_string (list, factory->longdesc);
+ gst_registry_binary_save_const_string (list, factory->longdesc);
}
#endif
else {
*list = g_list_prepend (*list, chk);
/* pack plugin feature strings */
- gst_registry_binary_save_string (list, feature->name);
- gst_registry_binary_save_string (list, (gchar *) type_name);
+ gst_registry_binary_save_const_string (list, feature->name);
+ gst_registry_binary_save_const_string (list, (gchar *) type_name);
return TRUE;
}
gst_plugin_feature_list_free (plugin_features);
/* pack plugin element strings */
- gst_registry_binary_save_string (list, plugin->desc.origin);
- gst_registry_binary_save_string (list, plugin->desc.package);
- gst_registry_binary_save_string (list, plugin->desc.source);
- gst_registry_binary_save_string (list, plugin->desc.license);
- gst_registry_binary_save_string (list, plugin->desc.version);
- gst_registry_binary_save_string (list, plugin->filename);
- gst_registry_binary_save_string (list, plugin->desc.description);
- gst_registry_binary_save_string (list, plugin->desc.name);
+ gst_registry_binary_save_const_string (list, plugin->desc.origin);
+ gst_registry_binary_save_const_string (list, plugin->desc.package);
+ gst_registry_binary_save_const_string (list, plugin->desc.source);
+ gst_registry_binary_save_const_string (list, plugin->desc.license);
+ gst_registry_binary_save_const_string (list, plugin->desc.version);
+ gst_registry_binary_save_const_string (list, plugin->filename);
+ gst_registry_binary_save_const_string (list, plugin->desc.description);
+ gst_registry_binary_save_const_string (list, plugin->desc.name);
*list = g_list_prepend (*list, chk);
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
align32 (*in);
- GST_DEBUG ("Reading/casting for GstBinaryElementFactory at address %p",
- *in);
+ GST_LOG ("Reading/casting for GstBinaryElementFactory at address %p", *in);
unpack_element (*in, ef, GstBinaryElementFactory);
pf = (GstBinaryPluginFeature *) ef;
guint i;
align32 (*in);
- GST_DEBUG ("Reading/casting for GstBinaryPluginElement at address %p", *in);
+ GST_LOG ("Reading/casting for GstBinaryPluginElement at address %p", *in);
unpack_element (*in, pe, GstBinaryPluginElement);
if (pe->nfeatures < 0) {
return FALSE;
}
- GST_DEBUG ("Adding plugin with %d features from binary registry",
- pe->nfeatures);
-
plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
/* TODO: also set GST_PLUGIN_FLAG_CONST */
unpack_string (*in, plugin->desc.source);
unpack_string (*in, plugin->desc.package);
unpack_string (*in, plugin->desc.origin);
- GST_DEBUG ("read strings for '%s'", plugin->desc.name);
+ GST_LOG ("read strings for '%s'", plugin->desc.name);
plugin->basename = g_path_get_basename (plugin->filename);
gst_registry_add_plugin (registry, plugin);
- GST_DEBUG ("Added plugin '%s' from binary registry", plugin->desc.name);
- GST_DEBUG ("Number of features %d", pe->nfeatures);
+ GST_INFO ("Added plugin '%s' plugin with %d features from binary registry",
+ plugin->desc.name, pe->nfeatures);
for (i = 0; i < pe->nfeatures; i++) {
if (!gst_registry_binary_load_feature (registry, in,
g_strdup (plugin->desc.name))) {
for (;
((size_t) in + sizeof (GstBinaryPluginElement)) <
(size_t) contents + size;) {
- GST_INFO ("reading binary registry %" G_GSIZE_FORMAT "(%x)/%"
+ GST_DEBUG ("reading binary registry %" G_GSIZE_FORMAT "(%x)/%"
G_GSIZE_FORMAT, (size_t) in - (size_t) contents,
(guint) ((size_t) in - (size_t) contents), size);
if (!gst_registry_binary_load_plugin (registry, &in)) {