return window;
}
-GstGLPlatform
-gst_gl_window_get_platform (GstGLWindow * window)
-{
- GstGLWindowClass *window_class;
-
- window_class = GST_GL_WINDOW_GET_CLASS (window);
-
- g_return_val_if_fail (window_class->get_platform != NULL,
- GST_GL_PLATFORM_UNKNOWN);
-
- return window_class->get_platform (window);
-}
-
guintptr
gst_gl_window_get_gl_context (GstGLWindow * window)
{
GST_GL_WINDOW_UNLOCK (window);
}
-guintptr
-gst_gl_window_get_window_handle (GstGLWindow * window)
-{
- GstGLWindowClass *window_class;
- guintptr result;
-
- g_return_val_if_fail (GST_GL_IS_WINDOW (window), 0);
- window_class = GST_GL_WINDOW_GET_CLASS (window);
- g_return_val_if_fail (window_class->get_window_handle != NULL, FALSE);
-
- GST_GL_WINDOW_LOCK (window);
- result = window_class->get_window_handle (window);
- GST_GL_WINDOW_UNLOCK (window);
-
- return result;
-}
-
void
gst_gl_window_draw_unlocked (GstGLWindow * window, guint width, guint height)
{
/*
* GStreamer
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include <gst/gst.h>
+#include "gstglrenderer.h"
+
G_BEGIN_DECLS
#define GST_GL_TYPE_WINDOW (gst_gl_window_get_type())
GST_GL_PLATFORM_GLX,
GST_GL_PLATFORM_WGL,
GST_GL_PLATFORM_CGL,
-
+
+ GST_GL_PLATFORM_ANY = 254,
GST_GL_PLATFORM_LAST = 255
} GstGLPlatform;
struct _GstGLWindowClass {
/*< private >*/
GObjectClass parent_class;
-
+
guintptr (*get_gl_context) (GstGLWindow *window);
gboolean (*activate) (GstGLWindow *window, gboolean activate);
void (*set_window_handle) (GstGLWindow *window, guintptr id);
- guintptr (*get_window_handle) (GstGLWindow *window);
+ gboolean (*share_context) (GstGLWindow *window, guintptr external_gl_context);
void (*draw_unlocked) (GstGLWindow *window, guint width, guint height);
void (*draw) (GstGLWindow *window, guint width, guint height);
void (*run) (GstGLWindow *window);
void (*quit) (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void (*send_message) (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
- GstGLPlatform (*get_platform) (GstGLWindow *window);
/*< private >*/
gpointer _reserved[GST_PADDING];
/*
* GStreamer
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
gboolean gst_gl_window_x11_activate (GstGLWindow * window, gboolean activate);
void gst_gl_window_x11_set_window_handle (GstGLWindow * window,
guintptr handle);
-guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
void gst_gl_window_x11_draw_unlocked (GstGLWindow * window, guint width,
guint height);
void gst_gl_window_x11_draw (GstGLWindow * window, guint width, guint height);
window_class->activate = GST_DEBUG_FUNCPTR (gst_gl_window_x11_activate);
window_class->set_window_handle =
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_x11->connection = ConnectionNumber (window_x11->device);
- if (!window_class->choose_visual (window_x11)) {
+ if (!window_class->choose_format (window_x11)) {
GST_WARNING ("Failed to choose XVisual");
goto failure;
}
return window_class->get_gl_context (GST_GL_WINDOW_X11 (window));
}
-guintptr
-gst_gl_window_x11_get_window_handle (GstGLWindow * window)
-{
- return (guintptr) GST_GL_WINDOW_X11 (window)->internal_win_id;
-}
-
static void
callback_activate (GstGLWindow * window)
{
/*< private >*/
GstGLWindowClass parent_class;
- gboolean (*choose_visual) (GstGLWindowX11 *window);
+ gboolean (*choose_format) (GstGLWindowX11 *window);
gboolean (*create_context) (GstGLWindowX11 *window, GstGLRendererAPI render_api,
guintptr external_gl_context);
void (*swap_buffers) (GstGLWindowX11 *window);
/*
* GStreamer
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
static gboolean gst_gl_window_x11_egl_create_context (GstGLWindowX11 *
window_x11, GstGLRendererAPI render_api, guintptr external_gl_context);
static void gst_gl_window_x11_egl_destroy_context (GstGLWindowX11 * window_x11);
-static gboolean gst_gl_window_x11_egl_choose_visual (GstGLWindowX11 *
+static gboolean gst_gl_window_x11_egl_choose_format (GstGLWindowX11 *
window_x11);
static GstGLPlatform gst_gl_window_x11_egl_get_platform (GstGLWindow * window);
GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_create_context);
window_x11_class->destroy_context =
GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_destroy_context);
- window_x11_class->choose_visual =
- GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_choose_visual);
+ window_x11_class->choose_format =
+ GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_choose_format);
window_x11_class->swap_buffers =
GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_swap_buffers);
}
}
static gboolean
-gst_gl_window_x11_egl_choose_visual (GstGLWindowX11 * window_x11)
+gst_gl_window_x11_egl_choose_format (GstGLWindowX11 * window_x11)
{
gint ret;
/*
* GStreamer
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
static gboolean gst_gl_window_x11_glx_create_context (GstGLWindowX11 *
window_x11, GstGLRendererAPI render_api, guintptr external_gl_context);
static void gst_gl_window_x11_glx_destroy_context (GstGLWindowX11 * window_x11);
-static gboolean gst_gl_window_x11_glx_choose_visual (GstGLWindowX11 *
+static gboolean gst_gl_window_x11_glx_choose_format (GstGLWindowX11 *
window_x11);
static void
GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_create_context);
window_x11_class->destroy_context =
GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_destroy_context);
- window_x11_class->choose_visual =
- GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_choose_visual);
+ window_x11_class->choose_format =
+ GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_choose_format);
window_x11_class->swap_buffers =
GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_swap_buffers);
}
}
static gboolean
-gst_gl_window_x11_glx_choose_visual (GstGLWindowX11 * window_x11)
+gst_gl_window_x11_glx_choose_format (GstGLWindowX11 * window_x11)
{
gint error_base;
gint event_base;