summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2012-01-02 02:32:49 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-01-02 02:32:49 +0000
commit8ff3102116baf94fd6874fccc1fc40677e7a906f (patch)
tree30465bac0efdeaf686ffd7741d77952951c4d8f4
parented80a5cd4b0f35c19bad786402239317e65546a5 (diff)
registry: get rid of gst_default_registry_*() convenience macros
They're not really worth it: hardly save any typing, and aren't great for bindings or gobject-introspection.
-rw-r--r--gst/gstregistry.c9
-rw-r--r--gst/gstregistry.h112
-rw-r--r--tests/check/gst/gstplugin.c3
-rw-r--r--win32/common/libgstreamer.def2
4 files changed, 13 insertions, 113 deletions
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 470d3c1f8d..d4f0780289 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -1400,7 +1400,7 @@ _priv_gst_registry_cleanup (void)
}
/**
- * gst_default_registry_check_feature_version:
+ * gst_registry_check_feature_version:
* @feature_name: the name of the feature (e.g. "oggdemux")
* @min_major: the minimum major version number
* @min_minor: the minimum minor version number
@@ -1414,18 +1414,17 @@ _priv_gst_registry_cleanup (void)
* the same as the required version or newer, and #FALSE otherwise.
*/
gboolean
-gst_default_registry_check_feature_version (const gchar * feature_name,
- guint min_major, guint min_minor, guint min_micro)
+gst_registry_check_feature_version (GstRegistry * registry,
+ const gchar * feature_name, guint min_major, guint min_minor,
+ guint min_micro)
{
GstPluginFeature *feature;
- GstRegistry *registry;
gboolean ret = FALSE;
g_return_val_if_fail (feature_name != NULL, FALSE);
GST_DEBUG ("Looking up plugin feature '%s'", feature_name);
- registry = gst_registry_get ();
feature = gst_registry_lookup_feature (registry, feature_name);
if (feature) {
ret = gst_plugin_feature_check_version (feature, min_major, min_minor,
diff --git a/gst/gstregistry.h b/gst/gstregistry.h
index 8a7576ed1b..b7c48358c6 100644
--- a/gst/gstregistry.h
+++ b/gst/gstregistry.h
@@ -90,113 +90,11 @@ GstPluginFeature* gst_registry_find_feature (GstRegistry *registry,
GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename);
GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name);
-/* convinience defines for the default registry */
-
-/**
- * gst_default_registry_add_plugin:
- * @plugin: (transfer full): the plugin to add
- *
- * Add the plugin to the default registry.
- * The plugin-added signal will be emitted.
- *
- * Returns: TRUE on success.
- */
-#define gst_default_registry_add_plugin(plugin) \
- gst_registry_add_plugin (gst_registry_get_default(), plugin)
-
-/**
- * gst_default_registry_add_path:
- * @path: the path to add to the registry
- *
- * Add the given path to the default registry. The syntax of the
- * path is specific to the registry. If the path has already been
- * added, do nothing.
- */
-#define gst_default_registry_add_path(path) \
- gst_registry_add_path (gst_registry_get_default(), path)
-
-/**
- * gst_default_registry_get_path_list:
- *
- * Get the list of paths for the default registry.
- *
- * Returns: (transfer container) (element-type char*): a #GList of paths as
- * strings. g_list_free() after use.
- */
-#define gst_default_registry_get_path_list() \
- gst_registry_get_path_list (gst_registry_get_default())
-
-/**
- * gst_default_registry_get_plugin_list:
- *
- * Get a copy of all plugins registered in the default registry.
- *
- * Returns: (transfer full) (element-type Gst.Plugin): a copy of the list.
- * Free after use.
- */
-#define gst_default_registry_get_plugin_list() \
- gst_registry_get_plugin_list (gst_registry_get_default())
-
-/**
- * gst_default_registry_find_feature:
- * @name: the pluginfeature name to find
- * @type: the pluginfeature type to find
- *
- * Find the pluginfeature with the given name and type in the default registry.
- *
- * Returns: (transfer full): the pluginfeature with the given name and type or
- * NULL if the plugin was not found.
- */
-#define gst_default_registry_find_feature(name,type) \
- gst_registry_find_feature (gst_registry_get_default(),name,type)
-
-/**
- * gst_default_registry_find_plugin:
- * @name: the plugin name to find
- *
- * Find the plugin with the given name in the default registry.
- * The plugin will be reffed; caller is responsible for unreffing.
- *
- * Returns: (transfer full): The plugin with the given name or NULL if the
- * plugin was not found.
- */
-#define gst_default_registry_find_plugin(name) \
- gst_registry_find_plugin (gst_registry_get_default(),name)
-
-/**
- * gst_default_registry_feature_filter:
- * @filter: the filter to use
- * @first: only return first match
- * @user_data: user data passed to the filter function
- *
- * Runs a filter against all features of the plugins in the default registry
- * and returns a GList with the results.
- * If the first flag is set, only the first match is
- * returned (as a list with a single object).
- *
- * Returns: (transfer full) (element-type Gst.PluginFeature): a #GList of
- * plugin features, gst_plugin_feature_list_free after use.
- */
-#define gst_default_registry_feature_filter(filter,first,user_data) \
- gst_registry_feature_filter (gst_registry_get_default(),filter,first,user_data)
-
-/**
- * gst_default_registry_get_feature_list_cookie:
- *
- * Returns the default registrys feature list cookie. This changes
- * every time a feature is added or removed from the registry.
- *
- * Returns: the feature list cookie.
- *
- * Since: 0.10.26
- */
-#define gst_default_registry_get_feature_list_cookie() \
- gst_registry_get_feature_list_cookie (gst_registry_get_default())
-
-gboolean gst_default_registry_check_feature_version (const gchar *feature_name,
- guint min_major,
- guint min_minor,
- guint min_micro);
+gboolean gst_registry_check_feature_version (GstRegistry *registry,
+ const gchar *feature_name,
+ guint min_major,
+ guint min_minor,
+ guint min_micro);
G_END_DECLS
diff --git a/tests/check/gst/gstplugin.c b/tests/check/gst/gstplugin.c
index cc7da7e79d..3db1150f1b 100644
--- a/tests/check/gst/gstplugin.c
+++ b/tests/check/gst/gstplugin.c
@@ -245,6 +245,9 @@ GST_START_TEST (test_typefind)
GST_END_TEST;
#endif
+#define gst_default_registry_check_feature_version(name,a,b,c) \
+ gst_registry_check_feature_version(gst_registry_get(),(name),(a),(b),(c))
+
GST_START_TEST (test_version_checks)
{
fail_if (gst_default_registry_check_feature_version ("identity",
diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def
index a994767e3d..3f7ab8ce90 100644
--- a/win32/common/libgstreamer.def
+++ b/win32/common/libgstreamer.def
@@ -316,7 +316,6 @@ EXPORTS
gst_debug_set_default_threshold
gst_debug_set_threshold_for_name
gst_debug_unset_threshold_for_name
- gst_default_registry_check_feature_version
gst_deinit
gst_double_range_get_type
gst_element_abort_state
@@ -899,6 +898,7 @@ EXPORTS
gst_registry_add_feature
gst_registry_add_path
gst_registry_add_plugin
+ gst_registry_check_feature_version
gst_registry_feature_filter
gst_registry_find_feature
gst_registry_find_plugin