GstElement

GstElement — Base class for all pipeline elements

Synopsis


#include <gst/gst.h>


struct      GstElement;
#define     gst_element_get_name            (elem)
#define     gst_element_set_name            (elem,name)
GstElementFactory* gst_element_get_factory  (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);
G_CONST_RETURN GList* gst_element_get_pad_list
                                            (GstElement *element);
GstPadTemplate* gst_element_get_pad_template
                                            (GstElement *element,
                                             const gchar *name);
GList*      gst_element_get_pad_template_list
                                            (GstElement *element);
void        gst_element_class_add_pad_template
                                            (GstElementClass *klass,
                                             GstPadTemplate *templ);
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,
                                             GstCaps *filtercaps);
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,
                                             GstCaps *filtercaps);
void        gst_element_unlink              (GstElement *src,
                                             GstElement *dest);
void        gst_element_unlink_many         (GstElement *element_1,
                                             GstElement *element_2,
                                             ...);
void        gst_element_unlink_pads         (GstElement *src,
                                             const gchar *srcpadname,
                                             GstElement *dest,
                                             const gchar *destpadname);
GstPad*     gst_element_get_compatible_pad  (GstElement *element,
                                             GstPad *pad);
GstPad*     gst_element_get_compatible_pad_filtered
                                            (GstElement *element,
                                             GstPad *pad,
                                             GstCaps *filtercaps);
GstPadTemplate* gst_element_get_compatible_pad_template
                                            (GstElement *element,
                                             GstPadTemplate *compattempl);
GstElementStateReturn gst_element_set_state (GstElement *element,
                                             GstElementState state);
GstElementState gst_element_get_state       (GstElement *element);
G_CONST_RETURN gchar* gst_element_state_get_name
                                            (GstElementState state);
void        gst_element_wait_state_change   (GstElement *element);
void        gst_element_error               (GstElement *element,
                                             const gchar *error,
                                             ...);
void        gst_element_set_eos             (GstElement *element);
gboolean    gst_element_interrupt           (GstElement *element);
void        gst_element_yield               (GstElement *element);
gboolean    gst_element_release_locks       (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);
gboolean    gst_element_provides_clock      (GstElement *element);
gboolean    gst_element_requires_clock      (GstElement *element);
void        gst_element_set_index           (GstElement *element,
                                             GstIndex *index);
GstIndex*   gst_element_get_index           (GstElement *element);
gboolean    gst_element_is_indexable        (GstElement *element);
void        gst_element_set_loop_function   (GstElement *element,
                                             GstElementLoopFunction loop);
void        (*GstElementLoopFunction)       (GstElement *element);
GstScheduler* gst_element_get_scheduler     (GstElement *element);
void        gst_element_set_scheduler       (GstElement *element,
                                             GstScheduler *sched);
#define     gst_element_get_parent          (elem)
#define     gst_element_set_parent          (elem,parent)
GstBin*     gst_element_get_managing_bin    (GstElement *element);
void        (*GstElementPostRunFunction)    (GstElement *element);
void        (*GstElementPreRunFunction)     (GstElement *element);
void        gst_element_disable_threadsafe_properties
                                            (GstElement *element);
void        gst_element_enable_threadsafe_properties
                                            (GstElement *element);
void        gst_element_get                 (GstElement *element,
                                             const gchar *first_property_name,
                                             ...);
void        gst_element_get_property        (GstElement *element,
                                             const gchar *property_name,
                                             GValue *value);
void        gst_element_get_valist          (GstElement *element,
                                             const gchar *first_property_name,
                                             va_list var_args);
void        gst_element_set                 (GstElement *element,
                                             const gchar *first_property_name,
                                             ...);
void        gst_element_set_pending_properties
                                            (GstElement *element);
void        gst_element_set_property        (GstElement *element,
                                             const gchar *property_name,
                                             const GValue *value);
void        gst_element_set_valist          (GstElement *element,
                                             const gchar *first_property_name,
                                             va_list var_args);
gboolean    gst_element_query               (GstElement *element,
                                             GstQueryType type,
                                             GstFormat *format,
                                             gint64 *value);
gboolean    gst_element_send_event          (GstElement *element,
                                             GstEvent *event);
G_CONST_RETURN GstEventMask* gst_element_get_event_masks
                                            (GstElement *element);
G_CONST_RETURN GstFormat* gst_element_get_formats
                                            (GstElement *element);
G_CONST_RETURN GstQueryType* gst_element_get_query_types
                                            (GstElement *element);
gboolean    gst_element_convert             (GstElement *element,
                                             GstFormat src_format,
                                             gint64 src_value,
                                             GstFormat *dest_format,
                                             gint64 *dest_value);
#define     gst_element_default_deep_notify
void        gst_element_default_error       (GObject *object,
                                             GstObject *orig,
                                             gchar *error);
enum        GstElementState;
enum        GstElementStateReturn;
#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_READY
#define     GST_STATE_PLAYING_TO_PAUSED
#define     GST_STATE_PAUSED_TO_PLAYING
#define     GST_STATE_READY_TO_NULL
enum        GstElementFlags;
#define     GST_ELEMENT_IS_THREAD_SUGGESTED (obj)
#define     GST_ELEMENT_IS_DECOUPLED        (obj)
#define     GST_ELEMENT_IS_EVENT_AWARE      (obj)
#define     GST_ELEMENT_PARENT              (obj)
#define     GST_ELEMENT_NAME                (obj)
#define     GST_ELEMENT_PADS                (obj)
#define     GST_ELEMENT_SCHED               (obj)
#define     GST_ELEMENT_MANAGER             (obj)
#define     GST_ELEMENT_CLOCK               (obj)
#define     GST_ELEMENT_EVENT_MASK_FUNCTION (functionname, ...)
#define     GST_ELEMENT_FORMATS_FUNCTION    (functionname, ...)
#define     GST_ELEMENT_QUERY_TYPE_FUNCTION (functionname, ...)

Object Hierarchy


  GObject
   +----GstObject
         +----GstElement

Signal Prototypes


"eos"       void        user_function      (GstElement *gstelement,
                                            gpointer user_data);
"error"     void        user_function      (GstElement *gstelement,
                                            GstElement *arg1,
                                            gchar *arg2,
                                            gpointer user_data);
"found-tag" void        user_function      (GstElement *gstelement,
                                            GstElement *arg1,
                                            gpointer arg2,
                                            gpointer user_data);
"new-pad"   void        user_function      (GstElement *gstelement,
                                            GObject *arg1,
                                            gpointer user_data);
"pad-removed"
            void        user_function      (GstElement *gstelement,
                                            GObject *arg1,
                                            gpointer user_data);
"state-change"
            void        user_function      (GstElement *gstelement,
                                            gint arg1,
                                            gint arg2,
                                            gpointer user_data);

Description

GstElement is the base class needed to construct an element that can be used in a GStreamer pipeline. As such, it is not a functional entity, and cannot do anything when placed in a pipeline.

The name of a GstElement can be get with gst_element_get_name() and set with gst_element_set_name(). For speed, GST_ELEMENT_NAME() can be used in the core. Do not use this in plug-ins or applications in order to retain ABI compatibility.

All elements have pads (of the type GstPad). These pads link to pads on other elements. Buffers flow between these linked pads. A GstElement has a GList of GstPad structures for all their input (or sink) and output (or source) pads. Core and plug-in writers can add and remove pads with gst_element_add_pad() and gst_element_remove_pad(). Application writers can manipulate ghost pads (copies of real pads inside a bin) with gst_element_add_ghost_pad() and gst_element_remove_ghost_pad(). A pad of an element can be retrieved by name with gst_element_get_pad(). A GList of all pads can be retrieved with gst_element_get_pad_list().

Elements can be linked through their pads. If the link is straightforward, use the gst_element_link() convenience function to link two elements, or gst_element_link_many() for more elements in a row. Use gst_element_link_filtered() to link two elements constrained by a specified set of GstCaps. For finer control, use gst_element_link_pads() and gst_element_link_pads_filtered() to specify the pads to link on each element by name.

Each element has a state (see GstElementState). You can get and set the state of an element with gst_element_get_state() and gst_element_set_state(). You can wait for an element to change it's state with gst_element_wait_state_change(). To get a string representation of a GstElementState, use gst_element_state_get_name().

You can get and set a GstClock on an element using gst_element_get_clock() and gst_element_set_clock(). You can wait for the clock to reach a given GstClockTime using gst_element_clock_wait().

Details

struct GstElement

struct GstElement;

The element object


gst_element_get_name()

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

Gets the name of the element.

elem :
Returns :the name of the element.

gst_element_set_name()

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

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

elem :a GstElement to set the name of.
name :the new name of the element.

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_add_pad ()

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

Add a pad (link point) to the element, setting the parent of the pad to the element (and thus adding a reference). 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);

Remove a pad (link point) from the element.

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 the given pad, and adds it to the list of pads for this element.

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.
Returns : the added ghost GstPad, or NULL, if no ghost pad was created.

gst_element_remove_ghost_pad ()

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

Removes a ghost pad from an element.

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 the element by name.

element : a GstElement to find pad of.
name : the name of the pad to retrieve.
Returns : requested 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 the 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 ()

G_CONST_RETURN GList* gst_element_get_pad_list
                                            (GstElement *element);

Retrieves a list of the pads associated with the element.

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

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_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_link ()

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

Links the source to the destination element. The link must be from source to destination, the other direction will not be tried. The functions looks for existing pads and request pads that aren't linked yet. If multiple links are possible, only one is established.

src : a GstElement containing the source pad.
dest : the GstElement containing the destination pad.
Returns : TRUE if the elements could be linked.

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.

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,
                                             GstCaps *filtercaps);

Links the source to the destination element using the filtercaps. The link must be from source to destination, the other direction will not be tried. The functions looks for existing pads that aren't linked yet. It will use request pads if possible. But both pads will not be requested. 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.

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.

gst_element_link_pads_filtered ()

gboolean    gst_element_link_pads_filtered  (GstElement *src,
                                             const gchar *srcpadname,
                                             GstElement *dest,
                                             const gchar *destpadname,
                                             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.

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_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_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 none could be found.

gst_element_get_compatible_pad_filtered ()

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

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.
filtercaps : the GstCaps to use as a filter.
Returns : the GstPad to which a link can be made.

gst_element_get_compatible_pad_template ()

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

Generates a pad template for this element compatible with the given template (meaning it is able to link with it).

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

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_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_state_get_name ()

G_CONST_RETURN 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_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_error ()

void        gst_element_error               (GstElement *element,
                                             const gchar *error,
                                             ...);

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.
error : the printf-style string describing the error.
... : the optional arguments for the string.

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_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_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_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_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_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_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_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_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_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.

GstElementLoopFunction ()

void        (*GstElementLoopFunction)       (GstElement *element);

This function type is used to specify a loop function for the element. It is passed the element in question, and is expect to return only in error circumstances.

element :The element in question.

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_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_parent()

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

Gets the parent of an element.

elem :a GstElement to get the parent of.
Returns :the GstObject parent of the element.

gst_element_set_parent()

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

Sets the parent of an element.

elem :a GstElement to set the parent of.
parent : the new GstObject parent of the object.

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.

GstElementPostRunFunction ()

void        (*GstElementPostRunFunction)    (GstElement *element);

The signature of the function to execute before this element is scheduled.

element :The element

GstElementPreRunFunction ()

void        (*GstElementPreRunFunction)     (GstElement *element);

The signature of the function to execute after this element is scheduled.

element :The element

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_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_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_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_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 ()

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_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_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_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_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_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_get_event_masks ()

G_CONST_RETURN 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_get_formats ()

G_CONST_RETURN GstFormat* gst_element_get_formats
                                            (GstElement *element);

Get an array of formst 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_get_query_types ()

G_CONST_RETURN 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_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_default_deep_notify

#define 		gst_element_default_deep_notify 	gst_object_default_deep_notify

The default deep notify handler that prints out the property change notifications to stdout.


gst_element_default_error ()

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

Adds a default error signal callback 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 error message.

enum GstElementState

typedef enum {
  GST_STATE_VOID_PENDING        = 0,
  GST_STATE_NULL                = (1 << 0),
  GST_STATE_READY               = (1 << 1),
  GST_STATE_PAUSED              = (1 << 2),
  GST_STATE_PLAYING             = (1 << 3)
} GstElementState;

This enum defines the standard states an element may be in. You will normally use gst_element_set_state() to change the state of an element.

GST_STATE_VOID_PENDING
GST_STATE_NULLReset the state of an element.
GST_STATE_READYwill make the element ready to start processing data. some elements might have a non trivial way to initialize themselves.
GST_STATE_PAUSEDmeans there really is data flowing temporary stops the data flow.
GST_STATE_PLAYINGmeans there really is data flowing through the graph.

enum GstElementStateReturn

typedef enum {
  GST_STATE_FAILURE             = 0,
  GST_STATE_SUCCESS             = 1,
  GST_STATE_ASYNC               = 2
} GstElementStateReturn;

This enum defines the standard return values that an element can return after a state change.

GST_STATE_FAILUREthe element could not perform the state change
GST_STATE_SUCCESSthe element successfully changed its state
GST_STATE_ASYNCthe element will asynchronously change its state as soon as possible

GST_NUM_STATES

#define GST_NUM_STATES 4

The maximun number of states.


GST_STATE()

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

This macro returns the current state of the element.

obj :Element to return state for.

GST_STATE_PENDING()

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

This macro returns the currently pending state of the element.

obj :Element to return the pending state for.

GST_STATE_TRANSITION()

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

Returns the state transition this object is going through.

obj :the Element to return the state transition for

GST_STATE_NULL_TO_READY

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

The Element is going from the NULL state to the READY state.


GST_STATE_READY_TO_PAUSED

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

The Element is going from the READY state to the PAUSED state.


GST_STATE_PAUSED_TO_READY

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

The Element is going from the PAUSED state to the READY state.


GST_STATE_PLAYING_TO_PAUSED

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

The Element is going from the PLAYING state to the PAUSED state.


GST_STATE_PAUSED_TO_PLAYING

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

The Element is going from the PAUSED state to the PLAYING state.


GST_STATE_READY_TO_NULL

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

The Element is going from the READY state to the NULL state.


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_ERROR,

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

This enum defines the standard flags that an element may have.


GST_ELEMENT_IS_THREAD_SUGGESTED()

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

Queries whether the Element should be placed in a thread.

obj :a GstElement to query

GST_ELEMENT_IS_DECOUPLED()

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

Queries if the Element is decoupled.

obj :a GstElement to query

GST_ELEMENT_IS_EVENT_AWARE()

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

Query wether this element can handle events.

obj :a GstElement to query

GST_ELEMENT_PARENT()

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

Get the parent object of this element.

obj :a GstElement to query

GST_ELEMENT_NAME()

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

Gets the name of this element. Used in the core. Not ABI-compatible.

obj :A GstElement to query

GST_ELEMENT_PADS()

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

Get the pads of this elements.

obj :a GstElement to query

GST_ELEMENT_SCHED()

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

Get the scheduler of this element.

obj :a GstElement to query

GST_ELEMENT_MANAGER()

#define GST_ELEMENT_MANAGER(obj)		(((GstElement*)(obj))->manager)

Get the manager of this element.

obj :a GstElement to query

GST_ELEMENT_CLOCK()

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

Get the clock of this element

obj :a GstElement to query

GST_ELEMENT_EVENT_MASK_FUNCTION()

#define     GST_ELEMENT_EVENT_MASK_FUNCTION(functionname, ...)

A helper macro to create a mask function

functionname :the name of the mask function
... :Masks

GST_ELEMENT_FORMATS_FUNCTION()

#define     GST_ELEMENT_FORMATS_FUNCTION(functionname, ...)

Halper macro to create element format functions

functionname :The function name
... :formats

GST_ELEMENT_QUERY_TYPE_FUNCTION()

#define     GST_ELEMENT_QUERY_TYPE_FUNCTION(functionname, ...)

Helper macro to create query type functions

functionname :The function name
... :list of query types.

Signals

The "eos" signal

void        user_function                  (GstElement *gstelement,
                                            gpointer user_data);

Signal emited when the element goes to PAUSED due to an end-of-stream condition.

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 *arg1,
                                            gchar *arg2,
                                            gpointer user_data);

Is triggered whenever an error occured.

gstelement :the object which received the signal.
arg1 :the error message
arg2 :
user_data :user data set when the signal handler was connected.

The "found-tag" signal

void        user_function                  (GstElement *gstelement,
                                            GstElement *arg1,
                                            gpointer arg2,
                                            gpointer user_data);

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

The "new-pad" signal

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

Is triggered whenever a new pad is added to an element.

gstelement :the object which received the signal.
arg1 :the new pad that was added
user_data :user data set when the signal handler was connected.

The "pad-removed" signal

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

Is triggered whenever a pad has been removed from the element.

gstelement :the object which received the signal.
arg1 :The pad that was removed.
user_data :user data set when the signal handler was connected.

The "state-change" signal

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

Is triggered whenever the state of an element changes.

gstelement :the object which received the signal.
arg1 :the new state of the object
arg2 :
user_data :user data set when the signal handler was connected.

See Also

GstElementFactory, GstPad