2 Copyright 2004-2005 Chris Tallon, 2006,2011-2012 Marten Richter
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
26 #include <bcm_host.h>
\r
28 #include <GLES2/gl2.h>
\r
29 #include <EGL/egl.h>
\r
30 #include <EGL/eglext.h>
\r
33 #include "defines.h"
\r
35 #include "threadp.h"
\r
37 #include "videovpeogl.h"
\r
39 #include "glosdshader.h"
\r
40 #include "glyuv400shader.h"
\r
41 #include "glyuv444shader.h"
\r
70 class OsdOpenGL : public Osd, public Thread_TYPE
\r
74 virtual ~OsdOpenGL();
\r
76 int init(void* device);
\r
81 void screenShot(const char* fileName);
\r
83 Surface * createNewSurface();
\r
88 // This function is called from the threadMethod function in order to get Screen updates
\r
90 void RenderDS(VPEOGLFrame* frame);*/
\r
91 void BeginPainting();
\r
94 void setExternalDriving(/*DsAllocator* dsall,*/ unsigned int width, unsigned int height);
\r
97 void getEGLObjs(EGLDisplay *i_egl_display,EGLSurface *i_egl_surface,EGLContext *i_egl_context, EGLConfig *i_egl_config){
\r
98 *i_egl_display=egl_display;
\r
99 *i_egl_surface=egl_surface;
\r
100 *i_egl_context=egl_context;
\r
101 *i_egl_config=egl_ourconfig;
\r
104 EGLConfig getEGLConfig() {return egl_ourconfig;};
\r
106 void AdviseAboutNewFrame() {threadSignal();};
\r
112 //Maybe move the following stuff to a generic opengl object also for boosting DCT etc.
\r
116 void threadMethod();
\r
117 void threadPostStopCleanup();
\r
119 // This indicates, that currently a video is played, thus the osd updates are driven by the Videosystem
\r
120 bool external_driving;
\r
122 long long lastrendertime;
\r
123 void InternalRendering(VPEOGLFrame* frame);
\r
125 void InitVertexBuffer(float scalex,float scaley);
\r
126 OSDVERTEX osdvertices[4];
\r
127 GLubyte osdindices[6];
\r
130 /* GLuint osd_shader;
\r
133 GLuint osd_program;
\r
135 GLuint frame_shader;
\r
136 GLuint frame_program;
\r
138 GLint frame_sampler_locY;
\r
139 GLint frame_sampler_locU;
\r
140 GLint frame_sampler_locV;
\r
142 GLint osd_sampler_loc;*/
\r
143 GLOsdShader osd_shader;
\r
144 GLYuv400Shader yuv400_shader;
\r
145 GLYuv444Shader yuv444_shader;
\r
152 uint32_t display_height;
\r
153 uint32_t display_width;
\r
155 EGLDisplay egl_display;
\r
156 EGLSurface egl_surface;
\r
157 EGLContext egl_context;
\r
158 EGLConfig egl_ourconfig;
\r
159 #ifdef BENCHMARK_FPS
\r
160 long long last_benchmark_time;
\r
161 unsigned int num_benchmark_frames;
\r