From 2d928bad1c60aa452b2ca41cf911d76dd3f91f01 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 26 Aug 2014 12:38:52 +1000 Subject: [PATCH] egl: Wrap KHR_create_context flags in an ifdef EGL_CONTEXT_FLAGS_KHR and EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR don't exist in the Android NDK. Wrap their usage in an #ifdef EGL_KHR_create_context to fix the build there. --- gst-libs/gst/gl/egl/gstglcontext_egl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index 7ff5ae9..16adff9 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -336,7 +336,7 @@ gst_gl_context_egl_create_context (GstGLContext * context, context_attrib[i++] = EGL_CONTEXT_CLIENT_VERSION; context_attrib[i++] = 2; } -#if !defined(GST_DISABLE_GST_DEBUG) +#if !defined(GST_DISABLE_GST_DEBUG) && defined(EGL_KHR_create_context) if (gst_gl_check_extension ("EGL_KHR_create_context", egl_exts)) { context_attrib[i++] = EGL_CONTEXT_FLAGS_KHR; context_attrib[i++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; @@ -348,6 +348,7 @@ gst_gl_context_egl_create_context (GstGLContext * context, eglCreateContext (egl->egl_display, egl->egl_config, (EGLContext) external_gl_context, context_attrib); +#ifdef EGL_KHR_create_context if (egl->egl_context == EGL_NO_CONTEXT && egl->gl_api & GST_GL_API_GLES2 && eglGetError () != EGL_SUCCESS) { /* try without EGL_CONTEXT_FLAGS flags as it was added to @@ -362,6 +363,7 @@ gst_gl_context_egl_create_context (GstGLContext * context, eglCreateContext (egl->egl_display, egl->egl_config, (EGLContext) external_gl_context, context_attrib); } +#endif if (egl->egl_context != EGL_NO_CONTEXT) { GST_INFO ("gl context created: %" G_GUINTPTR_FORMAT, -- 2.7.4