:right-sidebar: True MiniObject =================================================================== .. currentmodule:: gi.repository.Gst .. class:: MiniObject(*args, **kwargs) :no-contents-entry: :Constructors: :: MiniObject() Methods ------- .. rst-class:: interim-class .. class:: MiniObject :no-index: .. method:: add_parent(parent: ~gi.repository.Gst.MiniObject) -> None 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. .. versionadded:: 1.16 :param parent: a parent :obj:`~gi.repository.Gst.MiniObject` .. method:: get_qdata(quark: int) -> None This function gets back user data pointers stored via :func:`~gi.repository.Gst.MiniObject.set_qdata`. :param quark: A :obj:`~gi.repository.GLib.Quark`, naming the user data pointer .. method:: is_writable() -> bool 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. .. method:: lock(flags: ~gi.repository.Gst.LockFlags) -> bool Lock the mini-object with the specified access mode in ``flags``. :param flags: :obj:`~gi.repository.Gst.LockFlags` .. method:: remove_parent(parent: ~gi.repository.Gst.MiniObject) -> None This removes ``parent`` as a parent for ``object``. See :func:`~gi.repository.Gst.MiniObject.add_parent`. .. versionadded:: 1.16 :param parent: a parent :obj:`~gi.repository.Gst.MiniObject` .. method:: replace(newdata: ~gi.repository.Gst.MiniObject | None = None) -> tuple[bool, ~gi.repository.Gst.MiniObject] 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. Either ``newdata`` and the value pointed to by ``olddata`` may be :const:`None`. :param newdata: pointer to new mini-object .. method:: set_qdata(quark: int, data: None, destroy: ~typing.Callable[[None], None]) -> None This sets an opaque, named pointer on a miniobject. The name is specified through a :obj:`~gi.repository.GLib.Quark` (retrieved e.g. via :func:`~gi.repository.GLib.quark_from_static_string`), and the pointer can be gotten back from the ``object`` with :func:`~gi.repository.Gst.MiniObject.get_qdata` until the ``object`` is disposed. Setting a previously set user data pointer, overrides (frees) the old pointer set, using :const:`None` 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 :func:`~gi.repository.Gst.MiniObject.set_qdata` with the same ``quark``. :param quark: A :obj:`~gi.repository.GLib.Quark`, naming the user data pointer :param data: An opaque user data pointer :param destroy: Function to invoke with ``data`` as argument, when ``data`` needs to be freed .. method:: take(newdata: ~gi.repository.Gst.MiniObject) -> tuple[bool, ~gi.repository.Gst.MiniObject] Modifies a pointer to point to a new mini-object. The modification is done atomically. This version is similar to :func:`~gi.repository.Gst.MiniObject.replace` except that it does not increase the refcount of ``newdata`` and thus takes ownership of ``newdata``. Either ``newdata`` and the value pointed to by ``olddata`` may be :const:`None`. :param newdata: pointer to new mini-object .. method:: unlock(flags: ~gi.repository.Gst.LockFlags) -> None Unlock the mini-object with the specified access mode in ``flags``. :param flags: :obj:`~gi.repository.Gst.LockFlags` Fields ------ .. rst-class:: interim-class .. class:: MiniObject :no-index: .. attribute:: copy A copy function .. attribute:: dispose A dispose function .. attribute:: flags Extra flags. .. attribute:: free The free function .. attribute:: lockstate Atomic state of the locks .. attribute:: priv_pointer .. attribute:: priv_uint .. attribute:: refcount Atomic refcount .. attribute:: type The GType of the object