mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
glwindow: remove unused draw_unlocked function
The functionality is provided by draw anyway and is leftover from X11's specific threading requirements that no longer apply.
This commit is contained in:
parent
231e91c883
commit
e9864e2e3e
8 changed files with 20 additions and 66 deletions
|
@ -57,8 +57,6 @@ gst_gl_window_android_egl_class_init (GstGLWindowAndroidEGLClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_gl_window_android_egl_get_window_handle);
|
||||
window_class->set_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_android_egl_set_window_handle);
|
||||
window_class->draw_unlocked =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_android_egl_draw);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_android_egl_draw);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@ gst_gl_window_cocoa_class_init (GstGLWindowCocoaClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_get_window_handle);
|
||||
window_class->set_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_set_window_handle);
|
||||
window_class->draw_unlocked = GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_draw);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_draw);
|
||||
window_class->set_preferred_size =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_set_preferred_size);
|
||||
|
|
|
@ -69,7 +69,6 @@ gst_gl_window_eagl_class_init (GstGLWindowEaglClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_gl_window_eagl_get_window_handle);
|
||||
window_class->set_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_eagl_set_window_handle);
|
||||
window_class->draw_unlocked = GST_DEBUG_FUNCPTR (gst_gl_window_eagl_draw);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_eagl_draw);
|
||||
window_class->set_preferred_size =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_eagl_set_preferred_size);
|
||||
|
|
|
@ -209,7 +209,6 @@ gst_gl_window_class_init (GstGLWindowClass * klass)
|
|||
klass->close = GST_DEBUG_FUNCPTR (gst_gl_window_default_close);
|
||||
klass->run = GST_DEBUG_FUNCPTR (gst_gl_window_default_run);
|
||||
klass->quit = GST_DEBUG_FUNCPTR (gst_gl_window_default_quit);
|
||||
klass->draw_unlocked = GST_DEBUG_FUNCPTR (gst_gl_window_default_draw);
|
||||
klass->draw = GST_DEBUG_FUNCPTR (gst_gl_window_default_draw);
|
||||
klass->send_message = GST_DEBUG_FUNCPTR (gst_gl_window_default_send_message);
|
||||
klass->send_message_async =
|
||||
|
@ -462,29 +461,6 @@ gst_gl_window_default_draw (GstGLWindow * window)
|
|||
gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_gl_window_draw_unlocked:
|
||||
* @window: a #GstGLWindow
|
||||
*
|
||||
* Redraw the window contents. Implementations should invoke the draw callback.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
gst_gl_window_draw_unlocked (GstGLWindow * window)
|
||||
{
|
||||
GstGLWindowClass *window_class;
|
||||
|
||||
g_return_if_fail (GST_GL_IS_WINDOW (window));
|
||||
window_class = GST_GL_WINDOW_GET_CLASS (window);
|
||||
g_return_if_fail (window_class->draw_unlocked != NULL);
|
||||
|
||||
window_class->draw_unlocked (window);
|
||||
|
||||
window->queue_resize = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_gl_window_draw:
|
||||
* @window: a #GstGLWindow
|
||||
|
|
|
@ -108,7 +108,6 @@ struct _GstGLWindow {
|
|||
* @set_window_handle: Set a window to render into
|
||||
* @get_window_handle: Gets the current window that this #GstGLWindow is
|
||||
* rendering into
|
||||
* @draw_unlocked: redraw the window with the specified dimensions
|
||||
* @draw: redraw the window with the specified dimensions
|
||||
* @run: run the mainloop
|
||||
* @quit: send a quit to the mainloop
|
||||
|
@ -131,7 +130,6 @@ struct _GstGLWindowClass {
|
|||
guintptr (*get_display) (GstGLWindow *window);
|
||||
void (*set_window_handle) (GstGLWindow *window, guintptr id);
|
||||
guintptr (*get_window_handle) (GstGLWindow *window);
|
||||
void (*draw_unlocked) (GstGLWindow *window);
|
||||
void (*draw) (GstGLWindow *window);
|
||||
void (*run) (GstGLWindow *window);
|
||||
void (*quit) (GstGLWindow *window);
|
||||
|
@ -216,7 +214,6 @@ void gst_gl_window_send_mouse_event (GstGLWindow * window,
|
|||
|
||||
/* surfaces/rendering */
|
||||
void gst_gl_window_queue_resize (GstGLWindow *window);
|
||||
void gst_gl_window_draw_unlocked (GstGLWindow *window);
|
||||
void gst_gl_window_draw (GstGLWindow *window);
|
||||
void gst_gl_window_show (GstGLWindow *window);
|
||||
void gst_gl_window_set_preferred_size (GstGLWindow * window,
|
||||
|
|
|
@ -334,8 +334,6 @@ gst_gl_window_wayland_egl_class_init (GstGLWindowWaylandEGLClass * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_get_window_handle);
|
||||
window_class->set_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_set_window_handle);
|
||||
window_class->draw_unlocked =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_draw);
|
||||
window_class->show = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_show);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_draw);
|
||||
window_class->close = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_close);
|
||||
|
|
|
@ -74,7 +74,6 @@ gst_gl_window_win32_class_init (GstGLWindowWin32Class * klass)
|
|||
|
||||
window_class->set_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_win32_set_window_handle);
|
||||
window_class->draw_unlocked = GST_DEBUG_FUNCPTR (gst_gl_window_win32_draw);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_win32_draw);
|
||||
window_class->get_display =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_win32_get_display);
|
||||
|
|
|
@ -74,7 +74,6 @@ guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
|
|||
static void gst_gl_window_x11_set_preferred_size (GstGLWindow * window,
|
||||
gint width, gint height);
|
||||
void gst_gl_window_x11_show (GstGLWindow * window);
|
||||
void gst_gl_window_x11_draw_unlocked (GstGLWindow * window);
|
||||
void gst_gl_window_x11_draw (GstGLWindow * window);
|
||||
gboolean gst_gl_window_x11_create_context (GstGLWindow * window,
|
||||
GstGLAPI gl_api, guintptr external_gl_context, GError ** error);
|
||||
|
@ -104,8 +103,6 @@ gst_gl_window_x11_class_init (GstGLWindowX11Class * klass)
|
|||
GST_DEBUG_FUNCPTR (gst_gl_window_x11_set_window_handle);
|
||||
window_class->get_window_handle =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_x11_get_window_handle);
|
||||
window_class->draw_unlocked =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_x11_draw_unlocked);
|
||||
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_x11_draw);
|
||||
window_class->open = GST_DEBUG_FUNCPTR (gst_gl_window_x11_open);
|
||||
window_class->close = GST_DEBUG_FUNCPTR (gst_gl_window_x11_close);
|
||||
|
@ -387,39 +384,13 @@ gst_gl_window_x11_show (GstGLWindow * window)
|
|||
gst_gl_window_send_message (window, (GstGLWindowCB) _show_window, window);
|
||||
}
|
||||
|
||||
/* Called in the gl thread */
|
||||
void
|
||||
gst_gl_window_x11_draw_unlocked (GstGLWindow * window)
|
||||
{
|
||||
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
|
||||
|
||||
if (gst_gl_window_is_running (GST_GL_WINDOW (window_x11))
|
||||
&& window_x11->allow_extra_expose_events) {
|
||||
if (window->queue_resize) {
|
||||
guint width, height;
|
||||
|
||||
gst_gl_window_get_surface_dimensions (window, &width, &height);
|
||||
gst_gl_window_resize (window, width, height);
|
||||
}
|
||||
|
||||
if (window->draw) {
|
||||
GstGLContext *context = gst_gl_window_get_context (window);
|
||||
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
|
||||
|
||||
window->draw (window->draw_data);
|
||||
context_class->swap_buffers (context);
|
||||
|
||||
gst_object_unref (context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_cb (gpointer data)
|
||||
{
|
||||
GstGLWindowX11 *window_x11 = data;
|
||||
GstGLWindow *window = GST_GL_WINDOW (window_x11);
|
||||
|
||||
if (gst_gl_window_is_running (GST_GL_WINDOW (window_x11))) {
|
||||
if (gst_gl_window_is_running (window)) {
|
||||
XWindowAttributes attr;
|
||||
|
||||
XGetWindowAttributes (window_x11->device, window_x11->internal_win_id,
|
||||
|
@ -443,7 +414,24 @@ draw_cb (gpointer data)
|
|||
}
|
||||
}
|
||||
|
||||
gst_gl_window_x11_draw_unlocked (GST_GL_WINDOW (window_x11));
|
||||
if (window_x11->allow_extra_expose_events) {
|
||||
if (window->queue_resize) {
|
||||
guint width, height;
|
||||
|
||||
gst_gl_window_get_surface_dimensions (window, &width, &height);
|
||||
gst_gl_window_resize (window, width, height);
|
||||
}
|
||||
|
||||
if (window->draw) {
|
||||
GstGLContext *context = gst_gl_window_get_context (window);
|
||||
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
|
||||
|
||||
window->draw (window->draw_data);
|
||||
context_class->swap_buffers (context);
|
||||
|
||||
gst_object_unref (context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue