![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Known Derived Interfaces | Signals |
#include <gst/gst.h> struct GstElement; struct GstElementClass; enum GstElementFlags; enum GstState; enum GstStateChange; enum GstStateChangeReturn; #define GST_STATE (elem) #define GST_STATE_GET_NEXT (cur, pending) #define GST_STATE_NEXT (elem) #define GST_STATE_PENDING (elem) #define GST_STATE_RETURN (elem) #define GST_STATE_TARGET (elem) #define GST_STATE_TRANSITION (cur, next) #define GST_STATE_TRANSITION_CURRENT (trans) #define GST_STATE_TRANSITION_NEXT (trans) #define GST_STATE_GET_LOCK (elem) #define GST_STATE_GET_COND (elem) #define GST_ELEMENT_NAME (elem) #define GST_ELEMENT_PARENT (elem) #define GST_ELEMENT_BUS (elem) #define GST_ELEMENT_CLOCK (elem) #define GST_ELEMENT_PADS (elem) #define GST_ELEMENT_START_TIME (elem) #define GST_ELEMENT_ERROR (el, domain, code, text, debug) #define GST_ELEMENT_WARNING (el, domain, code, text, debug) #define GST_ELEMENT_INFO (el, domain, code, text, debug) #define GST_ELEMENT_IS_LOCKED_STATE (elem) void gst_element_class_add_pad_template (GstElementClass *klass
,GstPadTemplate *templ
); GstPadTemplate * gst_element_class_get_pad_template (GstElementClass *element_class
,const gchar *name
); GList * gst_element_class_get_pad_template_list (GstElementClass *element_class
); void gst_element_class_install_std_props (GstElementClass *klass
,const gchar *first_name
,...
); void gst_element_class_set_details (GstElementClass *klass
,const GstElementDetails *details
); void gst_element_class_set_details_simple (GstElementClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
); void gst_element_class_set_documentation_uri (GstElementClass *klass
,const gchar *uri
); void gst_element_class_set_icon_name (GstElementClass *klass
,const gchar *name
); gboolean gst_element_add_pad (GstElement *element
,GstPad *pad
); GstPad * gst_element_get_pad (GstElement *element
,const gchar *name
); void gst_element_create_all_pads (GstElement *element
); GstPad * gst_element_get_compatible_pad (GstElement *element
,GstPad *pad
,const GstCaps *caps
); GstPadTemplate * gst_element_get_compatible_pad_template (GstElement *element
,GstPadTemplate *compattempl
); GstPad * gst_element_get_request_pad (GstElement *element
,const gchar *name
); GstPad * gst_element_get_static_pad (GstElement *element
,const gchar *name
); GstPad * gst_element_request_pad (GstElement *element
,GstPadTemplate *templ
,const gchar *name
,const GstCaps *caps
); void gst_element_no_more_pads (GstElement *element
); void gst_element_release_request_pad (GstElement *element
,GstPad *pad
); gboolean gst_element_remove_pad (GstElement *element
,GstPad *pad
); GstIterator * gst_element_iterate_pads (GstElement *element
); GstIterator * gst_element_iterate_sink_pads (GstElement *element
); GstIterator * gst_element_iterate_src_pads (GstElement *element
); gboolean gst_element_link (GstElement *src
,GstElement *dest
); void gst_element_unlink (GstElement *src
,GstElement *dest
); gboolean gst_element_link_many (GstElement *element_1
,GstElement *element_2
,...
); 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_full (GstElement *src
,const gchar *srcpadname
,GstElement *dest
,const gchar *destpadname
,GstPadLinkCheck flags
); void gst_element_unlink_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 *filter
); gboolean gst_element_link_filtered (GstElement *src
,GstElement *dest
,GstCaps *filter
); void gst_element_set_base_time (GstElement *element
,GstClockTime time
); GstClockTime gst_element_get_base_time (GstElement *element
); void gst_element_set_start_time (GstElement *element
,GstClockTime time
); GstClockTime gst_element_get_start_time (GstElement *element
); void gst_element_set_bus (GstElement *element
,GstBus *bus
); GstBus * gst_element_get_bus (GstElement *element
); GstElementFactory * gst_element_get_factory (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
); #define gst_element_set_name (elem, name) #define gst_element_get_name (elem) #define gst_element_set_parent (elem, parent) #define gst_element_get_parent (elem) gboolean gst_element_requires_clock (GstElement *element
); gboolean gst_element_set_clock (GstElement *element
,GstClock *clock
); GstClock * gst_element_get_clock (GstElement *element
); gboolean gst_element_provides_clock (GstElement *element
); GstClock * gst_element_provide_clock (GstElement *element
); GstStateChangeReturn gst_element_set_state (GstElement *element
,GstState state
); GstStateChangeReturn gst_element_get_state (GstElement *element
,GstState *state
,GstState *pending
,GstClockTime timeout
); gboolean gst_element_set_locked_state (GstElement *element
,gboolean locked_state
); gboolean gst_element_is_locked_state (GstElement *element
); void gst_element_abort_state (GstElement *element
); GstStateChangeReturn gst_element_continue_state (GstElement *element
,GstStateChangeReturn ret
); void gst_element_lost_state (GstElement *element
); void gst_element_lost_state_full (GstElement *element
,gboolean new_base_time
); const gchar * gst_element_state_get_name (GstState state
); const gchar * gst_element_state_change_return_get_name (GstStateChangeReturn state_ret
); gboolean gst_element_sync_state_with_parent (GstElement *element
); GstStateChangeReturn gst_element_change_state (GstElement *element
,GstStateChange transition
); void gst_element_found_tags (GstElement *element
,GstTagList *list
); void gst_element_found_tags_for_pad (GstElement *element
,GstPad *pad
,GstTagList *list
); void gst_element_message_full (GstElement *element
,GstMessageType type
,GQuark domain
,gint code
,gchar *text
,gchar *debug
,const gchar *file
,const gchar *function
,gint line
); gboolean gst_element_post_message (GstElement *element
,GstMessage *message
); const GstQueryType * gst_element_get_query_types (GstElement *element
); gboolean gst_element_query (GstElement *element
,GstQuery *query
); gboolean gst_element_query_convert (GstElement *element
,GstFormat src_format
,gint64 src_val
,GstFormat *dest_format
,gint64 *dest_val
); gboolean gst_element_query_position (GstElement *element
,GstFormat *format
,gint64 *cur
); gboolean gst_element_query_duration (GstElement *element
,GstFormat *format
,gint64 *duration
); gboolean gst_element_send_event (GstElement *element
,GstEvent *event
); gboolean gst_element_seek_simple (GstElement *element
,GstFormat format
,GstSeekFlags seek_flags
,gint64 seek_pos
); gboolean gst_element_seek (GstElement *element
,gdouble rate
,GstFormat format
,GstSeekFlags flags
,GstSeekType cur_type
,gint64 cur
,GstSeekType stop_type
,gint64 stop
);
GstElement is the abstract base class needed to construct an element that can be used in a GStreamer pipeline. Please refer to the plugin writers guide for more information on creating GstElement subclasses.
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 when using the appropriate locking. 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. GstBuffer 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()
.
An existing pad of an element can be retrieved by name with
gst_element_get_static_pad()
. A new dynamic pad can be created using
gst_element_request_pad()
with a GstPadTemplate or
gst_element_get_request_pad()
with the template name such as "src_%d".
An iterator of all pads can be retrieved with gst_element_iterate_pads()
.
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 GstState). You can get and set the state
of an element with gst_element_get_state()
and gst_element_set_state()
.
Setting a state triggers a GstStateChange. To get a string representation
of a GstState, 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()
.
Some elements can provide a clock for the pipeline if
gst_element_provides_clock()
returns TRUE
. With the
gst_element_provide_clock()
method one can retrieve the clock provided by
such an element.
Not all elements require a clock to operate correctly. If
gst_element_requires_clock()
returns TRUE
, a clock should be set on the
element with gst_element_set_clock()
.
Note that clock slection and distribution is normally handled by the toplevel GstPipeline so the clock functions are only to be used in very specific situations.
Last reviewed on 2009-05-29 (0.10.24)
struct GstElement { GStaticRecMutex *state_lock; /* element state */ GCond *state_cond; guint32 state_cookie; GstState current_state; GstState next_state; GstState pending_state; GstStateChangeReturn last_return; GstBus *bus; /* allocated clock */ GstClock *clock; GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */ /* element pads, these lists can only be iterated while holding * the LOCK or checking the cookie after each LOCK. */ guint16 numpads; GList *pads; guint16 numsrcpads; GList *srcpads; guint16 numsinkpads; GList *sinkpads; guint32 pads_cookie; };
GStreamer element abstract base class.
Used to serialize execution of gst_element_set_state()
|
|
Used to signal completion of a state change | |
Used to detect concurrent execution of
gst_element_set_state() and gst_element_get_state()
|
|
GstState |
the current state of an element |
GstState |
the next state of an element, can be GST_STATE_VOID_PENDING if the element is in the correct state. |
GstState |
the final state the element should go to, can be GST_STATE_VOID_PENDING if the element is in the correct state |
GstStateChangeReturn |
the last return value of an element state change |
GstBus * |
the bus of the element. This bus is provided to the element by the parent element or the application. A GstPipeline has a bus of its own. |
GstClock * |
the clock of the element. This clock is usually provided to the element by the toplevel GstPipeline. |
GstClockTimeDiff |
the time of the clock right before the element is set to
PLAYING. Subtracting base_time from the current clock time in the PLAYING
state will yield the running_time against the clock. |
number of pads of the element, includes both source and sink pads. | |
list of pads | |
number of source pads of the element. | |
list of source pads | |
number of sink pads of the element. | |
list of sink pads | |
updated whenever the a pad is added or removed |
struct GstElementClass { GstObjectClass parent_class; /* the element details */ /* FIXME-0.11: deprecate this in favour of meta_data */ GstElementDetails details; /* factory that the element was created from */ GstElementFactory *elementfactory; /* templates for our pads */ GList *padtemplates; gint numpadtemplates; guint32 pad_templ_cookie; /* virtual methods for subclasses */ /* request/release pads */ GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name); void (*release_pad) (GstElement *element, GstPad *pad); /* state changes */ GstStateChangeReturn (*get_state) (GstElement * element, GstState * state, GstState * pending, GstClockTime timeout); GstStateChangeReturn (*set_state) (GstElement *element, GstState state); GstStateChangeReturn (*change_state) (GstElement *element, GstStateChange transition); /* bus */ void (*set_bus) (GstElement * element, GstBus * bus); /* set/get clocks */ GstClock* (*provide_clock) (GstElement *element); gboolean (*set_clock) (GstElement *element, GstClock *clock); /* index */ GstIndex* (*get_index) (GstElement *element); void (*set_index) (GstElement *element, GstIndex *index); /* query functions */ gboolean (*send_event) (GstElement *element, GstEvent *event); const GstQueryType* (*get_query_types) (GstElement *element); gboolean (*query) (GstElement *element, GstQuery *query); /* Virtual method for subclasses (additions) */ /* FIXME-0.11 Make this the default behaviour */ GstPad* (*request_new_pad_full) (GstElement *element, GstPadTemplate *templ, const gchar* name, const GstCaps *caps); void (*state_changed) (GstElement *element, GstState oldstate, GstState newstate, GstState pending); };
GStreamer element class. Override the vmethods to implement the element functionality.
GstObjectClass |
the parent class structure |
GstElementDetails |
GstElementDetails for elements of this class |
GstElementFactory * |
the GstElementFactory that creates these elements |
a GList of GstPadTemplate | |
the number of padtemplates | |
changed whenever the padtemplates change | |
called when a new pad is requested | |
called when a request pad is to be released | |
get the state of the element | |
set a new state on the element | |
called by set_state to perform an incremental state change |
|
set a GstBus on the element | |
gets the GstClock provided by the element | |
set the GstClock on the element | |
set a GstIndex on the element | |
get the GstIndex of an element | |
send a GstEvent to the element | |
get the supported GstQueryType of this element | |
perform a GstQuery on the element | |
called when a new pad is requested. Since: 0.10.32. | |
called immediately after a new state was set. Since: 0.10.36. |
typedef enum { GST_ELEMENT_LOCKED_STATE = (GST_OBJECT_FLAG_LAST << 0), GST_ELEMENT_IS_SINK = (GST_OBJECT_FLAG_LAST << 1), GST_ELEMENT_UNPARENTING = (GST_OBJECT_FLAG_LAST << 2), GST_ELEMENT_IS_SOURCE = (GST_OBJECT_FLAG_LAST << 3), /* padding */ GST_ELEMENT_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16) } GstElementFlags;
The standard flags that an element may have.
ignore state changes from parent | |
the element is a sink | |
Child is being removed from the parent bin.
gst_bin_remove() on a child already being removed immediately returns FALSE
|
|
the element is a source. Since 0.10.31 | |
offset to define more flags |
typedef enum { GST_STATE_VOID_PENDING = 0, GST_STATE_NULL = 1, GST_STATE_READY = 2, GST_STATE_PAUSED = 3, GST_STATE_PLAYING = 4 } GstState;
The possible states an element can be in. States can be changed using
gst_element_set_state()
and checked using gst_element_get_state()
.
no pending state. | |
the NULL state or initial state of an element. | |
the element is ready to go to PAUSED. | |
the element is PAUSED, it is ready to accept and process data. Sink elements however only accept one buffer and then block. | |
the element is PLAYING, the GstClock is running and the data is flowing. |
typedef enum { GST_STATE_CHANGE_NULL_TO_READY = (GST_STATE_NULL<<3) | GST_STATE_READY, GST_STATE_CHANGE_READY_TO_PAUSED = (GST_STATE_READY<<3) | GST_STATE_PAUSED, GST_STATE_CHANGE_PAUSED_TO_PLAYING = (GST_STATE_PAUSED<<3) | GST_STATE_PLAYING, GST_STATE_CHANGE_PLAYING_TO_PAUSED = (GST_STATE_PLAYING<<3) | GST_STATE_PAUSED, GST_STATE_CHANGE_PAUSED_TO_READY = (GST_STATE_PAUSED<<3) | GST_STATE_READY, GST_STATE_CHANGE_READY_TO_NULL = (GST_STATE_READY<<3) | GST_STATE_NULL } GstStateChange;
These are the different state changes an element goes through.
GST_STATE_NULL
⇒ GST_STATE_PLAYING
is called an upwards state change
and GST_STATE_PLAYING
⇒ GST_STATE_NULL
a downwards state change.
state change from NULL to READY.
|
|
state change from READY to PAUSED.
|
|
state change from PAUSED to PLAYING.
|
|
state change from PLAYING to PAUSED.
|
|
state change from PAUSED to READY.
|
|
state change from READY to NULL.
|
typedef enum { GST_STATE_CHANGE_FAILURE = 0, GST_STATE_CHANGE_SUCCESS = 1, GST_STATE_CHANGE_ASYNC = 2, GST_STATE_CHANGE_NO_PREROLL = 3 } GstStateChangeReturn;
The possible return values from a state change function such as
gst_element_set_state()
. Only GST_STATE_CHANGE_FAILURE
is a real failure.
the state change failed | |
the state change succeeded | |
the state change will happen asynchronously | |
the state change succeeded but the element
cannot produce data in GST_STATE_PAUSED .
This typically happens with live sources.
|
#define GST_STATE(elem) (GST_ELEMENT_CAST(elem)->current_state)
This macro returns the current GstState of the element.
|
a GstElement to return state for. |
#define GST_STATE_GET_NEXT(cur,pending) ((GstState)((cur) + __GST_SIGN ((gint)(pending) - (gint)(cur))))
Given a current state cur
and a target state pending
, calculate the next (intermediate)
GstState.
#define GST_STATE_NEXT(elem) (GST_ELEMENT_CAST(elem)->next_state)
This macro returns the next GstState of the element.
|
a GstElement to return the next state for. |
#define GST_STATE_PENDING(elem) (GST_ELEMENT_CAST(elem)->pending_state)
This macro returns the currently pending GstState of the element.
|
a GstElement to return the pending state for. |
#define GST_STATE_RETURN(elem) (GST_ELEMENT_CAST(elem)->last_return)
This macro returns the last GstStateChangeReturn value.
|
a GstElement to return the last state result for. |
#define GST_STATE_TARGET(elem) (GST_ELEMENT_CAST(elem)->abidata.ABI.target_state)
This macro returns the target GstState of the element.
|
a GstElement to return the target state for. |
Since 0.10.13
#define GST_STATE_TRANSITION(cur,next) ((GstStateChange)(((cur)<<3)|(next)))
Given a current state cur
and a next state next
, calculate the associated
GstStateChange transition.
|
A current state |
|
A next state |
#define GST_STATE_TRANSITION_CURRENT(trans) ((GstState)((trans)>>3))
Given a state transition trans
, extract the current GstState.
|
A GstStateChange |
#define GST_STATE_TRANSITION_NEXT(trans) ((GstState)((trans)&0x7))
Given a state transition trans
, extract the next GstState.
|
A GstStateChange |
#define GST_STATE_GET_LOCK(elem) (GST_ELEMENT_CAST(elem)->state_lock)
Get a reference to the state lock of elem
.
This lock is used by the core. It is taken while getting or setting
the state, during state changes, and while finalizing.
|
a GstElement |
#define GST_STATE_GET_COND(elem) (GST_ELEMENT_CAST(elem)->state_cond)
Get the conditional used to signal the completion of a state change.
|
a GstElement |
#define GST_ELEMENT_NAME(elem) (GST_OBJECT_NAME(elem))
Gets the name of this element. Use only in core as this is not
ABI-compatible. Others use gst_element_get_name()
|
A GstElement to query |
#define GST_ELEMENT_PARENT(elem) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(elem)))
Get the parent object of this element.
|
A GstElement to query |
#define GST_ELEMENT_BUS(elem) (GST_ELEMENT_CAST(elem)->bus)
Get the message bus of this element.
|
A GstElement to query |
#define GST_ELEMENT_CLOCK(elem) (GST_ELEMENT_CAST(elem)->clock)
Get the clock of this element
|
A GstElement to query |
#define GST_ELEMENT_PADS(elem) (GST_ELEMENT_CAST(elem)->pads)
Get the pads of this elements.
|
A GstElement to query |
#define GST_ELEMENT_START_TIME(elem) (GST_ELEMENT_CAST(elem)->abidata.ABI.start_time)
This macro returns the start_time of the elem
. The start_time is the
running_time of the pipeline when the element went to PAUSED.
|
a GstElement to return the start time for. |
Since 0.10.24
#define GST_ELEMENT_ERROR(el, domain, code, text, debug)
Utility function that elements can use in case they encountered a fatal data processing error. The pipeline will post an error message and the application will be requested to stop further media processing.
|
the element that generates the error |
|
like CORE, LIBRARY, RESOURCE or STREAM (see gstreamer-GstGError) |
|
error code defined for that domain (see gstreamer-GstGError) |
|
the message to display (format string and args enclosed in parentheses) |
|
debugging information for the message (format string and args enclosed in parentheses) |
#define GST_ELEMENT_WARNING(el, domain, code, text, debug)
Utility function that elements can use in case they encountered a non-fatal data processing problem. The pipeline will post a warning message and the application will be informed.
|
the element that generates the warning |
|
like CORE, LIBRARY, RESOURCE or STREAM (see gstreamer-GstGError) |
|
error code defined for that domain (see gstreamer-GstGError) |
|
the message to display (format string and args enclosed in parentheses) |
|
debugging information for the message (format string and args enclosed in parentheses) |
#define GST_ELEMENT_INFO(el, domain, code, text, debug)
Utility function that elements can use in case they want to inform the application of something noteworthy that is not an error. The pipeline will post a info message and the application will be informed.
|
the element that generates the information |
|
like CORE, LIBRARY, RESOURCE or STREAM (see gstreamer-GstGError) |
|
error code defined for that domain (see gstreamer-GstGError) |
|
the message to display (format string and args enclosed in parentheses) |
|
debugging information for the message (format string and args enclosed in parentheses) |
Since 0.10.12
#define GST_ELEMENT_IS_LOCKED_STATE(elem) (GST_OBJECT_FLAG_IS_SET(elem,GST_ELEMENT_LOCKED_STATE))
Check if the element is in the locked state and therefore will ignore state changes from its parent object.
|
A GstElement to query |
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.
|
the GstElementClass to add the pad template to. |
|
a GstPadTemplate to add to the element class. [transfer none] |
GstPadTemplate * gst_element_class_get_pad_template (GstElementClass *element_class
,const gchar *name
);
Retrieves a padtemplate from element_class
with the given name.
|
a GstElementClass to get the pad template of. |
|
the name of the GstPadTemplate to get. |
Returns : |
the GstPadTemplate with the given name, or NULL
if none was found. No unreferencing is necessary. [transfer none]
|
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.
|
a GstElementClass to get pad templates of. |
Returns : |
the GList of pad templates. [transfer none][element-type Gst.PadTemplate] |
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.
|
the GstElementClass to add the properties to. |
|
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
);
gst_element_class_set_details
is deprecated and should not be used in newly-written code. Use gst_element_class_set_details_simple()
instead.
Sets the detailed information for a GstElementClass.
The details
are copied.
|
class to set details for |
|
details to set |
void gst_element_class_set_details_simple (GstElementClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
);
Sets the detailed information for a GstElementClass. Simpler version of
gst_element_class_set_details()
that generates less linker overhead.
The detail parameter strings are copied into the GstElementDetails for the element class.
|
class to set details for |
|
The long English name of the element. E.g. "File Sink" |
|
String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File" |
|
Sentence describing the purpose of the element. E.g: "Write stream to a file" |
|
Name and contact details of the author(s). Use \n to separate multiple author details. E.g: "Joe Bloggs <joe.blogs at foo.com>" |
Since 0.10.14
void gst_element_class_set_documentation_uri (GstElementClass *klass
,const gchar *uri
);
Set uri pointing to user documentation. Applications can use this to show help for e.g. effects to users.
|
class to set details for |
|
uri of element documentation |
Since 0.10.31
void gst_element_class_set_icon_name (GstElementClass *klass
,const gchar *name
);
Elements that bridge to certain other products can include an icon of that used product. Application can show the icon in menus/selectors to help identifying specific elements.
|
class to set details for |
|
name of an icon |
Since 0.10.31
gboolean 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 not automatically activated so elements should perform the needed
steps to activate the pad in case this pad is added in the PAUSED or PLAYING
state. See gst_pad_set_active()
for more information about activating pads.
The pad and the element should be unlocked when calling this function.
This function will emit the "pad-added" signal on the element.
|
a GstElement to add the pad to. |
|
the GstPad to add to the element. [transfer full] |
Returns : |
TRUE if the pad could be added. This function can fail when
a pad with the same name already existed or the pad already had another
parent.
MT safe. |
GstPad * gst_element_get_pad (GstElement *element
,const gchar *name
);
gst_element_get_pad
is deprecated and should not be used in newly-written code. This function is deprecated as it's unclear if the reference
to the result pad should be released with gst_object_unref()
in case of a static pad
or gst_element_release_request_pad()
in case of a request pad.
Use gst_element_get_static_pad()
or gst_element_get_request_pad()
instead.
Retrieves a pad from element
by name. Tries gst_element_get_static_pad()
first, then gst_element_get_request_pad()
.
|
a GstElement. |
|
the name of the pad to retrieve. |
Returns : |
the GstPad if found, otherwise NULL . Unref or Release after usage,
depending on the type of the pad. [transfer full]
|
void gst_element_create_all_pads (GstElement *element
);
Creates a pad for each pad template that is always available. This function is only useful during object initialization of subclasses of GstElement.
|
a GstElement to create pads for. [transfer none] |
GstPad * gst_element_get_compatible_pad (GstElement *element
,GstPad *pad
,const GstCaps *caps
);
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.
This function will first attempt to find a compatible unlinked ALWAYS pad,
and if none can be found, it will request a compatible REQUEST pad by looking
at the templates of element
.
|
a GstElement in which the pad should be found. [transfer none] |
|
the GstPad to find a compatible one for. [transfer none] |
|
the GstCaps to use as a filter. |
Returns : |
the GstPad to which a link can be made, or NULL
if one cannot be found. gst_object_unref() after usage. [transfer full]
|
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.
|
a GstElement to get a compatible pad template for. [transfer none] |
|
the GstPadTemplate to find a compatible template for. [transfer none] |
Returns : |
a compatible GstPadTemplate, or NULL if none was found. No unreferencing is necessary. [transfer none] |
GstPad * gst_element_get_request_pad (GstElement *element
,const gchar *name
);
Retrieves a pad from the element by name (e.g. "src_%d"). This version only
retrieves request pads. The pad should be released with
gst_element_release_request_pad()
.
This method is slow and will be deprecated in the future. New code should
use gst_element_request_pad()
with the requested template.
|
a GstElement to find a request pad of. |
|
the name of the request GstPad to retrieve. |
Returns : |
requested GstPad if found, otherwise NULL .
Release after usage. [transfer full]
|
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.
|
a GstElement to find a static pad of. |
|
the name of the static GstPad to retrieve. |
Returns : |
the requested GstPad if found, otherwise NULL .
unref after usage.
MT safe. [transfer full]
|
GstPad * gst_element_request_pad (GstElement *element
,GstPadTemplate *templ
,const gchar *name
,const GstCaps *caps
);
Retrieves a request pad from the element according to the provided template.
Pad templates can be looked up using
gst_element_factory_get_static_pad_templates()
.
If the caps
are specified and the element implements thew new
request_new_pad_full virtual method, the element will use them to select
which pad to create.
The pad should be released with gst_element_release_request_pad()
.
|
a GstElement to find a request pad of. |
|
a GstPadTemplate of which we want a pad of. |
|
the name of the request GstPad
to retrieve. Can be NULL . [transfer none][allow-none]
|
|
the caps of the pad we want to
request. Can be NULL . [transfer none][allow-none]
|
Returns : |
requested GstPad if found, otherwise NULL .
Release after usage. [transfer full]
|
Since 0.10.32
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.
This function emits the "no-more-pads" signal.
MT safe.
|
a GstElement |
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()
.
This does not unref the pad. If the pad was created by using
gst_element_get_request_pad()
, gst_element_release_request_pad()
needs to be
followed by gst_object_unref()
to free the pad
.
MT safe.
|
a GstElement to release the request pad of. |
|
the GstPad to release. |
gboolean gst_element_remove_pad (GstElement *element
,GstPad *pad
);
Removes pad
from element
. pad
will be destroyed if it has not been
referenced elsewhere using gst_object_unparent()
.
This function is used by plugin developers and should not be used
by applications. Pads that were dynamically requested from elements
with gst_element_get_request_pad()
should be released with the
gst_element_release_request_pad()
function instead.
Pads are not automatically deactivated so elements should perform the needed
steps to deactivate the pad in case this pad is removed in the PAUSED or
PLAYING state. See gst_pad_set_active()
for more information about
deactivating pads.
The pad and the element should be unlocked when calling this function.
This function will emit the "pad-removed" signal on the element.
|
a GstElement to remove pad from. |
|
the GstPad to remove from the element. [transfer none] |
Returns : |
TRUE if the pad could be removed. Can return FALSE if the
pad does not belong to the provided element.
MT safe. |
GstIterator * gst_element_iterate_pads (GstElement *element
);
Retrieves an iterator of element
's pads. The iterator should
be freed after usage. Also more specialized iterators exists such as
gst_element_iterate_src_pads()
or gst_element_iterate_sink_pads()
.
|
a GstElement to iterate pads of. |
Returns : |
the GstIterator of GstPad. Unref each pad after use. MT safe. [transfer full] |
GstIterator * gst_element_iterate_sink_pads (GstElement *element
);
Retrieves an iterator of element
's sink pads.
|
a GstElement. |
Returns : |
the GstIterator of GstPad. Unref each pad after use. MT safe. [transfer full] |
GstIterator * gst_element_iterate_src_pads (GstElement *element
);
Retrieves an iterator of element
's source pads.
|
a GstElement. |
Returns : |
the GstIterator of GstPad. Unref each pad after use. MT safe. [transfer full] |
gboolean gst_element_link (GstElement *src
,GstElement *dest
);
Links src
to dest
. 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.
Such pads need to be released manually when unlinking.
If multiple links are possible, only one is established.
Make sure you have added your elements to a bin or pipeline with
gst_bin_add()
before trying to link them.
|
a GstElement containing the source pad. [transfer none] |
|
the GstElement containing the destination pad. [transfer none] |
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.
If the link has been made using gst_element_link()
, it could have created an
requestpad, which has to be released using gst_element_release_request_pad()
.
|
the source GstElement to unlink. [transfer none] |
|
the sink GstElement to unlink. [transfer none] |
gboolean gst_element_link_many (GstElement *element_1
,GstElement *element_2
,...
);
Chain together a series of elements. Uses gst_element_link()
.
Make sure you have added your elements to a bin or pipeline with
gst_bin_add()
before trying to link them.
|
the first GstElement in the link chain. [transfer none] |
|
the second GstElement in the link chain. [transfer none] |
|
the NULL-terminated list of elements to link in order. |
Returns : |
TRUE on success, FALSE otherwise. |
void gst_element_unlink_many (GstElement *element_1
,GstElement *element_2
,...
);
Unlinks a series of elements. Uses gst_element_unlink()
.
|
the first GstElement in the link chain. [transfer none] |
|
the second GstElement in the link chain. [transfer none] |
|
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.
|
a GstElement containing the source pad. |
|
the name of the GstPad in source element or NULL for any pad. [allow-none] |
|
the GstElement containing the destination pad. [transfer none] |
|
the name of the GstPad in destination element, or NULL for any pad. [allow-none] |
Returns : |
TRUE if the pads could be linked, FALSE otherwise. |
gboolean gst_element_link_pads_full (GstElement *src
,const gchar *srcpadname
,GstElement *dest
,const gchar *destpadname
,GstPadLinkCheck flags
);
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.
Calling gst_element_link_pads_full()
with flags
== GST_PAD_LINK_CHECK_DEFAULT
is the same as calling gst_element_link_pads()
and the recommended way of
linking pads with safety checks applied.
This is a convenience function for gst_pad_link_full()
.
|
a GstElement containing the source pad. |
|
the name of the GstPad in source element or NULL for any pad. [allow-none] |
|
the GstElement containing the destination pad. [transfer none] |
|
the name of the GstPad in destination element, or NULL for any pad. [allow-none] |
|
the GstPadLinkCheck to be performed when linking pads. |
Returns : |
TRUE if the pads could be linked, FALSE otherwise. |
Since 0.10.30
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.
This is a convenience function for gst_pad_unlink()
.
|
a (transfer none): GstElement containing the source pad. |
|
the name of the GstPad in source element. |
|
a GstElement containing the destination pad. [transfer none] |
|
the name of the GstPad in destination element. |
gboolean gst_element_link_pads_filtered (GstElement *src
,const gchar *srcpadname
,GstElement *dest
,const gchar *destpadname
,GstCaps *filter
);
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. If caps
is not NULL, makes sure that the caps of the link is a subset of caps
.
|
a GstElement containing the source pad. |
|
the name of the GstPad in source element or NULL for any pad. [allow-none] |
|
the GstElement containing the destination pad. [transfer none] |
|
the name of the GstPad in destination element or NULL for any pad. [allow-none] |
|
the GstCaps to filter the link, or NULL for no filter. [transfer none][allow-none] |
Returns : |
TRUE if the pads could be linked, FALSE otherwise. |
gboolean gst_element_link_filtered (GstElement *src
,GstElement *dest
,GstCaps *filter
);
Links src
to dest
using the given caps as 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.
Make sure you have added your elements to a bin or pipeline with
gst_bin_add()
before trying to link them.
|
a GstElement containing the source pad. |
|
the GstElement containing the destination pad. [transfer none] |
|
the GstCaps to filter the link, or NULL for no filter. [transfer none][allow-none] |
Returns : |
TRUE if the pads could be linked, FALSE otherwise. |
void gst_element_set_base_time (GstElement *element
,GstClockTime time
);
Set the base time of an element. See gst_element_get_base_time()
.
MT safe.
|
a GstElement. |
|
the base time to set. |
GstClockTime gst_element_get_base_time (GstElement *element
);
Returns the base time of the element. The base time is the absolute time of the clock when this element was last put to PLAYING. Subtracting the base time from the clock time gives the running time of the element.
|
a GstElement. |
Returns : |
the base time of the element. MT safe. |
void gst_element_set_start_time (GstElement *element
,GstClockTime time
);
Set the start time of an element. The start time of the element is the running time of the element when it last went to the PAUSED state. In READY or after a flushing seek, it is set to 0.
Toplevel elements like GstPipeline will manage the start_time and base_time on its children. Setting the start_time to GST_CLOCK_TIME_NONE on such a toplevel element will disable the distribution of the base_time to the children and can be useful if the application manages the base_time itself, for example if you want to synchronize capture from multiple pipelines, and you can also ensure that the pipelines have the same clock.
MT safe.
|
a GstElement. |
|
the base time to set. |
Since 0.10.24
GstClockTime gst_element_get_start_time (GstElement *element
);
Returns the start time of the element. The start time is the running time of the clock when this element was last put to PAUSED.
Usually the start_time is managed by a toplevel element such as GstPipeline.
MT safe.
|
a GstElement. |
Returns : |
the start time of the element. |
Since 0.10.24
void gst_element_set_bus (GstElement *element
,GstBus *bus
);
Sets the bus of the element. Increases the refcount on the bus. For internal use only, unless you're testing elements.
MT safe.
|
a GstElement to set the bus of. |
|
the GstBus to set. [transfer none] |
GstBus * gst_element_get_bus (GstElement *element
);
Returns the bus of the element. Note that only a GstPipeline will provide a bus for the application.
|
a GstElement to get the bus of. |
Returns : |
the element's GstBus. unref after usage. MT safe. [transfer full] |
GstElementFactory * gst_element_get_factory (GstElement *element
);
Retrieves the factory that was used to create this element.
|
a GstElement to request the element factory of. |
Returns : |
the GstElementFactory used for creating this element. no refcounting is needed. [transfer none] |
void gst_element_set_index (GstElement *element
,GstIndex *index
);
Set index
on the element. The refcount of the index
will be increased, any previously set index is unreffed.
MT safe.
|
a GstElement. |
|
a GstIndex. [transfer none] |
GstIndex * gst_element_get_index (GstElement *element
);
Gets the index from the element.
|
a GstElement. |
Returns : |
a GstIndex or NULL when no index was set on the
element. unref after usage.
MT safe. [transfer full]
|
gboolean gst_element_is_indexable (GstElement *element
);
Queries if the element can be indexed.
|
a GstElement. |
Returns : |
TRUE if the element can be indexed. MT safe. |
#define gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT_CAST(elem),name)
Sets the name of the element, getting rid of the old name if there was one.
|
a GstElement to set the name of. |
|
the new name |
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT_CAST(elem))
Returns a copy of the name of elem
.
Caller should g_free()
the return value after usage.
For a nameless element, this returns NULL, which you can safely g_free()
as well.
|
a GstElement to get the name of elem . |
Returns : |
the name of elem . g_free() after usage. MT safe. [transfer full]
|
#define gst_element_set_parent(elem,parent) gst_object_set_parent(GST_OBJECT_CAST(elem),parent)
Sets the parent of an element.
|
a GstElement to set the parent of. |
|
the new parent GstObject of the element. |
#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT_CAST(elem))
Get the parent of an element.
|
a GstElement to get the parent of. |
Returns : |
the parent of an element. [transfer full] |
gboolean gst_element_requires_clock (GstElement *element
);
Query if the element requires a clock.
|
a GstElement to query |
Returns : |
TRUE if the element requires a clock
MT safe. |
gboolean gst_element_set_clock (GstElement *element
,GstClock *clock
);
Sets the clock for the element. This function increases the refcount on the clock. Any previously set clock on the object is unreffed.
|
a GstElement to set the clock for. |
|
the GstClock to set for the element. |
Returns : |
TRUE if the element accepted the clock. An element can refuse a
clock when it, for example, is not able to slave its internal clock to the
clock or when it requires a specific clock to operate.
MT safe. |
GstClock * gst_element_get_clock (GstElement *element
);
Gets the currently configured clock of the element. This is the clock as was
last set with gst_element_set_clock()
.
|
a GstElement to get the clock of. |
Returns : |
the GstClock of the element. unref after usage. MT safe. [transfer full] |
gboolean gst_element_provides_clock (GstElement *element
);
Query if the element provides a clock. A GstClock provided by an element can be used as the global GstClock for the pipeline. An element that can provide a clock is only required to do so in the PAUSED state, this means when it is fully negotiated and has allocated the resources to operate the clock.
|
a GstElement to query |
Returns : |
TRUE if the element provides a clock
MT safe. |
GstClock * gst_element_provide_clock (GstElement *element
);
Get the clock provided by the given element.
|
a GstElement to query |
Returns : |
the GstClock provided by the element or NULL
if no clock could be provided. Unref after usage.
MT safe. [transfer full]
|
GstStateChangeReturn gst_element_set_state (GstElement *element
,GstState 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.
This function can return GST_STATE_CHANGE_ASYNC, in which case the
element will perform the remainder of the state change asynchronously in
another thread.
An application can use gst_element_get_state()
to wait for the completion
of the state change or it can wait for a state change message on the bus.
State changes to GST_STATE_READY
or GST_STATE_NULL
never return
GST_STATE_CHANGE_ASYNC.
|
a GstElement to change state of. |
|
the element's new GstState. |
Returns : |
Result of the state change using GstStateChangeReturn. MT safe. |
GstStateChangeReturn gst_element_get_state (GstElement *element
,GstState *state
,GstState *pending
,GstClockTime timeout
);
Gets the state of the element.
For elements that performed an ASYNC state change, as reported by
gst_element_set_state()
, this function will block up to the
specified timeout value for the state change to complete.
If the element completes the state change or goes into
an error, this function returns immediately with a return value of
GST_STATE_CHANGE_SUCCESS
or GST_STATE_CHANGE_FAILURE
respectively.
For elements that did not return GST_STATE_CHANGE_ASYNC
, this function
returns the current and pending state immediately.
This function returns GST_STATE_CHANGE_NO_PREROLL
if the element
successfully changed its state but is not able to provide data yet.
This mostly happens for live sources that only produce data in
GST_STATE_PLAYING
. While the state change return is equivalent to
GST_STATE_CHANGE_SUCCESS
, it is returned to the application to signal that
some sink elements might not be able to complete their state change because
an element is not producing data to complete the preroll. When setting the
element to playing, the preroll will complete and playback will start.
|
a GstElement to get the state of. |
|
a pointer to GstState to hold the state.
Can be NULL . [out][allow-none]
|
|
a pointer to GstState to hold the pending
state. Can be NULL . [out][allow-none]
|
|
a GstClockTime to specify the timeout for an async
state change or GST_CLOCK_TIME_NONE for infinite timeout. |
Returns : |
GST_STATE_CHANGE_SUCCESS if the element has no more pending state
and the last state change succeeded, GST_STATE_CHANGE_ASYNC if the
element is still performing a state change or
GST_STATE_CHANGE_FAILURE if the last state change failed.
MT safe. |
gboolean 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.
MT safe.
|
a GstElement |
|
TRUE to lock the element's state |
Returns : |
TRUE if the state was changed, FALSE if bad parameters were given or the elements state-locking needed no change. |
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.
MT safe.
|
a GstElement. |
Returns : |
TRUE, if the element's state is locked. |
void gst_element_abort_state (GstElement *element
);
Abort the state change of the element. This function is used by elements that do asynchronous state changes and find out something is wrong.
This function should be called with the STATE_LOCK held.
MT safe.
|
a GstElement to abort the state of. |
GstStateChangeReturn gst_element_continue_state (GstElement *element
,GstStateChangeReturn ret
);
Commit the state change of the element and proceed to the next
pending state if any. This function is used
by elements that do asynchronous state changes.
The core will normally call this method automatically when an
element returned GST_STATE_CHANGE_SUCCESS
from the state change function.
If after calling this method the element still has not reached the pending state, the next state change is performed.
This method is used internally and should normally not be called by plugins or applications.
|
a GstElement to continue the state change of. |
|
The previous state return value |
Returns : |
The result of the commit state change. MT safe. |
void gst_element_lost_state (GstElement *element
);
Brings the element to the lost state. This function calls
gst_element_lost_state_full()
with the new_base_time set to TRUE
.
This function is used internally and should normally not be called from plugins or applications.
MT safe.
|
a GstElement the state is lost of |
void gst_element_lost_state_full (GstElement *element
,gboolean new_base_time
);
Brings the element to the lost state. The current state of the
element is copied to the pending state so that any call to
gst_element_get_state()
will return GST_STATE_CHANGE_ASYNC
.
An ASYNC_START message is posted with indication to distribute a new
base_time to the element when new_base_time
is TRUE
.
If the element was PLAYING, it will go to PAUSED. The element
will be restored to its PLAYING state by the parent pipeline when it
prerolls again.
This is mostly used for elements that lost their preroll buffer
in the GST_STATE_PAUSED
or GST_STATE_PLAYING
state after a flush,
they will go to their pending state again when a new preroll buffer is
queued. This function can only be called when the element is currently
not in error or an async state change.
This function is used internally and should normally not be called from plugins or applications.
MT safe.
|
a GstElement the state is lost of |
|
if a new base time should be distributed |
Since 0.10.24
const gchar * gst_element_state_get_name (GstState state
);
Gets a string representing the given state.
|
a GstState to get the name of. |
Returns : |
a string with the name of the state. [transfer none] |
const gchar * gst_element_state_change_return_get_name
(GstStateChangeReturn state_ret
);
Gets a string representing the given state change result.
|
a GstStateChangeReturn to get the name of. |
Returns : |
a string with the name of the state result. [transfer none] |
Since 0.10.11
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.
|
a GstElement. |
Returns : |
TRUE, if the element's state could be synced to the parent's state. MT safe. |
GstStateChangeReturn gst_element_change_state (GstElement *element
,GstStateChange transition
);
Perform transition
on element
.
This function must be called with STATE_LOCK held and is mainly used internally.
|
a GstElement |
|
the requested transition |
Returns : |
the GstStateChangeReturn of the state transition. |
void gst_element_found_tags (GstElement *element
,GstTagList *list
);
Posts a message to the bus that new tags were found, and pushes an event
to all sourcepads. Takes ownership of the list
.
This is a utility method for elements. Applications should use the GstTagSetter interface.
|
element for which we found the tags. |
|
list of tags. [transfer full] |
void gst_element_found_tags_for_pad (GstElement *element
,GstPad *pad
,GstTagList *list
);
Posts a message to the bus that new tags were found and pushes the
tags as event. Takes ownership of the list
.
This is a utility method for elements. Applications should use the GstTagSetter interface.
|
element for which to post taglist to bus. |
|
pad on which to push tag-event. [transfer none] |
|
the taglist to post on the bus and create event from. [transfer full] |
void gst_element_message_full (GstElement *element
,GstMessageType type
,GQuark domain
,gint code
,gchar *text
,gchar *debug
,const gchar *file
,const gchar *function
,gint line
);
Post an error, warning or info message on the bus from inside an element.
type
must be of GST_MESSAGE_ERROR, GST_MESSAGE_WARNING or
GST_MESSAGE_INFO.
MT safe.
|
a GstElement to send message from |
|
the GstMessageType |
|
the GStreamer GError domain this message belongs to |
|
the GError code belonging to the domain |
|
an allocated text string to be used
as a replacement for the default message connected to code,
or NULL . [allow-none][transfer full]
|
|
an allocated debug message to be
used as a replacement for the default debugging information,
or NULL . [allow-none][transfer full]
|
|
the source code file where the error was generated |
|
the source code function where the error was generated |
|
the source code line where the error was generated |
gboolean gst_element_post_message (GstElement *element
,GstMessage *message
);
Post a message on the element's GstBus. This function takes ownership of the message; if you want to access the message after this call, you should add an additional reference before calling.
|
a GstElement posting the message |
|
a GstMessage to post. [transfer full] |
Returns : |
TRUE if the message was successfully posted. The function returns
FALSE if the element did not have a bus.
MT safe. |
const GstQueryType * gst_element_get_query_types (GstElement *element
);
Get an array of query types from the element. If the element doesn't implement a query types function, the query will be forwarded to the peer of a random linked sink pad.
|
a GstElement to query |
Returns : |
An array of GstQueryType elements that should not be freed or modified. MT safe. |
gboolean gst_element_query (GstElement *element
,GstQuery *query
);
Performs a query on the given element.
For elements that don't implement a query handler, this function forwards the query to a random srcpad or to the peer of a random linked sinkpad of this element.
Please note that some queries might need a running pipeline to work.
|
a GstElement to perform the query on. |
|
the GstQuery. [transfer none] |
Returns : |
TRUE if the query could be performed. MT safe. |
gboolean gst_element_query_convert (GstElement *element
,GstFormat src_format
,gint64 src_val
,GstFormat *dest_format
,gint64 *dest_val
);
Queries an element to convert src_val
in src_format
to dest_format
.
|
a GstElement to invoke the convert query on. |
|
a GstFormat to convert from. [inout] |
|
a value to convert. |
|
a pointer to the GstFormat to convert to. [inout] |
|
a pointer to the result. [out] |
Returns : |
TRUE if the query could be performed. |
gboolean gst_element_query_position (GstElement *element
,GstFormat *format
,gint64 *cur
);
Queries an element for the stream position. If one repeatedly calls this
function one can also create and reuse it in gst_element_query()
.
|
a GstElement to invoke the position query on. |
|
a pointer to the GstFormat asked for. On return contains the GstFormat used. [inout] |
|
a location in which to store the current position, or NULL. [out][allow-none] |
Returns : |
TRUE if the query could be performed. |
gboolean gst_element_query_duration (GstElement *element
,GstFormat *format
,gint64 *duration
);
Queries an element for the total stream duration.
|
a GstElement to invoke the duration query on. |
|
a pointer to the GstFormat asked for. On return contains the GstFormat used. [inout] |
|
A location in which to store the total duration, or NULL. [out] |
Returns : |
TRUE if the query could be performed. |
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 pushed on a random linked sink pad for upstream events or a random linked source pad for downstream events.
This function takes owership of the provided event so you should
gst_event_ref()
it if you want to reuse the event after this call.
|
a GstElement to send the event to. |
|
the GstEvent to send to the element. [transfer full] |
Returns : |
TRUE if the event was handled.
MT safe. |
gboolean gst_element_seek_simple (GstElement *element
,GstFormat format
,GstSeekFlags seek_flags
,gint64 seek_pos
);
Simple API to perform a seek on the given element, meaning it just seeks
to the given position relative to the start of the stream. For more complex
operations like segment seeks (e.g. for looping) or changing the playback
rate or seeking relative to the last configured playback segment you should
use gst_element_seek()
.
In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
guaranteed to return TRUE
on a seekable media type or FALSE
when the media
type is certainly not seekable (such as a live stream).
Some elements allow for seeking in the READY state, in this
case they will store the seek event and execute it when they are put to
PAUSED. If the element supports seek in READY, it will always return TRUE
when
it receives the event in the READY state.
|
a GstElement to seek on |
|
a GstFormat to execute the seek in, such as GST_FORMAT_TIME |
|
seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here |
|
position to seek to (relative to the start); if you are doing a seek in GST_FORMAT_TIME this value is in nanoseconds - multiply with GST_SECOND to convert seconds to nanoseconds or with GST_MSECOND to convert milliseconds to nanoseconds. |
Returns : |
TRUE if the seek operation succeeded (the seek might not always be
executed instantly though) |
Since 0.10.7
gboolean gst_element_seek (GstElement *element
,gdouble rate
,GstFormat format
,GstSeekFlags flags
,GstSeekType cur_type
,gint64 cur
,GstSeekType stop_type
,gint64 stop
);
Sends a seek event to an element. See gst_event_new_seek()
for the details of
the parameters. The seek event is sent to the element using
gst_element_send_event()
.
|
a GstElement to send the event to. |
|
The new playback rate |
|
The format of the seek values |
|
The optional seek flags. |
|
The type and flags for the new current position |
|
The value of the new current position |
|
The type and flags for the new stop position |
|
The value of the new stop position |
Returns : |
TRUE if the event was handled.
MT safe. |
"no-more-pads"
signalvoid user_function (GstElement *gstelement,
gpointer user_data) : Run Last
This signals that the element will not generate more dynamic pads. Note that this signal will usually be emitted from the context of the streaming thread.
|
the object which received the signal |
|
user data set when the signal handler was connected. |
"pad-added"
signalvoid user_function (GstElement *gstelement,
GstPad *new_pad,
gpointer user_data) : Run Last
a new GstPad has been added to the element. Note that this signal will
usually be emitted from the context of the streaming thread. Also keep in
mind that if you add new elements to the pipeline in the signal handler
you will need to set them to the desired target state with
gst_element_set_state()
or gst_element_sync_state_with_parent()
.
|
the object which received the signal |
|
the pad that has been added |
|
user data set when the signal handler was connected. |
"pad-removed"
signalvoid user_function (GstElement *gstelement,
GstPad *old_pad,
gpointer user_data) : Run Last
a GstPad has been removed from the element
|
the object which received the signal |
|
the pad that has been removed |
|
user data set when the signal handler was connected. |