GstPad

Name

GstPad -- The connection between Elements

Synopsis


#include <gst/gst.h>


#define     GST_PAD_CONNECTED               (pad)
#define     GST_PAD_CAN_PULL                (pad)
struct      GstPad;
void        (*GstPadChainFunction)          (GstPad *pad,
                                             GstBuffer *buf);
GstBuffer*  (*GstPadGetFunction)            (GstPad *pad);
GstBuffer*  (*GstPadGetRegionFunction)      (GstPad *pad,
                                             gulong offset,
                                             gulong size);
void        (*GstPadQoSFunction)            (GstPad *pad,
                                             glong qos_message);
gboolean    (*GstPadEOSFunction)            (GstPad *pad);
void        (*GstPadPushFunction)           (GstPad *pad,
                                             GstBuffer *buf);
GstBuffer*  (*GstPadPullFunction)           (GstPad *pad);
GstBuffer*  (*GstPadPullRegionFunction)     (GstPad *pad,
                                             gulong offset,
                                             gulong size);
enum        GstPadDirection;
enum        GstPadFlags;
GstPad*     gst_pad_new                     (gchar *name,
                                             GstPadDirection direction);
#define     gst_pad_destroy                 (pad)
GstPad*     gst_pad_new_from_template       (GstPadTemplate *temp,
                                             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_getregion_function  (GstPad *pad,
                                             GstPadGetRegionFunction getregion);
void        gst_pad_set_qos_function        (GstPad *pad,
                                             GstPadQoSFunction qos);
void        gst_pad_set_eos_function        (GstPad *pad,
                                             GstPadEOSFunction eos);
void        gst_pad_set_caps_list           (GstPad *pad,
                                             GList *caps);
GList*      gst_pad_get_caps_list           (GstPad *pad);
GstCaps*    gst_pad_get_caps_by_name        (GstPad *pad,
                                             gchar *name);
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_parent              (GstPad *pad,
                                             GstObject *parent);
GstObject*  gst_pad_get_parent              (GstPad *pad);
void        gst_pad_add_ghost_parent        (GstPad *pad,
                                             GstObject *parent);
void        gst_pad_remove_ghost_parent     (GstPad *pad,
                                             GstObject *parent);
GList*      gst_pad_get_ghost_parents       (GstPad *pad);
GstPad*     gst_pad_get_peer                (GstPad *pad);
void        gst_pad_connect                 (GstPad *srcpad,
                                             GstPad *sinkpad);
void        gst_pad_disconnect              (GstPad *srcpad,
                                             GstPad *sinkpad);
void        gst_pad_push                    (GstPad *pad,
                                             GstBuffer *buffer);
GstBuffer*  gst_pad_pull                    (GstPad *pad);
GstBuffer*  gst_pad_pull_region             (GstPad *pad,
                                             gulong offset,
                                             gulong size);
#define     gst_pad_pullregion              (pad,offset,size)
GstPad*     gst_pad_select                  (GstPad *nextpad,
                                             ...);
gboolean    gst_pad_set_eos                 (GstPad *pad);
gboolean    gst_pad_eos_func                (GstPad *pad);
void        gst_pad_handle_qos              (GstPad *pad,
                                             glong qos_message);
#define     gst_pad_eos                     (pad)
xmlNodePtr  gst_pad_save_thyself            (GstPad *pad,
                                             xmlNodePtr parent);
void        gst_pad_load_and_connect        (xmlNodePtr parent,
                                             GstObject *element,
                                             GHashTable *elements);
typedef     GstPadFactoryEntry;
typedef     GstPadFactory[];
#define     GST_PAD_FACTORY_SOMETIMES
#define     GST_PAD_FACTORY_ALWAYS
#define     GST_PAD_FACTORY_SINK
#define     GST_PAD_FACTORY_SRC
#define     GST_PAD_FACTORY_CAPS            (a...)
enum        GstPadPresence;
struct      GstPadTemplate;
GstPadTemplate* gst_padtemplate_new         (GstPadFactory *factory);
GstPadTemplate* gst_padtemplate_create      (gchar *name_template,
                                             GstPadDirection direction,
                                             GstPadPresence presence,
                                             GList *caps);
GstPadTemplate* gst_padtemplate_load_thyself
                                            (xmlNodePtr parent);
xmlNodePtr  gst_padtemplate_save_thyself    (GstPadTemplate *pad,
                                             xmlNodePtr parent);

Object Hierarchy


  GtkObject
   +----GstObject
         +----GstPad

Description

Elements are connected to each other via "pads", which are extremely light-weight generic connections.

Details

GST_PAD_CONNECTED()

#define GST_PAD_CONNECTED(pad) 		((pad) && (pad)->peer != NULL)

Is this pad connected.

pad :the pad to check


GST_PAD_CAN_PULL()

#define GST_PAD_CAN_PULL(pad) 		((pad) && (pad)->pullfunc != NULL)

Can this pad be used to pull a buffer.

pad :the pad to check


struct GstPad

struct GstPad;


GstPadChainFunction ()

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

The function that will be called when chaining buffers.

pad :the pad that performed the chain
buf :the buffer that is chained


GstPadGetFunction ()

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

The function that will be called when pulling a buffer.

pad :the pad to get a buffer from
Returns :a GstBuffer


GstPadGetRegionFunction ()

GstBuffer*  (*GstPadGetRegionFunction)      (GstPad *pad,
                                             gulong offset,
                                             gulong size);

The function that will be called when pulling a region buffer.

pad :the pad to get a buffer from
offset :the offset of the region to get
size :the size of the region to get
Returns :a GstBuffer


GstPadQoSFunction ()

void        (*GstPadQoSFunction)            (GstPad *pad,
                                             glong qos_message);

The function that will be called when a QoS message is sent.

pad :the pad that sent the QoS message
qos_message :the message


GstPadEOSFunction ()

gboolean    (*GstPadEOSFunction)            (GstPad *pad);

The function that will be called in an EOS case.

pad :the pad that needs to be set to EOS state
Returns :TRUE if EOS was successful, FALSE otherwise


GstPadPushFunction ()

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

The function that will be called when pushing a buffers.

pad :the pad to push
buf :a GstBuffer to push


GstPadPullFunction ()

GstBuffer*  (*GstPadPullFunction)           (GstPad *pad);

The function that will be called when pulling buffers.

pad :the pad to pull
Returns :a GstBuffer


GstPadPullRegionFunction ()

GstBuffer*  (*GstPadPullRegionFunction)     (GstPad *pad,
                                             gulong offset,
                                             gulong size);

The function that will be called when pulling a region buffer.

pad :the pad to pull
offset :the offset of the region to pull
size :the size of the region to pull
Returns :a GstBuffer


enum GstPadDirection

typedef enum {
  GST_PAD_UNKNOWN,
  GST_PAD_SRC,
  GST_PAD_SINK,
} GstPadDirection;

The direction this pad is.

GST_PAD_UNKNOWNdirection is unknown
GST_PAD_SRCthis is a source pad
GST_PAD_SINKthis 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                     (gchar *name,
                                             GstPadDirection direction);

Create a new pad with given name.

name : name of new pad
direction : either GST_PAD_SRC or GST_PAD_SINK
Returns : new pad


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 *temp,
                                             gchar *name);

Create a new pad with given name from the given template.

temp : the pad template to use
name : the name of the element
Returns : new pad


gst_pad_get_direction ()

GstPadDirection gst_pad_get_direction       (GstPad *pad);

Get the direction of the pad.

pad : the Pad to get the direction from
Returns : the direction of the pad


gst_pad_set_chain_function ()

void        gst_pad_set_chain_function      (GstPad *pad,
                                             GstPadChainFunction chain);

Set the given chain function for the pad.

pad : the pad to set the chain function for
chain : the chain function


gst_pad_set_get_function ()

void        gst_pad_set_get_function        (GstPad *pad,
                                             GstPadGetFunction get);

Set the given get function for the pad.

pad : the pad to set the get function for
get : the get function


gst_pad_set_getregion_function ()

void        gst_pad_set_getregion_function  (GstPad *pad,
                                             GstPadGetRegionFunction getregion);

Set the given getregion function for the pad.

pad : the pad to set the getregion function for
getregion : the getregion function


gst_pad_set_qos_function ()

void        gst_pad_set_qos_function        (GstPad *pad,
                                             GstPadQoSFunction qos);

Set the given qos function for the pad.

pad : the pad to set the qos function for
qos : the qos function


gst_pad_set_eos_function ()

void        gst_pad_set_eos_function        (GstPad *pad,
                                             GstPadEOSFunction eos);

Set the given EOS function for the pad.

pad : the pad to set the eos function for
eos : the eos function


gst_pad_set_caps_list ()

void        gst_pad_set_caps_list           (GstPad *pad,
                                             GList *caps);

Set the capabilities of this pad.

pad : the pad to set the caps to
caps : the capslist to attach to this pad


gst_pad_get_caps_list ()

GList*      gst_pad_get_caps_list           (GstPad *pad);

Get the capabilities of this pad.

pad : the pad to get the capabilities from
Returns : a list of capabilities of this pad


gst_pad_get_caps_by_name ()

GstCaps*    gst_pad_get_caps_by_name        (GstPad *pad,
                                             gchar *name);

Get the capabilities with the given name from this pad.

pad : the pad to get the capabilities from
name : the name of the capability to get
Returns : a capability or NULL if not found


gst_pad_check_compatibility ()

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

Check if two pads have compatible capabilities.

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


gst_pad_set_name ()

void        gst_pad_set_name                (GstPad *pad,
                                             const gchar *name);

Set the name of a pad.

pad : the pad to set the name of
name : the name of the pad


gst_pad_get_name ()

const gchar* gst_pad_get_name               (GstPad *pad);

Get the name of a pad.

pad : the pad to get the name of
Returns : the name of the pad, don't free.


gst_pad_set_parent ()

void        gst_pad_set_parent              (GstPad *pad,
                                             GstObject *parent);

Sets the parent object of a pad.

pad : the pad to set the parent
parent : the object to set the parent to


gst_pad_get_parent ()

GstObject*  gst_pad_get_parent              (GstPad *pad);

Get the parent object of this pad.

pad : the pad to get the parent from
Returns : the parent object


gst_pad_add_ghost_parent ()

void        gst_pad_add_ghost_parent        (GstPad *pad,
                                             GstObject *parent);

Add a ghost parent object to a pad.

pad : the pad to set the ghost parent
parent : the object to set the ghost parent to


gst_pad_remove_ghost_parent ()

void        gst_pad_remove_ghost_parent     (GstPad *pad,
                                             GstObject *parent);

Remove a ghost parent object from a pad.

pad : the pad to remove the ghost parent
parent : the object to remove the ghost parent from


gst_pad_get_ghost_parents ()

GList*      gst_pad_get_ghost_parents       (GstPad *pad);

Get the ghost parents of this pad.

pad : the pad to get the ghost parents from
Returns : a GList of ghost parent objects


gst_pad_get_peer ()

GstPad*     gst_pad_get_peer                (GstPad *pad);

Get the peer pad of this pad.

pad : the pad to get the peer from
Returns : the peer pad


gst_pad_connect ()

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

Connects the source pad to the sink pad.

srcpad : the source pad to connect
sinkpad : the sink pad to connect


gst_pad_disconnect ()

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

Disconnects the source pad from the sink pad.

srcpad : the source pad to disconnect
sinkpad : the sink pad to disconnect


gst_pad_push ()

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

pad : 
buffer : 


gst_pad_pull ()

GstBuffer*  gst_pad_pull                    (GstPad *pad);

pad : 
Returns : 


gst_pad_pull_region ()

GstBuffer*  gst_pad_pull_region             (GstPad *pad,
                                             gulong offset,
                                             gulong size);

pad : 
offset : 
size : 
Returns : 


gst_pad_pullregion()

#define     gst_pad_pullregion(pad,offset,size)

pad : 
offset : 
size : 


gst_pad_select ()

GstPad*     gst_pad_select                  (GstPad *nextpad,
                                             ...);

nextpad : 
... : 
Returns : 


gst_pad_set_eos ()

gboolean    gst_pad_set_eos                 (GstPad *pad);

Sets the given pad to the EOS state.

pad : the pad to set to eos
Returns : TRUE if it succeeded


gst_pad_eos_func ()

gboolean    gst_pad_eos_func                (GstPad *pad);

pad : 
Returns : 


gst_pad_handle_qos ()

void        gst_pad_handle_qos              (GstPad *pad,
                                             glong qos_message);

Pass the qos message downstream.

pad : the pad to handle the QoS message
qos_message : the QoS message to handle


gst_pad_eos()

#define			gst_pad_eos(pad)		((pad)->peer->eosfunc((pad)->peer))

pad : 


gst_pad_save_thyself ()

xmlNodePtr  gst_pad_save_thyself            (GstPad *pad,
                                             xmlNodePtr parent);

Saves the pad into an xml representation

pad : the pad to save
parent : the parent XML node to save the description in
Returns : the xml representation of the pad


gst_pad_load_and_connect ()

void        gst_pad_load_and_connect        (xmlNodePtr parent,
                                             GstObject *element,
                                             GHashTable *elements);

Read the pad definition from the XML node and connect the given pad in element to a pad of an element in the hashtable.

parent : the parent XML node to read the description from
element : the element that has the source pad
elements : a hashtable with elements


GstPadFactoryEntry

typedef gpointer GstPadFactoryEntry;

Defines an entry for a padfactory.


GstPadFactory[]

typedef GstPadFactoryEntry GstPadFactory[];

The padfactory.


GST_PAD_FACTORY_SOMETIMES

#define GST_PAD_FACTORY_SOMETIMES 	GINT_TO_POINTER(GST_PAD_SOMETIMES)

Indicate that this pad will become available depending on the media type. Use this in the factory definition.


GST_PAD_FACTORY_ALWAYS

#define GST_PAD_FACTORY_ALWAYS 		GINT_TO_POINTER(GST_PAD_ALWAYS)

Indicate that this pad will always be available. Use this in the factory definition.


GST_PAD_FACTORY_SINK

#define GST_PAD_FACTORY_SINK 		GINT_TO_POINTER(GST_PAD_SINK)

Indicates a sinkpad for the padfactory.


GST_PAD_FACTORY_SRC

#define GST_PAD_FACTORY_SRC	 	GINT_TO_POINTER(GST_PAD_SRC)

Indicates a srcpad for the padfactory.


GST_PAD_FACTORY_CAPS()

#define GST_PAD_FACTORY_CAPS(a...) 	GINT_TO_POINTER(1),##a,NULL

Starts the declaration of a the capabilities for this padtemplate.

a... :a capability factory


enum GstPadPresence

typedef enum {
  GST_PAD_ALWAYS,
  GST_PAD_SOMETIMES,
} GstPadPresence;

Indicates when this pad will become available.

GST_PAD_ALWAYSthe pad is always available
GST_PAD_SOMETIMESthe pad will become available depending on the media stream


struct GstPadTemplate

struct GstPadTemplate {
  GstObject 	  object;

  gchar           *name_template;
  GstPadDirection direction;
  GstPadPresence  presence;
  GList  	  *caps;
};


gst_padtemplate_new ()

GstPadTemplate* gst_padtemplate_new         (GstPadFactory *factory);

Creates a new padtemplate from the factory.

factory : the padfactory to use
Returns : the new padtemplate


gst_padtemplate_create ()

GstPadTemplate* gst_padtemplate_create      (gchar *name_template,
                                             GstPadDirection direction,
                                             GstPadPresence presence,
                                             GList *caps);

Creates a new padtemplate from the given arguments.

name_template : the name template
direction : the direction for the template
presence : the presence of the pad
caps : a list of capabilities for the template
Returns : the new padtemplate


gst_padtemplate_load_thyself ()

GstPadTemplate* gst_padtemplate_load_thyself
                                            (xmlNodePtr parent);

Loads a padtemplate from the XML tree.

parent : the source XML tree
Returns : the new padtemplate


gst_padtemplate_save_thyself ()

xmlNodePtr  gst_padtemplate_save_thyself    (GstPadTemplate *pad,
                                             xmlNodePtr parent);

Saves the padtemplate into XML.

pad : the padtemplate to save
parent : the parent XML tree
Returns : the new XML tree