summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2016-02-08 23:06:51 +0200
committerwm4 <wm4@nowhere>2016-02-10 21:29:42 +0100
commit4b97869e5f8159bde598cbfc31f70ea3001d08df (patch)
treee722ab30cd271708ca2aad83adf379ba63607e16
parentff0112e08df32e88549d142371d49a2a8ac8a798 (diff)
downloadmpv-4b97869e5f8159bde598cbfc31f70ea3001d08df.tar.bz2
mpv-4b97869e5f8159bde598cbfc31f70ea3001d08df.tar.xz
Enable building the opengl-cb video renderer on Android
* Add Android-specific OpenGL ES feature and checks * Add missing GL_* symbols for Android (list gathered by Ilya Zhuravlev <whatever@xyz.is>)
-rw-r--r--video/out/opengl/common.h2
-rw-r--r--video/out/opengl/header_fixes.h24
-rw-r--r--wscript21
3 files changed, 44 insertions, 3 deletions
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h
index 9b16f82423..9236ce1d6f 100644
--- a/video/out/opengl/common.h
+++ b/video/out/opengl/common.h
@@ -36,6 +36,8 @@
#include <OpenGL/gl.h>
#include <OpenGL/gl3.h>
#include <OpenGL/glext.h>
+#elif HAVE_ANDROID_GL
+#include <GLES3/gl3.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
diff --git a/video/out/opengl/header_fixes.h b/video/out/opengl/header_fixes.h
index 8d72adb2c6..885c27700f 100644
--- a/video/out/opengl/header_fixes.h
+++ b/video/out/opengl/header_fixes.h
@@ -62,6 +62,30 @@
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
#endif
+#if HAVE_ANDROID_GL
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_RGB_422_APPLE 0x8A1F
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_WRITE_ONLY 0x88B9
+#define GL_RGB16 0x8054
+#define GL_RGB10 0x8052
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_R16 0x822A
+#define GL_RG16 0x822C
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
#undef MP_GET_GL_WORKAROUNDS
#endif // MP_GET_GL_WORKAROUNDS
diff --git a/wscript b/wscript
index a8f649a5fd..0e39e2ade6 100644
--- a/wscript
+++ b/wscript
@@ -767,14 +767,29 @@ video_output_features = [
check_statement('GL/gl.h', '(void)GL_LUMINANCE16') # arbitrary OpenGL legacy-only symbol
),
}, {
- 'name': '--plain-gl',
- 'desc': 'OpenGL without platform-specific code (e.g. for libmpv)',
- 'deps_any': [ 'libmpv-shared', 'libmpv-static' ],
+ 'name': '--desktop-gl',
+ 'desc': 'Desktop OpengGL support',
'func': compose_checks(
check_statement('GL/gl.h', '(void)GL_RGB32F'), # arbitrary OpenGL 3.0 symbol
check_statement('GL/gl.h', '(void)GL_LUMINANCE16') # arbitrary OpenGL legacy-only symbol
),
} , {
+ 'name': '--android-gl',
+ 'desc': 'Android OpenGL ES support',
+ 'deps': ['android'],
+ 'func': check_statement('GLES3/gl3.h', '(void)GL_RGB32F'), # arbitrary OpenGL ES 3.0 symbol
+ } , {
+ 'name': '--any-gl',
+ 'desc': 'Any OpenGL (ES) support',
+ 'deps_any': ['desktop-gl', 'android-gl'],
+ 'func': check_true
+ } , {
+ 'name': '--plain-gl',
+ 'desc': 'OpenGL without platform-specific code (e.g. for libmpv)',
+ 'deps': ['any-gl'],
+ 'deps_any': [ 'libmpv-shared', 'libmpv-static' ],
+ 'func': check_true,
+ } , {
'name': '--gl',
'desc': 'OpenGL video outputs',
'deps_any': [ 'gl-cocoa', 'gl-x11', 'egl-x11', 'egl-drm',