![]() | ![]() | ![]() | GStreamer 0.8 Core API Reference (0.8.2) | ![]() |
---|
GstElement — Abstract base class for all pipeline elements
struct GstElement; struct GstElementClass; struct GstElementDetails; #define GST_ELEMENT_DETAILS (longname,klass,description,author) #define GST_IS_ELEMENT_DETAILS (details) #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_CLASS (klass) #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_MANAGER (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); G_CONST_RETURN 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); G_CONST_RETURN 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); G_CONST_RETURN GstQueryType* gst_element_get_query_types (GstElement *element); gboolean gst_element_query (GstElement *element, GstQueryType type, GstFormat *format, gint64 *value); G_CONST_RETURN 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); G_CONST_RETURN 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); GType gst_element_factory_get_type (void); gboolean gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type); GstElementFactory* gst_element_factory_find (const gchar *name); GType gst_element_factory_get_element_type (GstElementFactory *factory); G_CONST_RETURN gchar* gst_element_factory_get_longname (GstElementFactory *factory); G_CONST_RETURN gchar* gst_element_factory_get_klass (GstElementFactory *factory); G_CONST_RETURN gchar* gst_element_factory_get_description (GstElementFactory *factory); G_CONST_RETURN gchar* gst_element_factory_get_author (GstElementFactory *factory); guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); G_CONST_RETURN GList* gst_element_factory_get_pad_templates (GstElementFactory *factory); guint gst_element_factory_get_uri_type (GstElementFactory *factory); gchar** gst_element_factory_get_uri_protocols (GstElementFactory *factory); GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name); GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name); gboolean gst_element_factory_can_src_caps (GstElementFactory *factory, const GstCaps *caps); gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory, const GstCaps *caps); struct GstElementFactory; struct GstElementFactoryClass; #define GST_TYPE_ELEMENT_FACTORY #define GST_ELEMENT_FACTORY (obj) #define GST_ELEMENT_FACTORY_CLASS (klass) #define GST_IS_ELEMENT_FACTORY (obj) #define GST_IS_ELEMENT_FACTORY_CLASS (klass)
GObject +----GstObject +----GstElement
GObject +----GstPluginFeature +----GstElementFactory
"eos" void user_function (GstElement *gstelement, gpointer user_data); "error" void user_function (GstElement *gstelement, GstElement *arg1, GstGError *arg2, gchar *arg3, gpointer user_data); "found-tag" void user_function (GstElement *gstelement, GstElement *arg1, GstTagList *arg2, gpointer user_data); "new-pad" void user_function (GstElement *gstelement, GObject *arg1, gpointer user_data); "no-more-pads" void user_function (GstElement *gstelement, 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);
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().
struct GstElementClass { GstObjectClass parent_class; /* the element details */ GstElementDetails details; /* factory that the element was created from */ GstElementFactory *elementfactory; /* templates for our pads */ GList *padtemplates; gint numpadtemplates; /* signal callbacks */ void (*state_change) (GstElement *element, GstElementState old, GstElementState state); void (*new_pad) (GstElement *element, GstPad *pad); void (*pad_removed) (GstElement *element, GstPad *pad); void (*error) (GstElement *element, GstElement *source, GError *error, gchar *debug); void (*eos) (GstElement *element); void (*found_tag) (GstElement *element, GstElement *source, const GstTagList *tag_list); /* local pointers for get/set */ void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); void (*get_property) (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); /* vtable*/ gboolean (*release_locks) (GstElement *element); /* query/convert/events functions */ const GstEventMask* (*get_event_masks) (GstElement *element); gboolean (*send_event) (GstElement *element, GstEvent *event); const GstFormat* (*get_formats) (GstElement *element); gboolean (*convert) (GstElement *element, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value); const GstQueryType* (*get_query_types) (GstElement *element); gboolean (*query) (GstElement *element, GstQueryType type, GstFormat *format, gint64 *value); /* change the element state */ GstElementStateReturn (*change_state) (GstElement *element); /* request/release pads */ GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name); void (*release_pad) (GstElement *element, GstPad *pad); /* set/get clocks */ GstClock* (*get_clock) (GstElement *element); void (*set_clock) (GstElement *element, GstClock *clock); /* index */ GstIndex* (*get_index) (GstElement *element); void (*set_index) (GstElement *element, GstIndex *index); GstElementStateReturn (*set_state) (GstElement *element, GstElementState state); /* FIXME 0.9: move up to signals */ void (*no_more_pads) (GstElement *element); gpointer _gst_reserved[GST_PADDING - 1]; };
struct GstElementDetails { gchar *longname; /* long, english name */ gchar *klass; /* type of element, as hierarchy */ gchar *description; /* insights of one form or another */ gchar *author; /* who wrote this thing? */ gpointer _gst_reserved[GST_PADDING]; };
This struct is used to define public information about the element. It describes the element, mostly for the benefit of editors.
#define GST_ELEMENT_DETAILS(longname,klass,description,author)
longname : | |
klass : | |
description : | |
author : |
#define GST_STATE(obj) (GST_ELEMENT(obj)->current_state)
This macro returns the current state of the element.
obj : | Element to return state for. |
#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. |
#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 |
#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.
#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.
#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.
#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.
#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.
#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.
#define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
klass : |
#define GST_ELEMENT_QUERY_TYPE_FUNCTION(functionname, ...)
Helper macro to create query type functions
functionname : | The function name |
... : | list of query types. |
#define GST_ELEMENT_FORMATS_FUNCTION(functionname, ...)
Halper macro to create element format functions
functionname : | The function name |
... : | formats |
#define GST_ELEMENT_EVENT_MASK_FUNCTION(functionname, ...)
A helper macro to create a mask function
functionname : | the name of the mask function |
... : | Masks |
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, /* 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.
#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 |
#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 |
#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 |
#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 |
#define GST_ELEMENT_PARENT(obj) (GST_OBJECT_PARENT(obj))
Get the parent object of this element.
obj : | a GstElement to query |
#define GST_ELEMENT_MANAGER(obj) (((GstElement*)(obj))->manager)
Get the manager of this element.
obj : | a GstElement to query |
#define GST_ELEMENT_SCHED(obj) (((GstElement*)(obj))->sched)
Get the scheduler of this element.
obj : | a GstElement to query |
#define GST_ELEMENT_CLOCK(obj) (((GstElement*)(obj))->clock)
Get the clock of this element
obj : | a GstElement to query |
#define GST_ELEMENT_PADS(obj) ((obj)->pads)
Get the pads of this elements.
obj : | a GstElement to query |
#define GST_ELEMENT_ERROR(el, domain, code, message, debug)
el : | |
domain : | |
code : | |
message : | |
debug : |
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. |
void (*GstElementPreRunFunction) (GstElement *element);
The signature of the function to execute after this element is scheduled.
element : | The element |
void (*GstElementPostRunFunction) (GstElement *element);
The signature of the function to execute before this element is scheduled.
element : | The element |
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. |
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. |
void gst_element_class_set_details (GstElementClass *klass, const GstElementDetails *details);
Sets the detailed information for a GstElementClass.
klass : | class to set details for |
details : | details to set |
#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.
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.
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. |
#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. |
#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. |
#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. |
#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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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 |
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. |
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. |
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. |
GstClockTime gst_element_get_time (GstElement *element);
Query the element's time. The element must use
element : | element to query |
Returns : | the current time of the element or GST_CLOCK_TIME_NONE when there is no time available. |
gboolean gst_element_wait (GstElement *element, GstClockTime timestamp);
Waits until the given time has arrived. When this function returns successfully, the time specified in the timestamp has passed.
element : | element that should wait |
timestamp : | wait until this time has arrived |
Returns : | TRUE on success |
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 |
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 |
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 |
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. |
void gst_element_set_index (GstElement *element, GstIndex *index);
Set the specified GstIndex on the element.
element : | a GstElement. |
index : | a GstIndex. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
void gst_element_remove_pad (GstElement *element, GstPad *pad);
Removes pad from element. pad will be destroyed if it has not been referenced elsewhere.
element : | a GstElement to remove pad from. |
pad : | the GstPad to remove from the element. |
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. |
void gst_element_remove_ghost_pad (GstElement *element, GstPad *pad);
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. |
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. |
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. |
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. |
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. |
G_CONST_RETURN 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. |
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. |
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. |
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
Retrieves a padtemplate from element_class with the given name.
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. |
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.
element_class : | a GstElementClass to get pad templates of. |
Returns : | the GList of padtemplates. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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.
element : | element that found the tag |
pad : | src pad the tags correspond to |
timestamp : | time the tags were found |
list : | the taglist |
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. |
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 |
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. |
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 |
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. |
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. |
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). |
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. |
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. |
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. |
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. |
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 |
gboolean gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type);
Create a new elementfactory capable of instantiating objects of the given type.
plugin : | GstPlugin to register the element with |
name : | name of elements of this type |
rank : | rank of element (higher rank means more importance when autoplugging) |
type : | GType of element to register |
Returns : | TRUE, if the registering succeeded, FALSE on error |
GstElementFactory* gst_element_factory_find (const gchar *name);
Search for an element factory of the given name.
name : | name of factory to find |
Returns : | GstElementFactory if found, NULL otherwise |
GType gst_element_factory_get_element_type (GstElementFactory *factory);
Get the GType for elements managed by this factory
G_CONST_RETURN gchar* gst_element_factory_get_longname (GstElementFactory *factory);
Gets the longname for this factory
factory : | a GstElementFactory |
Returns : | the longname |
G_CONST_RETURN gchar* gst_element_factory_get_klass (GstElementFactory *factory);
factory : | |
Returns : |
G_CONST_RETURN gchar* gst_element_factory_get_description (GstElementFactory *factory);
Gets the description for this factory.
factory : | a GstElementFactory |
Returns : | the description |
G_CONST_RETURN gchar* gst_element_factory_get_author (GstElementFactory *factory);
Gets the author for this factory.
factory : | a GstElementFactory |
Returns : | the author |
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
Gets the number of pad_templates in this factory.
factory : | a GstElementFactory |
Returns : | the number of pad_templates |
G_CONST_RETURN GList* gst_element_factory_get_pad_templates (GstElementFactory *factory);
Gets the GList of padtemplates for this factory.
factory : | a GstElementFactory |
Returns : | the padtemplates |
guint gst_element_factory_get_uri_type (GstElementFactory *factory);
Gets the type of URIs the element supports or GST_URI_UNKNOWN if none.
factory : | a GstElementFactory |
Returns : | type of URIs this element supports |
gchar** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
Gets a NULL-terminated array of protocols this element supports or NULL, if no protocols are supported. You may not change the contents of the returned array as it is still ownt by the element factory. Use g_strdupv() if you want to.
factory : | a GstElementFactory |
Returns : | the supported protocols or NULL |
GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name);
Create a new element of the type defined by the given elementfactory. It will be given the name supplied, since all elements require a name as their first argument.
factory : | factory to instantiate |
name : | name of new element |
Returns : | new GstElement or NULL if the element couldn't be created |
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
Create a new element of the type defined by the given element factory. If name is NULL, then the element will receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will be given the name supplied.
factoryname : | a named factory to instantiate |
name : | name of new element |
Returns : | new GstElement or NULL if unable to create element |
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory, const GstCaps *caps);
Checks if the factory can source the given capability.
factory : | factory to query |
caps : | the caps to check |
Returns : | true if it can src the capabilities |
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory, const GstCaps *caps);
Checks if the factory can sink the given capability.
factory : | factory to query |
caps : | the caps to check |
Returns : | true if it can sink the capabilities |
struct GstElementFactoryClass { GstPluginFeatureClass parent_class; gpointer _gst_reserved[GST_PADDING]; };
#define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
obj : |
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. |
void user_function (GstElement *gstelement, GstElement *arg1, GstGError *arg2, gchar *arg3, gpointer user_data);
gstelement : | the object which received the signal. |
arg1 : | |
arg2 : | |
arg3 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (GstElement *gstelement, GstElement *arg1, GstTagList *arg2, gpointer user_data);
gstelement : | the object which received the signal. |
arg1 : | |
arg2 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (GstElement *gstelement, GObject *arg1, gpointer user_data);
gstelement : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
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. |
void user_function (GstElement *gstelement, GObject *arg1, gpointer user_data);
gstelement : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (GstElement *gstelement, gint arg1, gint arg2, gpointer user_data);
gstelement : | the object which received the signal. |
arg1 : | |
arg2 : | |
user_data : | user data set when the signal handler was connected. |
<< GstData | GstError >> |