gst.mini_object

Module for [MiniObject] class

Types 1

#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.MiniObject.init_] to initialize the #GstMiniObject fields.

[gst.mini_object.MiniObject.ref_] and [gst.mini_object.MiniObject.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.MiniObject.copy].

[gst.mini_object.MiniObject.isWritable] 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.MiniObject.makeWritable] 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.MiniObject.setQdata] and [gst.mini_object.MiniObject.getQdata]. The data is meant to be specific to the particular object and is not automatically copied with [gst.mini_object.MiniObject.copy] or similar methods.

A weak reference can be added and remove with [gst.mini_object.MiniObject.weakRef] and [gst.mini_object.MiniObject.weakUnref] respectively.

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
MiniObject self()Returns `this`, for use in `with` statements.
gobject.types.GType type() @propertyGet `type` field. Returns: the GType of the object
void type(gobject.types.GType propval) @propertySet `type` field. Params: propval = the GType of the object
int refcount() @propertyGet `refcount` field. Returns: atomic refcount
void refcount(int propval) @propertySet `refcount` field. Params: propval = atomic refcount
int lockstate() @propertyGet `lockstate` field. Returns: atomic state of the locks
void lockstate(int propval) @propertySet `lockstate` field. Params: propval = atomic state of the locks
uint flags() @propertyGet `flags` field. Returns: extra flags.
void flags(uint propval) @propertySet `flags` field. Params: propval = extra flags.
GstMiniObjectCopyFunction copy() @propertyGet `copy` field. Returns: a copy function
void copy(GstMiniObjectCopyFunction propval) @propertySet `copy` field. Params: propval = a copy function
GstMiniObjectDisposeFunction dispose() @propertyGet `dispose` field. Returns: a dispose function
void dispose(GstMiniObjectDisposeFunction propval) @propertySet `dispose` field. Params: propval = a dispose function
GstMiniObjectFreeFunction free() @propertyGet `free` field. Returns: the free function
void free(GstMiniObjectFreeFunction propval) @propertySet `free` field. Params: propval = the free function
void addParent(gst.mini_object.MiniObject parent)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 ...
void * getQdata(glib.types.Quark quark)This function gets back user data pointers stored via [gst.mini_object.MiniObject.setQdata].
bool 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.
bool lock(gst.types.LockFlags flags)Lock the mini-object with the specified access mode in flags.
void removeParent(gst.mini_object.MiniObject parent)This removes parent as a parent for object. See [gst.mini_object.MiniObject.addParent].
void setQdata(glib.types.Quark quark, void * data, glib.types.DestroyNotify destroy)This sets an opaque, named pointer on a miniobject. The name is specified through a #GQuark (retrieved e.g. via [glib.global.quarkFromStaticString]), and the pointer can be gotten back from the obj...
void * stealQdata(glib.types.Quark quark)This function gets back user data pointers stored via [gst.mini_object.MiniObject.setQdata] and removes the data from object without invoking its `destroy()` function (if any was set).
void unlock(gst.types.LockFlags flags)Unlock the mini-object with the specified access mode in flags.
bool replace(gst.mini_object.MiniObject olddata = null, gst.mini_object.MiniObject newdata = null)Atomically modifies a pointer to point to a new mini-object. The reference count of olddata is decreased and the reference count of newdata is increased.
bool take(gst.mini_object.MiniObject olddata, gst.mini_object.MiniObject newdata)Modifies a pointer to point to a new mini-object. The modification is done atomically. This version is similar to [gst.mini_object.MiniObject.replace] except that it does not increase the refcount ...
Constructors
this(gobject.types.GType type = gobject.types.GType.init, int refcount = int.init, int lockstate = int.init, uint flags = uint.init, GstMiniObjectCopyFunction copy = GstMiniObjectCopyFunction.init, GstMiniObjectDisposeFunction dispose = GstMiniObjectDisposeFunction.init, GstMiniObjectFreeFunction free = GstMiniObjectFreeFunction.init)Create a `mini_object.MiniObject` boxed type. Params: type = the GType of the object refcount = atomic refcount lockstate = atomic state of the locks flags = extra flags. copy = a copy function dis...
this(void * ptr, Flag!"Take" take)