X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fopengl.h;h=a3f27f791c24782227ab71de961cbc5800287854;hb=cc8ed6374d126d968f1efbed23388cfc40bb3f22;hp=5d85d8c3a8e6d29637796916f61365ed78c47589;hpb=602d44823496e2c5bc2d3b4c89883ffe5377cd31;p=vlc diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h index 5d85d8c3a8..a3f27f791c 100644 --- a/modules/video_output/opengl.h +++ b/modules/video_output/opengl.h @@ -1,66 +1,92 @@ /***************************************************************************** * opengl.h: OpenGL vout_display helpers ***************************************************************************** - * Copyright (C) 2004 the VideoLAN team + * Copyright (C) 2004-2013 VLC authors and VideoLAN * Copyright (C) 2009 Laurent Aimar * - * Authors: Cyril Deguet - * Gildas Bazin - * Eric Petit - * Cedric Cocquebert - * Laurent Aimar + * Authors: Laurent Aimar + * Rémi Denis-Courmont + * Jean-Baptiste Kempf + * Ilkka Ollakka + * Felix Paul Kühne + * Rafaël Carré * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #include #include #include -// Define USE_OPENGL_ES to the GL ES Version you want to select -#ifndef USE_OPENGL_ES -# define USE_OPENGL_ES 0 -#endif - -#if !defined (__APPLE__) +/* Change USE_OPENGL_ES value to set the OpenGL ES version (1, 2) you want to use + * A value of 0 will activate normal OpenGL */ +#ifdef __APPLE__ +# include +# if !TARGET_OS_IPHONE +# define USE_OPENGL_ES 0 +# define MACOS_OPENGL +# include +# else /* Force ESv2 on iOS */ +# define USE_OPENGL_ES 2 +# include +# include +# include +# endif +#else /* !defined (__APPLE__) */ +# ifndef USE_OPENGL_ES +# define USE_OPENGL_ES 0 +# endif # if USE_OPENGL_ES == 2 # include # elif USE_OPENGL_ES == 1 # include # else +# ifdef WIN32 +# include +# undef glClientActiveTexture +# undef glActiveTexture + PFNGLACTIVETEXTUREPROC glActiveTexture; + PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture; +# endif # include # endif -#else -# if USE_OPENGL_ES == 2 -# include -# elif USE_OPENGL_ES == 1 -# include -# else -# define MACOS_OPENGL -# include -# endif #endif +static inline bool HasExtension(const char *apis, const char *api) +{ + size_t apilen = strlen(api); + while (apis) { + while (*apis == ' ') + apis++; + if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2)) + return true; + apis = strchr(apis, ' '); + } + return false; +} + typedef struct vout_display_opengl_t vout_display_opengl_t; -vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, vlc_gl_t *gl); +vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, + const vlc_fourcc_t **subpicture_chromas, + vlc_gl_t *gl); void vout_display_opengl_Delete(vout_display_opengl_t *vgl); -picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl); +picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned); int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, - picture_t *picture); + picture_t *picture, subpicture_t *subpicture); int vout_display_opengl_Display(vout_display_opengl_t *vgl, const video_format_t *source);