Package ch.bailu.gtk.gst
Klasse MiniObject
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gst.MiniObject
- Alle implementierten Schnittstellen:
PointerInterface
#GstMiniObject is a simple structure that can be used to implement refcounted
types.
Subclasses will include #GstMiniObject as the first member in their structure
and then call gst_mini_object_init() to initialize the #GstMiniObject fields.
gst_mini_object_ref() and gst_mini_object_unref() increment and decrement the
refcount respectively. When the refcount of a mini-object reaches 0, the
dispose function is called first and when this returns %TRUE, the free
function of the miniobject is called.
A copy can be made with gst_mini_object_copy().
gst_mini_object_is_writable() will return %TRUE when the refcount of the
object is exactly 1 and there is no parent or a single parent exists and is
writable itself, meaning the current caller has the only reference to the
object. gst_mini_object_make_writable() will return a writable version of
the object, which might be a new copy when the refcount was not 1.
Opaque data can be associated with a #GstMiniObject with
gst_mini_object_set_qdata() and gst_mini_object_get_qdata(). The data is
meant to be specific to the particular object and is not automatically copied
with gst_mini_object_copy() or similar methods.
A weak reference can be added and remove with gst_mini_object_weak_ref()
and gst_mini_object_weak_unref() respectively.
types.
Subclasses will include #GstMiniObject as the first member in their structure
and then call gst_mini_object_init() to initialize the #GstMiniObject fields.
gst_mini_object_ref() and gst_mini_object_unref() increment and decrement the
refcount respectively. When the refcount of a mini-object reaches 0, the
dispose function is called first and when this returns %TRUE, the free
function of the miniobject is called.
A copy can be made with gst_mini_object_copy().
gst_mini_object_is_writable() will return %TRUE when the refcount of the
object is exactly 1 and there is no parent or a single parent exists and is
writable itself, meaning the current caller has the only reference to the
object. gst_mini_object_make_writable() will return a writable version of
the object, which might be a new copy when the refcount was not 1.
Opaque data can be associated with a #GstMiniObject with
gst_mini_object_set_qdata() and gst_mini_object_get_qdata(). The data is
meant to be specific to the particular object and is not automatically copied
with gst_mini_object_copy() or similar methods.
A weak reference can be added and remove with gst_mini_object_weak_ref()
and gst_mini_object_weak_unref() respectively.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addParent
(MiniObject parent) This adds @parent as a parent for @object.copy()
Creates a copy of the mini-object.static ClassHandler
ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectCopyFunction
ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectDisposeFunction
int
extra flags.ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectFreeFunction
int
atomic state of the locksint
int
atomic refcountlong
the GType of the objectstatic int
static long
static TypeSystem.TypeSize
getQdata
(int quark) This function gets back user data pointers stored via
gst_mini_object_set_qdata().static long
static TypeSystem.TypeSize
void
init
(int flags, long type, MiniObject.OnMiniObjectCopyFunction copy_func, MiniObject.OnMiniObjectDisposeFunction dispose_func, MiniObject.OnMiniObjectFreeFunction free_func) Initializes a mini-object with the desired type and copy/dispose/free
functions.boolean
If @mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE
lock on @object is the only one, this means that changes to the object will
not be visible to any other object.boolean
lock
(int flags) Lock the mini-object with the specified access mode in @flags.Checks if a mini-object is writable.ref()
Increase the reference count of the mini-object.void
removeParent
(MiniObject parent) This removes @parent as a parent for @object.void
void
void
setFieldFlags
(int flags) extra flags.void
void
setFieldLockstate
(int lockstate) atomic state of the locksvoid
setFieldRefcount
(int refcount) atomic refcountvoid
setFieldType
(long type) the GType of the objectvoid
setQdata
(int quark, Pointer data, MiniObject.OnDestroyNotify destroy) This sets an opaque, named pointer on a miniobject.stealQdata
(int quark) This function gets back user data pointers stored via gst_mini_object_set_qdata()
and removes the data from @object without invoking its `destroy()` function (if
any was set).void
unlock
(int flags) Unlock the mini-object with the specified access mode in @flags.void
unref()
Decreases the reference count of the mini-object, possibly freeing
the mini-object.void
weakRef
(MiniObject.OnMiniObjectNotify notify, Pointer data) Adds a weak reference callback to a mini object.void
weakUnref
(MiniObject.OnMiniObjectNotify notify, Pointer data) Removes a weak reference callback from a mini object.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
TYPE
the GType of the object- Siehe auch:
-
REFCOUNT
atomic refcount- Siehe auch:
-
LOCKSTATE
atomic state of the locks- Siehe auch:
-
FLAGS
extra flags.- Siehe auch:
-
COPY
a copy function
SeeMiniObject.OnMiniObjectCopyFunction.onMiniObjectCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.MiniObject)
- Siehe auch:
-
DISPOSE
a dispose function
SeeMiniObject.OnMiniObjectDisposeFunction.onMiniObjectDisposeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.MiniObject)
- Siehe auch:
-
FREE
the free function
SeeMiniObject.OnMiniObjectFreeFunction.onMiniObjectFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.MiniObject)
- Siehe auch:
-
PRIV_UINT
- Siehe auch:
-
PRIV_POINTER
- Siehe auch:
-
-
Konstruktordetails
-
MiniObject
-
MiniObject
public MiniObject()
-
-
Methodendetails
-
getClassHandler
-
setFieldType
public void setFieldType(long type) the GType of the object -
getFieldType
public long getFieldType()the GType of the object -
setFieldRefcount
public void setFieldRefcount(int refcount) atomic refcount -
getFieldRefcount
public int getFieldRefcount()atomic refcount -
setFieldLockstate
public void setFieldLockstate(int lockstate) atomic state of the locks -
getFieldLockstate
public int getFieldLockstate()atomic state of the locks -
setFieldFlags
public void setFieldFlags(int flags) extra flags. -
getFieldFlags
public int getFieldFlags()extra flags. -
setFieldCopy
-
getFieldCopy
public ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectCopyFunction getFieldCopy() -
setFieldDispose
-
getFieldDispose
public ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectDisposeFunction getFieldDispose() -
setFieldFree
-
getFieldFree
public ch.bailu.gtk.gst.JnaMiniObject.OnMiniObjectFreeFunction getFieldFree() -
getFieldPrivUint
public int getFieldPrivUint() -
getFieldPrivPointer
-
addParent
This adds @parent as a parent for @object. Having one ore more parents affects the
writability of @object: if a @parent is not writable, @object is also not
writable, regardless of its refcount. @object is only writable if all
the parents are writable and its own refcount is exactly 1.
Note: This function does not take ownership of @parent and also does not
take an additional reference. It is the responsibility of the caller to
remove the parent again at a later time.- Parameter:
parent
- a parent #GstMiniObject
-
copy
Creates a copy of the mini-object.
MT safe- Gibt zurück:
- the new mini-object if copying is possible, %NULL otherwise.
-
getQdata
This function gets back user data pointers stored via
gst_mini_object_set_qdata().- Parameter:
quark
- A #GQuark, naming the user data pointer- Gibt zurück:
- The user data pointer set, or %NULL
-
init
public void init(int flags, long type, MiniObject.OnMiniObjectCopyFunction copy_func, MiniObject.OnMiniObjectDisposeFunction dispose_func, MiniObject.OnMiniObjectFreeFunction free_func) Initializes a mini-object with the desired type and copy/dispose/free
functions.- Parameter:
flags
- initial #GstMiniObjectFlagstype
- the #GType of the mini-object to createcopy_func
- the copy function, or %NULLdispose_func
- the dispose function, or %NULLfree_func
- the free function or %NULL
-
isWritable
public boolean isWritable()If @mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE
lock on @object is the only one, this means that changes to the object will
not be visible to any other object.
If the LOCKABLE flag is not set, check if the refcount of @mini_object is
exactly 1, meaning that no other reference exists to the object and that the
object is therefore writable.
Modification of a mini-object should only be done after verifying that it
is writable.- Gibt zurück:
- %TRUE if the object is writable.
-
lock
public boolean lock(int flags) Lock the mini-object with the specified access mode in @flags.- Parameter:
flags
- #GstLockFlags- Gibt zurück:
- %TRUE if @object could be locked.
-
makeWritable
Checks if a mini-object is writable. If not, a writable copy is made and
returned. This gives away the reference to the original mini object,
and returns a reference to the new object.
MT safe- Gibt zurück:
- a writable mini-object (which may or may not be the same as @mini_object) or %NULL if copying is required but not possible.
-
ref
Increase the reference count of the mini-object.
Note that the refcount affects the writability
of @mini-object, see gst_mini_object_is_writable(). It is
important to note that keeping additional references to
GstMiniObject instances can potentially increase the number
of memcpy operations in a pipeline, especially if the miniobject
is a #GstBuffer.- Gibt zurück:
- the mini-object.
-
removeParent
This removes @parent as a parent for @object. See
gst_mini_object_add_parent().- Parameter:
parent
- a parent #GstMiniObject
-
setQdata
This sets an opaque, named pointer on a miniobject.
The name is specified through a #GQuark (retrieved e.g. via
g_quark_from_static_string()), and the pointer
can be gotten back from the @object with gst_mini_object_get_qdata()
until the @object is disposed.
Setting a previously set user data pointer, overrides (frees)
the old pointer set, using %NULL as pointer essentially
removes the data stored.
@destroy may be specified which is called with @data as argument
when the @object is disposed, or the data is being overwritten by
a call to gst_mini_object_set_qdata() with the same @quark.- Parameter:
quark
- A #GQuark, naming the user data pointerdata
- An opaque user data pointerdestroy
- Function to invoke with @data as argument, when @data needs to be freed
-
stealQdata
This function gets back user data pointers stored via gst_mini_object_set_qdata()
and removes the data from @object without invoking its `destroy()` function (if
any was set).- Parameter:
quark
- A #GQuark, naming the user data pointer- Gibt zurück:
- The user data pointer set, or %NULL
-
unlock
public void unlock(int flags) Unlock the mini-object with the specified access mode in @flags.- Parameter:
flags
- #GstLockFlags
-
unref
public void unref()Decreases the reference count of the mini-object, possibly freeing
the mini-object. -
weakRef
Adds a weak reference callback to a mini object. Weak references are
used for notification when a mini object is finalized. They are called
"weak references" because they allow you to safely hold a pointer
to the mini object without calling gst_mini_object_ref()
(gst_mini_object_ref() adds a strong reference, that is, forces the object
to stay alive).- Parameter:
notify
- callback to invoke before the mini object is freeddata
- extra data to pass to notify
-
weakUnref
Removes a weak reference callback from a mini object.- Parameter:
notify
- callback to search fordata
- data to search for
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-