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"
41 #include "staticartwork.h"
42 #ifdef PICTURE_DECODER_OMX
49 #include FT_FREETYPE_H
54 OVGcreateImagePalette,
70 unsigned int param1,param2,param3;
71 unsigned int id; //only set an id if you are waiting
74 struct OpenVGResponse{
80 class OsdOpenVG : public OsdVector, public Thread_TYPE
81 #ifdef PICTURE_DECODER_OMX
82 , public EGLPictureCreator
89 int init(void* device);
93 bool screenShot(void *buffer, int width, int height, bool osd /*include osd*/);
97 float getFontHeight();
98 float getCharWidth(wchar_t c);
100 int getFontNames(const char *** names,const char *** names_keys);
102 virtual void setFont(const char * fontname);
104 virtual float getPixelAspect() {return aspect_correction;};
106 bool getEGLPicture(struct OsdVector::PictureInfo & info, EGLDisplay * display);
108 void updateBackgroundColor(DrawStyle bg);
114 /*osd vector implementation*/
115 void destroyImageRef(ImageIndex index);
116 // ImageIndex createJpeg(const char* fileName, int *width,int *height);
117 ImageIndex createMonoBitmap(void *base,int width,int height);
118 ImageIndex createImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data);
119 void createPicture(struct PictureInfo& pict_inf);
120 void destroyStyleRef(VectorHandle index);
121 VectorHandle createStyleRef(const DrawStyle &c);
122 bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
124 void drawSetTrans(SurfaceCommands & sc);
125 void executeDrawCommand(SVGCommand & command);
129 VGPath std_paths[PIPoint+1];
130 long long lastrendertime;
131 void InternalRendering();
132 void getScreenSize(int &width, int &height);
133 void getRealScreenSize(int &width, int &height);
140 deque<OpenVGCommand> vgcommands;
141 deque<OpenVGResponse> vgresponses;
143 bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
144 unsigned int putOpenVGCommand(OpenVGCommand& comm,bool wait);
145 unsigned int handleTask(OpenVGCommand& command);
146 //void purgeAllReferences();
147 unsigned int wait_id;
149 FT_Library ft_library;
154 int loadFont(bool fontchange);
155 map<unsigned int,float> font_exp_x;
156 vector<char*> fontnames;
157 vector<char*> fontnames_keys;
163 unsigned int loadTTchar(cTeletextChar c);
164 map<unsigned int,int> tt_font_chars;
169 void threadPostStopCleanup();
174 uint32_t display_height;
175 uint32_t display_width;
176 DISPMANX_DISPLAY_HANDLE_T bcm_display;
177 DISPMANX_ELEMENT_HANDLE_T bcm_element;
178 DISPMANX_ELEMENT_HANDLE_T bcm_background;
179 DISPMANX_RESOURCE_HANDLE_T bcm_backres;
184 EGLDisplay egl_display;
185 EGLSurface egl_surface;
186 EGLContext egl_context;
187 EGLConfig egl_ourconfig;
189 float aspect_correction;
190 bool freetype_inited;
192 uint8_t *static_artwork_begin[sa_MAX];
193 uint8_t *static_artwork_end[sa_MAX];
195 #ifdef PICTURE_DECODER_OMX