GstGL.GLWindow¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Will be emitted when a key event is received by the GstGLwindow. |
|
Will be emitted when a mouse event is received by the GstGLwindow. |
|
Will be emitted when a mouse scroll event is received by the GstGLwindow. |
|
Will be emitted when the window handle has been set into the native implementation, but before the context is re-activated. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
close |
r |
||
close_data |
r |
||
close_notify |
r |
||
context_ref |
r |
||
display |
r |
||
draw_data |
r |
||
draw_notify |
r |
||
is_drawing |
r |
||
lock |
r |
||
main_context |
r |
||
parent |
r |
||
resize_data |
r |
||
resize_notify |
r |
Class Details¶
- class GstGL.GLWindow(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
GstGL.GLWindowrepresents a window that elements can render into. A window can either be a user visible window (onscreen) or hidden (offscreen).- classmethod new(display)[source]¶
- Parameters:
display (
GstGL.GLDisplay) – aGstGL.GLDisplay- Returns:
a new
GstGL.GLWindowusing display's connection- Return type:
Added in version 1.4.
- draw()[source]¶
Redraw the window contents. Implementations should invoke the draw callback.
Added in version 1.4.
- get_context()[source]¶
- Returns:
the
GstGL.GLContextassociated with this self- Return type:
Added in version 1.4.
- get_display()[source]¶
- Returns:
the windowing system display handle for this self
- Return type:
Added in version 1.4.
- get_request_output_surface()[source]¶
- Returns:
whether an visible output surface has been requested
- Return type:
Added in version 1.28.
- get_surface_dimensions()[source]¶
- Returns:
- width:
resulting surface width
- height:
resulting surface height
- Return type:
Added in version 1.6.
- get_window_handle()[source]¶
- Returns:
the window handle we are currently rendering into
- Return type:
Added in version 1.4.
- handle_events(handle_events)[source]¶
-
Tell a self that it should handle events from the window system. These events are forwarded upstream as navigation events. In some window systems events are not propagated in the window hierarchy if a client is listening for them. This method allows you to disable events handling completely from the self.
- send_message(callback, *data)[source]¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Invoke callback with data on the window thread. callback is guaranteed to have executed when this function returns.
Added in version 1.4.
- send_message_async(callback, *data)[source]¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Invoke callback with data on the window thread. The callback may not have been executed when this function returns.
Added in version 1.4.
- send_scroll_event(posx, posy, delta_x, delta_y)[source]¶
- Parameters:
Notify a self about a scroll event. A scroll signal holding the event coordinates will be emitted.
Added in version 1.18.
- set_close_callback(callback, *data)[source]¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Sets the callback called when the window is about to close.
Added in version 1.4.
- set_draw_callback(callback, *data)[source]¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Sets the draw callback called every time
GstGL.GLWindow.draw() is calledAdded in version 1.4.
- set_preferred_size(width, height)[source]¶
-
Set the preferred width and height of the window. Implementations are free to ignore this information.
Added in version 1.6.
- set_render_rectangle(x, y, width, height)[source]¶
- Parameters:
- Returns:
whether the specified region could be set
- Return type:
Tell a self that it should render into a specific region of the window according to the
GstVideo.VideoOverlayinterface.
- set_request_output_surface(output_surface)[source]¶
- Parameters:
output_surface (
bool) – whether to request an output surface.
Configure whether a visible output surface is requested.
Added in version 1.28.
- set_resize_callback(callback, *data)[source]¶
- Parameters:
callback (
GstGL.GLWindowResizeCB) – function to invoke
Sets the resize callback called every time a resize of the window occurs.
Added in version 1.4.
- set_window_handle(handle)[source]¶
- Parameters:
handle (
int) – handle to the window
Sets the window that this self should render into. Some implementations require this to be called with a valid handle before drawing can commence.
Added in version 1.4.
- do_close() virtual¶
close the connection to the display
- do_controls_viewport() virtual¶
-
Checks if window controls the GL viewport.
Added in version 1.16.
- do_draw() virtual¶
Redraw the window contents. Implementations should invoke the draw callback.
Added in version 1.4.
- do_get_display() virtual¶
- Returns:
the windowing system display handle for this window
- Return type:
Gets the current windowing system display connection
Added in version 1.4.
- do_get_window_handle() virtual¶
- Returns:
the window handle we are currently rendering into
- Return type:
Gets the current window handle that this
GstGL.GLWindowis rendering into. This may return a different value to what is passed into set_window_handleAdded in version 1.4.
- do_handle_events(handle_events) virtual¶
-
Tell a window that it should handle events from the window system. These events are forwarded upstream as navigation events. In some window systems events are not propagated in the window hierarchy if a client is listening for them. This method allows you to disable events handling completely from the window.
- do_has_output_surface() virtual¶
-
Query whether window has output surface or not
Added in version 1.18.
- do_queue_resize() virtual¶
Queue resizing of window.
- do_quit() virtual¶
Quit the runloop’s execution.
Added in version 1.4.
- do_run() virtual¶
Start the execution of the runloop.
Added in version 1.4.
- do_send_message(callback, data) virtual¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Invoke callback with data on the window thread. callback is guaranteed to have executed when this function returns.
Added in version 1.4.
- do_send_message_async(callback, data) virtual¶
- Parameters:
callback (
GstGL.GLWindowCB) – function to invoke
Invoke callback with data on the window thread. The callback may not have been executed when this function returns.
Added in version 1.4.
- do_set_preferred_size(width, height) virtual¶
-
Set the preferred width and height of the window. Implementations are free to ignore this information.
Added in version 1.6.
- do_set_render_rectangle(x, y, width, height) virtual¶
- Parameters:
- Returns:
whether the specified region could be set
- Return type:
Tell a window that it should render into a specific region of the window according to the
GstVideo.VideoOverlayinterface.
- do_set_window_handle(handle) virtual¶
- Parameters:
handle (
int) – handle to the window
Sets the window that this window should render into. Some implementations require this to be called with a valid handle before drawing can commence.
Added in version 1.4.
- do_show() virtual¶
Present the window to the screen.
Added in version 1.6.
Signal Details¶
- GstGL.GLWindow.signals.key_event(g_l_window, id, key)¶
- Signal Name:
key-event- Flags:
- Parameters:
g_l_window (
GstGL.GLWindow) – The object which received the signalid (
str) – the name of the eventkey (
str) – the id of the key pressed
Will be emitted when a key event is received by the GstGLwindow.
Added in version 1.6.
- GstGL.GLWindow.signals.mouse_event(g_l_window, id, button, x, y)¶
- Signal Name:
mouse-event- Flags:
- Parameters:
g_l_window (
GstGL.GLWindow) – The object which received the signalid (
str) – the name of the eventbutton (
int) – the id of the buttonx (
float) – the x coordinate of the mouse eventy (
float) – the y coordinate of the mouse event
Will be emitted when a mouse event is received by the GstGLwindow.
Added in version 1.6.
- GstGL.GLWindow.signals.scroll_event(g_l_window, x, y, delta_x, delta_y)¶
- Signal Name:
scroll-event- Flags:
- Parameters:
g_l_window (
GstGL.GLWindow) – The object which received the signalx (
float) – the x coordinate of the mouse eventy (
float) – the y coordinate of the mouse eventdelta_x (
float) – the x offset of the scroll eventdelta_y (
float) – the y offset of the scroll event
Will be emitted when a mouse scroll event is received by the GstGLwindow.
Added in version 1.18.
- GstGL.GLWindow.signals.window_handle_changed(g_l_window)¶
- Signal Name:
window-handle-changed- Flags:
- Parameters:
g_l_window (
GstGL.GLWindow) – The object which received the signal
Will be emitted when the window handle has been set into the native implementation, but before the context is re-activated. By using this signal, elements can refresh associated resource without relying on direct handle comparision.
Added in version 1.20.