From bab8ed6b8a407f6aef896bb87cda2edb0cb7a234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 28 Oct 2012 15:53:19 +0000 Subject: [PATCH] pluginfeature: add gst_plugin_feature_get_plugin_name() API: gst_plugin_feature_get_plugin_name() https://bugzilla.gnome.org/show_bug.cgi?id=571832 --- docs/gst/gstreamer-sections.txt | 1 + gst/gstpluginfeature.c | 22 ++++++++++++++++++++++ gst/gstpluginfeature.h | 1 + win32/common/libgstreamer.def | 1 + 4 files changed, 25 insertions(+) diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 26070dd5a1..60b01e41bb 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -2087,6 +2087,7 @@ gst_plugin_feature_set_name gst_plugin_feature_get_rank gst_plugin_feature_get_name gst_plugin_feature_get_plugin +gst_plugin_feature_get_plugin_name gst_plugin_feature_load gst_plugin_feature_list_copy gst_plugin_feature_list_free diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c index 1fda31c076..a436237f67 100644 --- a/gst/gstpluginfeature.c +++ b/gst/gstpluginfeature.c @@ -199,6 +199,28 @@ gst_plugin_feature_get_plugin (GstPluginFeature * feature) return (GstPlugin *) gst_object_ref (feature->plugin); } +/** + * gst_plugin_feature_get_plugin_name: + * @feature: a feature + * + * Get the name of the plugin that provides this feature. + * + * Returns: the name of the plugin that provides this feature, or %NULL if + * the feature is not associated with a plugin. + * + * Since: 1.2.0 + */ +const gchar * +gst_plugin_feature_get_plugin_name (GstPluginFeature * feature) +{ + g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (feature), NULL); + + if (feature->plugin == NULL) + return NULL; + + return gst_plugin_get_name (feature->plugin); +} + /** * gst_plugin_feature_list_free: * @list: (transfer full) (element-type Gst.PluginFeature): list diff --git a/gst/gstpluginfeature.h b/gst/gstpluginfeature.h index 69ba44d4df..586f0eb5fd 100644 --- a/gst/gstpluginfeature.h +++ b/gst/gstpluginfeature.h @@ -113,6 +113,7 @@ void gst_plugin_feature_set_rank (GstPluginFeature *featu guint gst_plugin_feature_get_rank (GstPluginFeature *feature); GstPlugin * gst_plugin_feature_get_plugin (GstPluginFeature *feature); +const gchar * gst_plugin_feature_get_plugin_name (GstPluginFeature *feature); void gst_plugin_feature_list_free (GList *list); GList *gst_plugin_feature_list_copy (GList *list) G_GNUC_MALLOC; diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 4e5fcdb451..acb9138658 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -784,6 +784,7 @@ EXPORTS gst_plugin_error_quark gst_plugin_feature_check_version gst_plugin_feature_get_plugin + gst_plugin_feature_get_plugin_name gst_plugin_feature_get_rank gst_plugin_feature_get_type gst_plugin_feature_list_copy