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
27 #include <EGL/egl.h>
\r
28 #include <EGL/eglext.h>
\r
29 #include <VG/openvg.h>
\r
34 #include "osdvector.h"
\r
35 #include "defines.h"
\r
37 #include "threadp.h"
\r
39 #include "videoomx.h"
\r
43 #include <ft2build.h>
\r
44 #include FT_FREETYPE_H
\r
50 OVGcreateMonoBitmap,
\r
56 struct OpenVGCommand
\r
58 enum OpenVGTask task;
\r
60 unsigned int param1,param2,param3;
\r
61 unsigned int id; //only set an id if you are waiting
\r
64 struct OpenVGResponse{
\r
66 unsigned int result;
\r
70 class OsdOpenVG : public OsdVector, public Thread_TYPE
\r
74 virtual ~OsdOpenVG();
\r
76 int init(void* device);
\r
80 float getFontHeight();
\r
81 float getCharWidth(wchar_t c);
\r
82 void imageUploadLine(ImageIndex index,unsigned int j,unsigned int width,void *data);
\r
86 /*osd vector implementation*/
\r
87 void destroyImageRef(ImageIndex index);
\r
88 ImageIndex createJpeg(const char* fileName, int *width,int *height);
\r
89 ImageIndex createMonoBitmap(void *base,int width,int height);
\r
90 ImageIndex createImageRGBA(int width,int height);
\r
91 void destroyStyleRef(unsigned int index);
\r
92 unsigned int createStyleRef(const DrawStyle &c);
\r
93 unsigned int createColorRef(const Colour &c);
\r
95 void drawSetTrans(SurfaceCommands & sc);
\r
96 void executeDrawCommand(SVGCommand & command);
\r
99 void destroyPaths();
\r
100 VGPath std_paths[Point+1];
\r
101 long long lastrendertime;
\r
102 void InternalRendering();
\r
108 pthread_cond_t vgtaskCond;
\r
109 pthread_mutex_t vgtaskCondMutex;
\r
110 deque<OpenVGCommand> vgcommands;
\r
111 deque<OpenVGResponse> vgresponses;
\r
112 bool processTasks();
\r
113 bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
\r
114 unsigned int putOpenVGCommand(OpenVGCommand& comm,bool wait);
\r
115 unsigned int handleTask(OpenVGCommand& command);
\r
116 unsigned int wait_id;
\r
118 FT_Library ft_library;
\r
124 map<unsigned int,float> font_exp_x;
\r
126 unsigned int loadTTchar(cTeletextChar c);
\r
127 map<unsigned int,int> tt_font_chars;
\r
131 void threadMethod();
\r
132 void threadPostStopCleanup();
\r
137 uint32_t display_height;
\r
138 uint32_t display_width;
\r
139 DISPMANX_DISPLAY_HANDLE_T bcm_display;
\r
140 DISPMANX_ELEMENT_HANDLE_T bcm_element;
\r
141 DISPMANX_ELEMENT_HANDLE_T bcm_background;
\r
142 DISPMANX_RESOURCE_HANDLE_T bcm_backres;
\r
147 EGLDisplay egl_display;
\r
148 EGLSurface egl_surface;
\r
149 EGLContext egl_context;
\r
150 EGLConfig egl_ourconfig;
\r
152 float aspect_correction;
\r