GstGL.GLDisplay

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GstGL.GLDisplay GstGL.GLDisplay Gst.Object->GstGL.GLDisplay

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_type (type)

add_context (context)

create_context (other_context)

create_window ()

filter_gl_api (gl_api)

find_window (data, compare_func)

get_gl_api ()

get_gl_api_unlocked ()

get_gl_context_for_thread (thread)

get_handle ()

get_handle_type ()

remove_context (context)

remove_window (window)

retrieve_window (data, compare_func)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

do_create_window ()

do_get_handle ()

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Short Description

create-context

Overrides the GstGLContext creation mechanism.

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

event_source

GLib.Source

r

main_context

GLib.MainContext

r

main_loop

GLib.MainLoop

r

object

Gst.Object

r

type

GstGL.GLDisplayType

r

windows

[object]

r

Class Details

class GstGL.GLDisplay(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstGL.GLDisplayClass

GstGL.GLDisplay represents a connection to the underlying windowing system. Elements are required to make use of Gst.Context to share and propagate a GstGL.GLDisplay.

There are a number of environment variables that influence the choice of platform and window system specific functionality.

  • GST_GL_WINDOW influences the window system to use. Common values are ‘x11’, ‘wayland’, ‘win32’ or ‘cocoa’.

  • GST_GL_PLATFORM influences the OpenGL platform to use. Common values are ‘egl’, ‘glx’, ‘wgl’ or ‘cgl’.

  • GST_GL_API influences the OpenGL API requested by the OpenGL platform. Common values are ‘opengl’, ‘opengl3’ and ‘gles2’.

Certain window systems require a special function to be called to initialize threading support. As this GStreamer GL library does not preclude concurrent access to the windowing system, it is strongly advised that applications ensure that threading support has been initialized before any other toolkit/library functionality is accessed. Failure to do so could result in sudden application abortion during execution. The most notably example of such a function is X11’s XInitThreads\().

classmethod new()[source]
Returns:

a new GstGL.GLDisplay

Return type:

GstGL.GLDisplay

New in version 1.4.

classmethod new_with_type(type)[source]
Parameters:

type (GstGL.GLDisplayType) – GstGL.GLDisplayType

Returns:

a new GstGL.GLDisplay or None if type is not supported

Return type:

GstGL.GLDisplay or None

Will always return a GstGL.GLDisplay of a single type. This differs from GstGL.GLDisplay.new() and the seemingly equivalent call GstGL.GLDisplay.new_with_type (GstGL.GLDisplayType.ANY) in that the latter may return None.

New in version 1.20.

add_context(context)[source]
Parameters:

context (GstGL.GLContext) – a GstGL.GLContext

Returns:

whether context was successfully added. False may be returned if there already exists another context for context's active thread.

Must be called with the object lock held.

Return type:

bool

New in version 1.6.

create_context(other_context)[source]
Parameters:

other_context (GstGL.GLContext or None) – other GstGL.GLContext to share resources with.

Raises:

GLib.Error

Returns:

whether a new context could be created.

p_context:

resulting GstGL.GLContext

Return type:

(bool, p_context: GstGL.GLContext)

It requires the display’s object lock to be held.

New in version 1.6.

create_window()[source]
Returns:

a new GstGL.GLWindow for self or None.

Return type:

GstGL.GLWindow or None

filter_gl_api(gl_api)[source]
Parameters:

gl_api (GstGL.GLAPI) – a GstGL.GLAPI to filter with

limit the use of OpenGL to the requested gl_api. This is intended to allow application and elements to request a specific set of OpenGL API’s based on what they support. See GstGL.GLContext.get_gl_api() for the retrieving the API supported by a GstGL.GLContext.

find_window(data, compare_func)[source]
Parameters:
Returns:

The first GstGL.GLWindow that causes a match from compare_func

Return type:

GstGL.GLWindow or None

Execute compare_func over the list of windows stored by self. The first argument to compare_func is the GstGL.GLWindow being checked and the second argument is data.

New in version 1.12.

Deprecated since version 1.18: Use GstGL.GLDisplay.retrieve_window() instead.

get_gl_api()[source]
Returns:

the GstGL.GLAPI configured for self

Return type:

GstGL.GLAPI

see GstGL.GLDisplay.filter_gl_api() for what the returned value represents

get_gl_api_unlocked()[source]
Return type:

GstGL.GLAPI

get_gl_context_for_thread(thread)[source]
Parameters:

thread (GLib.Thread) – a GLib.Thread

Returns:

the GstGL.GLContext current on thread or None

Must be called with the object lock held.

Return type:

GstGL.GLContext or None

New in version 1.6.

get_handle()[source]
Returns:

the native handle for the display

Return type:

int

New in version 1.4.

get_handle_type()[source]
Returns:

the GstGL.GLDisplayType of self

Return type:

GstGL.GLDisplayType

New in version 1.4.

remove_context(context)[source]
Parameters:

context (GstGL.GLContext) – the GstGL.GLContext to remove

Must be called with the object lock held.

New in version 1.18.

remove_window(window)[source]
Parameters:

window (GstGL.GLWindow) – a GstGL.GLWindow to remove

Returns:

if window could be removed from self

Return type:

bool

New in version 1.12.

retrieve_window(data, compare_func)[source]
Parameters:
Returns:

The first GstGL.GLWindow that causes a match from compare_func

Return type:

GstGL.GLWindow or None

Execute compare_func over the list of windows stored by self. The first argument to compare_func is the GstGL.GLWindow being checked and the second argument is data.

New in version 1.18.

do_create_window() virtual
Returns:

a new GstGL.GLWindow for display or None.

Return type:

GstGL.GLWindow or None

do_get_handle() virtual
Returns:

the native handle for the display

Return type:

int

New in version 1.4.

Signal Details

GstGL.GLDisplay.signals.create_context(g_l_display, context)
Signal Name:

create-context

Flags:

RUN_LAST

Parameters:
Returns:

the new context.

Return type:

GstGL.GLContext or None

Overrides the GstGLContext creation mechanism. It can be called in any thread and it is emitted with display’s object lock held.