Commit 538643e3 authored by Matthew Waters's avatar Matthew Waters 🐨 Committed by Tim-Philipp Müller

[606/906] determine the GL platform to use at runtime

- Make GstGLWindow subclassablerather than specified at compile time.
- Add GstGLWindowX11 for x11 windows and two subclasses, GstGLWindowX11GLX
  and GstGLWindwX11EGL for GLX and EGL repectively. (win32 and cocoa
  ports to come)
- Also cleanup GL library detection in configure.ac
parent 9dd6570c
......@@ -2,8 +2,6 @@
lib_LTLIBRARIES = libgstgl-@GST_API_VERSION@.la
EXTRA_DIST = \
gstglwindow_x11.c \
gstglwindow_x11ES2.c \
gstglwindow_win32.c \
gstglwindow_winCE.c \
gstglwindow_cocoa.m
......@@ -17,19 +15,25 @@ libgstgl_@GST_API_VERSION@_la_SOURCES = \
gstglshader.c \
gstglshadervariables.c \
gstgldownload.c \
gstglupload.c
gstglupload.c \
gstglwindow.c
if GL_BACKEND_WIN32
#SUBDIRS =
if HAVE_WINDOW_WIN32
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_win32.c
endif
if GL_BACKEND_COCOA
if HAVE_WINDOW_COCOA
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_cocoa.m
endif
if GL_BACKEND_X11
if HAVE_WINDOW_X11
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_x11.c
if USE_GLX
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_x11_glx.c
endif
if GL_BACKEND_X11ES2
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_x11ES2.c
if USE_EGL
libgstgl_@GST_API_VERSION@_la_SOURCES += gstglwindow_x11_egl.c
endif
#SUBDIRS += x11
endif
libgstgl_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/gl
......@@ -42,7 +46,7 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \
gstglfilter.h \
gstglmixer.h \
gstglmixerpad.h \
gstglshadervariables.h \
gstglshadervariables.h \
gstglshader.h \
gstgldownload.h \
gstglupload.h
......@@ -62,7 +66,7 @@ libgstgl_@GST_API_VERSION@_la_OBJCFLAGS = \
libgstgl_@GST_API_VERSION@_la_LDFLAGS = \
$(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
if GL_BACKEND_COCOA
if HAVE_WINDOW_COCOA
libgstgl_@GST_API_VERSION@_la_LIBTOOLFLAGS = --tag=OBJC
else
libgstgl_@GST_API_VERSION@_la_LIBTOOLFLAGS = --tag=CC
......
......@@ -93,8 +93,6 @@ static void
gst_gl_display_class_init (GstGLDisplayClass * klass)
{
G_OBJECT_CLASS (klass)->finalize = gst_gl_display_finalize;
gst_gl_window_init_platform ();
}
......@@ -217,7 +215,7 @@ gst_gl_display_finalize (GObject * object)
GST_INFO ("send quit gl window loop");
gst_gl_window_quit_loop (display->gl_window,
gst_gl_window_quit (display->gl_window,
GST_GL_WINDOW_CB (gst_gl_display_thread_destroy_context), display);
GST_INFO ("quit sent to gl window loop");
......@@ -303,7 +301,9 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
GLenum err = GLEW_OK;
gst_gl_display_lock (display);
display->gl_window = gst_gl_window_new (display->external_gl_context);
display->gl_window =
gst_gl_window_new (GST_GL_RENDERER_API_OPENGL,
display->external_gl_context);
if (!display->gl_window) {
gst_gl_display_set_error (display, "Failed to create gl window");
......@@ -385,7 +385,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
//setup callbacks
gst_gl_window_set_resize_callback (display->gl_window,
GST_GL_WINDOW_CB2 (gst_gl_display_on_resize), display);
GST_GL_WINDOW_RESIZE_CB (gst_gl_display_on_resize), display);
gst_gl_window_set_draw_callback (display->gl_window,
GST_GL_WINDOW_CB (gst_gl_display_on_draw), display);
gst_gl_window_set_close_callback (display->gl_window,
......@@ -395,7 +395,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
gst_gl_display_unlock (display);
gst_gl_window_run_loop (display->gl_window);
gst_gl_window_run (display->gl_window);
GST_INFO ("loop exited\n");
......@@ -1302,10 +1302,10 @@ gst_gl_display_del_shader (GstGLDisplay * display, GstGLShader * shader)
/* Called by the glimagesink */
void
gst_gl_display_set_window_id (GstGLDisplay * display, gulong window_id)
gst_gl_display_set_window_id (GstGLDisplay * display, guintptr window_id)
{
gst_gl_display_lock (display);
gst_gl_window_set_external_window_id (display->gl_window, window_id);
gst_gl_window_set_window_handle (display->gl_window, window_id);
gst_gl_display_unlock (display);
}
......@@ -1342,8 +1342,7 @@ gst_gl_display_get_internal_gl_context (GstGLDisplay * display)
{
gulong external_gl_context = 0;
gst_gl_display_lock (display);
external_gl_context =
gst_gl_window_get_internal_gl_context (display->gl_window);
external_gl_context = gst_gl_window_get_gl_context (display->gl_window);
gst_gl_display_unlock (display);
return external_gl_context;
}
......@@ -1353,7 +1352,7 @@ gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate)
{
if (!activate)
gst_gl_display_lock (display);
gst_gl_window_activate_gl_context (display->gl_window, activate);
gst_gl_window_activate (display->gl_window, activate);
if (activate)
gst_gl_display_unlock (display);
}
......
/*
* GStreamer
* 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
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GL_RENDERER_H__
#define __GST_GL_RENDERER_H__
/* OpenGL 2.0 for Embedded Systems */
#ifdef GST_GL_RENDERER_GLES2
# undef UNICODE
# include <EGL/egl.h>
# define UNICODE
# include <GLES2/gl2.h>
# include "gstgles2.h"
/* OpenGL for usual systems */
#endif
#if GST_GL_RENDERER_GL || GST_GL_RENDERER_GL3
# if __APPLE__
# include <GL/glew.h>
# include <OpenGL/OpenGL.h>
# include <OpenGL/gl.h>
# else
# if HAVE_GLEW
# include <GL/glew.h>
# endif
# include <GL/gl.h>
# endif
#endif
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_GL_TYPE_RENDERER (gst_gl_renderer_get_type())
#define GST_GL_RENDERER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_GL_TYPE_RENDERER, GstGLRenderer))
#define GST_GL_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_GL_TYPE_RENDERER, GstGLRendererClass))
#define GST_GL_IS_RENDERER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_GL_TYPE_RENDERER))
#define GST_GL_IS_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_GL_TYPE_RENDERER))
#define GST_GL_RENDERER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_GL_TYPE_RENDERER, GstGLRendererClass))
#define GST_GL_RENDERER_ERROR (gst_gl_renderer_error_quark ())
typedef struct _GstGLRenderer GstGLRenderer;
typedef struct _GstGLRendererPrivate GstGLRendererPrivate;
typedef struct _GstGLRendererClass GstGLRendererClass;
typedef enum {
GST_GL_RENDERER_API_OPENGL = 1,
GST_GL_RENDERER_API_OPENGL3 = 2,
GST_GL_RENDERER_API_GLES = 40,
GST_GL_RENDERER_API_GLES2 = 41,
GST_GL_RENDERER_API_GLES3 = 42,
GST_GL_RENDERER_API_LAST = 255
} GstGLRendererAPI;
struct _GstGLRenderer {
/*< private >*/
GObject parent;
/*< public >*/
GstGLRendererAPI renderer_api;
/*< private >*/
gpointer _reserved[GST_PADDING_LARGE];
};
struct _GstGLRendererClass {
/*< private >*/
GObjectClass parent_class;
/*< private >*/
gpointer _reserved[GST_PADDING_LARGE];
};
/* methods */
GQuark gst_gl_renderer_error_quark (void);
GType gst_gl_renderer_get_type (void);
GstGLRenderer * gst_gl_renderer_new ();
GstGLRendererAPI gst_gl_renderer_get_renderer_api (GstGLRenderer *renderer);
G_END_DECLS
#endif /* __GST_GL_WINDOW_H__ */
/*
* GStreamer
* 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
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstglwindow.h"
#ifdef HAVE_WINDOW_X11
#include "gstglwindow_x11.h"
#endif
#ifdef HAVE_WINDOW_WIN32
#include "win32/gstglwindow_win32.h"
#endif
#ifdef HAVE_WINDOW_COCOA
#include "osx/gstglwindow_cocoa.h"
#endif
#define GST_CAT_DEFAULT gst_gl_window_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
#define DEBUG_INIT \
GST_DEBUG_CATEGORY_INIT (gst_gl_window_debug, "glwindow", 0, "glwindow element");
#define gst_gl_window_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstGLWindow, gst_gl_window, G_TYPE_OBJECT,
DEBUG_INIT);
static void
gst_gl_window_init (GstGLWindow * window)
{
g_mutex_init (&window->lock);
window->need_lock = TRUE;
}
static void
gst_gl_window_class_init (GstGLWindowClass * klass)
{
}
GstGLWindow *
gst_gl_window_new (GstGLRendererAPI render_api, guintptr external_gl_context)
{
GstGLWindow *window = NULL;
const gchar *user_choice;
user_choice = g_getenv ("GST_GL_WINDOW");
#ifdef HAVE_WINDOW_X11
if (!window && (!user_choice || g_strstr_len (user_choice, 3, "x11")))
window =
GST_GL_WINDOW (gst_gl_window_x11_new (render_api, external_gl_context));
#endif
#ifdef HAVE_WINDOW_WIN32
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "win32")))
window =
GST_GL_WINDOW (gst_gl_window_win32_new (render_api,
external_gl_context));
#endif
#ifdef HAVE_WINDOW_COCOA
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "cocoa")))
window =
GST_GL_WINDOW (gst_gl_window_cocoa_new (render_api,
external_gl_context));
#endif
if (!window) {
GST_WARNING ("could not create a window, user choice:%s", user_choice);
/* FIXME: set and return a GError */
return NULL;
}
window->external_gl_context = external_gl_context;
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)
{
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_gl_context != NULL, 0);
GST_GL_WINDOW_LOCK (window);
result = window_class->get_gl_context (window);
GST_GL_WINDOW_UNLOCK (window);
return result;
}
gboolean
gst_gl_window_activate (GstGLWindow * window, gboolean activate)
{
GstGLWindowClass *window_class;
gboolean result;
g_return_val_if_fail (GST_GL_IS_WINDOW (window), FALSE);
window_class = GST_GL_WINDOW_GET_CLASS (window);
g_return_val_if_fail (window_class->activate != NULL, FALSE);
GST_GL_WINDOW_LOCK (window);
result = window_class->activate (window, activate);
GST_GL_WINDOW_UNLOCK (window);
return result;
}
void
gst_gl_window_set_window_handle (GstGLWindow * window, guintptr handle)
{
GstGLWindowClass *window_class;
g_return_if_fail (GST_GL_IS_WINDOW (window));
g_return_if_fail (handle != 0);
window_class = GST_GL_WINDOW_GET_CLASS (window);
g_return_if_fail (window_class->set_window_handle != NULL);
GST_GL_WINDOW_LOCK (window);
window_class->set_window_handle (window, handle);
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)
{
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, width, height);
}
void
gst_gl_window_draw (GstGLWindow * window, guint width, guint height)
{
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 != NULL);
GST_GL_WINDOW_LOCK (window);
window_class->draw (window, width, height);
GST_GL_WINDOW_UNLOCK (window);
}
void
gst_gl_window_run (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->run != NULL);
GST_GL_WINDOW_LOCK (window);
window_class->run (window);
GST_GL_WINDOW_UNLOCK (window);
}
void
gst_gl_window_quit (GstGLWindow * window, GstGLWindowCB callback, gpointer data)
{
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->quit != NULL);
GST_GL_WINDOW_LOCK (window);
window->close = callback;
window->close_data = data;
window_class->quit (window, callback, data);
GST_GL_WINDOW_UNLOCK (window);
}
void
gst_gl_window_send_message (GstGLWindow * window, GstGLWindowCB callback,
gpointer data)
{
GstGLWindowClass *window_class;
g_return_if_fail (GST_GL_IS_WINDOW (window));
g_return_if_fail (callback != NULL);
window_class = GST_GL_WINDOW_GET_CLASS (window);
g_return_if_fail (window_class->quit != NULL);
GST_GL_WINDOW_LOCK (window);
window_class->send_message (window, callback, data);
GST_GL_WINDOW_UNLOCK (window);
}
/**
* gst_gl_window_set_need_lock:
*
* window: a #GstGLWindow
* need_lock: whether the @window needs to lock for concurrent access
*
* This API is intended only for subclasses of #GstGLWindow in order to ensure
* correct interaction with the underlying window system.
*/
void
gst_gl_window_set_need_lock (GstGLWindow * window, gboolean need_lock)
{
g_return_if_fail (GST_GL_IS_WINDOW (window));
window->need_lock = need_lock;
}
void
gst_gl_window_set_draw_callback (GstGLWindow * window, GstGLWindowCB callback,
gpointer data)
{
g_return_if_fail (GST_GL_IS_WINDOW (window));
GST_GL_WINDOW_LOCK (window);
window->draw = callback;
window->draw_data = data;
GST_GL_WINDOW_UNLOCK (window);
}
void
gst_gl_window_set_resize_callback (GstGLWindow * window,
GstGLWindowResizeCB callback, gpointer data)
{
g_return_if_fail (GST_GL_IS_WINDOW (window));
GST_GL_WINDOW_LOCK (window);
window->resize = callback;
window->resize_data = data;
GST_GL_WINDOW_UNLOCK (window);
}
void
gst_gl_window_set_close_callback (GstGLWindow * window, GstGLWindowCB callback,
gpointer data)
{
g_return_if_fail (GST_GL_IS_WINDOW (window));
GST_GL_WINDOW_LOCK (window);
window->close = callback;
window->close_data = data;
GST_GL_WINDOW_UNLOCK (window);
}
......@@ -21,25 +21,6 @@
#ifndef __GST_GL_WINDOW_H__
#define __GST_GL_WINDOW_H__
/* OpenGL 2.0 for Embedded Systems */
#ifdef OPENGL_ES2
#undef UNICODE
#include <EGL/egl.h>
#define UNICODE
#include <GLES2/gl2.h>
#include "gstgles2.h"
/* OpenGL for usual systems */
#else
#if __APPLE__
#include <GL/glew.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#else
#include <GL/glew.h>
#include <GL/gl.h>
#endif
#endif
#include <gst/gst.h>
G_BEGIN_DECLS
......@@ -51,13 +32,38 @@ G_BEGIN_DECLS
#define GST_GL_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_GL_TYPE_WINDOW))
#define GST_GL_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_GL_TYPE_WINDOW, GstGLWindowClass))
#define GST_GL_WINDOW_LOCK(w) \
do { \
if (GST_GL_WINDOW(w)->need_lock) \
g_mutex_lock (&GST_GL_WINDOW(w)->lock); \
} while (0)
#define GST_GL_WINDOW_UNLOCK(w) \
do { \
if (GST_GL_WINDOW(w)->need_lock) \
g_mutex_unlock (&GST_GL_WINDOW(w)->lock); \
} while (0)
#define GST_GL_WINDOW_GET_LOCK(w) (&GST_GL_WINDOW(w)->lock)
#define GST_GL_WINDOW_ERROR (gst_gl_window_error_quark ())
typedef void (* GstGLWindowCB) ( gpointer );
typedef void (* GstGLWindowCB2) ( gpointer, gint, gint );
typedef void (*GstGLWindowCB) (gpointer data);
typedef void (*GstGLWindowResizeCB) (gpointer data, guint width, guint height);
#define GST_GL_WINDOW_CB(f) ((GstGLWindowCB) (f))
#define GST_GL_WINDOW_CB2(f) ((GstGLWindowCB2) (f))
#define GST_GL_WINDOW_RESIZE_CB(f) ((GstGLWindowResizeCB) (f))
typedef enum
{
GST_GL_PLATFORM_UNKNOWN = 0,
GST_GL_PLATFORM_EGL,
GST_GL_PLATFORM_GLX,
GST_GL_PLATFORM_WGL,
GST_GL_PLATFORM_CGL,
GST_GL_PLATFORM_LAST = 255
} GstGLPlatform;
typedef struct _GstGLWindow GstGLWindow;
typedef struct _GstGLWindowPrivate GstGLWindowPrivate;
......@@ -66,38 +72,66 @@ typedef struct _GstGLWindowClass GstGLWindowClass;
struct _GstGLWindow {
/*< private >*/
GObject parent;
GstGLWindowPrivate *priv;
/*< public >*/
GMutex lock;
gboolean need_lock;
guintptr external_gl_context;
GstGLWindowCB draw;
gpointer draw_data;
GstGLWindowCB close;
gpointer close_data;
GstGLWindowResizeCB resize;
gpointer resize_data;
/*< private >*/
gpointer _reserved[GST_PADDING];
};
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);
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];
};
/* methods */
GQuark gst_gl_window_error_quark (void);
GType gst_gl_window_get_type (void);
GstGLWindow * gst_gl_window_new (guintptr external_gl_context);
guintptr gst_gl_window_get_internal_gl_context (GstGLWindow *window);
void gst_gl_window_activate_gl_context (GstGLWindow *window, gboolean activate);
void gst_gl_window_set_external_window_id (GstGLWindow *window, guintptr id);
void gst_gl_window_set_draw_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_set_resize_callback (GstGLWindow *window, GstGLWindowCB2 callback, gpointer data);
void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_draw_unlocked (GstGLWindow *window, gint width, gint height);
void gst_gl_window_draw (GstGLWindow *window, gint width, gint height);
void gst_gl_window_run_loop (GstGLWindow *window);
void gst_gl_window_quit_loop (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_send_message (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
/* helper */
void gst_gl_window_init_platform ();
GType gst_gl_window_get_type (void);
GstGLWindow * gst_gl_window_new (GstGLRendererAPI render_api, guintptr external_gl_context);
void gst_gl_window_set_draw_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_set_resize_callback (GstGLWindow *window, GstGLWindowResizeCB callback, gpointer data);
void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_set_need_lock (GstGLWindow *window, gboolean need_lock);
guintptr gst_gl_window_get_gl_context (GstGLWindow *window);
gboolean gst_gl_window_activate (GstGLWindow *window, gboolean activate);
void gst_gl_window_set_window_handle (GstGLWindow *window, guintptr handle);
guintptr gst_gl_window_get_window_handle (GstGLWindow *window);
void gst_gl_window_draw_unlocked (GstGLWindow *window, guint width, guint height);
void gst_gl_window_draw (GstGLWindow *window, guint width, guint height);
void gst_gl_window_run (GstGLWindow *window);
void gst_gl_window_quit (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_send_message (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
GstGLPlatform gst_gl_window_get_platform (GstGLWindow *window);
G_END_DECLS
......
This diff is collapsed.
/*
* GStreamer
* 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
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GL_WINDOW_X11_H__
#define __GST_GL_WINDOW_X11_H__
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "gstglwindow.h"
G_BEGIN_DECLS
#define GST_GL_TYPE_WINDOW_X11 (gst_gl_window_x11_get_type())
#define GST_GL_WINDOW_X11(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_GL_TYPE_WINDOW_X11, GstGLWindowX11))
#define GST_GL_WINDOW_X11_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_GL_TYPE_WINDOW_X11, GstGLWindowX11Class))
#define GST_GL_IS_WINDOW_X11(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_GL_TYPE_WINDOW_X11))
#define GST_GL_IS_WINDOW_X11_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_GL_TYPE_WINDOW_X11))
#define GST_GL_WINDOW_X11_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_GL_TYPE_WINDOW_X11, GstGLWindowX11Class))
typedef struct _GstGLWindowX11 GstGLWindowX11;
typedef struct _GstGLWindowX11Private GstGLWindowX11Private;
typedef struct _GstGLWindowX11Class GstGLWindowX11Class;
struct _GstGLWindowX11 {
/*< private >*/
GstGLWindow parent;