GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextEGL *context_egl = GST_GL_CONTEXT_EGL (context);
- GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
if (context_egl->egl_surface) {
gint width, height;
if (window->draw)
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
gst_object_unref (context);
}
static gboolean gst_gl_context_cocoa_activate (GstGLContext * context, gboolean activate);
static GstGLAPI gst_gl_context_cocoa_get_gl_api (GstGLContext * context);
static GstGLPlatform gst_gl_context_cocoa_get_gl_platform (GstGLContext * context);
-static void gst_gl_context_cocoa_swap_buffer (GstGLContext * context);
+static void gst_gl_context_cocoa_swap_buffers (GstGLContext * context);
#define GST_GL_CONTEXT_COCOA_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoaPrivate))
g_type_class_add_private (klass, sizeof (GstGLContextCocoaPrivate));
context_class->swap_buffers =
- GST_DEBUG_FUNCPTR (gst_gl_context_cocoa_swap_buffer);
+ GST_DEBUG_FUNCPTR (gst_gl_context_cocoa_swap_buffers);
context_class->destroy_context =
GST_DEBUG_FUNCPTR (gst_gl_context_cocoa_destroy_context);
context_class->create_context =
}
static void
-gst_gl_context_cocoa_swap_buffer (GstGLContext * context)
+gst_gl_context_cocoa_swap_buffers (GstGLContext * context)
{
}
GstGLWindow *window = GST_GL_WINDOW (window_eagl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextEagl *eagl_context = GST_GL_CONTEXT_EAGL (context);
- GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
if (window_eagl->priv->view) {
CGSize size;
if (window->draw)
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
gst_gl_context_eagl_finish_draw (eagl_context);
context_class->get_gl_platform_version (context, major, minor);
}
+/**
+ * gst_gl_context_swap_buffers:
+ * @context: a #GstGLContext
+ *
+ * Swap the front and back buffers on the window attached to @context.
+ * This will display the frame on the next refresh cycle.
+ */
+void
+gst_gl_context_swap_buffers (GstGLContext * context)
+{
+ GstGLContextClass *context_class;
+
+ g_return_if_fail (GST_IS_GL_CONTEXT (context));
+ context_class = GST_GL_CONTEXT_GET_CLASS (context);
+ g_return_if_fail (context_class->swap_buffers != NULL);
+
+ context_class->swap_buffers (context);
+}
+
static GstGLAPI
gst_gl_wrapped_context_get_gl_api (GstGLContext * context)
{
guintptr gst_gl_context_get_gl_context (GstGLContext *context);
GST_EXPORT
gboolean gst_gl_context_can_share (GstGLContext * context, GstGLContext *other_context);
+GST_EXPORT
+void gst_gl_context_swap_buffers (GstGLContext * context);
GST_EXPORT
gboolean gst_gl_context_create (GstGLContext *context, GstGLContext *other_context, GError ** error);
{
GstGLWindow *window = GST_GL_WINDOW (data);
GstGLContext *context = gst_gl_window_get_context (window);
- GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
if (window->queue_resize) {
guint width, height;
if (window->draw)
window->draw (window->draw_data);
- if (context_class->swap_buffers)
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
gst_object_unref (context);
}
GstGLWindowVivFBEGL *window_egl = data;
GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
- GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
const GstGLFuncs *gl;
gint viewport_dim[4];
if (window->draw)
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
gst_object_unref (context);
}
GstGLWindowWaylandEGL *window_egl = data;
GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
- GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
create_surfaces (window_egl);
if (window->draw)
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
if (window_egl->window.subsurface)
wl_subsurface_set_desync (window_egl->window.subsurface);
} else if (GetProp (hWnd, "gl_window")) {
GstGLWindow *window;
GstGLContext *context;
- GstGLContextClass *context_class;
window_win32 = GST_GL_WINDOW_WIN32 (GetProp (hWnd, "gl_window"));
window = GST_GL_WINDOW (window_win32);
context = gst_gl_window_get_context (window);
- context_class = GST_GL_CONTEXT_GET_CLASS (context);
g_assert (window_win32->internal_win_id == hWnd);
PAINTSTRUCT ps;
BeginPaint (hWnd, &ps);
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
EndPaint (hWnd, &ps);
}
break;
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
window->draw (window->draw_data);
- context_class->swap_buffers (context);
+ gst_gl_context_swap_buffers (context);
gst_object_unref (context);
}