2 Copyright 2004-2005 Chris Tallon, 2006,2011-2012 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <EGL/eglext.h>
29 #include <VG/openvg.h>
34 #include "osdvector.h"
44 #include FT_FREETYPE_H
49 OVGcreateImagePalette,
63 unsigned int param1,param2,param3;
64 unsigned int id; //only set an id if you are waiting
67 struct OpenVGResponse{
73 class OsdOpenVG : public OsdVector, public Thread_TYPE
79 int init(void* device);
86 float getFontHeight();
87 float getCharWidth(wchar_t c);
88 void imageUploadLine(ImageIndex index,unsigned int j,unsigned int width,void *data);
90 int getFontNames(const char *** names,const char *** names_keys);
92 virtual void setFont(const char * fontname);
94 virtual float getPixelAspect() {return aspect_correction;};
100 /*osd vector implementation*/
101 void destroyImageRef(ImageIndex index);
102 ImageIndex createJpeg(const char* fileName, int *width,int *height);
103 ImageIndex createMonoBitmap(void *base,int width,int height);
104 ImageIndex createImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data);
105 void createPicture(struct PictureInfo& pict_inf);
106 void destroyStyleRef(unsigned int index);
107 unsigned int createStyleRef(const DrawStyle &c);
108 unsigned int createColorRef(const Colour &c);
110 void drawSetTrans(SurfaceCommands & sc);
111 void executeDrawCommand(SVGCommand & command);
115 VGPath std_paths[Point+1];
116 long long lastrendertime;
117 void InternalRendering();
118 void getScreenSize(int &width, int &height);
124 pthread_cond_t vgtaskCond;
125 pthread_mutex_t vgtaskCondMutex;
126 deque<OpenVGCommand> vgcommands;
127 deque<OpenVGResponse> vgresponses;
129 bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
130 unsigned int putOpenVGCommand(OpenVGCommand& comm,bool wait);
131 unsigned int handleTask(OpenVGCommand& command);
132 void purgeAllReferences();
133 unsigned int wait_id;
135 FT_Library ft_library;
140 int loadFont(bool fontchange);
141 map<unsigned int,float> font_exp_x;
142 vector<char*> fontnames;
143 vector<char*> fontnames_keys;
149 unsigned int loadTTchar(cTeletextChar c);
150 map<unsigned int,int> tt_font_chars;
155 void threadPostStopCleanup();
160 uint32_t display_height;
161 uint32_t display_width;
162 DISPMANX_DISPLAY_HANDLE_T bcm_display;
163 DISPMANX_ELEMENT_HANDLE_T bcm_element;
164 // DISPMANX_ELEMENT_HANDLE_T bcm_background;
165 // DISPMANX_RESOURCE_HANDLE_T bcm_backres;
170 EGLDisplay egl_display;
171 EGLSurface egl_surface;
172 EGLContext egl_context;
173 EGLConfig egl_ourconfig;
175 float aspect_correction;
176 bool freetype_inited;