GstElement properties

A GstElement can have several properties which are implemented using standard GObject properties. The usual GObject methods to query, set and get property values and GParamSpecs are therefore supported.

Every GstElement inherits at least one property of its parent GstObject: the "name" property. This is the name you provide to the functions gst_element_factory_make or gst_element_factory_create. You can get and set this property using the functions gst_object_set_name and gst_object_get_name or use the GObject property mechanism as shown below.

 GstElement *element;
 GValue value = { 0, }; /* initialize the GValue for g_object_get() */

 element = gst_element_factory_make ("mad", "decoder");
 g_object_set (G_OBJECT (element), "name", "mydecoder", NULL);
 ...

 g_value_init (&value, G_TYPE_STRING);
 g_object_get_property (G_OBJECT (element), "name", &value);
 ...
    

Most plugins provide additional properties to provide more information about their configuration or to configure the element. gst-inspect is a useful tool to query the properties of a particular element, it will also use property introspection to give a short explanation about the function of the property and about the parameter types and ranges it supports.

For more information about GObject properties we recommend you read the GObject manual.