gi-gst-1.0.23: GStreamer bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gst.Structs.Context

Description

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 elementSetContext, which will then be propagated to all child elements. Elements can handle these in ElementClass.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_QUERY_CONTEXT for the context 3. Query upstream with GST_QUERY_CONTEXT for the context 4. Post a GST_MESSAGE_NEED_CONTEXT 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_MESSAGE_HAVE_CONTEXT message on the bus.

Bins will catch GST_MESSAGE_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.

Contexts can be persistent. A persistent Context is kept in elements when they reach StateNull, non-persistent ones will be removed. Also, a non-persistent context won't override a previous persistent context set to an element.

Since: 1.2

Synopsis

Exported types

newtype Context Source #

Memory-managed wrapper type.

Constructors

Context (ManagedPtr Context) 

Instances

Instances details
Eq Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

Methods

(==) :: Context -> Context -> Bool

(/=) :: Context -> Context -> Bool

GBoxed Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

ManagedPtrNewtype Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

Methods

toManagedPtr :: Context -> ManagedPtr Context

TypedObject Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

Methods

glibType :: IO GType

IsGValue Context Source #

Convert Context to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gst.Structs.Context

Methods

toGValue :: Context -> IO GValue

fromGValue :: GValue -> IO Context

HasParentTypes Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

type ParentTypes Context Source # 
Instance details

Defined in GI.Gst.Structs.Context

type ParentTypes Context = '[] :: [Type]

Methods

Overloaded methods

getContextType

contextGetContextType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

context: The Context.

-> m Text

Returns: The type of the context.

Get the type of context.

Since: 1.2

getStructure

contextGetStructure Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

context: The Context.

-> m Structure

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.

Access the structure of the context.

Since: 1.2

hasContextType

contextHasContextType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

context: The Context.

-> Text

contextType: Context type to check.

-> m Bool

Returns: True if context has contextType.

Checks if context has contextType.

Since: 1.2

isPersistent

contextIsPersistent Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

context: The Context.

-> m Bool

Returns: True if the context is persistent.

Check if context is persistent.

Since: 1.2

new

contextNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

contextType: Context type

-> Bool

persistent: Persistent context

-> m Context

Returns: The new context.

Create a new context.

Since: 1.2

writableStructure

contextWritableStructure Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

context: The Context.

-> m 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 invalid when you free the context. This function checks if context is writable.

Get a writable version of the structure.

Since: 1.2