gst_plugin_get_version
gst_plugin_get_module
gst_plugin_is_loaded
+gst_plugin_get_cache_data
+gst_plugin_set_cache_data
gst_plugin_name_filter
gst_plugin_load_file
gst_plugin_load
struct _GstPluginPrivate {
GList *deps; /* list of GstPluginDep structures */
+ GstStructure *cache_data;
};
gboolean _priv_plugin_deps_env_vars_changed (GstPlugin * plugin);
g_list_free (plugin->priv->deps);
plugin->priv->deps = NULL;
+ if (plugin->priv->cache_data) {
+ gst_structure_free (plugin->priv->cache_data);
+ }
+
G_OBJECT_CLASS (gst_plugin_parent_class)->finalize (object);
}
return (plugin->module != NULL || plugin->filename == NULL);
}
+/**
+ * gst_plugin_get_cache_data:
+ * @plugin: a plugin
+ *
+ * Gets the plugin specific data cache. If it is %NULL there is no cached data
+ * stored. This is the case when the registry is getting rebuild.
+ *
+ * Returns: The cached data as a #GstStructure or %NULL.
+ */
+G_CONST_RETURN GstStructure *
+gst_plugin_get_cache_data (GstPlugin * plugin)
+{
+ g_return_val_if_fail (GST_IS_PLUGIN (plugin), NULL);
+
+ return plugin->priv->cache_data;
+}
+
+/**
+ * gst_plugin_set_cache_data:
+ * @plugin: a plugin
+ * @cache_data: a structure containing the data to cache
+ *
+ * Adds plugin specific data to cache. Passes the ownership of the structure to
+ * the @plugin.
+ *
+ * The cache is flushed every time the registry is rebuild.
+ */
+void
+gst_plugin_set_cache_data (GstPlugin * plugin, GstStructure * cache_data)
+{
+ g_return_if_fail (GST_IS_PLUGIN (plugin));
+ g_return_if_fail (GST_IS_STRUCTURE (cache_data));
+
+ if (plugin->priv->cache_data) {
+ gst_structure_free (plugin->priv->cache_data);
+ }
+ plugin->priv->cache_data = cache_data;
+}
+
#if 0
/**
* gst_plugin_feature_list:
#include <gmodule.h>
#include <gst/gstobject.h>
#include <gst/gstmacros.h>
+#include <gst/gststructure.h>
G_BEGIN_DECLS
G_CONST_RETURN gchar* gst_plugin_get_source (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
+G_CONST_RETURN GstStructure* gst_plugin_get_cache_data (GstPlugin * plugin);
+void gst_plugin_set_cache_data (GstPlugin * plugin, GstStructure *cache_data);
+
GModule * gst_plugin_get_module (GstPlugin *plugin);
gboolean gst_plugin_is_loaded (GstPlugin *plugin);
gst_plugin_feature_list_free (plugin_features);
+ /* pack cache data */
+ if (plugin->priv->cache_data) {
+ gchar *cache_str = gst_structure_to_string (plugin->priv->cache_data);
+ gst_registry_binary_save_string (list, cache_str);
+ } else {
+ gst_registry_binary_save_const_string (list, "");
+ }
+
/* pack plugin element strings */
gst_registry_binary_save_const_string (list, plugin->desc.origin);
gst_registry_binary_save_const_string (list, plugin->desc.package);
{
GstBinaryPluginElement *pe;
GstPlugin *plugin = NULL;
+ gchar *cache_str = NULL;
guint i;
align (*in);
GST_LOG (" desc.package='%s'", plugin->desc.package);
GST_LOG (" desc.origin='%s'", plugin->desc.origin);
+ /* unpack cache data */
+ unpack_string (*in, cache_str, end, fail);
+ if (*cache_str) {
+ plugin->priv->cache_data = gst_structure_from_string (cache_str, NULL);
+ }
+ g_free (cache_str);
+
plugin->basename = g_path_get_basename (plugin->filename);
/* Takes ownership of plugin */
* This _must_ be updated whenever the registry format changes,
* we currently use the core version where this change happened.
*/
-#define GST_MAGIC_BINARY_VERSION_STR ("0.10.21.2")
+#define GST_MAGIC_BINARY_VERSION_STR ("0.10.23.1")
/*
* GST_MAGIC_BINARY_VERSION_LEN:
gst_plugin_feature_set_rank
gst_plugin_feature_type_name_filter
gst_plugin_flags_get_type
+ gst_plugin_get_cache_data
gst_plugin_get_description
gst_plugin_get_filename
gst_plugin_get_license
gst_plugin_name_filter
gst_plugin_register_static
gst_plugin_register_static_full
+ gst_plugin_set_cache_data
gst_poll_add_fd
gst_poll_fd_can_read
gst_poll_fd_can_write