2012-12-03 04:04:49 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-12-06 06:40:47 +00:00
|
|
|
#ifndef __GST_GL_API_H__
|
|
|
|
#define __GST_GL_API_H__
|
2012-12-03 04:04:49 +00:00
|
|
|
|
2013-07-11 09:03:31 +00:00
|
|
|
#include <gst/gl/gstglconfig.h>
|
2013-07-19 07:20:09 +00:00
|
|
|
#include <gst/gl/glprototypes/gstgl_compat.h>
|
|
|
|
|
2014-03-19 13:45:35 +00:00
|
|
|
#if GST_GL_HAVE_PLATFORM_EGL
|
2014-03-19 13:48:10 +00:00
|
|
|
|
|
|
|
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
|
|
|
#ifndef __VCCOREVER__
|
|
|
|
#define __VCCOREVER__ 0x04000000
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
|
|
|
#pragma GCC optimize ("gnu89-inline")
|
|
|
|
#endif
|
|
|
|
|
2014-03-22 22:01:49 +00:00
|
|
|
#ifndef EGL_EGLEXT_PROTOTYPES
|
|
|
|
#define EGL_EGLEXT_PROTOTYPES 1
|
|
|
|
#endif
|
2014-03-19 13:45:35 +00:00
|
|
|
#include <EGL/egl.h>
|
2014-03-22 22:01:49 +00:00
|
|
|
#include <EGL/eglext.h>
|
2014-03-19 13:48:10 +00:00
|
|
|
|
|
|
|
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
|
|
|
#pragma GCC reset_options
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
#endif
|
|
|
|
|
2014-03-19 13:45:35 +00:00
|
|
|
#endif
|
|
|
|
|
2012-12-03 04:04:49 +00:00
|
|
|
/* OpenGL 2.0 for Embedded Systems */
|
2013-01-09 14:13:23 +00:00
|
|
|
#if GST_GL_HAVE_GLES2
|
2014-03-22 22:01:49 +00:00
|
|
|
#ifndef GL_GLEXT_PROTOTYPES
|
|
|
|
#define GL_GLEXT_PROTOTYPES 1
|
|
|
|
#endif
|
2014-04-23 12:30:27 +00:00
|
|
|
# ifdef __APPLE__
|
2014-04-12 19:43:50 +00:00
|
|
|
# include <OpenGLES/ES2/gl.h>
|
|
|
|
# include <OpenGLES/ES2/glext.h>
|
|
|
|
# else
|
|
|
|
# include <GLES2/gl2.h>
|
|
|
|
# include <GLES2/gl2ext.h>
|
|
|
|
# endif
|
2013-01-09 14:13:23 +00:00
|
|
|
# if !GST_GL_HAVE_OPENGL
|
2013-07-11 09:03:31 +00:00
|
|
|
# include <gst/gl/gstgles2.h>
|
2012-12-03 04:04:49 +00:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2012-12-06 06:40:47 +00:00
|
|
|
/* OpenGL for desktop systems */
|
2013-01-09 14:13:23 +00:00
|
|
|
#if GST_GL_HAVE_OPENGL
|
2014-04-23 12:30:27 +00:00
|
|
|
# ifdef __APPLE__
|
2012-12-03 04:04:49 +00:00
|
|
|
# include <OpenGL/OpenGL.h>
|
|
|
|
# include <OpenGL/gl.h>
|
2013-07-10 15:03:04 +00:00
|
|
|
# include <OpenGL/glu.h>
|
2012-12-03 04:04:49 +00:00
|
|
|
# else
|
|
|
|
# include <GL/gl.h>
|
2013-07-11 18:51:47 +00:00
|
|
|
# include <GL/glu.h>
|
2013-06-30 21:36:35 +00:00
|
|
|
# if __WIN32__ || _WIN32
|
2013-03-09 10:59:02 +00:00
|
|
|
# include <GL/glext.h>
|
|
|
|
# endif
|
2012-12-03 04:04:49 +00:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2013-06-02 07:52:30 +00:00
|
|
|
#ifdef WINAPI
|
|
|
|
#define GSTGLAPI WINAPI
|
|
|
|
#else
|
|
|
|
#define GSTGLAPI
|
|
|
|
#endif
|
|
|
|
|
2012-12-03 04:04:49 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GST_GL_API_NONE = 0,
|
|
|
|
GST_GL_API_OPENGL = (1 << 0),
|
|
|
|
GST_GL_API_OPENGL3 = (1 << 1),
|
2014-02-10 21:23:39 +00:00
|
|
|
GST_GL_API_GLES1 = (1 << 15),
|
2012-12-03 04:04:49 +00:00
|
|
|
GST_GL_API_GLES2 = (1 << 16),
|
|
|
|
GST_GL_API_GLES3 = (1 << 17),
|
|
|
|
|
|
|
|
GST_GL_API_ANY = G_MAXUINT32
|
|
|
|
} GstGLAPI;
|
|
|
|
|
2014-02-10 21:23:39 +00:00
|
|
|
#define GST_GL_API_OPENGL_NAME "opengl"
|
|
|
|
#define GST_GL_API_OPENGL3_NAME "opengl3"
|
|
|
|
#define GST_GL_API_GLES1_NAME "gles1"
|
|
|
|
#define GST_GL_API_GLES2_NAME "gles2"
|
|
|
|
#define GST_GL_API_GLES3_NAME "gles3"
|
|
|
|
|
2012-12-03 04:04:49 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2014-03-15 12:51:44 +00:00
|
|
|
GST_GL_PLATFORM_NONE = 0,
|
2012-12-06 06:40:47 +00:00
|
|
|
GST_GL_PLATFORM_EGL = (1 << 0),
|
|
|
|
GST_GL_PLATFORM_GLX = (1 << 1),
|
|
|
|
GST_GL_PLATFORM_WGL = (1 << 2),
|
|
|
|
GST_GL_PLATFORM_CGL = (1 << 3),
|
2014-04-12 19:43:50 +00:00
|
|
|
GST_GL_PLATFORM_EAGL = (1 << 4),
|
2012-12-03 04:04:49 +00:00
|
|
|
|
2012-12-06 06:40:47 +00:00
|
|
|
GST_GL_PLATFORM_ANY = G_MAXUINT32
|
2012-12-03 04:04:49 +00:00
|
|
|
} GstGLPlatform;
|
|
|
|
|
2012-12-06 13:16:04 +00:00
|
|
|
#define GST_GL_EXT_BEGIN(name, min_gl, maj_gl, in_gles, ext_suf, ext_name)
|
|
|
|
#define GST_GL_EXT_FUNCTION(ret, name, args) \
|
2013-06-02 07:52:30 +00:00
|
|
|
ret GSTGLAPI (*name) args;
|
2012-12-06 13:16:04 +00:00
|
|
|
#define GST_GL_EXT_END()
|
|
|
|
|
|
|
|
typedef struct _GstGLFuncs
|
|
|
|
{
|
2014-03-22 13:38:16 +00:00
|
|
|
#include <gst/gl/glprototypes/all_functions.h>
|
|
|
|
gpointer padding[GST_PADDING_LARGE*6];
|
2013-01-16 04:21:44 +00:00
|
|
|
} GstGLFuncs;
|
2012-12-06 13:16:04 +00:00
|
|
|
|
|
|
|
#undef GST_GL_EXT_BEGIN
|
|
|
|
#undef GST_GL_EXT_FUNCTION
|
|
|
|
#undef GST_GL_EXT_END
|
|
|
|
|
2014-02-10 21:23:39 +00:00
|
|
|
gchar * gst_gl_api_to_string (GstGLAPI api);
|
|
|
|
GstGLAPI gst_gl_api_from_string (const gchar * api_s);
|
2012-12-08 22:32:48 +00:00
|
|
|
|
2014-03-15 12:51:44 +00:00
|
|
|
gchar * gst_gl_platform_to_string (GstGLPlatform api);
|
|
|
|
GstGLPlatform gst_gl_platform_from_string (const gchar * platform_s);
|
|
|
|
|
2012-12-03 04:04:49 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2012-12-06 06:40:47 +00:00
|
|
|
#endif /* __GST_GL_API_H__ */
|