35 #ifndef __NV_EGL_RENDERER_H__
36 #define __NV_EGL_RENDERER_H__
41 #include <EGL/eglext.h>
42 #include <GLES2/gl2.h>
43 #include <GLES2/gl2ext.h>
99 uint32_t height, uint32_t x_offset,
161 EGLDisplay egl_display;
162 EGLContext egl_context;
163 EGLSurface egl_surface;
164 EGLConfig egl_config;
169 XFontStruct *fontinfo;
170 char overlay_str[512];
177 int create_texture();
184 int InitializeShaders();
194 void CreateShader(GLuint program, GLenum type,
const char *source,
197 struct timespec last_render_time;
203 pthread_t render_thread;
204 pthread_mutex_t render_lock;
205 pthread_cond_t render_cond;
206 uint32_t overlay_str_x_offset;
207 uint32_t overlay_str_y_offset;
209 uint64_t render_time_sec;
211 uint64_t render_time_nsec;
217 NvEglRenderer(
const char *name, uint32_t width, uint32_t height,
218 uint32_t x_offset, uint32_t y_offset);
222 static int initEgl();
230 static void * renderThread(
void *arg);
235 int renderInternal();
240 static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
241 static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
242 static PFNEGLCREATESYNCKHRPROC eglCreateSyncKHR;
243 static PFNEGLDESTROYSYNCKHRPROC eglDestroySyncKHR;
244 static PFNEGLCLIENTWAITSYNCKHRPROC eglClientWaitSyncKHR;
245 static PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
246 static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;