## GstElement

GstElement —

## Synopsis

    #include <gst/gst.h>

                GstElement;
    #define     GST_NUM_STATES
    #define     GST_STATE                       (obj)
    #define     GST_STATE_PENDING               (obj)
    #define     GST_STATE_TRANSITION            (obj)
    #define     GST_STATE_NULL_TO_READY
    #define     GST_STATE_READY_TO_PAUSED
    #define     GST_STATE_PAUSED_TO_PLAYING
    #define     GST_STATE_PLAYING_TO_PAUSED
    #define     GST_STATE_PAUSED_TO_READY
    #define     GST_STATE_READY_TO_NULL
    #define     GST_ELEMENT_QUERY_TYPE_FUNCTION (functionname, ...)
    #define     GST_ELEMENT_FORMATS_FUNCTION    (functionname, ...)
    #define     GST_ELEMENT_EVENT_MASK_FUNCTION (functionname, ...)
    enum        GstElementFlags;
    #define     GST_ELEMENT_IS_THREAD_SUGGESTED (obj)
    #define     GST_ELEMENT_IS_EVENT_AWARE      (obj)
    #define     GST_ELEMENT_IS_DECOUPLED        (obj)
    #define     GST_ELEMENT_NAME                (obj)
    #define     GST_ELEMENT_PARENT              (obj)
    #define     GST_ELEMENT_SCHED               (obj)
    #define     GST_ELEMENT_CLOCK               (obj)
    #define     GST_ELEMENT_PADS                (obj)
    #define     GST_ELEMENT_ERROR               (el, domain, code, message, debug)
    void        (*GstElementLoopFunction)       (GstElement *element);
    void        (*GstElementPreRunFunction)     (GstElement *element);
    void        (*GstElementPostRunFunction)    (GstElement *element);
    void        gst_element_class_add_pad_template
                                                (GstElementClass *klass,
                                                 GstPadTemplate *templ);
    void        gst_element_class_install_std_props
                                                (GstElementClass *klass,
                                                 const gchar *first_name,
                                                 ...);
    void        gst_element_class_set_details   (GstElementClass *klass,
                                                 const GstElementDetails *details);
    #define     gst_element_default_deep_notify
    void        gst_element_default_error       (GObject *object,
                                                 GstObject *orig,
                                                 GError *error,
                                                 gchar *debug);
    void        gst_element_set_loop_function   (GstElement *element,
                                                 GstElementLoopFunction loop);
    #define     gst_element_get_name            (elem)
    #define     gst_element_set_name            (elem,name)
    #define     gst_element_get_parent          (elem)
    #define     gst_element_set_parent          (elem,parent)
    void        gst_element_set                 (GstElement *element,
                                                 const gchar *first_property_name,
                                                 ...);
    void        gst_element_get                 (GstElement *element,
                                                 const gchar *first_property_name,
                                                 ...);
    void        gst_element_set_valist          (GstElement *element,
                                                 const gchar *first_property_name,
                                                 va_list var_args);
    void        gst_element_get_valist          (GstElement *element,
                                                 const gchar *first_property_name,
                                                 va_list var_args);
    void        gst_element_set_property        (GstElement *element,
                                                 const gchar *property_name,
                                                 const GValue *value);
    void        gst_element_get_property        (GstElement *element,
                                                 const gchar *property_name,
                                                 GValue *value);
    void        gst_element_enable_threadsafe_properties
                                                (GstElement *element);
    void        gst_element_disable_threadsafe_properties
                                                (GstElement *element);
    void        gst_element_set_pending_properties
                                                (GstElement *element);
    gboolean    gst_element_requires_clock      (GstElement *element);
    gboolean    gst_element_provides_clock      (GstElement *element);
    GstClock*   gst_element_get_clock           (GstElement *element);
    void        gst_element_set_clock           (GstElement *element,
                                                 GstClock *clock);
    GstClockReturn gst_element_clock_wait       (GstElement *element,
                                                 GstClockID id,
                                                 GstClockTimeDiff *jitter);
    GstClockTime gst_element_get_time           (GstElement *element);
    gboolean    gst_element_wait                (GstElement *element,
                                                 GstClockTime timestamp);
    void        gst_element_set_time            (GstElement *element,
                                                 GstClockTime time);
    void        gst_element_set_time_delay      (GstElement *element,
                                                 GstClockTime time,
                                                 GstClockTime delay);
    void        gst_element_adjust_time         (GstElement *element,
                                                 GstClockTimeDiff diff);
    gboolean    gst_element_is_indexable        (GstElement *element);
    void        gst_element_set_index           (GstElement *element,
                                                 GstIndex *index);
    GstIndex*   gst_element_get_index           (GstElement *element);
    gboolean    gst_element_release_locks       (GstElement *element);
    void        gst_element_yield               (GstElement *element);
    gboolean    gst_element_interrupt           (GstElement *element);
    void        gst_element_set_scheduler       (GstElement *element,
                                                 GstScheduler *sched);
    GstScheduler* gst_element_get_scheduler     (GstElement *element);
    void        gst_element_add_pad             (GstElement *element,
                                                 GstPad *pad);
    void        gst_element_remove_pad          (GstElement *element,
                                                 GstPad *pad);
    GstPad*     gst_element_add_ghost_pad       (GstElement *element,
                                                 GstPad *pad,
                                                 const gchar *name);
    void        gst_element_remove_ghost_pad    (GstElement *element,
                                                 GstPad *pad);
    GstPad*     gst_element_get_pad             (GstElement *element,
                                                 const gchar *name);
    GstPad*     gst_element_get_static_pad      (GstElement *element,
                                                 const gchar *name);
    GstPad*     gst_element_get_request_pad     (GstElement *element,
                                                 const gchar *name);
    void        gst_element_release_request_pad (GstElement *element,
                                                 GstPad *pad);
    const GList* gst_element_get_pad_list       (GstElement *element);
    GstPad*     gst_element_get_compatible_pad  (GstElement *element,
                                                 GstPad *pad);
    GstPad*     gst_element_get_compatible_pad_filtered
                                                (GstElement *element,
                                                 GstPad *pad,
                                                 const GstCaps *filtercaps);
    GstPadTemplate* gst_element_class_get_pad_template
                                                (GstElementClass *element_class,
                                                 const gchar *name);
    GList*      gst_element_class_get_pad_template_list
                                                (GstElementClass *element_class);
    GstPadTemplate* gst_element_get_pad_template
                                                (GstElement *element,
                                                 const gchar *name);
    GList*      gst_element_get_pad_template_list
                                                (GstElement *element);
    GstPadTemplate* gst_element_get_compatible_pad_template
                                                (GstElement *element,
                                                 GstPadTemplate *compattempl);
    gboolean    gst_element_link                (GstElement *src,
                                                 GstElement *dest);
    gboolean    gst_element_link_many           (GstElement *element_1,
                                                 GstElement *element_2,
                                                 ...);
    gboolean    gst_element_link_filtered       (GstElement *src,
                                                 GstElement *dest,
                                                 const GstCaps *filtercaps);
    void        gst_element_unlink              (GstElement *src,
                                                 GstElement *dest);
    void        gst_element_unlink_many         (GstElement *element_1,
                                                 GstElement *element_2,
                                                 ...);
    gboolean    gst_element_link_pads           (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname);
    gboolean    gst_element_link_pads_filtered  (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname,
                                                 const GstCaps *filtercaps);
    void        gst_element_unlink_pads         (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname);
    const GstEventMask* gst_element_get_event_masks
                                                (GstElement *element);
    gboolean    gst_element_send_event          (GstElement *element,
                                                 GstEvent *event);
    gboolean    gst_element_seek                (GstElement *element,
                                                 GstSeekType seek_type,
                                                 guint64 offset);
    const GstQueryType* gst_element_get_query_types
                                                (GstElement *element);
    gboolean    gst_element_query               (GstElement *element,
                                                 GstQueryType type,
                                                 GstFormat *format,
                                                 gint64 *value);
    const GstFormat* gst_element_get_formats    (GstElement *element);
    gboolean    gst_element_convert             (GstElement *element,
                                                 GstFormat src_format,
                                                 gint64 src_value,
                                                 GstFormat *dest_format,
                                                 gint64 *dest_value);
    void        gst_element_found_tags          (GstElement *element,
                                                 const GstTagList *tag_list);
    void        gst_element_found_tags_for_pad  (GstElement *element,
                                                 GstPad *pad,
                                                 GstClockTime timestamp,
                                                 GstTagList *list);
    void        gst_element_set_eos             (GstElement *element);
    void        gst_element_error_full          (GstElement *element,
                                                 GQuark domain,
                                                 gint code,
                                                 gchar *message,
                                                 gchar *debug,
                                                 const gchar *file,
                                                 const gchar *function,
                                                 gint line);
    gboolean    gst_element_is_locked_state     (GstElement *element);
    void        gst_element_set_locked_state    (GstElement *element,
                                                 gboolean locked_state);
    gboolean    gst_element_sync_state_with_parent
                                                (GstElement *element);
    GstElementState gst_element_get_state       (GstElement *element);
    GstElementStateReturn gst_element_set_state (GstElement *element,
                                                 GstElementState state);
    void        gst_element_wait_state_change   (GstElement *element);
    const gchar* gst_element_state_get_name     (GstElementState state);
    GstElementFactory* gst_element_get_factory  (GstElement *element);
    GstBin*     gst_element_get_managing_bin    (GstElement *element);
    void        gst_element_no_more_pads        (GstElement *element);

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBin
                   +----GstQueue

## Known Derived Interfaces

GstElement is required by GstImplementsInterface and GstTagSetter.

## Signal Prototypes

    "eos"       void        user_function      (GstElement *gstelement,
                                                gpointer user_data);
    "error"     void        user_function      (GstElement *gstelement,
                                                GstElement *element,
                                                GstGError *error,
                                                gchar *message,
                                                gpointer user_data);
    "found-tag" void        user_function      (GstElement *gstelement,
                                                GstElement *element,
                                                GstTagList *tags,
                                                gpointer user_data);
    "new-pad"   void        user_function      (GstElement *gstelement,
                                                GObject *object,
                                                gpointer user_data);
    "no-more-pads"
                void        user_function      (GstElement *gstelement,
                                                gpointer user_data);
    "pad-removed"
                void        user_function      (GstElement *gstelement,
                                                GObject *object,
                                                gpointer user_data);
    "state-change"
                void        user_function      (GstElement *gstelement,
                                                gint int,
                                                gint int,
                                                gpointer user_data);

## Description

## Details

### GstElement

    typedef struct _GstElement GstElement;

### GST_NUM_STATES

    #define GST_NUM_STATES 4

### GST_STATE()

    #define GST_STATE(obj)			(GST_ELEMENT(obj)->current_state)

`obj` : |

### GST_STATE_PENDING()

    #define GST_STATE_PENDING(obj)		(GST_ELEMENT(obj)->pending_state)

`obj` : |

### GST_STATE_TRANSITION()

    #define GST_STATE_TRANSITION(obj)	((GST_STATE(obj)<<8) | GST_STATE_PENDING(obj))

`obj` : |

### GST_STATE_NULL_TO_READY

    #define GST_STATE_NULL_TO_READY		((GST_STATE_NULL<<8) | GST_STATE_READY)

### GST_STATE_READY_TO_PAUSED

    #define GST_STATE_READY_TO_PAUSED	((GST_STATE_READY<<8) | GST_STATE_PAUSED)

### GST_STATE_PAUSED_TO_PLAYING

    #define GST_STATE_PAUSED_TO_PLAYING	((GST_STATE_PAUSED<<8) | GST_STATE_PLAYING)

### GST_STATE_PLAYING_TO_PAUSED

    #define GST_STATE_PLAYING_TO_PAUSED	((GST_STATE_PLAYING<<8) | GST_STATE_PAUSED)

### GST_STATE_PAUSED_TO_READY

    #define GST_STATE_PAUSED_TO_READY	((GST_STATE_PAUSED<<8) | GST_STATE_READY)

### GST_STATE_READY_TO_NULL

    #define GST_STATE_READY_TO_NULL		((GST_STATE_READY<<8) | GST_STATE_NULL)

### GST_ELEMENT_QUERY_TYPE_FUNCTION()

    #define     GST_ELEMENT_QUERY_TYPE_FUNCTION(functionname, ...)

### Warning

`GST_ELEMENT_QUERY_TYPE_FUNCTION` is deprecated and should not be used in newly-written code.

`functionname` : |
`...` : |

### GST_ELEMENT_FORMATS_FUNCTION()

    #define     GST_ELEMENT_FORMATS_FUNCTION(functionname, ...)

### Warning

`GST_ELEMENT_FORMATS_FUNCTION` is deprecated and should not be used in newly-written code.

`functionname` : |
`...` : |

### GST_ELEMENT_EVENT_MASK_FUNCTION()

    #define     GST_ELEMENT_EVENT_MASK_FUNCTION(functionname, ...)

### Warning

`GST_ELEMENT_EVENT_MASK_FUNCTION` is deprecated and should not be used in newly-written code.

`functionname` : |
`...` : |

### enum GstElementFlags

    typedef enum {
      /* element is complex (for some def.) and generally require a cothread */
      GST_ELEMENT_COMPLEX		= GST_OBJECT_FLAG_LAST,
      /* input and output pads aren't directly coupled to each other
         examples: queues, multi-output async readers, etc. */
      GST_ELEMENT_DECOUPLED,
      /* this element should be placed in a thread if at all possible */
      GST_ELEMENT_THREAD_SUGGESTED,
      /* this element, for some reason, has a loop function that performs
       * an infinite loop without calls to gst_element_yield () */
      GST_ELEMENT_INFINITE_LOOP,
      /* there is a new loopfunction ready for placement */
      GST_ELEMENT_NEW_LOOPFUNC,
      /* if this element can handle events */
      GST_ELEMENT_EVENT_AWARE,
      /* use threadsafe property get/set implementation */
      GST_ELEMENT_USE_THREADSAFE_PROPERTIES,

      /* private flags that can be used by the scheduler */
      GST_ELEMENT_SCHEDULER_PRIVATE1,
      GST_ELEMENT_SCHEDULER_PRIVATE2,

      /* ignore state changes from parent */
      GST_ELEMENT_LOCKED_STATE,

      /* element is in error */
      GST_ELEMENT_IN_ERROR,

      /* element doesn't change passed buffer or change it in place */
      GST_ELEMENT_WORK_IN_PLACE,

      /* use some padding for future expansion */
      GST_ELEMENT_FLAG_LAST		= GST_OBJECT_FLAG_LAST + 16
    } GstElementFlags;

### GST_ELEMENT_IS_THREAD_SUGGESTED()

    #define GST_ELEMENT_IS_THREAD_SUGGESTED(obj)	(GST_FLAG_IS_SET(obj,GST_ELEMENT_THREAD_SUGGESTED))

`obj` : |

### GST_ELEMENT_IS_EVENT_AWARE()

    #define GST_ELEMENT_IS_EVENT_AWARE(obj)		(GST_FLAG_IS_SET(obj,GST_ELEMENT_EVENT_AWARE))

`obj` : |

### GST_ELEMENT_IS_DECOUPLED()

    #define GST_ELEMENT_IS_DECOUPLED(obj)		(GST_FLAG_IS_SET(obj,GST_ELEMENT_DECOUPLED))

`obj` : |

### GST_ELEMENT_NAME()

    #define GST_ELEMENT_NAME(obj)			(GST_OBJECT_NAME(obj))

`obj` : |

### GST_ELEMENT_PARENT()

    #define GST_ELEMENT_PARENT(obj)			(GST_OBJECT_PARENT(obj))

`obj` : |

### GST_ELEMENT_SCHED()

    #define GST_ELEMENT_SCHED(obj)			(((GstElement*)(obj))->sched)

`obj` : |

### GST_ELEMENT_CLOCK()

    #define GST_ELEMENT_CLOCK(obj)			(((GstElement*)(obj))->clock)

`obj` : |

### GST_ELEMENT_PADS()

    #define GST_ELEMENT_PADS(obj)			((obj)->pads)

`obj` : |

### GST_ELEMENT_ERROR()

    #define     GST_ELEMENT_ERROR(el, domain, code, message, debug)

Utility function that elements can use in case they encountered a fatal data processing error. The pipeline will throw an error signal and the application will be requested to stop further media processing.

`el` : | the element that throws the error
`domain` : | like CORE, LIBRARY, RESOURCE or STREAM (see GstError)
`code` : | error code defined for that domain (see GstError)
`message` : | the message to display (format string and args enclosed in round brackets)
`debug` : | debugging information for the message (format string and args enclosed in round brackets)

### GstElementLoopFunction ()

    void        (*GstElementLoopFunction)       (GstElement *element);

`element` : |

### GstElementPreRunFunction ()

    void        (*GstElementPreRunFunction)     (GstElement *element);

`element` : |

### GstElementPostRunFunction ()

    void        (*GstElementPostRunFunction)    (GstElement *element);

`element` : |

### gst_element_class_add_pad_template ()

    void        gst_element_class_add_pad_template
                                                (GstElementClass *klass,
                                                 GstPadTemplate *templ);

Adds a padtemplate to an element class. This is mainly used in the _base_init functions of classes.

`klass` : | the GstElementClass to add the pad template to.
`templ` : | a GstPadTemplate to add to the element class.

### gst_element_class_install_std_props ()

    void        gst_element_class_install_std_props
                                                (GstElementClass *klass,
                                                 const gchar *first_name,
                                                 ...);

Adds a list of standardized properties with types to the `klass`. the id is for the property switch in your get_prop method, and the flags determine readability / writeability.

`klass` : | the GstElementClass to add the properties to.
`first_name` : | the name of the first property. in a NULL terminated
`...` : | the id and flags of the first property, followed by further 'name', 'id', 'flags' triplets and terminated by NULL.

### gst_element_class_set_details ()

    void        gst_element_class_set_details   (GstElementClass *klass,
                                                 const GstElementDetails *details);

Sets the detailed information for a GstElementClass.

### Note

This function is for use in _base_init functions only.

`klass` : | class to set details for
`details` : | details to set

### gst_element_default_deep_notify

    #define 		gst_element_default_deep_notify 	gst_object_default_deep_notify

### gst_element_default_error ()

    void        gst_element_default_error       (GObject *object,
                                                 GstObject *orig,
                                                 GError *error,
                                                 gchar *debug);

A default error signal callback to attach to an element. The user data passed to the g_signal_connect is ignored.

The default handler will simply print the error string using g_print.

`object` : | a GObject that signalled the error.
`orig` : | the GstObject that initiated the error.
`error` : | the GError.
`debug` : | an additional debug information string, or NULL.

### gst_element_set_loop_function ()

    void        gst_element_set_loop_function   (GstElement *element,
                                                 GstElementLoopFunction loop);

This sets the loop function for the element. The function pointed to can deviate from the GstElementLoopFunction definition in type of pointer only.

NOTE: in order for this to take effect, the current loop function *must* exit. Assuming the loop function itself is the only one who will cause a new loopfunc to be assigned, this should be no problem.

`element` : | a GstElement to set the loop function of.
`loop` : | Pointer to GstElementLoopFunction.

### gst_element_get_name()

    #define			gst_element_get_name(elem)	gst_object_get_name(GST_OBJECT(elem))

`elem` : |

### gst_element_set_name()

    #define			gst_element_set_name(elem,name)	gst_object_set_name(GST_OBJECT(elem),name)

`elem` : |
`name` : |

### gst_element_get_parent()

    #define			gst_element_get_parent(elem)	gst_object_get_parent(GST_OBJECT(elem))

`elem` : |

### gst_element_set_parent()

    #define			gst_element_set_parent(elem,parent)	gst_object_set_parent(GST_OBJECT(elem),parent)

`elem` : |
`parent` : |

### gst_element_set ()

    void        gst_element_set                 (GstElement *element,
                                                 const gchar *first_property_name,
                                                 ...);

Sets properties on an element. If the element uses threadsafe properties, they will be queued and set on the object when it is scheduled again.

`element` : | a GstElement to set properties on.
`first_property_name` : | the first property to set.
`...` : | value of the first property, and more properties to set, ending with NULL.

### gst_element_get ()

    void        gst_element_get                 (GstElement *element,
                                                 const gchar *first_property_name,
                                                 ...);

Gets properties from an element. If the element uses threadsafe properties, the element will be locked before getting the given properties.

`element` : | a GstElement to get properties of.
`first_property_name` : | the first property to get.
`...` : | pointer to a variable to store the first property in, as well as more properties to get, ending with NULL.

### gst_element_set_valist ()

    void        gst_element_set_valist          (GstElement *element,
                                                 const gchar *first_property_name,
                                                 va_list var_args);

Sets properties on an element. If the element uses threadsafe properties, the property change will be put on the async queue.

`element` : | a GstElement to set properties on.
`first_property_name` : | the first property to set.
`var_args` : | the var_args list of other properties to get.

### gst_element_get_valist ()

    void        gst_element_get_valist          (GstElement *element,
                                                 const gchar *first_property_name,
                                                 va_list var_args);

Gets properties from an element. If the element uses threadsafe properties, the element will be locked before getting the given properties.

`element` : | a GstElement to get properties of.
`first_property_name` : | the first property to get.
`var_args` : | the var_args list of other properties to get.

### gst_element_set_property ()

    void        gst_element_set_property        (GstElement *element,
                                                 const gchar *property_name,
                                                 const GValue *value);

Sets a property on an element. If the element uses threadsafe properties, the property will be put on the async queue.

`element` : | a GstElement to set properties on.
`property_name` : | the first property to get.
`value` : | the GValue that holds the value to set.

### gst_element_get_property ()

    void        gst_element_get_property        (GstElement *element,
                                                 const gchar *property_name,
                                                 GValue *value);

Gets a property from an element. If the element uses threadsafe properties, the element will be locked before getting the given property.

`element` : | a GstElement to get properties of.
`property_name` : | the first property to get.
`value` : | the GValue to store the property value in.

### gst_element_enable_threadsafe_properties ()

    void        gst_element_enable_threadsafe_properties
                                                (GstElement *element);

Installs an asynchronous queue, a mutex and pre- and post-run functions on this element so that properties on the element can be set in a threadsafe way.

`element` : | a GstElement to enable threadsafe properties on.

### gst_element_disable_threadsafe_properties ()

    void        gst_element_disable_threadsafe_properties
                                                (GstElement *element);

Removes the threadsafe properties, post- and pre-run locks from this element.

`element` : | a GstElement to disable threadsafe properties on.

### gst_element_set_pending_properties ()

    void        gst_element_set_pending_properties
                                                (GstElement *element);

Sets all pending properties on the threadsafe properties enabled element.

`element` : | a GstElement to set the pending properties on.

### gst_element_requires_clock ()

    gboolean    gst_element_requires_clock      (GstElement *element);

Query if the element requiresd a clock

`element` : | a GstElement to query
Returns : | TRUE if the element requires a clock

### gst_element_provides_clock ()

    gboolean    gst_element_provides_clock      (GstElement *element);

Query if the element provides a clock

`element` : | a GstElement to query
Returns : | TRUE if the element provides a clock

### gst_element_get_clock ()

    GstClock*   gst_element_get_clock           (GstElement *element);

Gets the clock of the element.

`element` : | a GstElement to get the clock of.
Returns : | the GstClock of the element.

### gst_element_set_clock ()

    void        gst_element_set_clock           (GstElement *element,
                                                 GstClock *clock);

Sets the clock for the element.

`element` : | a GstElement to set the clock for.
`clock` : | the GstClock to set for the element.

### gst_element_clock_wait ()

    GstClockReturn gst_element_clock_wait       (GstElement *element,
                                                 GstClockID id,
                                                 GstClockTimeDiff *jitter);

Waits for a specific time on the clock.

`element` : | a GstElement.
`id` : | the GstClock to use.
`jitter` : | the difference between requested time and actual time.
Returns : | the GstClockReturn result of the wait operation.

### gst_element_get_time ()

    GstClockTime gst_element_get_time           (GstElement *element);

Query the element's time. FIXME: The element must use

`element` : | element to query
Returns : | the current stream time in GST_STATE_PLAYING, the element base time in GST_STATE_PAUSED, or GST_CLOCK_TIME_NONE otherwise.

### gst_element_wait ()

    gboolean    gst_element_wait                (GstElement *element,
                                                 GstClockTime timestamp);

Waits until the given relative time stamp for the element has arrived. When this function returns successfully, the relative time point specified in the timestamp has passed for this element.

### Note

This function can only be called on elements in GST_STATE_PLAYING

`element` : | element that should wait
`timestamp` : | what timestamp to wait on
Returns : | TRUE on success.

### gst_element_set_time ()

    void        gst_element_set_time            (GstElement *element,
                                                 GstClockTime time);

Sets the current time of the element. This function can be used when handling discont events. You can only call this function on an element with a clock in GST_STATE_PAUSED or GST_STATE_PLAYING. You might want to have a look at `gst_element_adjust_time()`, if you want to adjust by a difference as that is more accurate.

`element` : | element to set time on
`time` : | time to set

### gst_element_set_time_delay ()

    void        gst_element_set_time_delay      (GstElement *element,
                                                 GstClockTime time,
                                                 GstClockTime delay);

Sets the current time of the element to time - delay. This function can be used when handling discont events in elements writing to an external buffer, i. e., an audio sink that writes to a sound card that buffers the sound before playing it. The delay should be the current buffering delay.

You can only call this function on an element with a clock in GST_STATE_PAUSED or GST_STATE_PLAYING. You might want to have a look at `gst_element_adjust_time()`, if you want to adjust by a difference as that is more accurate.

`element` : | element to set time on
`time` : | time to set
`delay` : | a delay to discount from the given time

### gst_element_adjust_time ()

    void        gst_element_adjust_time         (GstElement *element,
                                                 GstClockTimeDiff diff);

Adjusts the current time of the element by the specified difference. This function can be used when handling discont events. You can only call this function on an element with a clock in GST_STATE_PAUSED or GST_STATE_PLAYING. It is more accurate than `gst_element_set_time()`.

`element` : | element to adjust time on
`diff` : | difference to adjust

### gst_element_is_indexable ()

    gboolean    gst_element_is_indexable        (GstElement *element);

Queries if the element can be indexed.

`element` : | a GstElement.
Returns : | TRUE if the element can be indexed.

### gst_element_set_index ()

    void        gst_element_set_index           (GstElement *element,
                                                 GstIndex *index);

Set the specified GstIndex on the element.

`element` : | a GstElement.
`index` : | a GstIndex.

### gst_element_get_index ()

    GstIndex*   gst_element_get_index           (GstElement *element);

Gets the index from the element.

`element` : | a GstElement.
Returns : | a GstIndex or NULL when no index was set on the element.

### gst_element_release_locks ()

    gboolean    gst_element_release_locks       (GstElement *element);

Instruct the element to release all the locks it is holding, such as blocking reads, waiting for the clock, ...

`element` : | a GstElement to release all locks on.
Returns : | TRUE if the locks could be released.

### gst_element_yield ()

    void        gst_element_yield               (GstElement *element);

Requests a yield operation for the element. The scheduler will typically give control to another element.

`element` : | a GstElement to yield.

### gst_element_interrupt ()

    gboolean    gst_element_interrupt           (GstElement *element);

Requests the scheduler of this element to interrupt the execution of this element and scheduler another one.

`element` : | a GstElement to interrupt.
Returns : | TRUE if the element should exit its chain/loop/get function ASAP, depending on the scheduler implementation.

### gst_element_set_scheduler ()

    void        gst_element_set_scheduler       (GstElement *element,
                                                 GstScheduler *sched);

Sets the scheduler of the element. For internal use only, unless you're writing a new bin subclass.

`element` : | a GstElement to set the scheduler of.
`sched` : | the GstScheduler to set.

### gst_element_get_scheduler ()

    GstScheduler* gst_element_get_scheduler     (GstElement *element);

Returns the scheduler of the element.

`element` : | a GstElement to get the scheduler of.
Returns : | the element's GstScheduler.

### gst_element_add_pad ()

    void        gst_element_add_pad             (GstElement *element,
                                                 GstPad *pad);

Adds a pad (link point) to `element`. `pad`'s parent will be set to `element`; see `gst_object_set_parent()` for refcounting information.

Pads are automatically activated when the element is in state PLAYING.

`element` : | a GstElement to add the pad to.
`pad` : | the GstPad to add to the element.

### gst_element_remove_pad ()

    void        gst_element_remove_pad          (GstElement *element,
                                                 GstPad *pad);

Removes `pad` from `element`. `pad` will be destroyed if it has not been referenced elsewhere. Normally, only elements remove pads. The only exception to this are ghost pads which were created by the application and request pads, which applications can remove using `gst_element_release_request_pad()`.

`element` : | a GstElement to remove pad from.
`pad` : | the GstPad to remove from the element.

### gst_element_add_ghost_pad ()

    GstPad*     gst_element_add_ghost_pad       (GstElement *element,
                                                 GstPad *pad,
                                                 const gchar *name);

Creates a ghost pad from `pad`, and adds it to `element` via `gst_element_add_pad()`.

`element` : | a GstElement to add the ghost pad to.
`pad` : | the GstPad from which the new ghost pad will be created.
`name` : | the name of the new ghost pad, or NULL to assign a unique name automatically.
Returns : | the added ghost GstPad, or NULL on error.

### gst_element_remove_ghost_pad ()

    void        gst_element_remove_ghost_pad    (GstElement *element,
                                                 GstPad *pad);

### Warning

`gst_element_remove_ghost_pad` is deprecated and should not be used in newly-written code.

Removes a ghost pad from an element. Deprecated, use `gst_element_remove_pad()` instead.

`element` : | a GstElement to remove the ghost pad from.
`pad` : | ghost GstPad to remove.

### gst_element_get_pad ()

    GstPad*     gst_element_get_pad             (GstElement *element,
                                                 const gchar *name);

Retrieves a pad from `element` by name. Tries `gst_element_get_static_pad()` first, then `gst_element_get_request_pad()`.

`element` : | a GstElement.
`name` : | the name of the pad to retrieve.
Returns : | the GstPad if found, otherwise `NULL`.

### gst_element_get_static_pad ()

    GstPad*     gst_element_get_static_pad      (GstElement *element,
                                                 const gchar *name);

Retrieves a pad from `element` by name. This version only retrieves already-existing (i.e. 'static') pads.

`element` : | a GstElement to find a static pad of.
`name` : | the name of the static GstPad to retrieve.
Returns : | the requested GstPad if found, otherwise NULL.

### gst_element_get_request_pad ()

    GstPad*     gst_element_get_request_pad     (GstElement *element,
                                                 const gchar *name);

Retrieves a pad from the element by name. This version only retrieves request pads.

`element` : | a GstElement to find a request pad of.
`name` : | the name of the request GstPad to retrieve.
Returns : | requested GstPad if found, otherwise NULL.

### gst_element_release_request_pad ()

    void        gst_element_release_request_pad (GstElement *element,
                                                 GstPad *pad);

Makes the element free the previously requested pad as obtained with `gst_element_get_request_pad()`.

`element` : | a GstElement to release the request pad of.
`pad` : | the GstPad to release.

### gst_element_get_pad_list ()

    const GList* gst_element_get_pad_list       (GstElement *element);

Retrieves a list of `element`'s pads. The list must not be modified by the calling code.

`element` : | a GstElement to get pads of.
Returns : | the GList of pads.

### gst_element_get_compatible_pad ()

    GstPad*     gst_element_get_compatible_pad  (GstElement *element,
                                                 GstPad *pad);

Looks for an unlinked pad to which the given pad can link to. It is not guaranteed that linking the pads will work, though it should work in most cases.

`element` : | a GstElement in which the pad should be found.
`pad` : | the GstPad to find a compatible one for.
Returns : | the GstPad to which a link can be made, or `NULL` if one could not be found.

### gst_element_get_compatible_pad_filtered ()

    GstPad*     gst_element_get_compatible_pad_filtered
                                                (GstElement *element,
                                                 GstPad *pad,
                                                 const GstCaps *filtercaps);

Looks for an unlinked pad to which the given pad can link. It is not guaranteed that linking the pads will work, though it should work in most cases.

`element` : | a GstElement in which the pad should be found.
`pad` : | the GstPad to find a compatible one for.
`filtercaps` : | the GstCaps to use as a filter.
Returns : | the GstPad to which a link can be made, or `NULL` if one cannot be found.

### gst_element_class_get_pad_template ()

    GstPadTemplate* gst_element_class_get_pad_template
                                                (GstElementClass *element_class,
                                                 const gchar *name);

Retrieves a padtemplate from `element_class` with the given name.

### Note

If you use this function in the GInstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GInstanceInitFunc here.

`element_class` : | a GstElementClass to get the pad template of.
`name` : | the name of the GstPadTemplate to get.
Returns : | the GstPadTemplate with the given name, or NULL if none was found. No unreferencing is necessary.

### gst_element_class_get_pad_template_list ()

    GList*      gst_element_class_get_pad_template_list
                                                (GstElementClass *element_class);

Retrieves a list of the pad templates associated with `element_class`. The list must not be modified by the calling code.

### Note

If you use this function in the GInstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GInstanceInitFunc here.

`element_class` : | a GstElementClass to get pad templates of.
Returns : | the GList of padtemplates.

### gst_element_get_pad_template ()

    GstPadTemplate* gst_element_get_pad_template
                                                (GstElement *element,
                                                 const gchar *name);

Retrieves a padtemplate from this element with the given name. (FIXME: Should be deprecated in favor of gst_element_class_get_pad_template).

`element` : | a GstElement to get the pad template of.
`name` : | the name of the GstPadTemplate to get.
Returns : | the GstPadTemplate with the given name, or NULL if none was found. No unreferencing is necessary.

### gst_element_get_pad_template_list ()

    GList*      gst_element_get_pad_template_list
                                                (GstElement *element);

Retrieves a list of the pad templates associated with the element. (FIXME: Should be deprecated in favor of gst_element_class_get_pad_template_list).

`element` : | a GstElement to get pad templates of.
Returns : | the GList of padtemplates.

### gst_element_get_compatible_pad_template ()

    GstPadTemplate* gst_element_get_compatible_pad_template
                                                (GstElement *element,
                                                 GstPadTemplate *compattempl);

Retrieves a pad template from `element` that is compatible with `compattempl`. Pads from compatible templates can be linked together.

`element` : | a GstElement to get a compatible pad template for.
`compattempl` : | the GstPadTemplate to find a compatible template for.
Returns : | a compatible GstPadTemplate, or NULL if none was found. No unreferencing is necessary.

### gst_element_link ()

    gboolean    gst_element_link                (GstElement *src,
                                                 GstElement *dest);

Links `src` to `dest` with no filter caps. See `gst_element_link_filtered()` for more information.

`src` : | a GstElement containing the source pad.
`dest` : | the GstElement containing the destination pad.
Returns : | TRUE if the elements could be linked, FALSE otherwise.

### gst_element_link_many ()

    gboolean    gst_element_link_many           (GstElement *element_1,
                                                 GstElement *element_2,
                                                 ...);

Chain together a series of elements. Uses `gst_element_link()`. Does not unlink partially linked elements in the case of an error (use `gst_element_link_many()` ).

`element_1` : | the first GstElement in the link chain.
`element_2` : | the second GstElement in the link chain.
`...` : | the NULL-terminated list of elements to link in order.
Returns : | TRUE on success, FALSE otherwise.

### gst_element_link_filtered ()

    gboolean    gst_element_link_filtered       (GstElement *src,
                                                 GstElement *dest,
                                                 const GstCaps *filtercaps);

Links `src` to `dest`, filtered by `filtercaps`. The link must be from source to destination; the other direction will not be tried. The function looks for existing pads that aren't linked yet. It will request new pads if necessary. If multiple links are possible, only one is established.

`src` : | a GstElement containing the source pad.
`dest` : | the GstElement containing the destination pad.
`filtercaps` : | the GstCaps to use as a filter.
Returns : | TRUE if the elements could be linked, FALSE otherwise.

### gst_element_unlink ()

    void        gst_element_unlink              (GstElement *src,
                                                 GstElement *dest);

Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked.

`src` : | the source GstElement to unlink.
`dest` : | the sink GstElement to unlink.

### gst_element_unlink_many ()

    void        gst_element_unlink_many         (GstElement *element_1,
                                                 GstElement *element_2,
                                                 ...);

Unlinks a series of elements. Uses `gst_element_unlink()`.

`element_1` : | the first GstElement in the link chain.
`element_2` : | the second GstElement in the link chain.
`...` : | the NULL-terminated list of elements to unlink in order.

### gst_element_link_pads ()

    gboolean    gst_element_link_pads           (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname);

Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.

`src` : | a GstElement containing the source pad.
`srcpadname` : | the name of the GstPad in the source element.
`dest` : | the GstElement containing the destination pad.
`destpadname` : | the name of the GstPad in destination element.
Returns : | TRUE if the pads could be linked, FALSE otherwise.

### gst_element_link_pads_filtered ()

    gboolean    gst_element_link_pads_filtered  (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname,
                                                 const GstCaps *filtercaps);

Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.

`src` : | a GstElement containing the source pad.
`srcpadname` : | the name of the GstPad in source element or NULL for any pad.
`dest` : | the GstElement containing the destination pad.
`destpadname` : | the name of the GstPad in destination element or NULL for any pad.
`filtercaps` : | the GstCaps to use as a filter.
Returns : | TRUE if the pads could be linked, FALSE otherwise.

### gst_element_unlink_pads ()

    void        gst_element_unlink_pads         (GstElement *src,
                                                 const gchar *srcpadname,
                                                 GstElement *dest,
                                                 const gchar *destpadname);

Unlinks the two named pads of the source and destination elements.

`src` : | a GstElement containing the source pad.
`srcpadname` : | the name of the GstPad in source element.
`dest` : | a GstElement containing the destination pad.
`destpadname` : | the name of the GstPad in destination element.

### gst_element_get_event_masks ()

    const GstEventMask* gst_element_get_event_masks
                                                (GstElement *element);

Get an array of event masks from the element. If the element doesn't implement an event masks function, the query will be forwarded to a random linked sink pad.

`element` : | a GstElement to query
Returns : | An array of GstEventMask elements.

### gst_element_send_event ()

    gboolean    gst_element_send_event          (GstElement *element,
                                                 GstEvent *event);

Sends an event to an element. If the element doesn't implement an event handler, the event will be forwarded to a random sink pad.

`element` : | a GstElement to send the event to.
`event` : | the GstEvent to send to the element.
Returns : | TRUE if the event was handled.

### gst_element_seek ()

    gboolean    gst_element_seek                (GstElement *element,
                                                 GstSeekType seek_type,
                                                 guint64 offset);

Sends a seek event to an element.

`element` : | a GstElement to send the event to.
`seek_type` : | the method to use for seeking.
`offset` : | the offset to seek to.
Returns : | TRUE if the event was handled.

### gst_element_get_query_types ()

    const GstQueryType* gst_element_get_query_types
                                                (GstElement *element);

Get an array of query types from the element. If the element doesn't implement a query types function, the query will be forwarded to a random sink pad.

`element` : | a GstElement to query
Returns : | An array of GstQueryType elements.

### gst_element_query ()

    gboolean    gst_element_query               (GstElement *element,
                                                 GstQueryType type,
                                                 GstFormat *format,
                                                 gint64 *value);

Performs a query on the given element. If the format is set to GST_FORMAT_DEFAULT and this function returns TRUE, the format pointer will hold the default format. For element that don't implement a query handler, this function forwards the query to a random usable sinkpad of this element.

`element` : | a GstElement to perform the query on.
`type` : | the GstQueryType.
`format` : | the GstFormat pointer to hold the format of the result.
`value` : | the pointer to the value of the result.
Returns : | TRUE if the query could be performed.

### gst_element_get_formats ()

    const GstFormat* gst_element_get_formats    (GstElement *element);

Get an array of formats from the element. If the element doesn't implement a formats function, the query will be forwarded to a random sink pad.

`element` : | a GstElement to query
Returns : | An array of GstFormat elements.

### gst_element_convert ()

    gboolean    gst_element_convert             (GstElement *element,
                                                 GstFormat src_format,
                                                 gint64 src_value,
                                                 GstFormat *dest_format,
                                                 gint64 *dest_value);

Invokes a conversion on the element. If the element doesn't implement a convert function, the query will be forwarded to a random sink pad.

`element` : | a GstElement to invoke the converter on.
`src_format` : | the source GstFormat.
`src_value` : | the source value.
`dest_format` : | a pointer to the destination GstFormat.
`dest_value` : | a pointer to the destination value.
Returns : | TRUE if the conversion could be performed.

### gst_element_found_tags ()

    void        gst_element_found_tags          (GstElement *element,
                                                 const GstTagList *tag_list);

This function emits the found_tags signal. This is a recursive signal, so every parent will emit that signal, too, before this function returns. Only emit this signal, when you extracted these tags out of the data stream, not when you handle an event.

`element` : | the element that found the tags
`tag_list` : | the found tags

### gst_element_found_tags_for_pad ()

    void        gst_element_found_tags_for_pad  (GstElement *element,
                                                 GstPad *pad,
                                                 GstClockTime timestamp,
                                                 GstTagList *list);

This is a convenience routine for tag finding. Most of the time you only want to push the found tags down one pad, in that case this function is for you. It takes ownership of the taglist, emits the found-tag signal and pushes a tag event down the pad.

### Note

This function may not be used in a GstPadGetFunction, because it calls `gst_pad_push()`. In those functions, call `gst_element_found_tags()`, create a tag event with `gst_event_new_tag()` and return that from your GstPadGetFunction.

`element` : | element that found the tag
`pad` : | src pad the tags correspond to
`timestamp` : | time the tags were found
`list` : | the taglist

### gst_element_set_eos ()

    void        gst_element_set_eos             (GstElement *element);

Perform the actions needed to bring the element in the EOS state.

`element` : | a GstElement to set to the EOS state.

### gst_element_error_full ()

    void        gst_element_error_full          (GstElement *element,
                                                 GQuark domain,
                                                 gint code,
                                                 gchar *message,
                                                 gchar *debug,
                                                 const gchar *file,
                                                 const gchar *function,
                                                 gint line);

Signals an error condition on an element. This function is used internally by elements. It results in the "error" signal.

`element` : | a GstElement with the error.
`domain` : | the GStreamer error domain this error belongs to.
`code` : | the error code belonging to the domain
`message` : | an allocated message to be used as a replacement for the default message connected to code, or NULL
`debug` : | an allocated debug message to be used as a replacement for the default debugging information, or NULL
`file` : | the source code file where the error was generated
`function` : | the source code function where the error was generated
`line` : | the source code line where the error was generated

### gst_element_is_locked_state ()

    gboolean    gst_element_is_locked_state     (GstElement *element);

Checks if the state of an element is locked. If the state of an element is locked, state changes of the parent don't affect the element. This way you can leave currently unused elements inside bins. Just lock their state before changing the state from GST_STATE_NULL.

`element` : | a GstElement.
Returns : | TRUE, if the element's state is locked.

### gst_element_set_locked_state ()

    void        gst_element_set_locked_state    (GstElement *element,
                                                 gboolean locked_state);

Locks the state of an element, so state changes of the parent don't affect this element anymore.

`element` : | a GstElement
`locked_state` : | TRUE to lock the element's state

### gst_element_sync_state_with_parent ()

    gboolean    gst_element_sync_state_with_parent
                                                (GstElement *element);

Tries to change the state of the element to the same as its parent. If this function returns FALSE, the state of element is undefined.

`element` : | a GstElement.
Returns : | TRUE, if the element's state could be synced to the parent's state.

### gst_element_get_state ()

    GstElementState gst_element_get_state       (GstElement *element);

Gets the state of the element.

`element` : | a GstElement to get the state of.
Returns : | the GstElementState of the element.

### gst_element_set_state ()

    GstElementStateReturn gst_element_set_state (GstElement *element,
                                                 GstElementState state);

Sets the state of the element. This function will try to set the requested state by going through all the intermediary states and calling the class's state change function for each.

`element` : | a GstElement to change state of.
`state` : | the element's new GstElementState.
Returns : | TRUE if the state was successfully set. (using GstElementStateReturn).

### gst_element_wait_state_change ()

    void        gst_element_wait_state_change   (GstElement *element);

Waits and blocks until the element changed its state.

`element` : | a GstElement to wait for a state change on.

### gst_element_state_get_name ()

    const gchar* gst_element_state_get_name     (GstElementState state);

Gets a string representing the given state.

`state` : | a GstElementState to get the name of.
Returns : | a string with the name of the state.

### gst_element_get_factory ()

    GstElementFactory* gst_element_get_factory  (GstElement *element);

Retrieves the factory that was used to create this element.

`element` : | a GstElement to request the element factory of.
Returns : | the GstElementFactory used for creating this element.

### gst_element_get_managing_bin ()

    GstBin*     gst_element_get_managing_bin    (GstElement *element);

Gets the managing bin (a pipeline or a thread, for example) of an element.

`element` : | a GstElement to get the managing bin of.
Returns : | the GstBin, or NULL on failure.

### gst_element_no_more_pads ()

    void        gst_element_no_more_pads        (GstElement *element);

Use this function to signal that the element does not expect any more pads to show up in the current pipeline. This function should be called whenever pads have been added by the element itself. Elements with GST_PAD_SOMETIMES pad templates use this in combination with autopluggers to figure out that the element is done initializing its pads.

`element` : | a GstElement

## Signals

### The "eos" signal

    void        user_function                  (GstElement *gstelement,
                                                gpointer user_data);

the end of the stream has been reached

`gstelement` : | the object which received the signal
`user_data` : | user data set when the signal handler was connected.

### The "error" signal

    void        user_function                  (GstElement *gstelement,
                                                GstElement *element,
                                                GstGError *error,
                                                gchar *message,
                                                gpointer user_data);

a GstError has occured during data processing

`gstelement` : | the object which received the signal
`element` : |
`error` : |
`message` : |
`user_data` : | user data set when the signal handler was connected.

### The "found-tag" signal

    void        user_function                  (GstElement *gstelement,
                                                GstElement *element,
                                                GstTagList *tags,
                                                gpointer user_data);

tags for the incomming stream have been received

`gstelement` : | the object which received the signal
`element` : |
`tags` : |
`user_data` : | user data set when the signal handler was connected.

### The "new-pad" signal

    void        user_function                  (GstElement *gstelement,
                                                GObject *object,
                                                gpointer user_data);

a new GstPad has been added to the element

`gstelement` : | the object which received the signal
`object` : |
`user_data` : | user data set when the signal handler was connected.

### The "no-more-pads" signal

    void        user_function                  (GstElement *gstelement,
                                                gpointer user_data);

?

`gstelement` : | the object which received the signal
`user_data` : | user data set when the signal handler was connected.

### The "pad-removed" signal

    void        user_function                  (GstElement *gstelement,
                                                GObject *object,
                                                gpointer user_data);

a GstPad has been removed from the element

`gstelement` : | the object which received the signal
`object` : |
`user_data` : | user data set when the signal handler was connected.

### The "state-change" signal

    void        user_function                  (GstElement *gstelement,
                                                gint int,
                                                gint int,
                                                gpointer user_data);

the GstElementState of the element has been changed

`gstelement` : | the object which received the signal
`int` : |
`int` : |
`user_data` : | user data set when the signal handler was connected.