GstGhostPad

GstGhostPad — Pseudo link pads

Synopsis


#include <gst/gst.h>


            GstGhostPad;
GstPad*     gst_ghost_pad_new               (const gchar *name,
                                             GstPad *target);
GstPad*     gst_ghost_pad_new_no_target     (const gchar *name,
                                             GstPadDirection dir);
GstPad*     gst_ghost_pad_new_from_template (const gchar *name,
                                             GstPad *target,
                                             GstPadTemplate *templ);
GstPad*     gst_ghost_pad_new_no_target_from_template
                                            (const gchar *name,
                                             GstPadTemplate *templ);
gboolean    gst_ghost_pad_set_target        (GstGhostPad *gpad,
                                             GstPad *newtarget);
GstPad*     gst_ghost_pad_get_target        (GstGhostPad *gpad);


Object Hierarchy


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

Description

GhostPads are useful when organizing pipelines with GstBin like elements. The idea here is to create hierarchical element graphs. The bin element contains a sub-graph. Now one would like to treat the bin-element like other GstElements. This is where GhostPads come into play. A GhostPad acts as a proxy for another pad. Thus the bin can have sink and source ghost-pads that are associated with sink and source pads of the child elements.

If the target pad is known at creation time, gst_ghost_pad_new() is the function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target() to create the ghost-pad and use gst_ghost_pad_set_target() to establish the association later on.

Note that GhostPads add overhead to the data processing of a pipeline.

Last reviewed on 2005-11-18 (0.9.5)

Details

GstGhostPad

typedef struct _GstGhostPad GstGhostPad;

Opaque GstGhostPad structure.


gst_ghost_pad_new ()

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

Create a new ghostpad with target as the target. The direction will be taken from the target pad. target must be unlinked.

Will ref the target.

name :name the name of the new pad, or NULL to assign a default name. the name of the new pad, or NULL to assign a default name. target :target the pad to ghost. the pad to ghost. Returns :Returns a new GstPad, or NULL in case of an error. a new GstPad, or NULL in case of an error. GstPadGstPad
name : the name of the new pad, or NULL to assign a default name.
target : the pad to ghost.
Returns : a new GstPad, or NULL in case of an error.

gst_ghost_pad_new_no_target ()

GstPad*     gst_ghost_pad_new_no_target     (const gchar *name,
                                             GstPadDirection dir);

Create a new ghostpad without a target with the given direction. A target can be set on the ghostpad later with the gst_ghost_pad_set_target() function.

The created ghostpad will not have a padtemplate.

name :name the name of the new pad, or NULL to assign a default name. the name of the new pad, or NULL to assign a default name. dir :dir the direction of the ghostpad the direction of the ghostpad Returns :Returns a new GstPad, or NULL in case of an error. a new GstPad, or NULL in case of an error. GstPadGstPad
name : the name of the new pad, or NULL to assign a default name.
dir : the direction of the ghostpad
Returns : a new GstPad, or NULL in case of an error.

gst_ghost_pad_new_from_template ()

GstPad*     gst_ghost_pad_new_from_template (const gchar *name,
                                             GstPad *target,
                                             GstPadTemplate *templ);

Create a new ghostpad with target as the target. The direction will be taken from the target pad. The template used on the ghostpad will be template.

Will ref the target.

name :name the name of the new pad, or NULL to assign a default name. the name of the new pad, or NULL to assign a default name. target :target the pad to ghost. the pad to ghost. templ :templ the GstPadTemplate to use on the ghostpad. the GstPadTemplate to use on the ghostpad. GstPadTemplateGstPadTemplateReturns :Returns a new GstPad, or NULL in case of an error. a new GstPad, or NULL in case of an error. GstPadGstPad
name : the name of the new pad, or NULL to assign a default name.
target : the pad to ghost.
templ : the GstPadTemplate to use on the ghostpad.
Returns : a new GstPad, or NULL in case of an error.

Since 0.10.10


gst_ghost_pad_new_no_target_from_template ()

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

Create a new ghostpad based on templ, without setting a target. The direction will be taken from the templ.

name :name the name of the new pad, or NULL to assign a default name. the name of the new pad, or NULL to assign a default name. templ :templ the GstPadTemplate to create the ghostpad from. the GstPadTemplate to create the ghostpad from. GstPadTemplateGstPadTemplateReturns :Returns a new GstPad, or NULL in case of an error. a new GstPad, or NULL in case of an error. GstPadGstPad
name : the name of the new pad, or NULL to assign a default name.
templ : the GstPadTemplate to create the ghostpad from.
Returns : a new GstPad, or NULL in case of an error.

Since 0.10.10


gst_ghost_pad_set_target ()

gboolean    gst_ghost_pad_set_target        (GstGhostPad *gpad,
                                             GstPad *newtarget);

Set the new target of the ghostpad gpad. Any existing target is unlinked and links to the new target are established.

gpad :gpad the GstGhostpad the GstGhostpad GstGhostpadGstGhostpadnewtarget :newtarget the new pad target the new pad target Returns :Returns TRUE if the new target could be set, FALSE otherwise. TRUE if the new target could be set, FALSE otherwise.
gpad : the GstGhostpad
newtarget : the new pad target
Returns : TRUE if the new target could be set, FALSE otherwise.

gst_ghost_pad_get_target ()

GstPad*     gst_ghost_pad_get_target        (GstGhostPad *gpad);

Get the target pad of gpad. Unref target pad after usage.

gpad :gpad the GstGhostpad the GstGhostpad GstGhostpadGstGhostpadReturns :Returns the target GstPad, can be NULL if the ghostpad has no target set. Unref target pad after usage. the target GstPad, can be NULL if the ghostpad has no target set. Unref target pad after usage. GstPadGstPad
gpad : the GstGhostpad
Returns : the target GstPad, can be NULL if the ghostpad has no target set. Unref target pad after usage.

See Also

GstPad