MiniObject

#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.

Constructors

this
this(gobject.types.GType type, int refcount, int lockstate, uint flags, GstMiniObjectCopyFunction copy, GstMiniObjectDisposeFunction dispose, GstMiniObjectFreeFunction free)

Create a mini_object.MiniObject boxed type.

this
this(void* ptr, Flag!"Take" take)

Members

Functions

addParent
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 is only writable if all the parents are writable and its own refcount is exactly 1.

cPtr
void* cPtr(Flag!"Dup" dup)
getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gst.mini_object.MiniObject.setQdata.

isWritable
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.

lock
bool lock(gst.types.LockFlags flags)

Lock the mini-object with the specified access mode in flags.

removeParent
void removeParent(gst.mini_object.MiniObject parent)

This removes parent as a parent for object. See gst.mini_object.MiniObject.addParent.

self
MiniObject self()

Returns this, for use in with statements.

setQdata
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 object with gst.mini_object.MiniObject.getQdata 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.

stealQdata
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).

unlock
void unlock(gst.types.LockFlags flags)

Unlock the mini-object with the specified access mode in flags.

Properties

copy
GstMiniObjectCopyFunction copy [@property getter]

Get field copy.

copy
GstMiniObjectCopyFunction copy [@property setter]

Set field copy.

dispose
GstMiniObjectDisposeFunction dispose [@property getter]

Get field dispose.

dispose
GstMiniObjectDisposeFunction dispose [@property setter]

Set field dispose.

flags
uint flags [@property getter]

Get field flags.

flags
uint flags [@property setter]

Set field flags.

free
GstMiniObjectFreeFunction free [@property getter]

Get field free.

free
GstMiniObjectFreeFunction free [@property setter]

Set field free.

gType
GType gType [@property getter]
lockstate
int lockstate [@property getter]

Get field lockstate.

lockstate
int lockstate [@property setter]

Set field lockstate.

refcount
int refcount [@property getter]

Get field refcount.

refcount
int refcount [@property setter]

Set field refcount.

type
gobject.types.GType type [@property getter]

Get field type.

type
gobject.types.GType type [@property setter]

Set field type.

Static functions

getGType
GType getGType()
replace
bool replace(gst.mini_object.MiniObject olddata, gst.mini_object.MiniObject newdata)

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.

take
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 of newdata and thus takes ownership of newdata.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.