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:
*
gst_registry_chunks_save_const_string (list, (gchar *) walk->data);
}
GST_DEBUG ("Feature %s: saved %d interfaces %d pad templates",
- feature->name, ef->ninterfaces, ef->npadtemplates);
+ GST_OBJECT_NAME (feature), ef->ninterfaces, ef->npadtemplates);
/* save uritypes */
if (GST_URI_TYPE_IS_VALID (factory->uri_type)) {
GST_DEBUG ("Saved %d UriTypes", ef->nuriprotocols);
} else {
g_warning ("GStreamer feature '%s' is URI handler but does not provide"
- " any protocols it can handle", feature->name);
+ " any protocols it can handle", GST_OBJECT_NAME (feature));
}
}
}
}
- /* pack element factory strings */
- gst_registry_chunks_save_const_string (list, factory->details.author);
- gst_registry_chunks_save_const_string (list, factory->details.description);
- gst_registry_chunks_save_const_string (list, factory->details.klass);
- gst_registry_chunks_save_const_string (list, factory->details.longname);
- if (factory->meta_data) {
- gst_registry_chunks_save_string (list,
- gst_structure_to_string (factory->meta_data));
- } else {
- gst_registry_chunks_save_const_string (list, "");
- }
+ /* pack element metadata strings */
+ gst_registry_chunks_save_string (list,
+ gst_structure_to_string (factory->metadata));
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstRegistryChunkTypeFindFactory *tff;
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
}
/* save caps */
if (factory->caps) {
- /* we copy the caps here so we can simplify them before saving. This
- * is a lot faster when loading them later on */
- GstCaps *copy = gst_caps_copy (factory->caps);
+ GstCaps *fcaps = gst_caps_ref (factory->caps);
+ /* we simplify the caps before saving. This is a lot faster
+ * when loading them later on */
+ fcaps = gst_caps_simplify (fcaps);
+ str = gst_caps_to_string (fcaps);
+ gst_caps_unref (fcaps);
- gst_caps_do_simplify (copy);
- str = gst_caps_to_string (copy);
- gst_caps_unref (copy);
gst_registry_chunks_save_string (list, str);
} else {
gst_registry_chunks_save_const_string (list, "");
}
- } else if (GST_IS_INDEX_FACTORY (feature)) {
- GstIndexFactory *factory = GST_INDEX_FACTORY (feature);
-
- pf = g_slice_new (GstRegistryChunkPluginFeature);
- chk =
- gst_registry_chunks_make_data (pf,
- sizeof (GstRegistryChunkPluginFeature));
-
- /* pack element factory strings */
- gst_registry_chunks_save_const_string (list, factory->longdesc);
} else {
GST_WARNING ("unhandled feature type '%s'", type_name);
}
*list = g_list_prepend (*list, chk);
/* pack plugin feature strings */
- gst_registry_chunks_save_const_string (list, feature->name);
+ gst_registry_chunks_save_const_string (list, GST_OBJECT_NAME (feature));
gst_registry_chunks_save_const_string (list, (gchar *) type_name);
return TRUE;
template = g_slice_new (GstStaticPadTemplate);
template->presence = pt->presence;
- template->direction = pt->direction;
- template->static_caps.caps.refcount = 0;
+ template->direction = (GstPadDirection) pt->direction;
+ template->static_caps.caps = NULL;
/* unpack pad template strings */
unpack_const_string (*in, template->name_template, end, fail);
/* unpack element factory strings */
unpack_string_nocopy (*in, meta_data_str, end, fail);
if (meta_data_str && *meta_data_str) {
- factory->meta_data = gst_structure_from_string (meta_data_str, NULL);
- if (!factory->meta_data) {
+ factory->metadata = gst_structure_from_string (meta_data_str, NULL);
+ if (!factory->metadata) {
GST_ERROR
("Error when trying to deserialize structure for metadata '%s'",
meta_data_str);
goto fail;
}
}
- unpack_string (*in, factory->details.longname, end, fail);
- unpack_string (*in, factory->details.klass, end, fail);
- unpack_string (*in, factory->details.description, end, fail);
- unpack_string (*in, factory->details.author, end, fail);
n = ef->npadtemplates;
- GST_DEBUG ("Element factory : '%s' with npadtemplates=%d",
- factory->details.longname, n);
+ GST_DEBUG ("Element factory : npadtemplates=%d", n);
/* load pad templates */
for (i = 0; i < n; i++) {
factory->extensions[i - 1] = str;
}
}
- } else if (GST_IS_INDEX_FACTORY (feature)) {
- GstIndexFactory *factory = GST_INDEX_FACTORY (feature);
-
- align (*in);
- GST_DEBUG
- ("Reading/casting for GstRegistryChunkPluginFeature at address %p",
- *in);
- unpack_element (*in, pf, GstRegistryChunkPluginFeature, end, fail);
-
- /* unpack index factory strings */
- unpack_string (*in, factory->longdesc, end, fail);
} else {
GST_WARNING ("unhandled factory type : %s", G_OBJECT_TYPE_NAME (feature));
goto fail;
(gpointer *) & feature->plugin);
gst_registry_add_feature (registry, feature);
- GST_DEBUG ("Added feature %s, plugin %p %s", feature->name, plugin,
- plugin_name);
+ GST_DEBUG ("Added feature %s, plugin %p %s", GST_OBJECT_NAME (feature),
+ plugin, plugin_name);
return TRUE;
dep->env_hash = d->env_hash;
dep->stat_hash = d->stat_hash;
- dep->flags = d->flags;
+ dep->flags = (GstPluginDependencyFlags) d->flags;
dep->names = gst_registry_chunks_load_plugin_dep_strv (in, end, d->n_names);
dep->paths = gst_registry_chunks_load_plugin_dep_strv (in, end, d->n_paths);