pluginfeature: add gst_plugin_feature_get_plugin()
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 19 May 2012 16:16:35 +0000 (17:16 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 19 May 2012 16:16:35 +0000 (17:16 +0100)
Add function to retrieve plugin that provides this feature.

API: gst_plugin_feature_get_plugin()

docs/gst/gstreamer-sections.txt
gst/gstpluginfeature.c
gst/gstpluginfeature.h
win32/common/libgstreamer.def

index 2d3de81..524ad42 100644 (file)
@@ -2043,6 +2043,7 @@ gst_plugin_feature_set_rank
 gst_plugin_feature_set_name
 gst_plugin_feature_get_rank
 gst_plugin_feature_get_name
+gst_plugin_feature_get_plugin
 gst_plugin_feature_load
 gst_plugin_feature_list_copy
 gst_plugin_feature_list_free
index e61fee2..3e1228e 100644 (file)
@@ -180,6 +180,26 @@ gst_plugin_feature_get_rank (GstPluginFeature * feature)
 }
 
 /**
+ * gst_plugin_feature_get_plugin:
+ * @feature: a feature
+ *
+ * Get the plugin that provides this feature.
+ *
+ * Returns: (transfer full): the plugin that provides this feature, or %NULL.
+ *     Unref with gst_object_unref() when no longer needed.
+ */
+GstPlugin *
+gst_plugin_feature_get_plugin (GstPluginFeature * feature)
+{
+  g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (feature), NULL);
+
+  if (feature->plugin == NULL)
+    return NULL;
+
+  return (GstPlugin *) gst_object_ref (feature->plugin);
+}
+
+/**
  * gst_plugin_feature_list_free:
  * @list: (transfer full) (element-type Gst.PluginFeature): list
  *     of #GstPluginFeature
index b99d9ee..c3f212c 100644 (file)
@@ -133,6 +133,8 @@ GstPluginFeature *
 void            gst_plugin_feature_set_rank             (GstPluginFeature *feature, guint rank);
 guint           gst_plugin_feature_get_rank             (GstPluginFeature *feature);
 
+GstPlugin     * gst_plugin_feature_get_plugin           (GstPluginFeature *feature);
+
 void            gst_plugin_feature_list_free            (GList *list);
 GList          *gst_plugin_feature_list_copy            (GList *list) G_GNUC_MALLOC;
 void            gst_plugin_feature_list_debug           (GList *list);
index 3a510b5..e6753bf 100644 (file)
@@ -749,6 +749,7 @@ EXPORTS
        gst_plugin_error_get_type
        gst_plugin_error_quark
        gst_plugin_feature_check_version
+       gst_plugin_feature_get_plugin
        gst_plugin_feature_get_rank
        gst_plugin_feature_get_type
        gst_plugin_feature_list_copy