gst.context

Module for [Context] class

class Context

Types 1

classContext : gobject.boxed.Boxed

#GstContext is a container object used to store contexts like a device context, a display server connection and similar concepts that should be shared between multiple elements.

Applications can set a context on a complete pipeline by using gst.element.Element.setContext, which will then be propagated to all child elements. Elements can handle these in #GstElementClass::set_context and merge them with the context information they already have.

When an element needs a context it will do the following actions in this order until one step succeeds:

  1. Check if the element already has a context
  2. Query downstream with gst.types.QueryType.Context for the context
  3. Query upstream with gst.types.QueryType.Context for the context
  4. Post a gst.types.MessageType.NeedContext message on the bus with the required context types and afterwards check if a usable context was set now
  5. Create a context by itself and post a gst.types.MessageType.HaveContext message on the bus.

Bins will catch gst.types.MessageType.NeedContext messages and will set any previously known context on the element that asks for it if possible. Otherwise the application should provide one if it can.

#GstContext can be persistent. A persistent #GstContext is kept in elements when they reach gst.types.State.Null, non-persistent ones will be removed. Also, a non-persistent context won't override a previous persistent context set to an element.

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup) nothrow
GType _getGType() static nothrow
GType _gType() @property nothrow
Context self() nothrowReturns `this`, for use in `with` statements.
string getContextType() nothrowGets the type of context. Returns: The type of the context.
gst.structure.Structure getStructure() nothrowAccesses the structure of the context. Returns: The structure of the context. The structure is still owned by the context, which means that you should not modify it, free it and that the pointer be...
bool hasContextType(string contextType) nothrowChecks if context has context_type.
bool isPersistent() nothrowChecks if context is persistent. Returns: true if the context is persistent.
gst.structure.Structure writableStructure() nothrowGets a writable version of the structure. Returns: The structure of the context. The structure is still owned by the context, which means that you should not free it and that the pointer becomes in...
Constructors
this(void * ptr, Flag!"Take" take)
this(string contextType, bool persistent)Creates a new context.