Gst.Context¶
Fields¶
None
Methods¶
class |
|
|
|
Details¶
- class Gst.Context¶
Gst.Context
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.set_context
(), 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:
Check if the element already has a context
Query downstream with
Gst.QueryType.CONTEXT
for the contextQuery upstream with
Gst.QueryType.CONTEXT
for the contextPost a
Gst.MessageType.NEED_CONTEXT
message on the bus with the required context types and afterwards check if a usable context was set nowCreate a context by itself and post a
Gst.MessageType.HAVE_CONTEXT
message on the bus.Bins will catch
Gst.MessageType.NEED_CONTEXT
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.Gst.Context
can be persistent. A persistentGst.Context
is kept in elements when they reachGst.State.NULL
, non-persistent ones will be removed. Also, a non-persistent context won’t override a previous persistent context set to an element.New in version 1.2.
- classmethod new(context_type, persistent)[source]¶
- Parameters:
- Returns:
The new context.
- Return type:
Creates a new context.
New in version 1.2.
- get_context_type()[source]¶
- Returns:
The type of the context.
- Return type:
Gets the type of self.
New in version 1.2.
- get_structure()[source]¶
- 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 becomes invalid when you free the context.
- Return type:
Accesses the structure of the context.
New in version 1.2.
- has_context_type(context_type)[source]¶
- Parameters:
context_type (
str
) – Context type to check.- Returns:
True
if self has context_type.- Return type:
Checks if self has context_type.
New in version 1.2.
- writable_structure()[source]¶
- 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 invalid when you free the context. This function checks if self is writable.
- Return type:
Gets a writable version of the structure.
New in version 1.2.