GhostPad#
Superclasses: ProxyPad
, Pad
, Object
, InitiallyUnowned
, Object
GhostPads are useful when organizing pipelines with Bin
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 Element
. 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, new()
is the
function to use to get a ghost-pad. Otherwise one can use new_no_target()
to create the ghost-pad and use set_target()
to establish the
association later on.
Note that GhostPads add overhead to the data processing of a pipeline.
Constructors#
- class GhostPad
- classmethod new(name: str | None, target: Pad) Pad | None #
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.
- Parameters:
name – the name of the new pad, or
None
to assign a default nametarget – the pad to ghost.
- classmethod new_from_template(name: str | None, target: Pad, templ: PadTemplate) Pad | None #
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 betemplate
.Will ref the target.
- Parameters:
name – the name of the new pad, or
None
to assign a default name.target – the pad to ghost.
templ – the
PadTemplate
to use on the ghostpad.
- classmethod new_no_target(name: str | None, dir: PadDirection) Pad | None #
Create a new ghostpad without a target with the given direction. A target can be set on the ghostpad later with the
set_target()
function.The created ghostpad will not have a padtemplate.
- Parameters:
name – the name of the new pad, or
None
to assign a default name.dir – the direction of the ghostpad
- classmethod new_no_target_from_template(name: str | None, templ: PadTemplate) Pad | None #
Create a new ghostpad based on
templ
, without setting a target. The direction will be taken from thetempl
.- Parameters:
name – the name of the new pad, or
None
to assign a default nametempl – the
PadTemplate
to create the ghostpad from.
Methods#
- class GhostPad
- classmethod activate_mode_default(parent: Object | None, mode: PadMode, active: bool) bool #
Invoke the default activate mode function of a ghost pad.
- Parameters:
parent – the parent of
pad
orNone
mode – the requested activation mode
active – whether the pad should be active or not.
- construct() bool #
Finish initialization of a newly allocated ghost pad.
This function is most useful in language bindings and when subclassing
GhostPad
; 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).Deprecated since version Unknown: This function is deprecated since 1.18 and does nothing anymore.
- classmethod internal_activate_mode_default(parent: Object | None, mode: PadMode, active: bool) bool #
Invoke the default activate mode function of a proxy pad that is owned by a ghost pad.
- Parameters:
parent – the parent of
pad
orNone
mode – the requested activation mode
active – whether the pad should be active or not.