GstPad

GstPad — Object contained by elements that allows links to other elements

Synopsis


#include <gst/gst.h>


            GstPad;
#define     GST_PAD_LINK_FAILED             (ret)
#define     GST_PAD_LINK_SUCCESSFUL         (ret)
gboolean    (*GstPadActivateFunction)       (GstPad *pad);
gboolean    (*GstPadActivateModeFunction)   (GstPad *pad,
                                             gboolean active);
void        (*GstPadBlockCallback)          (GstPad *pad,
                                             gboolean blocked,
                                             gpointer user_data);
GstFlowReturn (*GstPadChainFunction)        (GstPad *pad,
                                             GstBuffer *buffer);
gboolean    (*GstPadEventFunction)          (GstPad *pad,
                                             GstEvent *event);
gboolean    (*GstPadCheckGetRangeFunction)  (GstPad *pad);
GstFlowReturn (*GstPadGetRangeFunction)     (GstPad *pad,
                                             guint64 offset,
                                             guint length,
                                             GstBuffer **buffer);
gboolean    (*GstPadQueryFunction)          (GstPad *pad,
                                             GstQuery *query);
GList*      (*GstPadIntLinkFunction)        (GstPad *pad);
const GstQueryType* (*GstPadQueryTypeFunction)
                                            (GstPad *pad);
GstPadLinkReturn (*GstPadLinkFunction)      (GstPad *pad,
                                             GstPad *peer);
void        (*GstPadUnlinkFunction)         (GstPad *pad);
gboolean    (*GstPadAcceptCapsFunction)     (GstPad *pad,
                                             GstCaps *caps);
void        (*GstPadFixateCapsFunction)     (GstPad *pad,
                                             GstCaps *caps);
GstCaps*    (*GstPadGetCapsFunction)        (GstPad *pad);
gboolean    (*GstPadSetCapsFunction)        (GstPad *pad,
                                             GstCaps *caps);
GstFlowReturn (*GstPadBufferAllocFunction)  (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstCaps *caps,
                                             GstBuffer **buf);
gboolean    (*GstPadDispatcherFunction)     (GstPad *pad,
                                             gpointer data);
enum        GstPadDirection;
enum        GstPadFlags;
enum        GstPadLinkReturn;
enum        GstPadPresence;
enum        GstFlowReturn;
enum        GstActivateMode;
#define     GST_PREROLL_BROADCAST           (pad)
#define     GST_PREROLL_GET_COND            (pad)
#define     GST_PREROLL_GET_LOCK            (pad)
#define     GST_PREROLL_LOCK                (pad)
#define     GST_PREROLL_SIGNAL              (pad)
#define     GST_PREROLL_TIMED_WAIT          (pad, timeval)
#define     GST_PREROLL_TRYLOCK             (pad)
#define     GST_PREROLL_UNLOCK              (pad)
#define     GST_PREROLL_WAIT                (pad)
#define     GST_STREAM_GET_LOCK             (pad)
#define     GST_STREAM_LOCK                 (pad)
#define     GST_STREAM_LOCK_FULL            (pad,t)
#define     GST_STREAM_TRYLOCK              (pad)
#define     GST_STREAM_UNLOCK               (pad)
#define     GST_STREAM_UNLOCK_FULL          (pad)
#define     GST_FLOW_IS_FATAL               (ret)
GstPad*     gst_pad_new                     (const gchar *name,
                                             GstPadDirection direction);
GstPad*     gst_pad_new_from_template       (GstPadTemplate *templ,
                                             const gchar *name);
#define     gst_pad_get_name                (pad)
GstPadDirection gst_pad_get_direction       (GstPad *pad);
#define     gst_pad_get_parent              (pad)
GstElement* gst_pad_get_parent_element      (GstPad *pad);
gboolean    gst_pad_set_active              (GstPad *pad,
                                             gboolean active);
gboolean    gst_pad_is_active               (GstPad *pad);
gboolean    gst_pad_set_blocked             (GstPad *pad,
                                             gboolean blocked);
gboolean    gst_pad_set_blocked_async       (GstPad *pad,
                                             gboolean blocked,
                                             GstPadBlockCallback callback,
                                             gpointer user_data);
gboolean    gst_pad_is_blocked              (GstPad *pad);
void        gst_pad_set_element_private     (GstPad *pad,
                                             gpointer priv);
gpointer    gst_pad_get_element_private     (GstPad *pad);
GstPadTemplate* gst_pad_get_pad_template    (GstPad *pad);
void        gst_pad_set_bufferalloc_function
                                            (GstPad *pad,
                                             GstPadBufferAllocFunction bufalloc);
GstFlowReturn gst_pad_alloc_buffer          (GstPad *pad,
                                             guint64 offset,
                                             gint size,
                                             GstCaps *caps,
                                             GstBuffer **buf);
void        gst_pad_set_chain_function      (GstPad *pad,
                                             GstPadChainFunction chain);
GstFlowReturn gst_pad_chain                 (GstPad *pad,
                                             GstBuffer *buffer);
void        gst_pad_set_checkgetrange_function
                                            (GstPad *pad,
                                             GstPadCheckGetRangeFunction check);
void        gst_pad_set_getrange_function   (GstPad *pad,
                                             GstPadGetRangeFunction get);
GstFlowReturn gst_pad_get_range             (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstBuffer **buffer);
void        gst_pad_set_event_function      (GstPad *pad,
                                             GstPadEventFunction event);
void        gst_pad_set_unlink_function     (GstPad *pad,
                                             GstPadUnlinkFunction unlink);
void        gst_pad_set_activate_function   (GstPad *pad,
                                             GstPadActivateFunction activate);
void        gst_pad_set_activatepull_function
                                            (GstPad *pad,
                                             GstPadActivateModeFunction activatepull);
gboolean    gst_pad_start_task              (GstPad *pad,
                                             GstTaskFunction func,
                                             gpointer data);
gboolean    gst_pad_pause_task              (GstPad *pad);
gboolean    gst_pad_stop_task               (GstPad *pad);
GstPadLinkReturn gst_pad_link               (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_unlink                  (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_is_linked               (GstPad *pad);
void        gst_pad_set_link_function       (GstPad *pad,
                                             GstPadLinkFunction link);
gboolean    gst_pad_can_link                (GstPad *srcpad,
                                             GstPad *sinkpad);
gboolean    gst_pad_accept_caps             (GstPad *pad,
                                             GstCaps *caps);
GstCaps*    gst_pad_get_negotiated_caps     (GstPad *pad);
GstCaps*    gst_pad_get_caps                (GstPad *pad);
gboolean    gst_pad_set_caps                (GstPad *pad,
                                             GstCaps *caps);
const GstCaps* gst_pad_get_pad_template_caps
                                            (GstPad *pad);
void        gst_pad_set_acceptcaps_function (GstPad *pad,
                                             GstPadAcceptCapsFunction acceptcaps);
void        gst_pad_set_getcaps_function    (GstPad *pad,
                                             GstPadGetCapsFunction getcaps);
void        gst_pad_set_setcaps_function    (GstPad *pad,
                                             GstPadSetCapsFunction setcaps);
GstCaps*    gst_pad_proxy_getcaps           (GstPad *pad);
gboolean    gst_pad_proxy_setcaps           (GstPad *pad,
                                             GstCaps *caps);
GstCaps*    gst_pad_get_allowed_caps        (GstPad *srcpad);
GstCaps*    gst_pad_get_fixed_caps_func     (GstPad *pad);
GstPad*     gst_pad_get_peer                (GstPad *pad);
GstCaps*    gst_pad_peer_get_caps           (GstPad *pad);
gboolean    gst_pad_peer_accept_caps        (GstPad *pad,
                                             GstCaps *caps);
void        gst_pad_use_fixed_caps          (GstPad *pad);
void        gst_pad_fixate_caps             (GstPad *pad,
                                             GstCaps *caps);
void        gst_pad_set_fixatecaps_function (GstPad *pad,
                                             GstPadFixateCapsFunction fixatecaps);
void        gst_pad_set_activatepush_function
                                            (GstPad *pad,
                                             GstPadActivateModeFunction activatepush);
GstFlowReturn gst_pad_push                  (GstPad *pad,
                                             GstBuffer *buffer);
gboolean    gst_pad_push_event              (GstPad *pad,
                                             GstEvent *event);
gboolean    gst_pad_check_pull_range        (GstPad *pad);
GstFlowReturn gst_pad_pull_range            (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstBuffer **buffer);
gboolean    gst_pad_activate_pull           (GstPad *pad,
                                             gboolean active);
gboolean    gst_pad_activate_push           (GstPad *pad,
                                             gboolean active);
gboolean    gst_pad_send_event              (GstPad *pad,
                                             GstEvent *event);
gboolean    gst_pad_event_default           (GstPad *pad,
                                             GstEvent *event);
void        gst_pad_set_query_function      (GstPad *pad,
                                             GstPadQueryFunction query);
void        gst_pad_set_query_type_function (GstPad *pad,
                                             GstPadQueryTypeFunction type_func);
const GstQueryType* gst_pad_get_query_types (GstPad *pad);
const GstQueryType* gst_pad_get_query_types_default
                                            (GstPad *pad);
gboolean    gst_pad_query                   (GstPad *pad,
                                             GstQuery *query);
gboolean    gst_pad_query_default           (GstPad *pad,
                                             GstQuery *query);
gboolean    gst_pad_query_position          (GstPad *pad,
                                             GstFormat *format,
                                             gint64 *cur,
                                             gint64 *end);
gboolean    gst_pad_query_convert           (GstPad *pad,
                                             GstFormat src_format,
                                             gint64 src_val,
                                             GstFormat *dest_format,
                                             gint64 *dest_val);
void        gst_pad_set_internal_link_function
                                            (GstPad *pad,
                                             GstPadIntLinkFunction intlink);
GList*      gst_pad_get_internal_links      (GstPad *pad);
GList*      gst_pad_get_internal_links_default
                                            (GstPad *pad);
gboolean    gst_pad_dispatcher              (GstPad *pad,
                                             GstPadDispatcherFunction dispatch,
                                             gpointer data);
void        gst_pad_load_and_link           (xmlNodePtr self,
                                             GstObject *parent);
gulong      gst_pad_add_data_probe          (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);
gulong      gst_pad_add_buffer_probe        (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);
gulong      gst_pad_add_event_probe         (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);
void        gst_pad_remove_data_probe       (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);
void        gst_pad_remove_buffer_probe     (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);
void        gst_pad_remove_event_probe      (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);


Object Hierarchy


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

Properties


  "caps"                 GstCaps               : Read
  "direction"            GstPadDirection       : Read / Write / Construct Only
  "template"             GstPadTemplate        : Read / Write

Signal Prototypes


"have-data" gboolean    user_function      (GstPad *pad,
                                            GstMiniObject mini_obj,
                                            gpointer user_data);
"linked"    void        user_function      (GstPad *pad,
                                            GstPad *peer,
                                            gpointer user_data);
"request-link"
            void        user_function      (GstPad *pad,
                                            gpointer user_data);
"unlinked"  void        user_function      (GstPad *pad,
                                            GstPad *peer,
                                            gpointer user_data);

Description

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)

Details

GstPad

typedef struct {
  /* streaming rec_lock */
  GStaticRecMutex		*stream_rec_lock;
  GstTask			*task;
  GMutex			*preroll_lock;
  GCond				*preroll_cond;

  /* block cond, mutex is from the object */
  GCond				*block_cond;
  GstPadBlockCallback		 block_callback;
  gpointer			 block_data;

  /* the pad capabilities */
  GstCaps			*caps;
  GstPadGetCapsFunction		getcapsfunc;
  GstPadSetCapsFunction		setcapsfunc;
  GstPadAcceptCapsFunction	 acceptcapsfunc;
  GstPadFixateCapsFunction	 fixatecapsfunc;

  GstPadActivateFunction	 activatefunc;
  GstPadActivateModeFunction	 activatepushfunc;
  GstPadActivateModeFunction	 activatepullfunc;

  /* pad link */
  GstPadLinkFunction		 linkfunc;
  GstPadUnlinkFunction		 unlinkfunc;
  GstPad			*peer;

  gpointer			 sched_private;

  /* data transport functions */
  GstPadChainFunction		 chainfunc;
  GstPadCheckGetRangeFunction	 checkgetrangefunc;
  GstPadGetRangeFunction	 getrangefunc;
  GstPadEventFunction		 eventfunc;

  GstActivateMode		 mode;

  /* generic query method */
  GstPadQueryTypeFunction	 querytypefunc;
  GstPadQueryFunction		 queryfunc;

  /* internal links */
  GstPadIntLinkFunction		 intlinkfunc;

  GstPadBufferAllocFunction      bufferallocfunc;

  /* whether to emit signals for have-data. counts number
   * of handlers attached. */
  gint				 do_buffer_signals;
  gint				 do_event_signals;
} GstPad;


GST_PAD_LINK_FAILED()

#define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)

Macro to test if the given GstPadLinkReturn value indicates a failed negotiation step (REFUSED/DELAYED).

ret : the GstPadLinkReturn value

GST_PAD_LINK_SUCCESSFUL()

#define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)

Macro to test if the given GstPadLinkReturn value indicates a successfull negotiation step (OK/DONE).

ret : the GstPadLinkReturn value

GstPadActivateFunction ()

gboolean    (*GstPadActivateFunction)       (GstPad *pad);

pad :
Returns :

GstPadActivateModeFunction ()

gboolean    (*GstPadActivateModeFunction)   (GstPad *pad,
                                             gboolean active);

pad :
active :
Returns :

GstPadBlockCallback ()

void        (*GstPadBlockCallback)          (GstPad *pad,
                                             gboolean blocked,
                                             gpointer user_data);

pad :
blocked :
user_data :

GstPadChainFunction ()

GstFlowReturn (*GstPadChainFunction)        (GstPad *pad,
                                             GstBuffer *buffer);

A function that will be called when chaining buffers.

pad : the GstPad that performed the chain.
buffer :
Returns :

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.

GstPadCheckGetRangeFunction ()

gboolean    (*GstPadCheckGetRangeFunction)  (GstPad *pad);

pad :
Returns :

GstPadGetRangeFunction ()

GstFlowReturn (*GstPadGetRangeFunction)     (GstPad *pad,
                                             guint64 offset,
                                             guint length,
                                             GstBuffer **buffer);

pad :
offset :
length :
buffer :
Returns :

GstPadQueryFunction ()

gboolean    (*GstPadQueryFunction)          (GstPad *pad,
                                             GstQuery *query);

The signature of the query function.

pad : the GstPad to query.
query :
Returns : TRUE if the query could be performed.

GstPadIntLinkFunction ()

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.

GstPadQueryTypeFunction ()

const GstQueryType* (*GstPadQueryTypeFunction)
                                            (GstPad *pad);

The signature of the query types function.

pad : a GstPad to query
Returns : an array of query types

GstPadLinkFunction ()

GstPadLinkReturn (*GstPadLinkFunction)      (GstPad *pad,
                                             GstPad *peer);

Function signature to handle a new link on the pad.

pad : the GstPad that is linked.
peer :
Returns : the result of the link with the specified caps.

GstPadUnlinkFunction ()

void        (*GstPadUnlinkFunction)         (GstPad *pad);

pad :

GstPadAcceptCapsFunction ()

gboolean    (*GstPadAcceptCapsFunction)     (GstPad *pad,
                                             GstCaps *caps);

pad :
caps :
Returns :

GstPadFixateCapsFunction ()

void        (*GstPadFixateCapsFunction)     (GstPad *pad,
                                             GstCaps *caps);

pad :
caps :

GstPadGetCapsFunction ()

GstCaps*    (*GstPadGetCapsFunction)        (GstPad *pad);

Returns a copy of 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.
Returns : a newly allocated copy GstCaps of the pad.

GstPadSetCapsFunction ()

gboolean    (*GstPadSetCapsFunction)        (GstPad *pad,
                                             GstCaps *caps);

pad :
caps :
Returns :

GstPadBufferAllocFunction ()

GstFlowReturn (*GstPadBufferAllocFunction)  (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstCaps *caps,
                                             GstBuffer **buf);

pad :
offset :
size :
caps :
buf :
Returns :

GstPadDispatcherFunction ()

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.

enum GstPadDirection

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.

enum GstPadFlags

typedef enum {
  GST_PAD_BLOCKED		= GST_OBJECT_FLAG_LAST,
  GST_PAD_FLUSHING,
  GST_PAD_IN_GETCAPS,
  GST_PAD_IN_SETCAPS,

  GST_PAD_FLAG_LAST		= GST_OBJECT_FLAG_LAST + 8
} GstPadFlags;


enum GstPadLinkReturn

typedef enum {
  GST_PAD_LINK_OK               =  0,
  GST_PAD_LINK_WRONG_HIERARCHY  = -1,
  GST_PAD_LINK_WAS_LINKED       = -2,
  GST_PAD_LINK_WRONG_DIRECTION  = -3,
  GST_PAD_LINK_NOFORMAT         = -4,
  GST_PAD_LINK_NOSCHED          = -5,
  GST_PAD_LINK_REFUSED          = -6,
} GstPadLinkReturn;

The result of a pad link.

GST_PAD_LINK_OK link ok
GST_PAD_LINK_WRONG_HIERARCHY pads have no common grandparent
GST_PAD_LINK_WAS_LINKED pad was already linked
GST_PAD_LINK_WRONG_DIRECTION pads have wrong direction
GST_PAD_LINK_NOFORMAT pads do not have common format
GST_PAD_LINK_NOSCHED pads cannot cooperate in scheduling
GST_PAD_LINK_REFUSED refused for some reason

enum GstPadPresence

typedef enum {
  GST_PAD_ALWAYS,
  GST_PAD_SOMETIMES,
  GST_PAD_REQUEST
} GstPadPresence;

Indicates when this pad will become available.

GST_PAD_ALWAYS the pad is always available
GST_PAD_SOMETIMES the pad will become available depending on the media stream
GST_PAD_REQUEST the pad is only available on request with gst_element_request_pad_by_name() or gst_element_request_compatible_pad().

enum GstFlowReturn

typedef enum {
  GST_FLOW_RESEND	  =  1,		/* resend buffer, possibly with new caps */
  GST_FLOW_OK		  =  0,		/* data passing was ok */
  /* expected failures */
  GST_FLOW_NOT_LINKED     = -1,		/* pad is not linked */
  GST_FLOW_WRONG_STATE    = -2,		/* pad is in wrong state */
  /* error cases */
  GST_FLOW_UNEXPECTED     = -3,		/* did not expect anything, like after EOS */
  GST_FLOW_NOT_NEGOTIATED = -4,		/* pad is not negotiated */
  GST_FLOW_ERROR	  = -5,		/* some (fatal) error occured */
  GST_FLOW_NOT_SUPPORTED  = -6		/* function not supported */
} GstFlowReturn;


enum GstActivateMode

typedef enum {
  GST_ACTIVATE_NONE,
  GST_ACTIVATE_PUSH,
  GST_ACTIVATE_PULL,
} GstActivateMode;


GST_PREROLL_BROADCAST()

#define GST_PREROLL_BROADCAST(pad)      g_cond_broadcast (GST_PREROLL_GET_COND (pad));

pad :

GST_PREROLL_GET_COND()

#define GST_PREROLL_GET_COND(pad)       (GST_PAD_CAST(pad)->preroll_cond)

pad :

GST_PREROLL_GET_LOCK()

#define GST_PREROLL_GET_LOCK(pad)       (GST_PAD_CAST(pad)->preroll_lock)

pad :

GST_PREROLL_LOCK()

#define GST_PREROLL_LOCK(pad)           (g_mutex_lock(GST_PREROLL_GET_LOCK(pad)))

pad :

GST_PREROLL_SIGNAL()

#define GST_PREROLL_SIGNAL(pad)         g_cond_signal (GST_PREROLL_GET_COND (pad));

pad :

GST_PREROLL_TIMED_WAIT()

#define     GST_PREROLL_TIMED_WAIT(pad, timeval)

pad :
timeval :

GST_PREROLL_TRYLOCK()

#define GST_PREROLL_TRYLOCK(pad)        (g_mutex_trylock(GST_PREROLL_GET_LOCK(pad)))

pad :

GST_PREROLL_UNLOCK()

#define GST_PREROLL_UNLOCK(pad)         (g_mutex_unlock(GST_PREROLL_GET_LOCK(pad)))

pad :

GST_PREROLL_WAIT()

#define GST_PREROLL_WAIT(pad)           g_cond_wait (GST_PREROLL_GET_COND (pad), GST_PREROLL_GET_LOCK (pad))

pad :

GST_STREAM_GET_LOCK()

#define GST_STREAM_GET_LOCK(pad)        (GST_PAD_CAST(pad)->stream_rec_lock)

pad :

GST_STREAM_LOCK()

#define GST_STREAM_LOCK(pad)            (g_static_rec_mutex_lock(GST_STREAM_GET_LOCK(pad)))

pad :

GST_STREAM_LOCK_FULL()

#define GST_STREAM_LOCK_FULL(pad,t)     (g_static_rec_mutex_lock_full(GST_STREAM_GET_LOCK(pad), t))

pad :
t :

GST_STREAM_TRYLOCK()

#define GST_STREAM_TRYLOCK(pad)         (g_static_rec_mutex_trylock(GST_STREAM_GET_LOCK(pad)))

pad :

GST_STREAM_UNLOCK()

#define GST_STREAM_UNLOCK(pad)          (g_static_rec_mutex_unlock(GST_STREAM_GET_LOCK(pad)))

pad :

GST_STREAM_UNLOCK_FULL()

#define GST_STREAM_UNLOCK_FULL(pad)     (g_static_rec_mutex_unlock_full(GST_STREAM_GET_LOCK(pad)))

pad :

GST_FLOW_IS_FATAL()

#define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)

ret :

gst_pad_new ()

GstPad*     gst_pad_new                     (const gchar *name,
                                             GstPadDirection direction);

Creates a new pad with the given name in the given direction. If name is NULL, a guaranteed unique name (across all pads) will be assigned. This function makes a copy of the name so you can safely free the name.

name : the name of the new pad.
direction : the GstPadDirection of the pad.
Returns : a new GstPad, or NULL in case of an error. MT safe.

gst_pad_new_from_template ()

GstPad*     gst_pad_new_from_template       (GstPadTemplate *templ,
                                             const gchar *name);

Creates a new pad with the given name from the given template. If name is NULL, a guaranteed unique name (across all pads) will be assigned. This function makes a copy of the name so you can safely free the name.

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

#define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))

pad :
Returns :

gst_pad_get_direction ()

GstPadDirection gst_pad_get_direction       (GstPad *pad);

Gets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK.

pad : a GstPad to get the direction of.
Returns : the GstPadDirection of the pad. MT safe.

gst_pad_get_parent()

#define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))

pad :
Returns :

gst_pad_get_parent_element ()

GstElement* gst_pad_get_parent_element      (GstPad *pad);

Gets the parent of pad, cast to a GstElement. If a pad has no parent or its parent is not an element, return NULL.

pad : a pad
Returns : The parent of the pad. The caller has a reference on the parent, so unref when you're finished with it. MT safe.

gst_pad_set_active ()

gboolean    gst_pad_set_active              (GstPad *pad,
                                             gboolean active);

Activates or deactivates the given pad. Must be called with the GST_STATE_LOCK. Normally called from within core state change functions.

If active, makes sure the pad is active. If it is already active, either in push or pull mode, just return. Otherwise dispatches to the pad's activate function to perform the actual activation.

If not active, checks the pad's current mode and calls gst_pad_activate_push() or gst_pad_activate_pull(), as appropriate, with a FALSE argument.

pad : the GstPad to activate or deactivate.
active : whether or not the pad should be active.
Returns : TRUE if the operation was successfull. MT safe. Must be called with GST_STATE_LOCK.

gst_pad_is_active ()

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. MT safe.

gst_pad_set_blocked ()

gboolean    gst_pad_set_blocked             (GstPad *pad,
                                             gboolean blocked);

Blocks or unblocks the dataflow on a pad. This function is a shortcut for @gst_pad_set_blocked_async() with a NULL callback.

pad : the GstPad to block or unblock
blocked : boolean indicating we should block or unblock
Returns : TRUE if the pad could be blocked. This function can fail wrong parameters were passed or the pad was already in the requested state. MT safe.

gst_pad_set_blocked_async ()

gboolean    gst_pad_set_blocked_async       (GstPad *pad,
                                             gboolean blocked,
                                             GstPadBlockCallback callback,
                                             gpointer user_data);

Blocks or unblocks the dataflow on a pad. The provided callback is called when the operation succeeds. This can take a while as the pad can only become blocked when real dataflow is happening. When the pipeline is stalled, for example in PAUSED, this can take an indeterminate amount of time. You can pass NULL as the callback to make this call block. Be carefull with this blocking call as it might not return for reasons stated above.

pad : the GstPad to block or unblock
blocked : boolean indicating we should block or unblock
callback : GstPadBlockCallback that will be called when the operation succeeds.
user_data : user data passed to the callback
Returns : TRUE if the pad could be blocked. This function can fail if wrong parameters were passed or the pad was already in the requested state. MT safe.

gst_pad_is_blocked ()

gboolean    gst_pad_is_blocked              (GstPad *pad);

Checks if the pad is blocked or not. This function returns the last requested state of the pad. It is not certain that the pad is actually blocked at this point.

pad : the GstPad to query
Returns : TRUE if the pad is blocked. MT safe.

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

GstPadTemplate* gst_pad_get_pad_template    (GstPad *pad);

Gets the template for pad.

pad : a GstPad.
Returns : the GstPadTemplate from which this pad was instantiated, or NULL if this pad has no template. FIXME: currently returns an unrefcounted padtemplate.

gst_pad_set_bufferalloc_function ()

void        gst_pad_set_bufferalloc_function
                                            (GstPad *pad,
                                             GstPadBufferAllocFunction bufalloc);

Sets the given bufferalloc function for the pad. Note that the bufferalloc function can only be set on sinkpads.

pad : a sink GstPad.
bufalloc : the GstPadBufferAllocFunction to set.

gst_pad_alloc_buffer ()

GstFlowReturn gst_pad_alloc_buffer          (GstPad *pad,
                                             guint64 offset,
                                             gint size,
                                             GstCaps *caps,
                                             GstBuffer **buf);

Allocates a new, empty buffer optimized to push to pad pad. This function only works if pad is a source pad and has a peer.

You need to check the caps of the buffer after performing this function and renegotiate to the format if needed.

A new, empty GstBuffer will be put in the buf argument.

pad : a source GstPad
offset : the offset of the new buffer in the stream
size : the size of the new buffer
caps : the caps of the new buffer
buf : a newly allocated buffer
Returns : a result code indicating success of the operation. Any result code other than GST_FLOW_OK is an error and buf should not be used. An error can occur if the pad is not connected or when the downstream peer elements cannot provide an acceptable buffer. MT safe.

gst_pad_set_chain_function ()

void        gst_pad_set_chain_function      (GstPad *pad,
                                             GstPadChainFunction chain);

Sets the given chain function for the pad. The chain function is called to process a GstBuffer input buffer.

pad : a sink GstPad.
chain : the GstPadChainFunction to set.

gst_pad_chain ()

GstFlowReturn gst_pad_chain                 (GstPad *pad,
                                             GstBuffer *buffer);

Chain a buffer to pad.

pad : a sink GstPad.
buffer : the GstBuffer to send.
Returns : a GstFlowReturn from the pad. MT safe.

gst_pad_set_checkgetrange_function ()

void        gst_pad_set_checkgetrange_function
                                            (GstPad *pad,
                                             GstPadCheckGetRangeFunction check);

Sets the given checkgetrange function for the pad. Implement this function on a pad if you dynamically support getrange based scheduling on the pad.

pad : a source GstPad.
check : the GstPadCheckGetRangeFunction to set.

gst_pad_set_getrange_function ()

void        gst_pad_set_getrange_function   (GstPad *pad,
                                             GstPadGetRangeFunction get);

Sets the given getrange function for the pad. The getrange function is called to produce a new GstBuffer to start the processing pipeline. Getrange functions cannot return NULL.

pad : a source GstPad.
get : the GstPadGetRangeFunction to set.

gst_pad_get_range ()

GstFlowReturn gst_pad_get_range             (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstBuffer **buffer);

Calls the getrange function of pad.

pad : a src GstPad.
offset : The start offset of the buffer
size : The length of the buffer
buffer : a pointer to hold the GstBuffer.
Returns : a GstFlowReturn from the pad. MT safe.

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 source GstPad.
event : the GstPadEventFunction to set.

gst_pad_set_unlink_function ()

void        gst_pad_set_unlink_function     (GstPad *pad,
                                             GstPadUnlinkFunction unlink);

Sets the given unlink function for the pad. It will be called when the pad is unlinked.

pad : a GstPad.
unlink : the GstPadUnlinkFunction to set.

gst_pad_set_activate_function ()

void        gst_pad_set_activate_function   (GstPad *pad,
                                             GstPadActivateFunction activate);

Sets the given activate function for the pad. The activate function will dispatch to activate_push or activate_pull to perform the actual activation. Only makes sense to set on sink pads.

Call this function if your sink pad can start a pull-based task.

pad : a sink GstPad.
activate : the GstPadActivateFunction to set.

gst_pad_set_activatepull_function ()

void        gst_pad_set_activatepull_function
                                            (GstPad *pad,
                                             GstPadActivateModeFunction activatepull);

Sets the given activate_pull function for the pad. An activate_pull function prepares the element and any upstream connections for pulling. See XXX part-activation.txt for details.

pad : a sink GstPad.
activatepull : the GstPadActivateModeFunction to set.

gst_pad_start_task ()

gboolean    gst_pad_start_task              (GstPad *pad,
                                             GstTaskFunction func,
                                             gpointer data);

Starts a task that repeadedly calls func with data. This function is nostly used in the pad activation function to start the dataflow. This function will automatically acauire the STREAM_LOCK of the pad before calling func.

pad : the GstPad to start the task of
func : the task function to call
data : data passed to the task function
Returns : a TRUE if the task could be started.

gst_pad_pause_task ()

gboolean    gst_pad_pause_task              (GstPad *pad);

Pause the task of pad. This function will also make sure that the function executed by the task will effectively stop.

pad : the GstPad to pause the task of
Returns : a TRUE if the task could be paused or FALSE when the pad has no task.

gst_pad_stop_task ()

gboolean    gst_pad_stop_task               (GstPad *pad);

Stop the task of pad. This function will also make sure that the function executed by the task will effectively stop if not called from the GstTaskFunction.

This function will deadlock if called from the GstTaskFunction of the task. Use #gst_task_pause() instead.

pad : the GstPad to stop the task of
Returns : a TRUE if the task could be stopped or FALSE when the pad has no task.

gst_pad_link ()

GstPadLinkReturn gst_pad_link               (GstPad *srcpad,
                                             GstPad *sinkpad);

Links the source pad and the sink pad.

srcpad : the source GstPad to link.
sinkpad : the sink GstPad to link.
Returns : A result code indicating if the connection worked or what went wrong. MT Safe.

gst_pad_unlink ()

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

Unlinks the source pad from the sink pad. Will emit the "unlinked" signal on both pads.

srcpad : the source GstPad to unlink.
sinkpad : the sink GstPad to unlink.
Returns : TRUE if the pads were unlinked. This function returns FALSE if the pads were not linked together. MT safe.

gst_pad_is_linked ()

gboolean    gst_pad_is_linked               (GstPad *pad);

Checks if a pad is linked to another pad or not.

pad : pad to check
Returns : TRUE if the pad is linked, FALSE otherwise. MT safe.

gst_pad_set_link_function ()

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. The caps passed to the link function is the caps for the connnection. It can contain a non fixed caps.

The return value GST_PAD_LINK_OK should be used when the connection can be made.

The return value GST_PAD_LINK_REFUSED should be used when the connection cannot be made for some reason.

pad : a GstPad.
link : the GstPadLinkFunction to set.

gst_pad_can_link ()

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

Checks if the source pad and the sink pad can be linked. Both srcpad and sinkpad must be unlinked.

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

gst_pad_accept_caps ()

gboolean    gst_pad_accept_caps             (GstPad *pad,
                                             GstCaps *caps);

Check if the given pad accepts the caps.

pad : a GstPad to check
caps :
Returns : TRUE if the pad can accept the caps.

gst_pad_get_negotiated_caps ()

GstCaps*    gst_pad_get_negotiated_caps     (GstPad *pad);

Gets the capabilities of the media type that currently flows through pad and its peer.

This function can be used on both src and sinkpads. Note that srcpads are always negotiated before sinkpads so it is possible that the negotiated caps on the srcpad do not match the negotiated caps of the peer.

pad : a GstPad.
Returns : the negotiated GstCaps of the pad link. Free the caps when you no longer need it. This function returns NULL when the pad has no peer or is not negotiated yet. MT safe.

gst_pad_get_caps ()

GstCaps*    gst_pad_get_caps                (GstPad *pad);

Gets the capabilities this pad can produce or consume. Note that this method doesn't necessarily returns the caps set by gst_pad_set_caps - use GST_PAD_CAPS for that instead. gst_pad_get_caps returns all possible caps a pad can operate with, using the pad's get_caps function; this returns the pad template caps if not explicitly set.

pad : a GstPad to get the capabilities of.
Returns : a newly allocated copy of the GstCaps of this pad. MT safe.

gst_pad_set_caps ()

gboolean    gst_pad_set_caps                (GstPad *pad,
                                             GstCaps *caps);

Sets the capabilities of this pad. The caps must be fixed. Any previous caps on the pad will be unreffed. This function refs the caps so you should unref if as soon as you don't need it anymore. It is possible to set NULL caps, which will make the pad unnegotiated again.

pad : a GstPad to set the capabilities of.
caps : a GstCaps to set.
Returns : TRUE if the caps could be set. FALSE if the caps were not fixed or bad parameters were provided to this function. MT safe.

gst_pad_get_pad_template_caps ()

const GstCaps* gst_pad_get_pad_template_caps
                                            (GstPad *pad);

Gets the capabilities for pad's template.

pad : a GstPad to get the template capabilities from.
Returns : the GstCaps of this pad template. If you intend to keep a reference on the caps, make a copy (see gst_caps_copy()).

gst_pad_set_acceptcaps_function ()

void        gst_pad_set_acceptcaps_function (GstPad *pad,
                                             GstPadAcceptCapsFunction acceptcaps);

Sets the given acceptcaps function for the pad. The acceptcaps function will be called to check if the pad can accept the given caps.

pad : a GstPad.
acceptcaps : the GstPadAcceptCapsFunction 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. getcaps should return the allowable caps for a pad in the context of the element's state, its link to other elements, and the devices or files it has opened. These caps must be a subset of the pad template caps. In the NULL state with no links, getcaps should ideally return the same caps as the pad template. In rare circumstances, an object property can affect the caps returned by getcaps, but this is discouraged.

You do not need to call this function if pad's allowed caps are always the same as the pad template caps. This can only be true if the padtemplate has fixed simple caps.

For most filters, the caps returned by getcaps is directly affected by the allowed caps on other pads. For demuxers and decoders, the caps returned by the srcpad's getcaps function is directly related to the stream data. Again, getcaps should return the most specific caps it reasonably can, since this helps with autoplugging.

Note that the return value from getcaps is owned by the caller, so the caller should unref the caps after usage.

pad : a GstPad.
getcaps : the GstPadGetCapsFunction to set.

gst_pad_set_setcaps_function ()

void        gst_pad_set_setcaps_function    (GstPad *pad,
                                             GstPadSetCapsFunction setcaps);

Sets the given setcaps function for the pad. The setcaps function will be called whenever a buffer with a new media type is pushed or pulled from the pad. The pad/element needs to update it's internal structures to process the new media type. If this new type is not acceptable, the setcaps function should return FALSE.

pad : a GstPad.
setcaps : the GstPadSetCapsFunction to set.

gst_pad_proxy_getcaps ()

GstCaps*    gst_pad_proxy_getcaps           (GstPad *pad);

Calls gst_pad_get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results.

This function is useful as a default getcaps function for an element that can handle any stream format, but requires all its pads to have the same caps. Two such elements are tee and aggregator.

pad : a GstPad to proxy.
Returns : the intersection of the other pads' allowed caps.

gst_pad_proxy_setcaps ()

gboolean    gst_pad_proxy_setcaps           (GstPad *pad,
                                             GstCaps *caps);

Calls gst_pad_set_caps() for every other pad belonging to the same element as pad. If gst_pad_set_caps() fails on any pad, the proxy setcaps fails. May be used only during negotiation.

pad : a GstPad to proxy from
caps : the GstCaps to link with
Returns : TRUE if sucessful

gst_pad_get_allowed_caps ()

GstCaps*    gst_pad_get_allowed_caps        (GstPad *srcpad);

Gets the capabilities of the allowed media types that can flow through srcpad and its peer. The pad must be a source pad. The caller must free the resulting caps.

srcpad : a GstPad, it must a a source pad.
Returns : the allowed GstCaps of the pad link. Free the caps when you no longer need it. This function returns NULL when the srcpad has no peer. MT safe.

gst_pad_get_fixed_caps_func ()

GstCaps*    gst_pad_get_fixed_caps_func     (GstPad *pad);

A helper function you can use as a GetCaps function that will return the currently negotiated caps or the padtemplate when NULL.

pad : the pad to use
Returns : The currently negotiated caps or the padtemplate.

gst_pad_get_peer ()

GstPad*     gst_pad_get_peer                (GstPad *pad);

Gets the peer of pad. This function refs the peer pad so you need to unref it after use.

pad : a GstPad to get the peer of.
Returns : the peer GstPad. Unref after usage. MT safe.

gst_pad_peer_get_caps ()

GstCaps*    gst_pad_peer_get_caps           (GstPad *pad);

Gets the capabilities of the peer connected to this pad.

pad : a GstPad to get the peer capabilities of.
Returns : the GstCaps of the peer pad. This function returns a new caps, so use gst_caps_unref to get rid of it. this function returns NULL if there is no peer pad or when this function is called recursively from a getcaps function.

gst_pad_peer_accept_caps ()

gboolean    gst_pad_peer_accept_caps        (GstPad *pad,
                                             GstCaps *caps);

Check if the given pad accepts the caps.

pad : a GstPad to check
caps :
Returns : TRUE if the pad can accept the caps.

gst_pad_use_fixed_caps ()

void        gst_pad_use_fixed_caps          (GstPad *pad);

A helper function you can use that sets the gst_pad_get_fixed_caps_func as the gstcaps function for the pad. This way the function will always return the negotiated caps or in case the pad is not negotiated, the padtemplate caps.

Use this function on a pad that, once _set_caps() has been called on it, it cannot be renegotiated to something else.

pad : the pad to use

gst_pad_fixate_caps ()

void        gst_pad_fixate_caps             (GstPad *pad,
                                             GstCaps *caps);

Fixate a caps on the given pad. Modifies the caps in place, so you should make sure that the caps are actually writable (see gst_caps_make_writable()).

pad : a GstPad to fixate
caps : the GstCaps to fixate

gst_pad_set_fixatecaps_function ()

void        gst_pad_set_fixatecaps_function (GstPad *pad,
                                             GstPadFixateCapsFunction fixatecaps);

Sets the given fixatecaps function for the pad. The fixatecaps function will be called whenever the default values for a GstCaps needs to be filled in.

pad : a GstPad.
fixatecaps : the GstPadFixateCapsFunction to set.

gst_pad_set_activatepush_function ()

void        gst_pad_set_activatepush_function
                                            (GstPad *pad,
                                             GstPadActivateModeFunction activatepush);

Sets the given activate_push function for the pad. An activate_push function prepares the element for pushing. See XXX part-activation.txt for details.

pad : a sink GstPad.
activatepush : the GstPadActivateModeFunction to set.

gst_pad_push ()

GstFlowReturn gst_pad_push                  (GstPad *pad,
                                             GstBuffer *buffer);

Pushes a buffer to the peer of pad. pad must be linked.

pad : a source GstPad.
buffer : the GstBuffer to push.
Returns : a GstFlowReturn from the peer pad. MT safe.

gst_pad_push_event ()

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

Sends the event to the peer of the given pad. This function is mainly used by elements to send events to their peer elements.

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

gst_pad_check_pull_range ()

gboolean    gst_pad_check_pull_range        (GstPad *pad);

Checks if a #gst_pad_pull_range() can be performed on the peer source pad. This function is used by plugins that want to check if they can use random access on the peer source pad.

The peer sourcepad can implement a custom GstPadCheckGetRangeFunction if it needs to perform some logic to determine if pull_range is possible.

pad : a sink GstPad.
Returns : a gboolean with the result. MT safe.

gst_pad_pull_range ()

GstFlowReturn gst_pad_pull_range            (GstPad *pad,
                                             guint64 offset,
                                             guint size,
                                             GstBuffer **buffer);

Pulls a buffer from the peer pad. pad must be linked.

pad : a sink GstPad.
offset : The start offset of the buffer
size : The length of the buffer
buffer : a pointer to hold the GstBuffer.
Returns : a GstFlowReturn from the peer pad. MT safe.

gst_pad_activate_pull ()

gboolean    gst_pad_activate_pull           (GstPad *pad,
                                             gboolean active);

Activates or deactivates the given pad in pull mode via dispatching to the pad's activatepullfunc. For use from within pad activation functions only. When called on sink pads, will first proxy the call to the peer pad, which is expected to activate its internally linked pads from within its activate_pull function.

If you don't know what this is, you probably don't want to call it.

pad : the GstPad to activate or deactivate.
active : whether or not the pad should be active.
Returns : TRUE if the operation was successfull. MT safe.

gst_pad_activate_push ()

gboolean    gst_pad_activate_push           (GstPad *pad,
                                             gboolean active);

Activates or deactivates the given pad in push mode via dispatching to the pad's activatepushfunc. For use from within pad activation functions only.

If you don't know what this is, you probably don't want to call it.

pad : the GstPad to activate or deactivate.
active : whether or not the pad should be active.
Returns : TRUE if the operation was successfull. MT safe.

gst_pad_send_event ()

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

Sends the event to the pad. This function can be used by applications to send events in the pipeline.

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. End-of-stream and discontinuity events are handled specially, and then the event is sent to all pads internally linked to pad. Note that if there are many possible sink pads that are internally linked to pad, only one will be sent an event. Multi-sinkpad elements should implement custom event handlers.

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

void        gst_pad_set_query_function      (GstPad *pad,
                                             GstPadQueryFunction query);

Set the given query function for the pad.

pad : a GstPad of either direction.
query : the GstPadQueryFunction to set.

gst_pad_set_query_type_function ()

void        gst_pad_set_query_type_function (GstPad *pad,
                                             GstPadQueryTypeFunction type_func);

Set the given query type function for the pad.

pad : a GstPad of either direction.
type_func : the GstPadQueryTypeFunction to set.

gst_pad_get_query_types ()

const GstQueryType* gst_pad_get_query_types (GstPad *pad);

Get an array of supported queries that can be performed on this pad.

pad : a GstPad.
Returns : a zero-terminated array of GstQueryType.

gst_pad_get_query_types_default ()

const GstQueryType* gst_pad_get_query_types_default
                                            (GstPad *pad);

Invoke the default dispatcher for the query types on the pad.

pad : a GstPad.
Returns : an zero-terminated array of GstQueryType, or NULL if none of the internally-linked pads has a query types function.

gst_pad_query ()

gboolean    gst_pad_query                   (GstPad *pad,
                                             GstQuery *query);

Dispatches a query to a pad. The query should have been allocated by the caller via one of the type-specific allocation functions in gstquery.h. The element is responsible for filling the query with an appropriate response, which should then be parsed with a type-specific query parsing function.

Again, the caller is responsible for both the allocation and deallocation of the query structure.

pad : a GstPad to invoke the default query on.
query : the GstQuery to perform.
Returns : TRUE if the query could be performed.

gst_pad_query_default ()

gboolean    gst_pad_query_default           (GstPad *pad,
                                             GstQuery *query);

pad :
query :
Returns :

gst_pad_query_position ()

gboolean    gst_pad_query_position          (GstPad *pad,
                                             GstFormat *format,
                                             gint64 *cur,
                                             gint64 *end);

Queries a pad for the stream position and length.

pad : a GstPad to invoke the position query on.
format : a pointer to the GstFormat asked for. On return contains the GstFormat used.
cur : A location in which to store the current position, or NULL.
end : A location in which to store the end position (length), or NULL.
Returns : TRUE if the query could be performed.

gst_pad_query_convert ()

gboolean    gst_pad_query_convert           (GstPad *pad,
                                             GstFormat src_format,
                                             gint64 src_val,
                                             GstFormat *dest_format,
                                             gint64 *dest_val);

Queries a pad to convert src_val in src_format to dest_format.

pad : a GstPad to invoke the convert query on.
src_format : a GstFormat to convert from.
src_val : a value to convert.
dest_format : a pointer to the GstFormat to convert to.
dest_val : a pointer to the result.
Returns : TRUE if the query could be performed.

gst_pad_set_internal_link_function ()

void        gst_pad_set_internal_link_function
                                            (GstPad *pad,
                                             GstPadIntLinkFunction intlink);

Sets the given internal link function for the pad.

pad : a GstPad of either direction.
intlink : the GstPadIntLinkFunction to set.

gst_pad_get_internal_links ()

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. Not MT safe.

gst_pad_get_internal_links_default ()

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, or NULL if the pad has no parent. Not MT safe.

gst_pad_dispatcher ()

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.

gst_pad_load_and_link ()

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.

gst_pad_add_data_probe ()

gulong      gst_pad_add_data_probe          (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Connects a signal handler to the pad's have-data signal, and increases the do_{buffer,event}_signals number on the pads so that those signals are actually fired.

pad : pad to add the data probe handler to
handler : function to call when data is passed over pad
data : data to pass along with the handler
Returns : The handler id

gst_pad_add_buffer_probe ()

gulong      gst_pad_add_buffer_probe        (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Connects a signal handler to the pad's have-data signal, and increases the do_buffer_signals number on the pads so that this signal is actually fired.

pad : pad to add the buffer probe handler to
handler : function to call when data is passed over pad
data : data to pass along with the handler
Returns : The handler id

gst_pad_add_event_probe ()

gulong      gst_pad_add_event_probe         (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Connects a signal handler to the pad's have-data signal, and increases the do_event_signals number on the pads so that this signal is actually fired.

pad : pad to add the event probe handler to
handler : function to call when data is passed over pad
data : data to pass along with the handler
Returns : The handler id

gst_pad_remove_data_probe ()

void        gst_pad_remove_data_probe       (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Unconnects a signal handler to the pad's have-data signal, and decreases the do_{buffer,event}_signals number on the pads so that those signals are actually no more fired if no signals are connected.

pad : pad to remove the data probe handler from
handler : function that was assigned to the signal
data : data that was assigned to the signal handler

gst_pad_remove_buffer_probe ()

void        gst_pad_remove_buffer_probe     (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Unconnects a signal handler to the pad's have-data signal, and decreases the emit_buffer_signals number on the pads so that this signal is actually no more fired if no signals are connected.

pad : pad to remove the buffer probe handler from
handler : function that was assigned to the signal
data : data that was assigned to the signal handler

gst_pad_remove_event_probe ()

void        gst_pad_remove_event_probe      (GstPad *pad,
                                             GCallback handler,
                                             gpointer data);

Unconnects a signal handler to the pad's have-data signal, and decreases the do_event_signals number on the pads so that this signal is actually no more fired if no signals are connected.

pad : pad to remove the event probe handler from
handler : function that was assigned to the signal
data : data that was assigned to the signal handler

Properties

The "caps" property

  "caps"                 GstCaps               : Read

The capabilities of the pad.


The "direction" property

  "direction"            GstPadDirection       : Read / Write / Construct Only

The direction of the pad.

Default value: GST_PAD_UNKNOWN


The "template" property

  "template"             GstPadTemplate        : Read / Write

The GstPadTemplate of this pad.

Signals

The "have-data" signal

gboolean    user_function                  (GstPad *pad,
                                            GstMiniObject mini_obj,
                                            gpointer user_data);

Signals that new data is available on the pad. This signal is used internally for implementing pad probes. See gst_pad_add_*_probe functions.

pad : the pad that emitted the signal
mini_obj : new data
user_data : user data set when the signal handler was connected.
Returns : TRUE to keep the data, FALSE to drop it

The "linked" signal

void        user_function                  (GstPad *pad,
                                            GstPad *peer,
                                            gpointer user_data);

Signals that a pad has been linked to the peer pad.

pad : the pad that emitted the signal
peer : the peer pad that has been connected
user_data : user data set when the signal handler was connected.

The "request-link" signal

void        user_function                  (GstPad *pad,
                                            gpointer user_data);

Signals that a pad connection has been requested.

pad : the pad that emitted the signal
peer : the peer pad for which a connection is requested
user_data : user data set when the signal handler was connected.

The "unlinked" signal

void        user_function                  (GstPad *pad,
                                            GstPad *peer,
                                            gpointer user_data);

Signals that a pad has been unlinked from the peer pad.

pad : the pad that emitted the signal
peer : the peer pad that has been disconnected
user_data : user data set when the signal handler was connected.

See Also

GstPadTemplate, GstElement, GstEvent