Package org.freedesktop.gstreamer.gst
Class GhostPad
- All Implemented Interfaces:
Proxy
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
GhostPad.Builder<B extends GhostPad.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.ProxyPad
ProxyPad.ProxyPadClass
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.Pad
Pad.LinkedCallback, Pad.PadClass, Pad.UnlinkedCallback
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.GstObject
GstObject.DeepNotifyCallback, GstObject.ObjectClass, GstObject.ObjectImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback
-
Constructor Summary
ConstructorDescriptionCreate a new ghostpad withtarget
as the target.GhostPad
(MemorySegment address) Create a GhostPad proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
activateModeDefault
(Pad pad, @Nullable GstObject parent, PadMode mode, boolean active) Invoke the default activate mode function of a ghost pad.protected GhostPad
asParent()
Returns this instance as if it were its parent type.static GhostPad.Builder
<? extends GhostPad.Builder> builder()
AGhostPad.Builder
object constructs aGhostPad
with the specified properties.boolean
Deprecated.This function is deprecated since 1.18 and does nothing anymore.static GhostPad
fromTemplate
(@Nullable String name, Pad target, PadTemplate templ) Create a new ghostpad withtarget
as the target.static MemoryLayout
The memory layout of the native struct.Get the target pad of this GhostPad.static Type
getType()
Get the GType of the GhostPad classstatic boolean
internalActivateModeDefault
(Pad pad, @Nullable GstObject parent, PadMode mode, boolean active) Invoke the default activate mode function of a proxy pad that is owned by a ghost pad.static GhostPad
noTarget
(@Nullable String name, PadDirection dir) Create a new ghostpad without a target with the given direction.static GhostPad
noTargetFromTemplate
(@Nullable String name, PadTemplate templ) Create a new ghostpad based ontempl
, without setting a target.boolean
Set the new target of the ghostpad this GhostPad.Methods inherited from class org.freedesktop.gstreamer.gst.ProxyPad
chainDefault, chainListDefault, getInternal, getrangeDefault, iterateInternalLinksDefault
Methods inherited from class org.freedesktop.gstreamer.gst.Pad
activateMode, addProbe, addProbe, canLink, chain, chainList, checkReconfigure, createStreamId, createStreamIdPrintf, emitLinked, emitUnlinked, eventDefault, forward, fromStaticTemplate, fromTemplate, getAllowedCaps, getCurrentCaps, getDirection, getElementPrivate, getLastFlowReturn, getOffset, getPadTemplate, getPadTemplateCaps, getParentElement, getPeer, getRange, getSingleInternalLink, getStickyEvent, getStream, getStreamId, getTaskState, hasCurrentCaps, isActive, isBlocked, isBlocking, isLinked, iterateInternalLinks, iterateInternalLinksDefault, link, linked, linkFull, linkFull, linkGetName, linkMaybeGhosting, linkMaybeGhostingFull, linkMaybeGhostingFull, markReconfigure, needsReconfigure, onLinked, onUnlinked, pauseTask, peerQuery, peerQueryAcceptCaps, peerQueryCaps, peerQueryConvert, peerQueryDuration, peerQueryPosition, proxyQueryAcceptCaps, proxyQueryCaps, pullRange, push, pushEvent, pushList, query, queryAcceptCaps, queryCaps, queryConvert, queryDefault, queryDuration, queryPosition, removeProbe, sendEvent, setActivateFunctionFull, setActivatemodeFunctionFull, setActive, setChainFunctionFull, setChainListFunctionFull, setElementPrivate, setEventFullFunctionFull, setEventFunctionFull, setGetrangeFunctionFull, setIterateInternalLinksFunctionFull, setLinkFunctionFull, setOffset, setQueryFunctionFull, setUnlinkFunctionFull, startTask, stickyEventsForeach, stopTask, storeStickyEvent, unlink, unlinked, useFixedCaps
Methods inherited from class org.freedesktop.gstreamer.gst.GstObject
addControlBinding, checkUniqueness, deepNotify, defaultDeepNotify, defaultError, emitDeepNotify, getControlBinding, getControlRate, getGValueArray, getName, getParent, getPathString, getValue, getValueArray, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, onDeepNotify, ref, refSink, removeControlBinding, replace, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setName, setParent, suggestNextSync, syncValues, unparent, unref
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GhostPad
Create a GhostPad proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
GhostPad
Create a new ghostpad withtarget
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, ornull
to assign a default nametarget
- the pad to ghost.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
fromTemplate
Create a new ghostpad withtarget
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, ornull
to assign a default name.target
- the pad to ghost.templ
- theGstPadTemplate
to use on the ghostpad.- Returns:
- a new
GstPad
, ornull
in case of an error.
-
noTarget
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.
- Parameters:
name
- the name of the new pad, ornull
to assign a default name.dir
- the direction of the ghostpad- Returns:
- a new
GstPad
, ornull
in case of an error.
-
noTargetFromTemplate
Create a new ghostpad based ontempl
, without setting a target. The direction will be taken from thetempl
.- Parameters:
name
- the name of the new pad, ornull
to assign a default nametempl
- theGstPadTemplate
to create the ghostpad from.- Returns:
- a new
GstPad
, ornull
in case of an error.
-
activateModeDefault
public static boolean activateModeDefault(Pad pad, @Nullable @Nullable GstObject parent, PadMode mode, boolean active) Invoke the default activate mode function of a ghost pad.- Parameters:
pad
- theGstPad
to activate or deactivate.parent
- the parent ofpad
ornull
mode
- the requested activation modeactive
- whether the pad should be active or not.- Returns:
true
if the operation was successful.
-
internalActivateModeDefault
public static boolean internalActivateModeDefault(Pad pad, @Nullable @Nullable GstObject parent, PadMode mode, boolean active) Invoke the default activate mode function of a proxy pad that is owned by a ghost pad.- Parameters:
pad
- theGstPad
to activate or deactivate.parent
- the parent ofpad
ornull
mode
- the requested activation modeactive
- whether the pad should be active or not.- Returns:
true
if the operation was successful.
-
construct
Deprecated.This function is deprecated since 1.18 and does nothing anymore.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).- Returns:
true
if the construction succeeds,false
otherwise.
-
getTarget
Get the target pad of this GhostPad. Unref target pad after usage.- Returns:
- the target
GstPad
, can benull
if the ghostpad has no target set. Unref target pad after usage.
-
setTarget
Set the new target of the ghostpad this GhostPad. Any existing target is unlinked and links to the new target are established. ifnewtarget
isnull
the target will be cleared.- Parameters:
newtarget
- the new pad target- Returns:
true
if the new target could be set. This function can returnfalse
when the internal pads could not be linked.
-
builder
AGhostPad.Builder
object constructs aGhostPad
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withGhostPad.Builder.build()
.
-