:right-sidebar: True GhostPad =================================================================== .. currentmodule:: gi.repository.Gst .. class:: GhostPad(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gst.ProxyPad`, :class:`~gi.repository.Gst.Pad`, :class:`~gi.repository.Gst.Object`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` GhostPads are useful when organizing pipelines with :obj:`~gi.repository.Gst.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 :obj:`~gi.repository.Gst.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, :func:`~gi.repository.Gst.GhostPad.new` is the function to use to get a ghost-pad. Otherwise one can use :func:`~gi.repository.Gst.GhostPad.new_no_target` to create the ghost-pad and use :func:`~gi.repository.Gst.GhostPad.set_target` to establish the association later on. Note that GhostPads add overhead to the data processing of a pipeline. Constructors ------------ .. rst-class:: interim-class .. class:: GhostPad :no-index: .. classmethod:: new(name: str | None, target: ~gi.repository.Gst.Pad) -> ~gi.repository.Gst.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. :param name: the name of the new pad, or :const:`None` to assign a default name :param target: the pad to ghost. .. classmethod:: new_from_template(name: str | None, target: ~gi.repository.Gst.Pad, templ: ~gi.repository.Gst.PadTemplate) -> ~gi.repository.Gst.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 be ``template``\. Will ref the target. :param name: the name of the new pad, or :const:`None` to assign a default name. :param target: the pad to ghost. :param templ: the :obj:`~gi.repository.Gst.PadTemplate` to use on the ghostpad. .. classmethod:: new_no_target(name: str | None, dir: ~gi.repository.Gst.PadDirection) -> ~gi.repository.Gst.Pad | None Create a new ghostpad without a target with the given direction. A target can be set on the ghostpad later with the :func:`~gi.repository.Gst.GhostPad.set_target` function. The created ghostpad will not have a padtemplate. :param name: the name of the new pad, or :const:`None` to assign a default name. :param dir: the direction of the ghostpad .. classmethod:: new_no_target_from_template(name: str | None, templ: ~gi.repository.Gst.PadTemplate) -> ~gi.repository.Gst.Pad | None Create a new ghostpad based on ``templ``\, without setting a target. The direction will be taken from the ``templ``\. :param name: the name of the new pad, or :const:`None` to assign a default name :param templ: the :obj:`~gi.repository.Gst.PadTemplate` to create the ghostpad from. Methods ------- .. rst-class:: interim-class .. class:: GhostPad :no-index: .. classmethod:: activate_mode_default(parent: ~gi.repository.Gst.Object | None, mode: ~gi.repository.Gst.PadMode, active: bool) -> bool Invoke the default activate mode function of a ghost pad. :param parent: the parent of ``pad`` or :const:`None` :param mode: the requested activation mode :param active: whether the pad should be active or not. .. method:: construct() -> bool Finish initialization of a newly allocated ghost pad. This function is most useful in language bindings and when subclassing :obj:`~gi.repository.Gst.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:: Unknown This function is deprecated since 1.18 and does nothing anymore. .. method:: get_target() -> ~gi.repository.Gst.Pad | None Get the target pad of ``gpad``\. Unref target pad after usage. .. classmethod:: internal_activate_mode_default(parent: ~gi.repository.Gst.Object | None, mode: ~gi.repository.Gst.PadMode, active: bool) -> bool Invoke the default activate mode function of a proxy pad that is owned by a ghost pad. :param parent: the parent of ``pad`` or :const:`None` :param mode: the requested activation mode :param active: whether the pad should be active or not. .. method:: set_target(newtarget: ~gi.repository.Gst.Pad | None = None) -> bool Set the new target of the ghostpad ``gpad``\. Any existing target is unlinked and links to the new target are established. if ``newtarget`` is :const:`None` the target will be cleared. :param newtarget: the new pad target Fields ------ .. rst-class:: interim-class .. class:: GhostPad :no-index: .. attribute:: pad .. attribute:: priv