org.gstreamer
Class MiniObject

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.MiniObject
Direct Known Subclasses:
Buffer, Event, Message, Query

public class MiniObject
extends org.gstreamer.lowlevel.RefCountedObject

Lightweight base class for the GStreamer object hierarchy MiniObject is a baseclass like GObject, but has been stripped down of features to be fast and small. It offers sub-classing and ref-counting in the same way as GObject does. It has no properties and no signal-support though.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject
org.gstreamer.lowlevel.NativeObject.Initializer
 
Field Summary
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, LIFECYCLE, ownsHandle
 
Constructor Summary
MiniObject(org.gstreamer.lowlevel.NativeObject.Initializer init)
          Creates a new instance of MiniObject
 
Method Summary
protected  void disposeNativeHandle(com.sun.jna.Pointer ptr)
           
 boolean isWritable()
          Checks if a mini-object is writable.
protected
<T extends MiniObject>
T
makeWritable(java.lang.Class<T> subclass)
          Makes a writable instance of this MiniObject.
static
<T extends MiniObject>
T
objectFor(com.sun.jna.Pointer ptr, java.lang.Class<T> defaultClass, boolean needRef)
           
protected  void ref()
           
protected  void unref()
           
 
Methods inherited from class org.gstreamer.lowlevel.NativeObject
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, initializer, instanceFor, invalidate, isDisposed, nativeValue, objectFor, objectFor, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiniObject

public MiniObject(org.gstreamer.lowlevel.NativeObject.Initializer init)
Creates a new instance of MiniObject

Method Detail

isWritable

public boolean isWritable()
Checks if a mini-object is writable. A mini-object is writable if the reference count is one and the MiniObjectFlags.READONLY flag is not set. Modification of a mini-object should only be done after verifying that it is writable.

Returns:
true if the object is writable.

makeWritable

protected <T extends MiniObject> T makeWritable(java.lang.Class<T> subclass)
Makes a writable instance of this MiniObject.

The result is cast to subclass.

Parameters:
subclass - the subclass to cast the result to.
Returns:
a writable version of this MiniObject.

ref

protected void ref()
Specified by:
ref in class org.gstreamer.lowlevel.RefCountedObject

unref

protected void unref()
Specified by:
unref in class org.gstreamer.lowlevel.RefCountedObject

disposeNativeHandle

protected void disposeNativeHandle(com.sun.jna.Pointer ptr)
Specified by:
disposeNativeHandle in class org.gstreamer.lowlevel.NativeObject

objectFor

public static <T extends MiniObject> T objectFor(com.sun.jna.Pointer ptr,
                                                 java.lang.Class<T> defaultClass,
                                                 boolean needRef)