GstPad

Name

GstPad -- The connection between Elements

Synopsis


#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_CONNECTED            (pad)
struct      GstPad;
void        (*GstPadChainFunction)          (GstPad *pad,
                                             GstBuffer *buf);
GstBuffer*  (*GstPadGetFunction)            (GstPad *pad);
GstBufferPool* (*GstPadBufferPoolFunction)  (GstPad *pad);
GstCaps*    (*GstPadGetCapsFunction)        (GstPad *pad,
                                             GstCaps *caps);
gboolean    (*GstPadEventFunction)          (GstPad *pad,
                                             GstEvent *event);
GstPadConnectReturn (*GstPadConnectFunction)
                                            (GstPad *pad,
                                             GstCaps *caps);
enum        GstPadConnectReturn;
gboolean    (*GstPadConvertFunction)        (GstPad *pad,
                                             GstFormat src_format,
                                             gint64 src_value,
                                             GstFormat *dest_format,
                                             gint64 *dest_value);
gboolean    (*GstPadDispatcherFunction)     (GstPad *pad,
                                             gpointer data);
GList*      (*GstPadIntConnFunction)        (GstPad *pad);
enum        GstPadQueryType;
gboolean    (*GstPadQueryFunction)          (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);
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);
#define     gst_pad_destroy                 (pad)
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_connect_function    (GstPad *pad,
                                             GstPadConnectFunction connect);
void        gst_pad_set_getcaps_function    (GstPad *pad,
                                             GstPadGetCapsFunction getcaps);
GstPadConnectReturn 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);
const 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);
GstScheduler* gst_pad_get_scheduler         (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_connect                 (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_connect_filtered        (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);
gboolean    gst_pad_reconnect_filtered      (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);
gboolean    gst_pad_try_reconnect_filtered  (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);
void        gst_pad_disconnect              (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_can_connect             (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_can_connect_filtered    (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);
void        gst_pad_push                    (GstPad *pad,
                                             GstBuffer *buf);
GstBuffer*  gst_pad_pull                    (GstPad *pad);
GstBufferPool* gst_pad_get_bufferpool       (GstPad *pad);
void        gst_pad_load_and_connect        (xmlNodePtr self,
                                             GstObject *parent);
GstPadConnectReturn gst_pad_proxy_connect   (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);
GstPad*     gst_pad_select                  (GList *padlist);
GstPad*     gst_pad_selectv                 (GstPad *pad,
                                             ...);
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);
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);
GList*      gst_pad_get_internal_connections
                                            (GstPad *pad);
GList*      gst_pad_get_internal_connections_default
                                            (GstPad *pad);
void        gst_pad_set_internal_connection_function
                                            (GstPad *pad,
                                             GstPadIntConnFunction intconn);
void        gst_pad_set_query_function      (GstPad *pad,
                                             GstPadQueryFunction query);
gboolean    gst_pad_query                   (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);
gboolean    gst_pad_query_default           (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);
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_CONNECTFUNC            (pad)
#define     GST_RPAD_GETCAPSFUNC            (pad)
#define     GST_RPAD_CONVERTFUNC            (pad)
#define     GST_RPAD_INTCONNFUNC            (pad)
#define     GST_RPAD_QUERYFUNC              (pad)
#define     GST_GPAD_REALPAD                (pad)
struct      GstGhostPad;
GstPad*     gst_ghost_pad_new               (const gchar *name,
                                             GstPad *pad);

Object Hierarchy


  GObject
   +----GstObject
         +----GstPad

Description

A GstElement is connected to other elements via "pads", which are extremely light-weight generic connections points. After two pads are retrieved from an element with gst_element_get_pad(), the pads can be connected with gst_pad_connect(). (For quick connections, you can also use gst_element_connect(), which will make the obvious connection 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. The gst_pad_pullregion() function can be used to request for a buffer with a specific offset (in time or in bytes). 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 September 1st, 2002 (0.4.0.1)

Details

GST_PAD_NAME()

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


GST_PAD_ELEMENT_PRIVATE()

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


GST_PAD_PARENT()

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


GST_PAD_PAD_TEMPLATE()

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


GST_PAD_REALIZE()

#define GST_PAD_REALIZE(pad)		(GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))

Returns the real pad of this pad.

pad :a GstPad to realize.
Returns :the actual GstPad.


GST_PAD_DIRECTION()

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


GST_PAD_CAPS()

#define GST_PAD_CAPS(pad)		GST_RPAD_CAPS(GST_PAD_REALIZE(pad))

Gets the capabilities of a pad.

pad :a GstPad to get the capabilities of.
Returns :the GstCaps of the pad.


GST_PAD_PEER()

#define GST_PAD_PEER(pad)		GST_PAD_CAST(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 connected through this pad.

pad :a GstPad to get the peer pad of.
Returns :the peer GstPad.


GST_PAD_CAN_PULL()

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


GST_PAD_IS_SINK()

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


GST_PAD_IS_SRC()

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


GST_PAD_IS_CONNECTED()

#define GST_PAD_IS_CONNECTED(pad)	(GST_PAD_PEER(pad) != NULL)

Checks if the pad is connected.

pad :a GstPad to check.


struct GstPad

struct GstPad;


GstPadChainFunction ()

void        (*GstPadChainFunction)          (GstPad *pad,
                                             GstBuffer *buf);

A function that will be called when chaining buffers.

pad :the GstPad that performed the chain.
buf :the GstBuffer that is chained.


GstPadGetFunction ()

GstBuffer*  (*GstPadGetFunction)            (GstPad *pad);

A function that will be called when pulling a buffer.

pad :the GstPad to get a buffer from.
Returns :the GstBuffer pulled.


GstPadBufferPoolFunction ()

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.


GstPadGetCapsFunction ()

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.

pad :the GstPad to get the capabilities of.
caps :the peer's GstCaps, can be used to filter the capabilities.
Returns :the GstCaps of the pad.


GstPadEventFunction ()

gboolean    (*GstPadEventFunction)          (GstPad *pad,
                                             GstEvent *event);

Function signature to handle an event for the pad.

pad :the GstPad to handle the event.
event :the GstEvent to handle.
Returns :TRUE if the pad could handle the event.


GstPadConnectFunction ()

GstPadConnectReturn (*GstPadConnectFunction)
                                            (GstPad *pad,
                                             GstCaps *caps);

Function signature to handle a new connection on the pad.

pad :the GstPad that is connected.
caps :the peer's GstCaps.
Returns :the result of the connection with the specified caps.


enum GstPadConnectReturn

typedef enum {
  GST_PAD_CONNECT_REFUSED = -1,
  GST_PAD_CONNECT_DELAYED =  0,
  GST_PAD_CONNECT_OK      =  1,
  GST_PAD_CONNECT_DONE    =  2
} GstPadConnectReturn;

The result of a pad connection.

GST_PAD_CONNECT_REFUSEDthe connection was refused.
GST_PAD_CONNECT_DELAYEDthe connection was delayed, probably because the element needs more specific pad capabilitiess.
GST_PAD_CONNECT_OK the connection succeeded.
GST_PAD_CONNECT_DONE the connection succeeded, any more attempts are not needed.


GstPadConvertFunction ()

gboolean    (*GstPadConvertFunction)        (GstPad *pad,
                                             GstFormat src_format,
                                             gint64 src_value,
                                             GstFormat *dest_format,
                                             gint64 *dest_value);

The signature of a convert function.

pad :the GstPad to perform the convert on.
src_format :the source GstFormat of the conversion.
src_value :the source value of the conversion.
dest_format :a pointer to the destination GstFormat.
dest_value :a pointer to the destination value.
Returns :TRUE if the conversion could be performed.


GstPadDispatcherFunction ()

gboolean    (*GstPadDispatcherFunction)     (GstPad *pad,
                                             gpointer data);

A dispatcher function is called for all internally connected 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.


GstPadIntConnFunction ()

GList*      (*GstPadIntConnFunction)        (GstPad *pad);

The signature of the internal pad connection function.

pad :The GstPad to query.
Returns :a newly allocated GList of pads that are connected to the given pad on the inside of the parent element. The caller must call g_list_free() on it after use.


enum GstPadQueryType

typedef enum {
  GST_PAD_QUERY_NONE = 0,
  GST_PAD_QUERY_TOTAL,
  GST_PAD_QUERY_POSITION,
  GST_PAD_QUERY_LATENCY,
  GST_PAD_QUERY_JITTER,
  GST_PAD_QUERY_START,
  GST_PAD_QUERY_SEGMENT_END,
  GST_PAD_QUERY_RATE
} GstPadQueryType;

The different supported query types.

GST_PAD_QUERY_NONE 
GST_PAD_QUERY_TOTALQuery the total stream time.
GST_PAD_QUERY_POSITIONQuery the current stream position.
GST_PAD_QUERY_LATENCYQuery the latency on the pad.
GST_PAD_QUERY_JITTERQuery the average jitter beteen optimal processing and current processing.
GST_PAD_QUERY_START 
GST_PAD_QUERY_SEGMENT_ENDQuery the end position of the currently executing segment.
GST_PAD_QUERY_RATE 


GstPadQueryFunction ()

gboolean    (*GstPadQueryFunction)          (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);

The signature of the query function.

pad :the GstPad to query.
type :the GstPadQueryType.
format :a pointer to the target GstFormat.
value :a pointer to the target value.
Returns :TRUE if the query could be performed.


enum GstPadDirection

typedef enum {
  GST_PAD_UNKNOWN,
  GST_PAD_SRC,
  GST_PAD_SINK
} GstPadDirection;

The direction of a pad.

GST_PAD_UNKNOWNdirection is unknown.
GST_PAD_SRCthe pad is a source pad.
GST_PAD_SINKthe pad is a sink pad.


enum GstPadFlags

typedef enum {
  GST_PAD_DISABLED		= GST_OBJECT_FLAG_LAST,
  GST_PAD_EOS,

  GST_PAD_FLAG_LAST		= GST_OBJECT_FLAG_LAST + 4
} GstPadFlags;

Flags for the pad.

GST_PAD_DISABLEDthe pad is disabled.
GST_PAD_EOSthe pad is in end of stream state.
GST_PAD_FLAG_LASTsubclasses can use this number to enumerate their flags.


gst_pad_new ()

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.


gst_pad_custom_new ()

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.


gst_pad_custom_new_from_template ()

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.


gst_pad_destroy()

#define			gst_pad_destroy(pad)			gst_object_destroy (GST_OBJECT (pad))

Destroy the pad.

pad :the pad to destroy


gst_pad_new_from_template ()

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.


gst_pad_get_direction ()

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.


gst_pad_set_chain_function ()

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.


gst_pad_set_get_function ()

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.


gst_pad_set_bufferpool_function ()

void        gst_pad_set_bufferpool_function (GstPad *pad,
                                             GstPadBufferPoolFunction bufpool);

Sets the given bufferpool function for the pad.

pad : a GstPad to set the bufferpool function for.
bufpool : the GstPadBufferPoolFunction to set.


gst_pad_set_connect_function ()

void        gst_pad_set_connect_function    (GstPad *pad,
                                             GstPadConnectFunction connect);

Sets the given connect function for the pad. It will be called when the pad is connected or reconnected with caps.

pad : a GstPad to set the connect function for.
connect : the GstPadConnectFunction to set.


gst_pad_set_getcaps_function ()

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.


gst_pad_try_set_caps ()

GstPadConnectReturn gst_pad_try_set_caps    (GstPad *pad,
                                             GstCaps *caps);

Tries to set the caps on the given pad.

pad : a GstPad to try to set the caps on.
caps : the GstCaps to set.
Returns : A GstPadConnectReturn value indicating whether the caps could be set.


gst_pad_get_caps ()

GstCaps*    gst_pad_get_caps                (GstPad *pad);

Gets the capabilities of this pad.

pad : a GstPad to get the capabilities of.
Returns : the GstCaps of this pad.


gst_pad_check_compatibility ()

gboolean    gst_pad_check_compatibility     (GstPad *srcpad,
                                             GstPad *sinkpad);

Checks if two pads have compatible capabilities.

srcpad : the source GstPad to check.
sinkpad : the sink GstPad to check against.
Returns : TRUE if they are compatible or if the capabilities could not be checked


gst_pad_set_name ()

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.


gst_pad_get_name ()

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


gst_pad_set_element_private ()

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.


gst_pad_get_element_private ()

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.


gst_pad_set_parent ()

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.


gst_pad_get_parent ()

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.


gst_pad_get_scheduler ()

GstScheduler* gst_pad_get_scheduler         (GstPad *pad);

Gets the scheduler of the pad.

pad : a GstPad to get the scheduler of.
Returns : the GstScheduler of the pad.


gst_pad_get_real_parent ()

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.


gst_pad_add_ghost_pad ()

void        gst_pad_add_ghost_pad           (GstPad *pad,
                                             GstPad *ghostpad);

Adds a ghost pad to a pad.

pad : a GstPad to attach the ghost pad to.
ghostpad : the ghost GstPad to to the pad.


gst_pad_remove_ghost_pad ()

void        gst_pad_remove_ghost_pad        (GstPad *pad,
                                             GstPad *ghostpad);

Removes a ghost pad from a pad.

pad : a GstPad to remove the ghost pad from.
ghostpad : the ghost GstPad to remove from the pad.


gst_pad_get_ghost_pad_list ()

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.


gst_pad_get_peer ()

GstPad*     gst_pad_get_peer                (GstPad *pad);

Gets the peer pad of this pad.

pad : a GstPad to get the peer of.
Returns : the peer GstPad.


gst_pad_connect ()

gboolean    gst_pad_connect                 (GstPad *srcpad,
                                             GstPad *sinkpad);

Connects the source pad to the sink pad.

srcpad : the source GstPad to connect.
sinkpad : the sink GstPad to connect.
Returns : TRUE if the pad could be connected, FALSE otherwise.


gst_pad_connect_filtered ()

gboolean    gst_pad_connect_filtered        (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);

Connects the source pad and the sink pad can be connected, constrained by the given filter caps.

srcpad : the source GstPad to connect.
sinkpad : the sink GstPad to connect.
filtercaps : the filter GstCaps.
Returns : TRUE if the pads have been connected, FALSE otherwise.


gst_pad_reconnect_filtered ()

gboolean    gst_pad_reconnect_filtered      (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);

Reconnects the given source and sink pad, constrained by the given capabilities. If the reconnection fails, the pads are disconnected and FALSE is returned.

srcpad : the source GstPad to reconnect.
sinkpad : the sink GstPad to reconnect.
filtercaps : the GstPad to use as a filter in the reconnection.
Returns : TRUE if the pads were succesfully reconnected, FALSE otherwise.


gst_pad_try_reconnect_filtered ()

gboolean    gst_pad_try_reconnect_filtered  (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);

Tries to reconnect the given source and sink pad, constrained by the given capabilities.

srcpad : the source GstPad to reconnect.
sinkpad : the sink GstPad to reconnect.
filtercaps : the GstPad to use as a filter in the reconnection.
Returns : TRUE if the pads were succesfully renegotiated, FALSE otherwise.


gst_pad_disconnect ()

void        gst_pad_disconnect              (GstPad *srcpad,
                                             GstPad *sinkpad);

Disconnects the source pad from the sink pad.

srcpad : the source GstPad to disconnect.
sinkpad : the sink GstPad to disconnect.


gst_pad_can_connect ()

gboolean    gst_pad_can_connect             (GstPad *srcpad,
                                             GstPad *sinkpad);

Checks if the source pad and the sink pad can be connected.

srcpad : the source GstPad to connect.
sinkpad : the sink GstPad to connect.
Returns : TRUE if the pads can be connected, FALSE otherwise.


gst_pad_can_connect_filtered ()

gboolean    gst_pad_can_connect_filtered    (GstPad *srcpad,
                                             GstPad *sinkpad,
                                             GstCaps *filtercaps);

Checks if the source pad and the sink pad can be connected when constrained by the given filter caps.

srcpad : the source GstPad to connect.
sinkpad : the sink GstPad to connect.
filtercaps : the filter GstCaps.
Returns : TRUE if the pads can be connected, FALSE otherwise.


gst_pad_push ()

void        gst_pad_push                    (GstPad *pad,
                                             GstBuffer *buf);

Pushes a buffer to the peer of the pad.

pad : a GstPad to push the buffer out of.
buf : the GstBuffer to push.


gst_pad_pull ()

GstBuffer*  gst_pad_pull                    (GstPad *pad);

Pulls a buffer from the peer pad.

pad : a GstPad to pull a buffer from.
Returns : a new GstBuffer from the peer pad.


gst_pad_get_bufferpool ()

GstBufferPool* gst_pad_get_bufferpool       (GstPad *pad);

Gets the bufferpool of the peer pad of the given pad.

pad : a GstPad to get the bufferpool from.
Returns : the GstBufferPool, or NULL in case of an error.


gst_pad_load_and_connect ()

void        gst_pad_load_and_connect        (xmlNodePtr self,
                                             GstObject *parent);

Reads the pad definition from the XML node and connects 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.


gst_pad_proxy_connect ()

GstPadConnectReturn gst_pad_proxy_connect   (GstPad *pad,
                                             GstCaps *caps);

Proxies the connect function to the specified pad.

pad : a GstPad to proxy to.
caps : the GstCaps to use in proxying.
Returns : TRUE if the peer pad accepted the caps, FALSE otherwise.


gst_pad_get_pad_template ()

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.


gst_pad_get_pad_template_caps ()

GstCaps*    gst_pad_get_pad_template_caps   (GstPad *pad);

Gets the template capabilities of this pad.

pad : a GstPad to get the template capabilities from.
Returns : the template GstCaps of this pad.


gst_pad_get_allowed_caps ()

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.

pad : a GstPad to get the allowed caps of.
Returns : a newly allocated copy of the allowed GstCaps.


gst_pad_recalc_allowed_caps ()

gboolean    gst_pad_recalc_allowed_caps     (GstPad *pad);

Attempts to reconnect the pad to its peer through its filter, set with gst_pad_[re]connect_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.


gst_pad_perform_negotiate ()

gboolean    gst_pad_perform_negotiate       (GstPad *srcpad,
                                             GstPad *sinkpad);

Tries to negotiate the pads.

srcpad : the source GstPad.
sinkpad : the sink GstPad.
Returns : TRUE if the pads were succesfully negotiated, FALSE otherwise.


gst_pad_select ()

GstPad*     gst_pad_select                  (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.


gst_pad_selectv ()

GstPad*     gst_pad_selectv                 (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.


gst_pad_dispatcher ()

gboolean    gst_pad_dispatcher              (GstPad *pad,
                                             GstPadDispatcherFunction dispatch,
                                             gpointer data);

Invokes the given dispatcher function on all pads that are internally connected 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.


gst_pad_send_event ()

gboolean    gst_pad_send_event              (GstPad *pad,
                                             GstEvent *event);

Sends the event to the pad.

pad : a GstPad to send the event to.
event : the GstEvent to send to the pad.
Returns : TRUE if the event was handled.


gst_pad_event_default ()

gboolean    gst_pad_event_default           (GstPad *pad,
                                             GstEvent *event);

Invokes the default event handler for the given pad.

pad : a GstPad to call the default event handler on.
event : the GstEvent to handle.
Returns : TRUE if the event was sent succesfully.


gst_pad_set_event_function ()

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.


gst_pad_set_convert_function ()

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.


gst_pad_convert ()

gboolean    gst_pad_convert                 (GstPad *pad,
                                             GstFormat src_format,
                                             gint64 src_value,
                                             GstFormat *dest_format,
                                             gint64 *dest_value);

Invokes a conversion on the pad.

pad : a GstPad to invoke the default converter on.
src_format : the source GstFormat.
src_value : the source value.
dest_format : a pointer to the destination GstFormat.
dest_value : a pointer to the destination value.
Returns : TRUE if the conversion could be performed.


gst_pad_convert_default ()

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 connection of the element.

pad : a GstPad to invoke the default converter on.
src_format : the source GstFormat.
src_value : the source value.
dest_format : a pointer to the destination GstFormat.
dest_value : a pointer to the destination value.
Returns : TRUE if the conversion could be performed.


gst_pad_get_internal_connections ()

GList*      gst_pad_get_internal_connections
                                            (GstPad *pad);

Gets a list of pads to which the given pad is connected to inside of the parent element. The caller must free this list after use.

pad : the GstPad to get the internal connections of.
Returns : a newly allocated GList of pads.


gst_pad_get_internal_connections_default ()

GList*      gst_pad_get_internal_connections_default
                                            (GstPad *pad);

Gets a list of pads to which the given pad is connected 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 connections of.
Returns : a newly allocated GList of pads.


gst_pad_set_internal_connection_function ()

void        gst_pad_set_internal_connection_function
                                            (GstPad *pad,
                                             GstPadIntConnFunction intconn);

Sets the given internal connection function for the pad.

pad : a GstPad to set the internal connection function for.
intconn : the GstPadIntConnFunction to set.


gst_pad_set_query_function ()

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.


gst_pad_query ()

gboolean    gst_pad_query                   (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);

Queries a pad for one of the available properties.

pad : a GstPad to invoke the default query on.
type : the GstPadQueryType 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.


gst_pad_query_default ()

gboolean    gst_pad_query_default           (GstPad *pad,
                                             GstPadQueryType type,
                                             GstFormat *format,
                                             gint64 *value);

Invokes the default query function on a pad.

pad : a GstPad to invoke the default query on.
type : the GstPadQueryType 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.


struct GstRealPad

struct GstRealPad {
  GstPad 			 pad;

  /* the pad capabilities */
  GstCaps 			*caps;
  GstCaps 			*filter;
  GstCaps 			*appfilter;
  GstPadGetCapsFunction 	 getcapsfunc;
  
  GstPadDirection 		 direction;

  GstPadConnectFunction 	 connectfunc;
  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;
  GstPadIntConnFunction		 intconnfunc;

  GstPadBufferPoolFunction 	 bufferpoolfunc;
};


GST_RPAD_DIRECTION()

#define GST_RPAD_DIRECTION(pad)		(((GstRealPad *)(pad))->direction)

Get the direction of the real pad.

pad :the realpad to query.


GST_RPAD_CAPS()

#define GST_RPAD_CAPS(pad)		(((GstRealPad *)(pad))->caps)

Get the caps of the real pad.

pad :the real pad to query.


GST_RPAD_PEER()

#define GST_RPAD_PEER(pad)		(((GstRealPad *)(pad))->peer)

Get the peer element of the real pad.

pad :the real pad to query.


GST_RPAD_CHAINFUNC()

#define GST_RPAD_CHAINFUNC(pad)		(((GstRealPad *)(pad))->chainfunc)

Get the chain function of the real pad.

pad :the real pad to query.


GST_RPAD_FILTER()

#define GST_RPAD_FILTER(pad)		(((GstRealPad *)(pad))->filter)

Get the filter from the pad

pad :the pad to query


GST_RPAD_APPFILTER()

#define GST_RPAD_APPFILTER(pad)		(((GstRealPad *)(pad))->appfilter)

Get the application filter for this pad

pad :the pad to query


GST_RPAD_GETFUNC()

#define GST_RPAD_GETFUNC(pad)		(((GstRealPad *)(pad))->getfunc)

Get get getfunction of the real pad.

pad :the real pad to query.


GST_RPAD_BUFFERPOOLFUNC()

#define GST_RPAD_BUFFERPOOLFUNC(pad)	(((GstRealPad *)(pad))->bufferpoolfunc)

Get the bufferpoolfunction from the real pad.

pad :the real pad to query.


GST_RPAD_CHAINHANDLER()

#define GST_RPAD_CHAINHANDLER(pad)	(((GstRealPad *)(pad))->chainhandler)

Get the eventhandler function from the real pad.

pad :the real pad to query.


GST_RPAD_EVENTFUNC()

#define GST_RPAD_EVENTFUNC(pad)		(((GstRealPad *)(pad))->eventfunc)

Get the event function of this real pad.

pad :the real pad to query.


GST_RPAD_EVENTHANDLER()

#define GST_RPAD_EVENTHANDLER(pad)	(((GstRealPad *)(pad))->eventhandler)

Get the eventhandler function of this real pad.

pad :the real pad to query.


GST_RPAD_GETHANDLER()

#define GST_RPAD_GETHANDLER(pad)	(((GstRealPad *)(pad))->gethandler)

Get the gethandler function of this real pad.

pad :the real pad to query.


GST_RPAD_CONNECTFUNC()

#define GST_RPAD_CONNECTFUNC(pad)	(((GstRealPad *)(pad))->connectfunc)

Get the connect function of the pad

pad :the pad to query


GST_RPAD_GETCAPSFUNC()

#define GST_RPAD_GETCAPSFUNC(pad)	(((GstRealPad *)(pad))->getcapsfunc)

Get the getcaps function of this pad

pad :the pad to query


GST_RPAD_CONVERTFUNC()

#define GST_RPAD_CONVERTFUNC(pad)	(((GstRealPad *)(pad))->convertfunc)

Get the convert function of this pad

pad :the pad to query


GST_RPAD_INTCONNFUNC()

#define GST_RPAD_INTCONNFUNC(pad)	(((GstRealPad *)(pad))->intconnfunc)

Get the internal connection function of this pad

pad :the pad to query


GST_RPAD_QUERYFUNC()

#define GST_RPAD_QUERYFUNC(pad)		(((GstRealPad *)(pad))->queryfunc)

Get the query function of this pad

pad :the pad to query


GST_GPAD_REALPAD()

#define GST_GPAD_REALPAD(pad)		(((GstGhostPad *)(pad))->realpad)

Get the real pad of this ghost pad.

pad :the real pad to query.


struct GstGhostPad

struct GstGhostPad;


gst_ghost_pad_new ()

GstPad*     gst_ghost_pad_new               (const gchar *name,
                                             GstPad *pad);

Creates a new ghost pad associated with the given pad, and names it with the given name. If name is NULL, a guaranteed unique name (across all ghost pads) will be assigned (most likely of the form ghostpadd).

name : the name of the new ghost pad.
pad : the GstPad to create a ghost pad for.
Returns : a new ghost GstPad, or NULL in case of an error.

See Also

GstPadTemplate, GstElement, GstEvent