GstPluginFeature: GStreamer 1.0 Core Reference Manual

## GstPluginFeature GstPluginFeature — Base class for contents of a GstPlugin |

## Functions

gboolean | (*GstPluginFeatureFilter) ()
void | gst_plugin_feature_set_rank ()
#define | gst_plugin_feature_set_name()
guint | gst_plugin_feature_get_rank ()
#define | gst_plugin_feature_get_name()
GstPlugin * | gst_plugin_feature_get_plugin ()
const gchar * | gst_plugin_feature_get_plugin_name ()
GstPluginFeature * | gst_plugin_feature_load ()
GList * | gst_plugin_feature_list_copy ()
void | gst_plugin_feature_list_free ()
#define | GST_PLUGIN_FEATURE_LIST_DEBUG()
gboolean | gst_plugin_feature_check_version ()
gint | gst_plugin_feature_rank_compare_func ()

## Types and Values

| GstPluginFeature
enum | GstRank

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstPluginFeature
                    ├── GstElementFactory
                    ├── GstTracerFactory
                    ├── GstTypeFindFactory
                    ╰── GstDeviceProviderFactory

## Includes

    #include <gst/gst.h>

## Description

This is a base class for anything that can be added to a GstPlugin.

## Functions

### GstPluginFeatureFilter ()

    gboolean
    (*GstPluginFeatureFilter) (GstPluginFeature *feature,
                               gpointer user_data);

A function that can be used with e.g. `gst_registry_feature_filter()` to get a list of pluginfeature that match certain criteria.

#### Parameters

feature | the pluginfeature to check |
user_data | the user_data that has been passed on e.g. `gst_registry_feature_filter()` |

#### Returns

`TRUE` for a positive match, `FALSE` otherwise

### gst_plugin_feature_set_rank ()

    void
    gst_plugin_feature_set_rank (GstPluginFeature *feature,
                                 guint rank);

Specifies a rank for a plugin feature, so that autoplugging uses the most appropriate feature.

#### Parameters

feature | feature to rank |
rank | rank value - higher number means more priority rank |

### gst_plugin_feature_set_name()

    #define                 gst_plugin_feature_set_name(feature,name) gst_object_set_name(GST_OBJECT_CAST(feature),name)

Sets the name of the plugin feature, getting rid of the old name if there was one.

#### Parameters

feature | a GstPluginFeature to set the name of. |
name | the new name |

### gst_plugin_feature_get_rank ()

    guint
    gst_plugin_feature_get_rank (GstPluginFeature *feature);

Gets the rank of a plugin feature.

#### Parameters

feature | a feature |

#### Returns

The rank of the feature

### gst_plugin_feature_get_name()

    #define                 gst_plugin_feature_get_name(feature)      GST_OBJECT_NAME(feature)

Returns the name of `feature` . For a nameless plugin feature, this returns `NULL`.

#### Parameters

feature | a GstPluginFeature to get the name of `feature` . |

#### Returns

the name of `feature` . MT safe.

[transfer none][nullable]

### gst_plugin_feature_get_plugin ()

    GstPlugin *
    gst_plugin_feature_get_plugin (GstPluginFeature *feature);

Get the plugin that provides this feature.

#### Parameters

feature | a feature |

#### Returns

the plugin that provides this feature, or `NULL`. Unref with `gst_object_unref()` when no longer needed.

[transfer full][nullable]

### gst_plugin_feature_get_plugin_name ()

    const gchar *
    gst_plugin_feature_get_plugin_name (GstPluginFeature *feature);

Get the name of the plugin that provides this feature.

#### Parameters

feature | a feature |

#### Returns

the name of the plugin that provides this feature, or `NULL` if the feature is not associated with a plugin.

[nullable]

Since: 1.2

### gst_plugin_feature_load ()

    GstPluginFeature *
    gst_plugin_feature_load (GstPluginFeature *feature);

Loads the plugin containing `feature` if it's not already loaded. `feature` is unaffected; use the return value instead.

Normally this function is used like this:

    1
    2
    3
    4
    5
    6
    GstPluginFeature *loaded_feature;

    loaded_feature = gst_plugin_feature_load (feature);
    // presumably, we're no longer interested in the potentially-unloaded feature
    gst_object_unref (feature);
    feature = loaded_feature;

#### Parameters

feature | the plugin feature to check. | [transfer none]

#### Returns

a reference to the loaded feature, or `NULL` on error.

[transfer full][nullable]

### gst_plugin_feature_list_copy ()

    GList *
    gst_plugin_feature_list_copy (GList *list);

Copies the list of features. Caller should call `gst_plugin_feature_list_free` when done with the list.

#### Parameters

list | list of GstPluginFeature. | [transfer none][element-type Gst.PluginFeature]

#### Returns

a copy of `list` , with each feature's reference count incremented.

[transfer full][element-type Gst.PluginFeature]

### gst_plugin_feature_list_free ()

    void
    gst_plugin_feature_list_free (GList *list);

Unrefs each member of `list` , then frees the list.

#### Parameters

list | list of GstPluginFeature. | [transfer full][element-type Gst.PluginFeature]

### GST_PLUGIN_FEATURE_LIST_DEBUG()

    #define GST_PLUGIN_FEATURE_LIST_DEBUG(list) gst_plugin_feature_list_debug(list)

Debug the plugin feature names in `list` .

#### Parameters

list | a GList of plugin features. | [transfer none][element-type Gst.PluginFeature]

### gst_plugin_feature_check_version ()

    gboolean
    gst_plugin_feature_check_version (GstPluginFeature *feature,
                                      guint min_major,
                                      guint min_minor,
                                      guint min_micro);

Checks whether the given plugin feature is at least the required version

#### Parameters

feature | a feature |
min_major | minimum required major version |
min_minor | minimum required minor version |
min_micro | minimum required micro version |

#### Returns

`TRUE` if the plugin feature has at least the required version, otherwise `FALSE`.

### gst_plugin_feature_rank_compare_func ()

    gint
    gst_plugin_feature_rank_compare_func (gconstpointer p1,
                                          gconstpointer p2);

Compares the two given GstPluginFeature instances. This function can be used as a GCompareFunc when sorting by rank and then by name.

#### Parameters

p1 | a GstPluginFeature |
p2 | a GstPluginFeature |

#### 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 before the name of p1

## Types and Values

### GstPluginFeature

    typedef struct _GstPluginFeature GstPluginFeature;

Opaque GstPluginFeature structure.

### enum GstRank

Element priority ranks. Defines the order in which the autoplugger (or similar rank-picking mechanisms, such as e.g. `gst_element_make_from_uri()`) will choose this element over an alternative one with the same function.

These constants serve as a rough guidance for defining the rank of a GstPluginFeature. Any value is valid, including values bigger than `GST_RANK_PRIMARY` .

#### Members

GST_RANK_NONE | will be chosen last or not at all |
GST_RANK_MARGINAL | unlikely to be chosen |
GST_RANK_SECONDARY | likely to be chosen |
GST_RANK_PRIMARY | will be chosen first |

## See Also

GstPlugin