org.gstreamer
Class GhostPad

java.lang.Object
  extended by org.gstreamer.lowlevel.NativeValue
      extended by org.gstreamer.lowlevel.Handle
          extended by org.gstreamer.lowlevel.NativeObject
              extended by org.gstreamer.lowlevel.RefCountedObject
                  extended by org.gstreamer.GObject
                      extended by org.gstreamer.GstObject
                          extended by org.gstreamer.Pad
                              extended by org.gstreamer.GhostPad

public class GhostPad
extends Pad

Pseudo link pads.

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, GhostPad(String, Pad) is the function to use to get a ghost-pad. Otherwise one can use GhostPad(String, PadDirection) to create the ghost-pad and use setTarget(org.gstreamer.Pad) to establish the association later on.

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

See Also:
Pad

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gstreamer.Pad
Pad.EVENT_PROBE, Pad.HAVE_DATA, Pad.LINKED, Pad.REQUEST_LINK, Pad.UNLINKED
 
Nested classes/interfaces inherited from class org.gstreamer.GObject
GObject.GCallback
 
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject
NativeObject.Initializer
 
Field Summary
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, ownsHandle
 
Constructor Summary
GhostPad(NativeObject.Initializer init)
          Creates a new instance of GhostPad
GhostPad(java.lang.String name, Pad target)
          Create a new ghostpad with target as the target.
GhostPad(java.lang.String name, PadDirection direction)
          Create a new ghostpad without a target with the given direction.
GhostPad(java.lang.String name, Pad target, PadTemplate template)
          Create a new ghostpad with target as the target.
GhostPad(java.lang.String name, PadTemplate template)
          Create a new ghostpad based on template, without setting a target.
 
Method Summary
 Pad getTarget()
          Get the target pad of this ghostpad.
 boolean setTarget(Pad pad)
          Set the new target of the ghostpad.
 
Methods inherited from class org.gstreamer.Pad
acceptCaps, addEventProbe, chain, connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, getAllowedCaps, getCaps, getDirection, getNegotiatedCaps, getParentElement, getPeer, getPeerCaps, getRange, isBlocked, isBlocking, isLinked, link, peerAcceptCaps, pullRange, pushEvent, removeEventProbe, sendEvent, setActive, setBlocked, setBlockedAsync, setCaps, unlink
 
Methods inherited from class org.gstreamer.GstObject
addListenerProxy, getName, getParent, initializer, initializer, objectFor, objectFor, ref, removeListenerProxy, setName, steal, toString, unref
 
Methods inherited from class org.gstreamer.GObject
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, invalidate, objectFor, removeCallback, set
 
Methods inherited from class org.gstreamer.lowlevel.NativeObject
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, instanceFor, isDisposed, nativeValue, objectFor, objectFor
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GhostPad

public GhostPad(NativeObject.Initializer init)
Creates a new instance of GhostPad


GhostPad

public GhostPad(java.lang.String name,
                Pad target)
Create a new ghostpad with target as the target. The direction will be taken from the target pad. The target pad must be unlinked.

Parameters:
name - The name of the new pad, or null to assign a default name.
target - The Pad to ghost.

GhostPad

public GhostPad(java.lang.String name,
                Pad target,
                PadTemplate template)
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.

Parameters:
name - The name of the new pad, or null to assign a default name.
target - The Pad to ghost.
template - The PadTemplate to use on the ghostpad.

GhostPad

public GhostPad(java.lang.String name,
                PadDirection direction)
Create a new ghostpad without a target with the given direction. A target can be set on the ghostpad later with the setTarget(org.gstreamer.Pad) method.

The created ghostpad will not have a padtemplate.

Parameters:
name - The name of the new pad, or null to assign a default name.
direction - The direction of the ghostpad.

GhostPad

public GhostPad(java.lang.String name,
                PadTemplate template)
Create a new ghostpad based on template, without setting a target. The direction will be taken from the template.

Parameters:
name - The name of the new pad, or null to assign a default name.
template - The PadTemplate to use on the ghostpad.
Method Detail

getTarget

public Pad getTarget()
Get the target pad of this ghostpad.

Returns:
the target Pad, can be null if the ghostpad has no target set

setTarget

public boolean setTarget(Pad pad)
Set the new target of the ghostpad. Any existing target is unlinked and links to the new target are established.

Parameters:
pad - The new pad target.
Returns:
true if the new target could be set. This function can return false when the internal pads could not be linked.


Copyright © 2010. All Rights Reserved.