![]() | ![]() | ![]() | GStreamer Core Reference Manual | ![]() |
---|
GstPad — The link between Elements
#include <gst/gst.h> #define GST_PAD_NAME (pad) #define GST_PAD_ELEMENT_PRIVATE (pad) #define GST_PAD_PARENT (pad) #define GST_PAD_PAD_TEMPLATE (pad) #define GST_PAD_REALIZE (pad) #define GST_PAD_DIRECTION (pad) #define GST_PAD_CAPS (pad) #define GST_PAD_PEER (pad) #define GST_PAD_CAN_PULL (pad) #define GST_PAD_IS_SINK (pad) #define GST_PAD_IS_SRC (pad) #define GST_PAD_IS_LINKED (pad) #define GST_PAD_IS_ACTIVE (pad) #define GST_PAD_IS_USABLE (pad) struct GstPad; void (*GstPadChainFunction) (GstPad *pad, GstData *data); GstData* (*GstPadGetFunction) (GstPad *pad); GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad); GstCaps* (*GstPadGetCapsFunction) (GstPad *pad, GstCaps *caps); gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event); GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstCaps *caps); enum GstPadLinkReturn; gboolean (*GstPadConvertFunction) (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value); gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data); GList* (*GstPadIntLinkFunction) (GstPad *pad); gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value); const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad); const GstFormat* (*GstPadFormatsFunction) (GstPad *pad); const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad); #define GST_PAD_QUERY_TYPE_FUNCTION (functionname, ...) #define GST_PAD_FORMATS_FUNCTION (functionname, ...) #define GST_PAD_EVENT_MASK_FUNCTION (functionname, ...) enum GstPadDirection; enum GstPadFlags; GstPad* gst_pad_new (const gchar *name, GstPadDirection direction); GstPad* gst_pad_custom_new (GType type, const gchar *name, GstPadDirection direction); GstPad* gst_pad_custom_new_from_template (GType type, GstPadTemplate *templ, const gchar *name); GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name); GstPadDirection gst_pad_get_direction (GstPad *pad); void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain); void gst_pad_set_get_function (GstPad *pad, GstPadGetFunction get); void gst_pad_set_bufferpool_function (GstPad *pad, GstPadBufferPoolFunction bufpool); void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link); void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps); GstCaps* gst_pad_get_caps (GstPad *pad); gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad); void gst_pad_set_name (GstPad *pad, const gchar *name); G_CONST_RETURN gchar* gst_pad_get_name (GstPad *pad); void gst_pad_set_element_private (GstPad *pad, gpointer priv); gpointer gst_pad_get_element_private (GstPad *pad); void gst_pad_set_parent (GstPad *pad, GstElement *parent); GstElement* gst_pad_get_parent (GstPad *pad); GstElement* gst_pad_get_real_parent (GstPad *pad); void gst_pad_add_ghost_pad (GstPad *pad, GstPad *ghostpad); void gst_pad_remove_ghost_pad (GstPad *pad, GstPad *ghostpad); GList* gst_pad_get_ghost_pad_list (GstPad *pad); GstPad* gst_pad_get_peer (GstPad *pad); gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); void gst_pad_push (GstPad *pad, GstData *data); GstData* gst_pad_pull (GstPad *pad); GstBufferPool* gst_pad_get_bufferpool (GstPad *pad); void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent); GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps); GstPadTemplate* gst_pad_get_pad_template (GstPad *pad); GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); GstCaps* gst_pad_get_allowed_caps (GstPad *pad); gboolean gst_pad_recalc_allowed_caps (GstPad *pad); gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad); xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad, xmlNodePtr parent); GstPad* gst_pad_select (GstPad *pad, ...); GstPad* gst_pad_selectv (GList *padlist); gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data); gboolean gst_pad_send_event (GstPad *pad, GstEvent *event); gboolean gst_pad_event_default (GstPad *pad, GstEvent *event); void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event); G_CONST_RETURN GstEventMask* gst_pad_get_event_masks (GstPad *pad); G_CONST_RETURN GstEventMask* gst_pad_get_event_masks_default (GstPad *pad); void gst_pad_set_event_mask_function (GstPad *pad, GstPadEventMaskFunction mask_func); void gst_pad_set_convert_function (GstPad *pad, GstPadConvertFunction convert); gboolean gst_pad_convert (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value); gboolean gst_pad_convert_default (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value); G_CONST_RETURN GstFormat* gst_pad_get_formats (GstPad *pad); G_CONST_RETURN GstFormat* gst_pad_get_formats_default (GstPad *pad); void gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction formats); GList* gst_pad_get_internal_links (GstPad *pad); GList* gst_pad_get_internal_links_default (GstPad *pad); void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink); void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query); gboolean gst_pad_query (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value); gboolean gst_pad_query_default (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value); G_CONST_RETURN GstQueryType* gst_pad_get_query_types (GstPad *pad); G_CONST_RETURN GstQueryType* gst_pad_get_query_types_default (GstPad *pad); void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func); #define gst_pad_add_probe (pad, probe) #define gst_pad_remove_probe (pad, probe) gboolean gst_pad_is_active (GstPad *pad); void gst_pad_set_active (GstPad *pad, gboolean active); GstScheduler* gst_pad_get_scheduler (GstPad *pad); struct GstRealPad; #define GST_RPAD_DIRECTION (pad) #define GST_RPAD_CAPS (pad) #define GST_RPAD_PEER (pad) #define GST_RPAD_CHAINFUNC (pad) #define GST_RPAD_FILTER (pad) #define GST_RPAD_APPFILTER (pad) #define GST_RPAD_GETFUNC (pad) #define GST_RPAD_BUFFERPOOLFUNC (pad) #define GST_RPAD_CHAINHANDLER (pad) #define GST_RPAD_EVENTFUNC (pad) #define GST_RPAD_EVENTHANDLER (pad) #define GST_RPAD_GETHANDLER (pad) #define GST_RPAD_LINKFUNC (pad) #define GST_RPAD_GETCAPSFUNC (pad) #define GST_RPAD_CONVERTFUNC (pad) #define GST_RPAD_INTLINKFUNC (pad) #define GST_RPAD_QUERYFUNC (pad) #define GST_RPAD_EVENTMASKFUNC (pad) #define GST_RPAD_FORMATSFUNC (pad) #define GST_RPAD_QUERYTYPEFUNC (pad) #define GST_GPAD_REALPAD (pad) struct GstGhostPad; GstPad* gst_ghost_pad_new (const gchar *name, GstPad *pad);
GObject +----GstObject +----GstPad
GObject +----GstObject +----GstPad +----GstGhostPad
A GstElement is linked to other elements via "pads", which are extremely light-weight generic link points. After two pads are retrieved from an element with gst_element_get_pad(), the pads can be link with gst_pad_link(). (For quick links, you can also use gst_element_link(), which will make the obvious link for you if it's straightforward.)
Pads are typically created from a GstPadTemplate with gst_pad_new_from_template().
Pads have GstCaps attached to it to describe the media type they are capable of dealing with. gst_pad_get_caps() and gst_pad_try_set_caps() are used to manipulate the caps of the pads. Pads created from a pad template cannot set capabilities that are incompatible with the pad template capabilities.
Pads without pad templates can be created with gst_pad_new(), which takes a direction and a name as an argument. If the name is NULL, then a guaranteed unique name will be assigned to it.
gst_pad_get_parent() will retrieve the GstElement that owns the pad.
A GstElement creating a pad will typically use the various gst_pad_set_*_function() calls to register callbacks for various events on the pads.
GstElements will use gst_pad_push() and gst_pad_pull() to push out or pull in a buffer. gst_pad_select() and gst_pad_selectv() are used by plugins to wait for the first incoming buffer or event on any of the given set of pads.
To send a GstEvent on a pad, use gst_pad_send_event().
Last reviewed on December 13th, 2002 (0.5.0.1)
#define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad))
Gets the name of the pad.
pad : | a GstPad to get the name of. |
Returns : | the pad's name. |
#define GST_PAD_ELEMENT_PRIVATE(pad) (((GstPad *)(pad))->element_private)
Gets the private data set by the element that owns the pad.
pad : | a GstPad to get the private data of. Returns: a gpointer to the private data. |
#define GST_PAD_PARENT(pad) ((GstElement *)(GST_OBJECT_PARENT(pad)))
Gets the parent element of this pad.
pad : | a GstPad to get the parent of. |
Returns : | the parent GstElement of this pad. |
#define GST_PAD_PAD_TEMPLATE(pad) (((GstPad *)(pad))->padtemplate)
Gets the pad template that was used to create this pad.
pad : | a GstPad to get the pad template of. Returns: the GstPadTemplate used to create the pad, or NULL if none was used. |
#define GST_PAD_REALIZE(pad) (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))
Returns the real pad of this pad.
#define GST_PAD_DIRECTION(pad) GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad))
Gets the pad's direction.
pad : | a GstPad to get the direction of. |
Returns : | the GstPadDirection of the pad. |
#define GST_PAD_CAPS(pad) GST_RPAD_CAPS(GST_PAD_REALIZE(pad))
Gets the capabilities of a pad.
#define GST_PAD_PEER(pad) GST_PAD(GST_RPAD_PEER(GST_PAD_REALIZE(pad)))
Gets the peer pad of this pad. The peer pad is the pad on to which the parent element is linked through this pad.
#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->gethandler != NULL)
Checks if buffers can be pulled from this buffer.
pad : | a GstPad to check on if a buffer can be pulled from it. |
#define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
Checks if the pad is a sink pad.
pad : | a GstPad to check. |
#define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
Checks if the pad is a source pad.
pad : | a GstPad to check. |
#define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
Checks if the pad is linked.
pad : | a GstPad to check. |
#define GST_PAD_IS_ACTIVE(pad) (!GST_FLAG_IS_SET(GST_PAD_REALIZE(pad), GST_PAD_DISABLED))
Checks if the pad is active.
pad : | a GstPad to check |
#define GST_PAD_IS_USABLE(pad)
Checks if a pad is usable. A usable pad is both linked and active.
pad : | a GstPad to check |
void (*GstPadChainFunction) (GstPad *pad, GstData *data);
A function that will be called when chaining buffers.
pad : | the GstPad that performed the chain. |
data : |
GstData* (*GstPadGetFunction) (GstPad *pad);
A function that will be called when pulling a buffer.
GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad);
A function that will be called when a buffer pool is requested from this pad.
pad : | the GstPad to which the buffer pool is associated. |
Returns : | the GstBufferPool associated with this pad. |
GstCaps* (*GstPadGetCapsFunction) (GstPad *pad, GstCaps *caps);
Returns the capabilities of the specified pad. By default this function will return the pad template capabilities, but can optionally be overridden.
gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
Function signature to handle an event for the pad.
GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstCaps *caps);
Function signature to handle a new link on the pad.
typedef enum { GST_PAD_LINK_REFUSED = -1, GST_PAD_LINK_DELAYED = 0, GST_PAD_LINK_OK = 1, GST_PAD_LINK_DONE = 2 } GstPadLinkReturn;
The result of a pad link.
GST_PAD_LINK_REFUSED | the link was refused. |
GST_PAD_LINK_DELAYED | the link was delayed, probably because the element needs more specific pad capabilitiess. |
GST_PAD_LINK_OK | the link succeeded. |
GST_PAD_LINK_DONE | the link succeeded, any more attempts are not needed. |
gboolean (*GstPadConvertFunction) (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value);
The signature of a convert function.
gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
A dispatcher function is called for all internally linked pads, see gst_pad_dispatcher().
pad : | the GstPad that is dispatched. |
data : | the gpointer to optional user data. |
Returns : | TRUE if the dispatching procedure has to be stopped. |
GList* (*GstPadIntLinkFunction) (GstPad *pad);
The signature of the internal pad link function.
pad : | The GstPad to query. |
Returns : | a newly allocated GList of pads that are linked to the given pad on the inside of the parent element. The caller must call g_list_free() on it after use. |
gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value);
The signature of the query function.
const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
The signature of the eventmask function.
pad : | the GstPad to query |
Returns : | an array of event masks |
const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
The signature of the formats function.
pad : | a GstPad to query |
Returns : | an array of formats |
const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
The signature of the query types function.
pad : | a GstPad to query |
Returns : | an array of query types |
#define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...)
A convenience macro to construct query type functions
functionname : | the name of the function |
... : | query types, 0 to mark the last element |
#define GST_PAD_FORMATS_FUNCTION(functionname, ...)
Convenience function to define an array of formats that can be used as GstPadGetFormatsFunction.
functionname : | The name of the function |
... : | comma separated list of formats, 0 to mark the end |
#define GST_PAD_EVENT_MASK_FUNCTION(functionname, ...)
Convenience function to define an array of event masks that can be used as GstPadGetEventMaskFunction.
functionname : | The name of the function |
... : | comma separated list of event maks, { 0, } to mark the end |
typedef enum { GST_PAD_UNKNOWN, GST_PAD_SRC, GST_PAD_SINK } GstPadDirection;
The direction of a pad.
GST_PAD_UNKNOWN | direction is unknown. |
GST_PAD_SRC | the pad is a source pad. |
GST_PAD_SINK | the pad is a sink pad. |
typedef enum { GST_PAD_DISABLED = GST_OBJECT_FLAG_LAST, GST_PAD_NEGOTIATING, GST_PAD_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4 } GstPadFlags;
Flags for the pad.
GST_PAD_DISABLED | the pad is disabled. |
GST_PAD_NEGOTIATING | |
GST_PAD_FLAG_LAST | subclasses can use this number to enumerate their flags. |
GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
Creates a new real pad with the given name in the given direction. If name is NULL, a guaranteed unique name (across all pads) will be assigned.
name : | the name of the new pad. |
direction : | the GstPadDirection of the pad. |
Returns : | a new GstPad, or NULL in case of an error. |
GstPad* gst_pad_custom_new (GType type, const gchar *name, GstPadDirection direction);
Creates a new pad with the given name and type in the given direction. If name is NULL, a guaranteed unique name (across all pads) will be assigned.
type : | the Gtype of the pad. |
name : | the name of the new pad. |
direction : | the GstPadDirection of the pad. |
Returns : | a new GstPad, or NULL in case of an error. |
GstPad* gst_pad_custom_new_from_template (GType type, GstPadTemplate *templ, const gchar *name);
Creates a new custom pad with the given name from the given template. If name is NULL, a guaranteed unique name (across all pads) will be assigned.
type : | the custom GType of the pad. |
templ : | the GstPadTemplate to instantiate from. |
name : | the name of the new pad. |
Returns : | a new GstPad, or NULL in case of an error. |
GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
Creates a new real pad with the given name from the given template. If name is NULL, a guaranteed unique name (across all pads) will be assigned.
templ : | the pad template to use |
name : | the name of the element |
Returns : | a new GstPad, or NULL in case of an error. |
GstPadDirection gst_pad_get_direction (GstPad *pad);
Gets the direction of the pad.
pad : | a GstPad to get the direction of. |
Returns : | the GstPadDirection of the pad. |
void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
Sets the given chain function for the pad.
pad : | a GstPad to set the chain function for. |
chain : | the GstPadChainFunction to set. |
void gst_pad_set_get_function (GstPad *pad, GstPadGetFunction get);
Sets the given get function for the pad.
pad : | a GstPad to set the get function for. |
get : | the GstPadGetFunction to set. |
void gst_pad_set_bufferpool_function (GstPad *pad, GstPadBufferPoolFunction bufpool);
Sets the given bufferpool function for the pad. Note that the bufferpool function can only be set on sinkpads.
pad : | a GstPad to set the bufferpool function for. |
bufpool : | the GstPadBufferPoolFunction to set. |
void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
Sets the given link function for the pad. It will be called when the pad is linked or relinked with caps.
pad : | a GstPad to set the link function for. |
link : | the GstPadLinkFunction to set. |
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
Sets the given getcaps function for the pad.
pad : | a GstPad to set the getcaps function for. |
getcaps : | the GstPadGetCapsFunction to set. |
GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps);
Tries to set the caps on the given pad. Ownership is always taken of the caps, so you will need to unref non-floating caps.
pad : | a GstPad to try to set the caps on. |
caps : | the GstCaps to set. |
Returns : | A GstPadLinkReturn value indicating whether the caps could be set. |
GstCaps* gst_pad_get_caps (GstPad *pad);
Gets the capabilities of this pad.
Returns: the GstCaps of this pad. This function potentially
pad : | a GstPad to get the capabilities of. |
Returns : | a floating caps, so use gst_caps_sink to get rid of it. |
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
Checks if two pads have compatible capabilities.
void gst_pad_set_name (GstPad *pad, const gchar *name);
Sets the name of a pad. If name is NULL, then a guaranteed unique name will be assigned.
pad : | a GstPad to set the name of. |
name : | the name of the pad. |
G_CONST_RETURN gchar* gst_pad_get_name (GstPad *pad);
Gets the name of a pad.
pad : | a GstPad to get the name of. |
Returns : | the name of the pad. This is not a newly allocated pointer so you must not free it. |
void gst_pad_set_element_private (GstPad *pad, gpointer priv);
Set the given private data gpointer on the pad. This function can only be used by the element that owns the pad.
pad : | the GstPad to set the private data of. |
priv : | The private data to attach to the pad. |
gpointer gst_pad_get_element_private (GstPad *pad);
Gets the private data of a pad.
pad : | the GstPad to get the private data of. |
Returns : | a gpointer to the private data. |
void gst_pad_set_parent (GstPad *pad, GstElement *parent);
Sets the parent object of a pad.
pad : | a GstPad to set the parent of. |
parent : | the new parent GstElement. |
GstElement* gst_pad_get_parent (GstPad *pad);
Gets the parent object of this pad.
pad : | the GstPad to get the parent of. |
Returns : | the parent GstElement. |
GstElement* gst_pad_get_real_parent (GstPad *pad);
Gets the real parent object of this pad. If the pad is a ghost pad, the actual owner of the real pad is returned, as opposed to #gst_pad_get_parent().
pad : | a GstPad to get the real parent of. |
Returns : | the parent GstElement. |
void gst_pad_add_ghost_pad (GstPad *pad, GstPad *ghostpad);
Adds a ghost pad to a pad.
void gst_pad_remove_ghost_pad (GstPad *pad, GstPad *ghostpad);
Removes a ghost pad from a pad.
GList* gst_pad_get_ghost_pad_list (GstPad *pad);
Gets the ghost pads of this pad.
pad : | a GstPad to get the ghost pads of. |
Returns : | a GList of ghost pads. |
gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
Links the source pad to the sink pad.
gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
Links the source pad and the sink pad, constrained by the given filter caps. This function sinks the caps.
gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
Relinks the given source and sink pad, constrained by the given capabilities. If the relink fails, the pads are unlinked and FALSE is returned.
gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
Tries to relink the given source and sink pad, constrained by the given capabilities.
void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
Unlinks the source pad from the sink pad.
gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
Checks if the source pad and the sink pad can be link.
gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
Checks if the source pad and the sink pad can be linked when constrained by the given filter caps.
void gst_pad_push (GstPad *pad, GstData *data);
Pushes a buffer or an event to the peer of the pad.
GstBufferPool* gst_pad_get_bufferpool (GstPad *pad);
Gets the bufferpool of the peer pad of the given pad.Note that a bufferpool can only be obtained from a srcpad.
pad : | a GstPad to get the bufferpool from. |
Returns : | the GstBufferPool, or NULL in case of an error. |
void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
Reads the pad definition from the XML node and links the given pad in the element to a pad of an element up in the hierarchy.
self : | an xmlNodePtr to read the description from. |
parent : | the GstObject element that owns the pad. |
GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps);
Proxies the link function to the specified pad.
GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
Gets the pad template object of this pad.
pad : | a GstPad to get the pad template of. |
Returns : | the GstPadTemplate from which this pad was instantiated. |
GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
Gets the template capabilities of this pad.
GstCaps* gst_pad_get_allowed_caps (GstPad *pad);
Gets the capabilities of the allowed media types that can flow through this pad. The caller must free the resulting caps.
gboolean gst_pad_recalc_allowed_caps (GstPad *pad);
Attempts to relink the pad to its peer through its filter, set with gst_pad_[re]link_filtered. This function is useful when a plug-in has new capabilities on a pad and wants to notify the peer.
pad : | a GstPad to recalculate the capablities of. |
Returns : | TRUE on success, FALSE otherwise. |
gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad);
Tries to negotiate the pads.
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad, xmlNodePtr parent);
Saves the ghost pad into an xml representation.
pad : | a ghost GstPad to save. |
parent : | the parent xmlNodePtr to save the description in. |
Returns : | the xmlNodePtr representation of the pad. |
GstPad* gst_pad_select (GstPad *pad, ...);
Waits for a buffer on the given set of pads.
pad : | a first GstPad to perform the select on. |
... : | A NULL-terminated list of more pads to select on. |
Returns : | the GstPad that has a buffer available. Use #gst_pad_pull() to get the buffer. |
GstPad* gst_pad_selectv (GList *padlist);
Waits for a buffer on any of the list of pads.
padlist : | a GList of pads. |
Returns : | the GstPad that has a buffer available. Use #gst_pad_pull() to get the buffer. |
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data);
Invokes the given dispatcher function on all pads that are internally linked to the given pad. The GstPadDispatcherFunction should return TRUE when no further pads need to be processed.
pad : | a GstPad to dispatch. |
dispatch : | the GstDispatcherFunction to call. |
data : | gpointer user data passed to the dispatcher function. |
Returns : | TRUE if one of the dispatcher functions returned TRUE. |
gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
Sends the event to the pad.
gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
Invokes the default event handler for the given pad.
void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
Sets the given event handler for the pad.
pad : | a GstPad to set the event handler for. |
event : | the GstPadEventFunction to set. |
G_CONST_RETURN GstEventMask* gst_pad_get_event_masks (GstPad *pad);
Gets the array of eventmasks from the given pad.
pad : | a GstPad to get the event mask for. |
Returns : | an array with eventmasks, the list is ended with 0 |
G_CONST_RETURN GstEventMask* gst_pad_get_event_masks_default (GstPad *pad);
Invokes the default event masks dispatcher on the pad.
pad : | a GstPad to get the event mask for. |
Returns : | an array with eventmasks, the list is ended with 0 |
void gst_pad_set_event_mask_function (GstPad *pad, GstPadEventMaskFunction mask_func);
Sets the given event mask function for the pad.
pad : | a GstPad to set the event mask function for. |
mask_func : | the GstPadEventMaskFunction to set. |
void gst_pad_set_convert_function (GstPad *pad, GstPadConvertFunction convert);
Sets the given convert function for the pad.
pad : | a GstPad to set the convert function for. |
convert : | the GstPadConvertFunction to set. |
gboolean gst_pad_convert (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value);
Invokes a conversion on the pad.
gboolean gst_pad_convert_default (GstPad *pad, GstFormat src_format, gint64 src_value, GstFormat *dest_format, gint64 *dest_value);
Invokes the default converter on a pad. This will forward the call to the pad obtained using the internal link of the element.
G_CONST_RETURN GstFormat* gst_pad_get_formats (GstPad *pad);
Gets the list of supported formats from the pad.
pad : | a GstPad to query |
Returns : | An array of GstFormats ended with a 0 value. |
G_CONST_RETURN GstFormat* gst_pad_get_formats_default (GstPad *pad);
Invoke the default format dispatcher for the pad.
pad : | a GstPad to query |
Returns : | An array of GstFormats ended with a 0 value. |
void gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction formats);
Sets the given formats function for the pad.
pad : | the GstPad to set the formats function for. |
formats : | the GstPadFormatsFunction to set. |
GList* gst_pad_get_internal_links (GstPad *pad);
Gets a list of pads to which the given pad is linked to inside of the parent element. The caller must free this list after use.
pad : | the GstPad to get the internal links of. |
Returns : | a newly allocated GList of pads. |
GList* gst_pad_get_internal_links_default (GstPad *pad);
Gets a list of pads to which the given pad is linked to inside of the parent element. This is the default handler, and thus returns a list of all of the pads inside the parent element with opposite direction. The caller must free this list after use.
pad : | the GstPad to get the internal links of. |
Returns : | a newly allocated GList of pads. |
void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
Sets the given internal link function for the pad.
pad : | a GstPad to set the internal link function for. |
intlink : | the GstPadIntLinkFunction to set. |
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
Set the given query function for the pad.
pad : | the GstPad to set the query function for. |
query : | the GstPadQueryFunction to set. |
gboolean gst_pad_query (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value);
Queries a pad for one of the available properties. The format will be adjusted to the actual format used when specifying formats such as GST_FORMAT_DEFAULT. FIXME: Tell if the format can be adjusted when specifying a definite format.
pad : | a GstPad to invoke the default query on. |
type : | the GstQueryType of the query to perform. |
format : | a pointer to the GstFormat asked for. On return contains the GstFormat used. |
value : | a pointer to the result. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_default (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value);
Invokes the default query function on a pad.
pad : | a GstPad to invoke the default query on. |
type : | the GstQueryType of the query to perform. |
format : | a pointer to the GstFormat of the result. |
value : | a pointer to the result. |
Returns : | TRUE if the query could be performed. |
G_CONST_RETURN GstQueryType* gst_pad_get_query_types (GstPad *pad);
Get an array of supported queries that can be performed on this pad.
pad : | the GstPad to query |
Returns : | an array of querytypes anded with 0. |
G_CONST_RETURN GstQueryType* gst_pad_get_query_types_default (GstPad *pad);
Invoke the default dispatcher for the query types on the pad.
pad : | the GstPad to query |
Returns : | an array of querytypes anded with 0. |
void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
Set the given query type function for the pad.
pad : | the GstPad to set the query type function for. |
type_func : | the GstPadQueryTypeFunction to set. |
#define gst_pad_add_probe(pad, probe)
Adds the probe to the given pad
pad : | The pad to add the probe to |
probe : | The probe to add to the pad |
#define gst_pad_remove_probe(pad, probe)
Remove the probe from the pad
pad : | The pad to remove the probe of |
probe : | The probe to remove |
gboolean gst_pad_is_active (GstPad *pad);
Query if a pad is active
pad : | the GstPad to query |
Returns : | TRUE if the pad is active. |
void gst_pad_set_active (GstPad *pad, gboolean active);
Activates or deactivates the given pad.
pad : | the GstPad to activate or deactivate. |
active : | TRUE to activate the pad. |
GstScheduler* gst_pad_get_scheduler (GstPad *pad);
Gets the scheduler of the pad. Since the pad does not have a scheduler of its own, the scheduler of the parent is taken. For decoupled pads, the scheduler of the peer parent is taken.
pad : | a GstPad to get the scheduler of. |
Returns : | the GstScheduler of the pad. |
struct GstRealPad { GstPad pad; /* the pad capabilities */ GstCaps *caps; GstCaps *filter; GstCaps *appfilter; GstPadGetCapsFunction getcapsfunc; GstPadDirection direction; GstPadLinkFunction linkfunc; GstPadUnlinkFunction unlinkfunc; GstRealPad *peer; gpointer sched_private; /* data transport functions */ GstPadChainFunction chainfunc; GstPadChainFunction chainhandler; GstPadGetFunction getfunc; GstPadGetFunction gethandler; GstPadEventFunction eventfunc; GstPadEventFunction eventhandler; GstPadEventMaskFunction eventmaskfunc; GList *ghostpads; /* query/convert/formats functions */ GstPadConvertFunction convertfunc; GstPadQueryFunction queryfunc; GstPadFormatsFunction formatsfunc; GstPadQueryTypeFunction querytypefunc; GstPadIntLinkFunction intlinkfunc; GstPadBufferPoolFunction bufferpoolfunc; GstProbeDispatcher probedisp; gpointer _gst_reserved[GST_PADDING]; };
The realpad object
#define GST_RPAD_DIRECTION(pad) (((GstRealPad *)(pad))->direction)
Get the direction of the real pad.
pad : | the realpad to query. |
#define GST_RPAD_CAPS(pad) (((GstRealPad *)(pad))->caps)
Get the caps of the real pad.
pad : | the real pad to query. |
#define GST_RPAD_PEER(pad) (((GstRealPad *)(pad))->peer)
Get the peer element of the real pad.
pad : | the real pad to query. |
#define GST_RPAD_CHAINFUNC(pad) (((GstRealPad *)(pad))->chainfunc)
Get the chain function of the real pad.
pad : | the real pad to query. |
#define GST_RPAD_FILTER(pad) (((GstRealPad *)(pad))->filter)
Get the filter from the pad
pad : | the pad to query |
#define GST_RPAD_APPFILTER(pad) (((GstRealPad *)(pad))->appfilter)
Get the application filter for this pad
pad : | the pad to query |
#define GST_RPAD_GETFUNC(pad) (((GstRealPad *)(pad))->getfunc)
Get get getfunction of the real pad.
pad : | the real pad to query. |
#define GST_RPAD_BUFFERPOOLFUNC(pad) (((GstRealPad *)(pad))->bufferpoolfunc)
Get the bufferpoolfunction from the real pad.
pad : | the real pad to query. |
#define GST_RPAD_CHAINHANDLER(pad) (((GstRealPad *)(pad))->chainhandler)
Get the eventhandler function from the real pad.
pad : | the real pad to query. |
#define GST_RPAD_EVENTFUNC(pad) (((GstRealPad *)(pad))->eventfunc)
Get the event function of this real pad.
pad : | the real pad to query. |
#define GST_RPAD_EVENTHANDLER(pad) (((GstRealPad *)(pad))->eventhandler)
Get the eventhandler function of this real pad.
pad : | the real pad to query. |
#define GST_RPAD_GETHANDLER(pad) (((GstRealPad *)(pad))->gethandler)
Get the gethandler function of this real pad.
pad : | the real pad to query. |
#define GST_RPAD_LINKFUNC(pad) (((GstRealPad *)(pad))->linkfunc)
Get the link function of the pad
pad : | the pad to query |
#define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc)
Get the getcaps function of this pad
pad : | the pad to query |
#define GST_RPAD_CONVERTFUNC(pad) (((GstRealPad *)(pad))->convertfunc)
Get the convert function of this pad
pad : | the pad to query |
#define GST_RPAD_INTLINKFUNC(pad) (((GstRealPad *)(pad))->intlinkfunc)
Get the internal link function of this pad
pad : | the pad to query |
#define GST_RPAD_QUERYFUNC(pad) (((GstRealPad *)(pad))->queryfunc)
Get the query function of this pad
pad : | the pad to query |
#define GST_RPAD_EVENTMASKFUNC(pad) (((GstRealPad *)(pad))->eventmaskfunc)
Get the event mask function of this pad
pad : | the pad to query |
#define GST_RPAD_FORMATSFUNC(pad) (((GstRealPad *)(pad))->formatsfunc)
Get the formats function of this pad
pad : | the pad to query |
#define GST_RPAD_QUERYTYPEFUNC(pad) (((GstRealPad *)(pad))->querytypefunc)
Get the query types function of this pad
pad : | the pad to query |
#define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad)
Get the real pad of this ghost pad.
pad : | the real pad to query. |
GstPadTemplate, GstElement, GstEvent
<< GstObject | GstParse >> |