org.gstreamer
Class GstObject
java.lang.Object
org.gstreamer.lowlevel.NativeValue
org.gstreamer.lowlevel.Handle
org.gstreamer.lowlevel.NativeObject
org.gstreamer.lowlevel.RefCountedObject
org.gstreamer.GObject
org.gstreamer.GstObject
- Direct Known Subclasses:
- Bus, Clock, Element, Pad, PadTemplate, Plugin, PluginFeature, Registry
public class GstObject
- extends GObject
Base class for the GStreamer object hierarchy
GstObject provides a root for the object hierarchy tree filed in by the
GStreamer library. It is currently a thin wrapper on top of
GObject
. It is an abstract class that is not very usable on its own.
Method Summary |
protected void |
addListenerProxy(java.lang.Class<? extends java.util.EventListener> listenerClass,
java.util.EventListener listener,
java.util.EventListenerProxy proxy)
Adds an EventListenerProxy on this object. |
java.lang.String |
getName()
Returns a copy of the name of this object. |
GstObject |
getParent()
|
protected static NativeObject.Initializer |
initializer(com.sun.jna.Pointer ptr)
|
protected static NativeObject.Initializer |
initializer(com.sun.jna.Pointer ptr,
boolean needRef)
|
static
|
objectFor(com.sun.jna.Pointer ptr,
java.lang.Class<T> defaultClass)
|
static
|
objectFor(com.sun.jna.Pointer ptr,
java.lang.Class<T> defaultClass,
boolean needRef)
|
protected void |
ref()
|
protected java.util.EventListenerProxy |
removeListenerProxy(java.lang.Class<? extends java.util.EventListener> listenerClass,
java.util.EventListener listener)
Removes an EventListenerProxy from this object. |
boolean |
setName(java.lang.String name)
Sets the name of this object, or gives this object a guaranteed unique
name (if name is null). |
protected static NativeObject.Initializer |
steal(GstObject victim)
Steal the native peer from another GstObject. |
java.lang.String |
toString()
|
protected void |
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 |
GstObject
public GstObject(NativeObject.Initializer init)
- Wraps an underlying C GstObject with a Java proxy
- Parameters:
init
- Initialization data
initializer
protected static NativeObject.Initializer initializer(com.sun.jna.Pointer ptr)
initializer
protected static NativeObject.Initializer initializer(com.sun.jna.Pointer ptr,
boolean needRef)
steal
protected static NativeObject.Initializer steal(GstObject victim)
- Steal the native peer from another GstObject.
After calling this, the victim object is disconnected from the native object
and any attempt to use it will throw an exception.
- Parameters:
victim
- The GstObject to takeover.
- Returns:
- An Initializer that can be passed to
GstObject(org.gstreamer.lowlevel.NativeObject.Initializer)
setName
public boolean setName(java.lang.String name)
- Sets the name of this object, or gives this object a guaranteed unique
name (if name is null).
Returns: TRUE if the name could be set. Since Objects that have
a parent cannot be renamed, this function returns FALSE in those
cases.
MT safe.
- Parameters:
name
- new name of object
- Returns:
- true if the name was set. Since Objects that have
a parent cannot be renamed, this function returns false in those
cases.
getName
public java.lang.String getName()
- Returns a copy of the name of this object.
For a nameless object, this returns null.
- Returns:
- the name of this object.
toString
public java.lang.String toString()
- Overrides:
toString
in class NativeObject
ref
protected void ref()
- Overrides:
ref
in class GObject
unref
protected void unref()
- Overrides:
unref
in class GObject
getParent
public GstObject getParent()
objectFor
public static <T extends GstObject> T objectFor(com.sun.jna.Pointer ptr,
java.lang.Class<T> defaultClass)
objectFor
public static <T extends GstObject> T objectFor(com.sun.jna.Pointer ptr,
java.lang.Class<T> defaultClass,
boolean needRef)
addListenerProxy
protected void addListenerProxy(java.lang.Class<? extends java.util.EventListener> listenerClass,
java.util.EventListener listener,
java.util.EventListenerProxy proxy)
- Adds an
EventListenerProxy
on this object.
This is used by subclasses that wish to map between java style event listeners
and gstreamer signals.
- Parameters:
listenerClass
- Class of the listener being added.listener
- The listener being added.proxy
- Proxy for the event listener.
removeListenerProxy
protected java.util.EventListenerProxy removeListenerProxy(java.lang.Class<? extends java.util.EventListener> listenerClass,
java.util.EventListener listener)
- Removes an
EventListenerProxy
from this object.
This is used by subclasses that wish to map between java style event listeners
and gstreamer signals.
- Parameters:
listenerClass
- The class of listener the proxy was added for.listener
- The listener the proxy was added for.
- Returns:
- The proxy that was removed, or null if no proxy was found.