From 97e66be37dd3cfd4dbca1f5a62d8fdf0bbeba68b Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 31 Mar 2016 19:43:04 +1100 Subject: [PATCH] gl: add support for building against GLES3 headers with a fallback to GLES2 headers if available. --- .../gst/gl/glprototypes/gstgl_gles2compat.h | 19 +++++++++++++------ gst-libs/gst/gl/gstglapi.h | 4 ++++ gst-libs/gst/gl/gstglcontext.c | 4 ---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gst-libs/gst/gl/glprototypes/gstgl_gles2compat.h b/gst-libs/gst/gl/glprototypes/gstgl_gles2compat.h index d28299025d..6dfd2c3b28 100644 --- a/gst-libs/gst/gl/glprototypes/gstgl_gles2compat.h +++ b/gst-libs/gst/gl/glprototypes/gstgl_gles2compat.h @@ -27,23 +27,30 @@ G_BEGIN_DECLS -/* SUPPORTED */ -//FIXME: +#ifndef GL_RGB16 #define GL_RGB16 GL_RGB565 +#endif +#ifndef GL_RGB8 #define GL_RGB8 GL_RGB -//END FIXME +#endif /* UNSUPPORTED */ -#define GL_COLOR_ATTACHMENT1 0 -#define GL_COLOR_ATTACHMENT2 0 +#ifndef GL_COLOR_ATTACHMENT1 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#endif +#ifndef GL_COLOR_ATTACHMENT2 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#endif #ifndef GL_TEXTURE_ENV #define GL_TEXTURE_ENV 0 #endif #ifndef GL_TEXTURE_ENV_MODE #define GL_TEXTURE_ENV_MODE 0 #endif -#define GL_DEPTH24_STENCIL8 0 +#ifndef GL_DEPTH24_STENCIL8 +#define GL_DEPTH24_STENCIL8 0x88F0 +#endif G_END_DECLS diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h index be381130c5..8c9266629f 100644 --- a/gst-libs/gst/gl/gstglapi.h +++ b/gst-libs/gst/gl/gstglapi.h @@ -41,6 +41,10 @@ # else # include # include +# if GST_GL_HAVE_GLES3 +# include +# include +# endif # endif # if !GST_GL_HAVE_OPENGL # include diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 2c208edd09..77dc8fc731 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -132,10 +132,6 @@ load_self_module (gpointer user_data) return NULL; } -#if GST_GL_HAVE_GLES3 -#error "Add module loading support for GLES3" -#endif - /* Context sharedness is tracked by a refcounted pointer stored in each context * object to track complex creation/deletion scenarios. As a result, * sharedness can only be successfully validated between two GstGLContext's