core: remove the 360 video viewpoint zoom
[vlc.git] / modules / video_output / opengl.h
blob7d6f55cd133cce06fd883d7d0d7a7e8ce8b1e5f1
1 /*****************************************************************************
2 * opengl.h: OpenGL vout_display helpers
3 *****************************************************************************
4 * Copyright (C) 2004-2013 VLC authors and VideoLAN
5 * Copyright (C) 2009 Laurent Aimar
7 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8 * Rémi Denis-Courmont
9 * Jean-Baptiste Kempf <jb@videolan.org>
10 * Ilkka Ollakka <ileoo@videolan.org>
11 * Felix Paul Kühne <fkuehne at videolan dot org>
12 * Rafaël Carré <funman@videolanorg>
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU Lesser General Public License as published by
16 * the Free Software Foundation; either version 2.1 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public License
25 * along with this program; if not, write to the Free Software Foundation,
26 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
27 *****************************************************************************/
29 #ifndef VLC_OPENGL_H
30 #define VLC_OPENGL_H
32 #include <vlc_common.h>
33 #include <vlc_picture_pool.h>
34 #include <vlc_opengl.h>
36 /* Change USE_OPENGL_ES value to set the OpenGL ES version (1, 2) you want to use
37 * A value of 0 will activate normal OpenGL */
38 #ifdef __APPLE__
39 # include <TargetConditionals.h>
40 # if !TARGET_OS_IPHONE
41 # define USE_OPENGL_ES 0
42 # define MACOS_OPENGL
43 # include <OpenGL/gl.h>
44 # else /* Force ESv2 on iOS */
45 # define USE_OPENGL_ES 2
46 # include <OpenGLES/ES1/gl.h>
47 # include <OpenGLES/ES2/gl.h>
48 # include <OpenGLES/ES2/glext.h>
49 # endif
50 #else /* !defined (__APPLE__) */
51 # ifndef USE_OPENGL_ES
52 # define USE_OPENGL_ES 0
53 # endif
54 # if USE_OPENGL_ES == 2
55 # include <GLES2/gl2.h>
56 # elif USE_OPENGL_ES == 1
57 # include <GLES/gl.h>
58 # else
59 # ifdef _WIN32
60 # include <GL/glew.h>
61 # undef glClientActiveTexture
62 # undef glActiveTexture
63 PFNGLACTIVETEXTUREPROC glActiveTexture;
64 PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture;
65 # endif
66 # include <GL/gl.h>
67 # endif
68 #endif
70 static const vlc_fourcc_t gl_subpicture_chromas[] = {
71 VLC_CODEC_RGBA,
75 static inline bool HasExtension(const char *apis, const char *api)
77 size_t apilen = strlen(api);
78 while (apis) {
79 while (*apis == ' ')
80 apis++;
81 if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2))
82 return true;
83 apis = strchr(apis, ' ');
85 return false;
88 void orientationTransformMatrix(GLfloat matrix[static 16], video_orientation_t orientation);
90 typedef struct vout_display_opengl_t vout_display_opengl_t;
92 vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
93 const vlc_fourcc_t **subpicture_chromas,
94 vlc_gl_t *gl,
95 const vlc_viewpoint_t *viewpoint);
96 void vout_display_opengl_Delete(vout_display_opengl_t *vgl);
98 picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned);
100 int vout_display_opengl_SetViewpoint(vout_display_opengl_t *vgl, const vlc_viewpoint_t*);
102 void vout_display_opengl_SetWindowAspectRatio(vout_display_opengl_t *vgl,
103 float f_sar);
105 int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
106 picture_t *picture, subpicture_t *subpicture);
107 int vout_display_opengl_Display(vout_display_opengl_t *vgl,
108 const video_format_t *source);
110 #endif