Mercurial > mplayer.hg
comparison configure @ 35889:a51578d7e264
Add (hackish) support for OpenGL on Android.
The only to run that actually works in my system is running
from adb shell, since trying to create a window from native code
is not possible when running from a app.
author | reimar |
---|---|
date | Sat, 16 Mar 2013 19:15:42 +0000 |
parents | 709d85ff7a0b |
children | f5023d8238ce |
comparison
equal
deleted
inserted
replaced
35888:f464ea910bd2 | 35889:a51578d7e264 |
---|---|
5315 | 5315 |
5316 # make sure this stays below CoreVideo to avoid issues due to namespace | 5316 # make sure this stays below CoreVideo to avoid issues due to namespace |
5317 # conflicts between -lGL and -framework OpenGL | 5317 # conflicts between -lGL and -framework OpenGL |
5318 echocheck "OpenGL" | 5318 echocheck "OpenGL" |
5319 #Note: this test is run even with --enable-gl since we autodetect linker flags | 5319 #Note: this test is run even with --enable-gl since we autodetect linker flags |
5320 if (test "$_x11" = yes || test "$_sdl" = yes || win32 || test "$_corevideo" = yes) && test "$_gl" != no ; then | 5320 if test "$_gl" != no ; then |
5321 cat > $TMPC << EOF | 5321 cat > $TMPC << EOF |
5322 #ifdef GL_WIN32 | 5322 #ifdef GL_WIN32 |
5323 #include <windows.h> | 5323 #include <windows.h> |
5324 #include <GL/gl.h> | 5324 #include <GL/gl.h> |
5325 #elif defined(GL_SDL) | 5325 #elif defined(GL_SDL) |
5335 #endif | 5335 #endif |
5336 #elif defined(GL_EGL_X11) | 5336 #elif defined(GL_EGL_X11) |
5337 #include <GL/gl.h> | 5337 #include <GL/gl.h> |
5338 #include <X11/Xlib.h> | 5338 #include <X11/Xlib.h> |
5339 #include <EGL/egl.h> | 5339 #include <EGL/egl.h> |
5340 #elif defined(GL_EGL_ANDROID) | |
5341 #include <GLES/gl.h> | |
5342 #include <EGL/egl.h> | |
5340 #else | 5343 #else |
5341 #include <GL/gl.h> | 5344 #include <GL/gl.h> |
5342 #include <X11/Xlib.h> | 5345 #include <X11/Xlib.h> |
5343 #include <GL/glx.h> | 5346 #include <GL/glx.h> |
5344 #endif | 5347 #endif |
5346 #ifdef GL_WIN32 | 5349 #ifdef GL_WIN32 |
5347 HDC dc; | 5350 HDC dc; |
5348 wglCreateContext(dc); | 5351 wglCreateContext(dc); |
5349 #elif defined(GL_SDL) | 5352 #elif defined(GL_SDL) |
5350 SDL_GL_SwapBuffers(); | 5353 SDL_GL_SwapBuffers(); |
5351 #elif defined(GL_EGL_X11) | 5354 #elif defined(GL_EGL_X11) || defined(GL_EGL_ANDROID) |
5352 EGLDisplay eglDisplay = EGL_NO_DISPLAY; | 5355 EGLDisplay eglDisplay = EGL_NO_DISPLAY; |
5353 eglInitialize(eglDisplay, NULL, NULL); | 5356 eglInitialize(eglDisplay, NULL, NULL); |
5354 #else | 5357 #else |
5355 glXCreateContext(NULL, NULL, NULL, True); | 5358 glXCreateContext(NULL, NULL, NULL, True); |
5356 #endif | 5359 #endif |
5357 #ifndef GL_EGL_X11 | 5360 #ifdef GL_EGL_ANDROID |
5361 EGLNativeWindowType android_createDisplaySurface(void); | |
5362 android_createDisplaySurface(); | |
5363 #elif !defined(GL_EGL_X11) | |
5358 glFinish(); | 5364 glFinish(); |
5359 #endif | 5365 #endif |
5360 return 0; | 5366 return 0; |
5361 } | 5367 } |
5362 EOF | 5368 EOF |
5367 _gl_x11=yes | 5373 _gl_x11=yes |
5368 libs_mplayer="$libs_mplayer $ld_tmp $ld_dl" | 5374 libs_mplayer="$libs_mplayer $ld_tmp $ld_dl" |
5369 break | 5375 break |
5370 fi | 5376 fi |
5371 done | 5377 done |
5378 if cc_check -DGL_EGL_ANDROID -lEGL -lui ; then | |
5379 _gl=yes | |
5380 _gl_egl_android=yes | |
5381 libs_mplayer="$libs_mplayer -lEGL -lui $ld_dl" | |
5382 fi | |
5372 if test "$_x11" = yes && cc_check -DGL_EGL_X11 -lEGL ; then | 5383 if test "$_x11" = yes && cc_check -DGL_EGL_X11 -lEGL ; then |
5373 _gl=yes | 5384 _gl=yes |
5374 _gl_egl_x11=yes | 5385 _gl_egl_x11=yes |
5375 libs_mplayer="$libs_mplayer -lEGL $ld_dl" | 5386 libs_mplayer="$libs_mplayer -lEGL $ld_dl" |
5376 fi | 5387 fi |
5408 fi | 5419 fi |
5409 if test "$_gl_x11" = yes ; then | 5420 if test "$_gl_x11" = yes ; then |
5410 def_gl_x11='#define CONFIG_GL_X11 1' | 5421 def_gl_x11='#define CONFIG_GL_X11 1' |
5411 res_comment="$res_comment x11" | 5422 res_comment="$res_comment x11" |
5412 fi | 5423 fi |
5424 if test "$_gl_egl_android" = yes ; then | |
5425 def_gl_egl_android='#define CONFIG_GL_EGL_ANDROID 1' | |
5426 res_comment="$res_comment egl_android" | |
5427 fi | |
5413 if test "$_gl_egl_x11" = yes ; then | 5428 if test "$_gl_egl_x11" = yes ; then |
5414 def_gl_egl_x11='#define CONFIG_GL_EGL_X11 1' | 5429 def_gl_egl_x11='#define CONFIG_GL_EGL_X11 1' |
5415 res_comment="$res_comment egl_x11" | 5430 res_comment="$res_comment egl_x11" |
5416 fi | 5431 fi |
5417 if test "$_gl_sdl" = yes ; then | 5432 if test "$_gl_sdl" = yes ; then |
5425 vomodules="opengl $vomodules" | 5440 vomodules="opengl $vomodules" |
5426 else | 5441 else |
5427 def_gl='#undef CONFIG_GL' | 5442 def_gl='#undef CONFIG_GL' |
5428 def_gl_win32='#undef CONFIG_GL_WIN32' | 5443 def_gl_win32='#undef CONFIG_GL_WIN32' |
5429 def_gl_x11='#undef CONFIG_GL_X11' | 5444 def_gl_x11='#undef CONFIG_GL_X11' |
5445 def_gl_egl_android='#undef CONFIG_GL_EGL_ANDROID' | |
5430 def_gl_egl_x11='#undef CONFIG_GL_EGL_X11' | 5446 def_gl_egl_x11='#undef CONFIG_GL_EGL_X11' |
5431 def_gl_sdl='#undef CONFIG_GL_SDL' | 5447 def_gl_sdl='#undef CONFIG_GL_SDL' |
5432 def_gl_osx='#undef CONFIG_GL_OSX' | 5448 def_gl_osx='#undef CONFIG_GL_OSX' |
5433 novomodules="opengl $novomodules" | 5449 novomodules="opengl $novomodules" |
5434 fi | 5450 fi |
8914 $def_gif_4 | 8930 $def_gif_4 |
8915 $def_gif_tvt_hack | 8931 $def_gif_tvt_hack |
8916 $def_gl | 8932 $def_gl |
8917 $def_gl_win32 | 8933 $def_gl_win32 |
8918 $def_gl_x11 | 8934 $def_gl_x11 |
8935 $def_gl_egl_android | |
8919 $def_gl_egl_x11 | 8936 $def_gl_egl_x11 |
8920 $def_gl_sdl | 8937 $def_gl_sdl |
8921 $def_gl_osx | 8938 $def_gl_osx |
8922 $def_matrixview | 8939 $def_matrixview |
8923 $def_ivtv | 8940 $def_ivtv |