GstGL.GLDisplay¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Overrides the GstGLContext creation mechanism. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
event_source |
r |
||
main_context |
r |
||
main_loop |
r |
||
object |
r |
||
type |
r |
||
windows |
[ |
r |
Class Details¶
- class GstGL.GLDisplay(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GstGL.GLDisplay
represents a connection to the underlying windowing system. Elements are required to make use ofGst.Context
to share and propagate aGstGL.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’, ‘surfaceless’, ‘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:
New in version 1.4.
- classmethod new_with_type(type)[source]¶
- Parameters:
type (
GstGL.GLDisplayType
) –GstGL.GLDisplayType
- Returns:
a new
GstGL.GLDisplay
orNone
if type is not supported- Return type:
Will always return a
GstGL.GLDisplay
of a single type. This differs fromGstGL.GLDisplay.new
() and the seemingly equivalent callGstGL.GLDisplay.new_with_type
(GstGL.GLDisplayType.ANY
) in that the latter may returnNone
.New in version 1.20.
- add_context(context)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.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:
New in version 1.6.
- create_context(other_context)[source]¶
- Parameters:
other_context (
GstGL.GLContext
orNone
) – otherGstGL.GLContext
to share resources with.- Raises:
- 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 orNone
.- Return type:
- ensure_context(other_context, context)[source]¶
- Parameters:
other_context (
GstGL.GLContext
orNone
) – otherGstGL.GLContext
to share resources with.context (
GstGL.GLContext
orNone
) – the resultingGstGL.GLContext
- Raises:
- Returns:
wether context contains a valid context.
- context:
the resulting
GstGL.GLContext
- Return type:
(
bool
, context:GstGL.GLContext
orNone
)
Ensures that the display has a valid GL context for the current thread. If context already contains a valid context, this does nothing.
New in version 1.24.
- filter_gl_api(gl_api)[source]¶
- Parameters:
gl_api (
GstGL.GLAPI
) – aGstGL.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 aGstGL.GLContext
.
- find_window(data, compare_func)[source]¶
- Parameters:
compare_func (
GLib.CompareFunc
) – a comparison function to run
- Returns:
The first
GstGL.GLWindow
that causes a match from compare_func- Return type:
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:
see
GstGL.GLDisplay.filter_gl_api
() for what the returned value represents
- get_gl_context_for_thread(thread)[source]¶
- Parameters:
thread (
GLib.Thread
) – aGLib.Thread
- Returns:
the
GstGL.GLContext
current on thread orNone
Must be called with the object lock held.
- Return type:
New in version 1.6.
- get_handle_type()[source]¶
- Returns:
the
GstGL.GLDisplayType
of self- Return type:
New in version 1.4.
- remove_context(context)[source]¶
- Parameters:
context (
GstGL.GLContext
) – theGstGL.GLContext
to remove
Must be called with the object lock held.
New in version 1.18.
- remove_window(window)[source]¶
- Parameters:
window (
GstGL.GLWindow
) – aGstGL.GLWindow
to remove- Returns:
if window could be removed from self
- Return type:
New in version 1.12.
- retrieve_window(data, compare_func)[source]¶
- Parameters:
compare_func (
GLib.CompareFunc
) – a comparison function to run
- Returns:
The first
GstGL.GLWindow
that causes a match from compare_func- Return type:
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 orNone
.- Return type:
Signal Details¶
- GstGL.GLDisplay.signals.create_context(g_l_display, context)¶
- Signal Name:
create-context
- Flags:
- Parameters:
g_l_display (
GstGL.GLDisplay
) – The object which received the signalcontext (
GstGL.GLContext
) – other context to share resources with.
- Returns:
the new context.
- Return type:
Overrides the GstGLContext creation mechanism. It can be called in any thread and it is emitted with display’s object lock held.