![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <gst/gst.h> struct GstProxyPad; struct 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
); gboolean gst_ghost_pad_construct (GstGhostPad *gpad
); gboolean gst_ghost_pad_setcaps_default (GstPad *pad
,GstCaps *caps
); void gst_ghost_pad_unlink_default (GstPad *pad
); GstPadLinkReturn gst_ghost_pad_link_default (GstPad *pad
,GstPad *peer
); gboolean gst_ghost_pad_activate_pull_default (GstPad *pad
,gboolean active
); gboolean gst_ghost_pad_activate_push_default (GstPad *pad
,gboolean active
); gboolean gst_ghost_pad_internal_activate_push_default (GstPad *pad
,gboolean active
); gboolean gst_ghost_pad_internal_activate_pull_default (GstPad *pad
,gboolean active
); GstProxyPad * gst_proxy_pad_get_internal (GstProxyPad *pad
); const GstQueryType * gst_proxy_pad_query_type_default (GstPad *pad
); gboolean gst_proxy_pad_event_default (GstPad *pad
,GstEvent *event
); gboolean gst_proxy_pad_query_default (GstPad *pad
,GstQuery *query
); GstIterator * gst_proxy_pad_iterate_internal_links_default (GstPad *pad
); GstFlowReturn gst_proxy_pad_bufferalloc_default (GstPad *pad
,guint64 offset
,guint size
,GstCaps *caps
,GstBuffer **buf
); GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad
,GstBuffer *buffer
); GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad
,GstBufferList *list
); GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad
,guint64 offset
,guint size
,GstBuffer **buffer
); gboolean gst_proxy_pad_checkgetrange_default (GstPad *pad
); GstCaps * gst_proxy_pad_getcaps_default (GstPad *pad
); gboolean gst_proxy_pad_acceptcaps_default (GstPad *pad
,GstCaps *caps
); void gst_proxy_pad_fixatecaps_default (GstPad *pad
,GstCaps *caps
); gboolean gst_proxy_pad_setcaps_default (GstPad *pad
,GstCaps *caps
); void gst_proxy_pad_unlink_default (GstPad *pad
);
GObject +----GstObject +----GstPad +----GstProxyPad +----GstGhostPad
GObject +----GstObject +----GstPad +----GstProxyPad +----GstGhostPad
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 any other GstElement. 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)
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.
|
the name of the new pad, or NULL to assign a default name. [allow-none] |
|
the pad to ghost. [transfer none] |
Returns : |
a new GstPad, or NULL in case of an error. [transfer full] |
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.
|
the name of the new pad, or NULL to assign a default name. [allow-none] |
|
the direction of the ghostpad |
Returns : |
a new GstPad, or NULL in case of an error. [transfer full] |
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.
|
the name of the new pad, or NULL to assign a default name. [allow-none] |
|
the pad to ghost. [transfer none] |
|
the GstPadTemplate to use on the ghostpad. [transfer none] |
Returns : |
a new GstPad, or NULL in case of an error. [transfer full] |
Since 0.10.10
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
.
|
the name of the new pad, or NULL to assign a default name. [allow-none] |
|
the GstPadTemplate to create the ghostpad from. [transfer none] |
Returns : |
a new GstPad, or NULL in case of an error. [transfer full] |
Since 0.10.10
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. if newtarget
is
NULL the target will be cleared.
|
the GstGhostPad |
|
the new pad target. [transfer none][allow-none] |
Returns : |
TRUE if the new target could be set. This function can return FALSE when the internal pads could not be linked. [transfer full] |
GstPad * gst_ghost_pad_get_target (GstGhostPad *gpad
);
Get the target pad of gpad
. Unref target pad after usage.
|
the GstGhostPad |
Returns : |
the target GstPad, can be NULL if the ghostpad has no target set. Unref target pad after usage. [transfer full] |
gboolean gst_ghost_pad_construct (GstGhostPad *gpad
);
Finish initialization of a newly allocated ghost pad.
This function is most useful in language bindings and when subclassing
GstGhostPad; plugin and application developers normally will not call this
function. Call this function directly after a call to g_object_new
(GST_TYPE_GHOST_PAD, "direction", dir
, ..., NULL).
|
the newly allocated ghost pad |
Returns : |
TRUE if the construction succeeds, FALSE otherwise. |
Since 0.10.22
gboolean gst_ghost_pad_setcaps_default (GstPad *pad
,GstCaps *caps
);
Invoke the default setcaps function of a ghost pad.
|
the GstPad to link. |
|
the GstCaps to set. [transfer none] |
Returns : |
TRUE if the operation was successful |
Since 0.10.36
void gst_ghost_pad_unlink_default (GstPad *pad
);
Invoke the default unlink function of a ghost pad.
|
the GstPad to link. |
Since 0.10.36
GstPadLinkReturn gst_ghost_pad_link_default (GstPad *pad
,GstPad *peer
);
Invoke the default link function of a ghost pad.
|
the GstPad to link. |
|
the GstPad peer |
Returns : |
GstPadLinkReturn of the operation |
Since 0.10.36
gboolean gst_ghost_pad_activate_pull_default (GstPad *pad
,gboolean active
);
Invoke the default activate pull function of a ghost pad.
|
the GstPad to activate or deactivate. |
|
whether the pad should be active or not. |
Returns : |
TRUE if the operation was successful. |
Since 0.10.36
gboolean gst_ghost_pad_activate_push_default (GstPad *pad
,gboolean active
);
Invoke the default activate push function of a ghost pad.
|
the GstPad to activate or deactivate. |
|
whether the pad should be active or not. |
Returns : |
TRUE if the operation was successful. |
Since 0.10.36
gboolean gst_ghost_pad_internal_activate_push_default (GstPad *pad
,gboolean active
);
Invoke the default activate push function of a proxy pad that is owned by a ghost pad.
|
the GstPad to activate or deactivate. |
|
whether the pad should be active or not. |
Returns : |
TRUE if the operation was successful. |
Since 0.10.36
gboolean gst_ghost_pad_internal_activate_pull_default (GstPad *pad
,gboolean active
);
Invoke the default activate pull function of a proxy pad that is owned by a ghost pad.
|
the GstPad to activate or deactivate. |
|
whether the pad should be active or not. |
Returns : |
TRUE if the operation was successful. |
Since 0.10.36
GstProxyPad * gst_proxy_pad_get_internal (GstProxyPad *pad
);
Get the internal pad of pad
. Unref target pad after usage.
The internal pad of a GstGhostPad is the internally used pad of opposite direction, which is used to link to the target.
|
the GstProxyPad |
Returns : |
the target GstProxyPad, can be NULL. Unref target pad after usage. [transfer full] |
Since 0.10.36
const GstQueryType * gst_proxy_pad_query_type_default (GstPad *pad
);
Invoke the default query type handler of the proxy pad.
|
a GstPad. |
Returns : |
a zero-terminated array of GstQueryType. [transfer none][array zero-terminated=1] |
Since 0.10.36
gboolean gst_proxy_pad_event_default (GstPad *pad
,GstEvent *event
);
Invoke the default event of the proxy pad.
|
a GstPad to push the event to. |
|
the GstEvent to send to the pad. [transfer full] |
Returns : |
TRUE if the event was handled. |
Since 0.10.36
gboolean gst_proxy_pad_query_default (GstPad *pad
,GstQuery *query
);
Invoke the default query function of the proxy pad.
|
a GstPad to invoke the default query on. |
|
the GstQuery to perform. [transfer none] |
Returns : |
TRUE if the query could be performed. |
Since 0.10.36
GstIterator * gst_proxy_pad_iterate_internal_links_default
(GstPad *pad
);
GstFlowReturn gst_proxy_pad_bufferalloc_default (GstPad *pad
,guint64 offset
,guint size
,GstCaps *caps
,GstBuffer **buf
);
Invoke the default bufferalloc function of the proxy pad.
|
a source GstPad |
|
the offset of the new buffer in the stream |
|
the size of the new buffer |
|
the caps of the new buffer |
|
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. |
Since 0.10.36
GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad
,GstBuffer *buffer
);
Invoke the default chain function of the proxy pad.
|
a sink GstPad, returns GST_FLOW_ERROR if not. |
|
the GstBuffer to send, return GST_FLOW_ERROR if not. [transfer full] |
Returns : |
a GstFlowReturn from the pad. |
Since 0.10.36
GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad
,GstBufferList *list
);
Invoke the default chain list function of the proxy pad.
|
a sink GstPad, returns GST_FLOW_ERROR if not. |
|
the GstBufferList to send, return GST_FLOW_ERROR if not. [transfer full] |
Returns : |
a GstFlowReturn from the pad. |
Since 0.10.36
GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad
,guint64 offset
,guint size
,GstBuffer **buffer
);
gboolean gst_proxy_pad_checkgetrange_default (GstPad *pad
);
Invoke the default checkgetrange function of the proxy pad.
|
a src GstPad, returns GST_FLOW_ERROR if not. |
Returns : |
a gboolean from the pad. |
Since 0.10.36
GstCaps * gst_proxy_pad_getcaps_default (GstPad *pad
);
Invoke the default getcaps function of the proxy pad.
|
a GstPad to get the capabilities of. |
Returns : |
the caps of the pad with incremented ref-count. [transfer full] |
Since 0.10.36
gboolean gst_proxy_pad_acceptcaps_default (GstPad *pad
,GstCaps *caps
);
Invoke the default acceptcaps function of the proxy pad.
|
a GstPad to check |
|
a GstCaps to check on the pad |
Returns : |
TRUE if the pad can accept the caps. |
Since 0.10.36
void gst_proxy_pad_fixatecaps_default (GstPad *pad
,GstCaps *caps
);
Invoke the default fixatecaps function of the proxy pad.
Since 0.10.36
gboolean gst_proxy_pad_setcaps_default (GstPad *pad
,GstCaps *caps
);
Invoke the default setcaps function of the proxy pad.
|
a GstPad to set the capabilities of. |
|
a GstCaps to set. [transfer none] |
Returns : |
TRUE if the caps could be set. FALSE if the caps were not fixed or bad parameters were provided to this function. |
Since 0.10.36