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,
154 EGLDisplay egl_display;
155 EGLContext egl_context;
156 EGLSurface egl_surface;
157 EGLConfig egl_config;
162 XFontStruct *fontinfo;
163 char overlay_str[512];
170 int create_texture();
177 int InitializeShaders();
187 void CreateShader(GLuint program, GLenum type,
const char *source,
190 struct timespec last_render_time;
196 pthread_t render_thread;
197 pthread_mutex_t render_lock;
198 pthread_cond_t render_cond;
199 uint32_t overlay_str_x_offset;
200 uint32_t overlay_str_y_offset;
202 uint64_t render_time_sec;
204 uint64_t render_time_nsec;
210 NvEglRenderer(
const char *name, uint32_t width, uint32_t height,
211 uint32_t x_offset, uint32_t y_offset);
215 static int initEgl();
223 static void * renderThread(
void *arg);
228 int renderInternal();
233 static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
234 static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
235 static PFNEGLCREATESYNCKHRPROC eglCreateSyncKHR;
236 static PFNEGLDESTROYSYNCKHRPROC eglDestroySyncKHR;
237 static PFNEGLCLIENTWAITSYNCKHRPROC eglClientWaitSyncKHR;
238 static PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
239 static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
241 static const NvElementProfiler::ProfilerField valid_fields =
242 NvElementProfiler::PROFILER_FIELD_TOTAL_UNITS |
243 NvElementProfiler::PROFILER_FIELD_FPS |
244 NvElementProfiler::PROFILER_FIELD_LATE_UNITS;
int setOverlayText(char *str, uint32_t x, uint32_t y)
Sets the overlay string.
NVIDIA Multimedia API: NvElement Base Class
Every element has a unique name that can be used for identifying the element in debug logs...
static int getDisplayResolution(uint32_t &width, uint32_t &height)
Gets the display resolution.
static NvEglRenderer * createEglRenderer(const char *name, uint32_t width, uint32_t height, uint32_t x_offset, uint32_t y_offset)
Creates a new EGL-based renderer named name.
int setFPS(float fps)
Sets the rendering rate in frames per second (fps).
NvEglRenderer is a helper class for rendering using EGL and OpenGL ES 2.0.
int render(int fd)
Renders a buffer.