[vlc-devel] [PATCH 3/3] EGL: add the OpenGL ES 2.0 support for android

Rémi Denis-Courmont remi at remlab.net
Thu Nov 7 08:54:45 CET 2013


On Wed,  6 Nov 2013 22:54:09 +0100, Adrien Maglo <magsoft at videolan.org>
wrote:
> ---
>  modules/video_output/Modules.am | 7 +++++++
>  modules/video_output/egl.c      | 9 +++++++++
>  modules/video_output/gl.c       | 4 ++--
>  modules/video_output/opengl.h   | 3 +++
>  4 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/video_output/Modules.am
> b/modules/video_output/Modules.am
> index 3393a11..eb84aa4 100644
> --- a/modules/video_output/Modules.am
> +++ b/modules/video_output/Modules.am
> @@ -182,12 +182,19 @@ endif
>  
>  ### Android ###
>  
> +libegl_android_plugin_la_SOURCES = egl.c
> +libegl_android_plugin_la_CFLAGS = $(AM_CFLAGS) $(EGL_CFLAGS)
> -DUSE_PLATFORM_ANDROID=1
> +libegl_android_plugin_la_LIBADD = $(EGL_LIBS)
> +
>  libandroid_native_window_plugin_la_SOURCES = androidnativewindow.c
>  libandroid_native_window_plugin_la_CFLAGS = $(AM_CFLAGS)
>  libandroid_native_window_plugin_la_LIBADD = -ldl
>  
>  if HAVE_ANDROID
>  vout_LTLIBRARIES += libandroid_native_window_plugin.la
> +if HAVE_EGL
> +vout_LTLIBRARIES += libegl_android_plugin.la
> +endif
>  endif
>  
>  ### Coloured ASCII art ###
> diff --git a/modules/video_output/egl.c b/modules/video_output/egl.c
> index 58cbece..4db3ee6 100644
> --- a/modules/video_output/egl.c
> +++ b/modules/video_output/egl.c
> @@ -209,6 +209,15 @@ static int Open (vlc_object_t *obj, const struct
> gl_api *api)
>      window.native = wnd->handle.hwnd;
>  # endif
>  
> +#elif defined (USE_PLATFORM_ANDROID)
> +    if (wnd->type != VOUT_WINDOW_TYPE_ANDROID_NATIVE_WINDOW)
> +        goto error;
> +
> +# if USE_DEFAULT_PLATFORM
> +    sys->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
> +    window.native = wnd->handle.anativewindow;
> +# endif
> +
>  #endif
>  
>      if (sys->display == EGL_NO_DISPLAY)
> diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
> index cf7c624..1fa5fd9 100644
> --- a/modules/video_output/gl.c
> +++ b/modules/video_output/gl.c
> @@ -112,8 +112,8 @@ static vout_window_t *MakeWindow (vout_display_t
*vd)
>  # error Wayland not supported.
>  #elif defined(__GBM__)
>  # error Glamor not supported.
> -#elif defined(ANDROID)
> -# error Android not supported.
> +#elif defined(__ANDROID__)
> +    wnd_cfg.type = VOUT_WINDOW_TYPE_ANDROID_NATIVE_WINDOW;
>  #elif defined(__unix__) /* X11 */
>      wnd_cfg.type = VOUT_WINDOW_TYPE_XID;
>  #else
> diff --git a/modules/video_output/opengl.h
b/modules/video_output/opengl.h
> index b01327e..06cd092 100644
> --- a/modules/video_output/opengl.h
> +++ b/modules/video_output/opengl.h
> @@ -48,6 +48,9 @@
>  #  include <OpenGLES/ES2/glext.h>
>  # endif
>  #else /* !defined (__APPLE__) */
> +# ifdef __ANDROID__
> +#  define USE_OPENGL_ES 2
> +# endif

This makes no sense; the Makefile already sets this.

>  # ifndef USE_OPENGL_ES
>  #  define USE_OPENGL_ES 0
>  # endif

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list