*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/**
* SECTION:gstpluginfeature
+ * @title: GstPluginfeature
* @short_description: Base class for contents of a GstPlugin
* @see_also: #GstPlugin
*
* unaffected; use the return value instead.
*
* Normally this function is used like this:
- * |[
+ * |[<!-- language="C" -->
* GstPluginFeature *loaded_feature;
*
* loaded_feature = gst_plugin_feature_load (feature);
* feature = loaded_feature;
* ]|
*
- * Returns: (transfer full): a reference to the loaded feature, or NULL on error
+ * Returns: (transfer full) (nullable): a reference to the loaded
+ * feature, or %NULL on error
*/
GstPluginFeature *
gst_plugin_feature_load (GstPluginFeature * feature)
GST_DEBUG ("loaded plugin %s", feature->plugin_name);
gst_object_unref (plugin);
- real_feature =
- gst_registry_lookup_feature (gst_registry_get_default (),
+ real_feature = gst_registry_lookup_feature (gst_registry_get (),
GST_OBJECT_NAME (feature));
if (real_feature == NULL)
}
/**
- * gst_plugin_feature_type_name_filter:
- * @feature: the #GstPluginFeature
- * @data: (in): the type and name to check against
- *
- * Compares type and name of plugin feature. Can be used with gst_filter_run().
- *
- * Returns: TRUE if equal.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-typedef struct
-{
- const gchar *name;
- GType type;
-} GstTypeNameData;
-gboolean gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
- GstTypeNameData * data);
-#endif
-gboolean
-gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
- GstTypeNameData * data)
-{
- g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (feature), FALSE);
-
- return ((data->type == 0 || data->type == G_OBJECT_TYPE (feature)) &&
- (data->name == NULL || !strcmp (data->name, GST_OBJECT_NAME (feature))));
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
* gst_plugin_feature_set_rank:
* @feature: feature to rank
* @rank: rank value - higher number means more priority rank
}
/**
+ * gst_plugin_feature_get_plugin:
+ * @feature: a feature
+ *
+ * Get the plugin that provides this feature.
+ *
+ * Returns: (transfer full) (nullable): 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_get_plugin_name:
+ * @feature: a feature
+ *
+ * Get the name of the plugin that provides this feature.
+ *
+ * Returns: (nullable): the name of the plugin that provides this
+ * feature, or %NULL if the feature is not associated with a
+ * plugin.
+ *
+ * Since: 1.2
+ */
+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
* of #GstPluginFeature
*
* Returns: (transfer full) (element-type Gst.PluginFeature): a copy of @list,
* with each feature's reference count incremented.
- *
- * Since: 0.10.26
*/
GList *
gst_plugin_feature_list_copy (GList * list)
GList *last;
new_list = g_list_alloc ();
- new_list->data = g_object_ref ((GObject *) list->data);
+ new_list->data = gst_object_ref (list->data);
new_list->prev = NULL;
last = new_list;
list = list->next;
last->next = g_list_alloc ();
last->next->prev = last;
last = last->next;
- last->data = g_object_ref ((GObject *) list->data);
+ last->data = gst_object_ref (list->data);
list = list->next;
}
last->next = NULL;
* plugin features
*
* Debug the plugin feature names in @list.
- *
- * Since: 0.10.31
*/
void
gst_plugin_feature_list_debug (GList * list)
* Checks whether the given plugin feature is at least
* the required version
*
- * Returns: #TRUE if the plugin feature has at least
- * the required version, otherwise #FALSE.
+ * Returns: %TRUE if the plugin feature has at least
+ * the required version, otherwise %FALSE.
*/
gboolean
gst_plugin_feature_check_version (GstPluginFeature * feature,
GST_DEBUG ("Looking up plugin '%s' containing plugin feature '%s'",
feature->plugin_name, GST_OBJECT_NAME (feature));
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
plugin = gst_registry_find_plugin (registry, feature->plugin_name);
if (plugin) {
* Returns: negative value if the rank of p1 > the rank of p2 or the ranks are
* equal but the name of p1 comes before the name of p2; zero if the rank
* and names are equal; positive value if the rank of p1 < the rank of p2 or the
- * ranks are equal but the name of p2 comes after the name of p1
- *
- * Since: 0.10.31
+ * ranks are equal but the name of p2 comes before the name of p1
*/
gint
gst_plugin_feature_rank_compare_func (gconstpointer p1, gconstpointer p2)
if (diff != 0)
return diff;
- diff = strcmp (GST_OBJECT_NAME (f2), GST_OBJECT_NAME (f1));
+ diff = strcmp (GST_OBJECT_NAME (f1), GST_OBJECT_NAME (f2));
return diff;
}