Enigma2

Aus DreamboxWIKI

Wechseln zu: Navigation, Suche


Inhaltsverzeichnis

Enigma2

enigma2 is a framebuffer-based zapping application (GUI) for linux. It's targeted to real set-top-boxes, like the DM7025, but would also work on regular PCs. Enigma2 is based on the Python programming language with a backend written in C++. It uses the [LinuxTV DVB API], which is part of a standard linux kernel.

Enigma2 can also be controlled via an Enigma2:WebInterface.

Current State

Enigma2 is in production usage on the DM7025 and DM800 and will be used on the DM8000. Ports exist for the DM7020 and probably other dreambox models. Enigma2 can also work with SDL, though some additional work is required to make it really usable on a PC.

Download

You can get the newest version by using CVS:

cvs -d :pserver:anonymous@dreamboxupdate.com:/cvs co enigma2

Also there is a CVS web view at http://dreamboxupdate.com/cgi-bin/viewcvs.cgi/enigma2/.

Write Access

As enigma2 is used on a commercial platform, write access is not available for everyone. Instead, patches must be sent to the enigma2-devel mailing list (see below), and you must acknowledge the special License. This does obviously not apply to plugins, which can be licesed with any (even closed source) license, and should be put into the CVS on http://schwerkraft.elitedvb.net/ which provides a home for your projects. You can either join the enigma2-plugins project (if you want other people to have write access to your plugin), or as a seperate project (where you can control everything on your own). Of course you are also free to host plugins wherever you want.

License

Enigma2 has a dual license, with the option for the user to fork a GPL2-licensed version. Details can be found here.

Build Instructions

  • Download the sourcecode by using CVS
  • You'll need the following libraries and tools (Debian 4.0r1):
 su -c "apt-get install build-essential python-all-dev automake autogen libfreetype6-dev libfribidi-dev libid3tag0-dev libmad0-dev libpng12-dev libsigc++-1.2-dev libdvbpsi4-dev libxml2-dev libsdl1.2-dev"
  • You have to manually download the libxmlccwrap Debian package and install it on your system:

cd /tmp

wget http://www.ant.uni-bremen.de/whomes/rinas/debs/libxmlccwrap_0.0.12-1_i386.deb

wget http://www.ant.uni-bremen.de/whomes/rinas/debs/libxmlccwrap-dev_0.0.12-1_i386.deb

su -c "cd /tmp; dpkg -i libxmlccwrap_0.0.12-1_i386.deb"

su -c "cd /tmp; dpkg -i libxmlccwrap-dev_0.0.12-1_i386.deb"


  • You have to manually download libdvbsi++, compile and install it on your system:

cd /tmp

wget http://www.saftware.de/libdvbsi++/libdvbsi++-0.3.2.tar.bz2

tar xvjf libdvbsi++-0.3.2.tar.bz2

cd libdvbsi++-0.3.2

./configure

make

su -c "cd /tmp/libdvbsi++-0.3.2; make install"


Afterwards, you can run ./configure; make in your enigma2 directory. configure works, but make fails for me(gcc-4.1.2 on x86): action.cpp: In member function 'virtual void eActionMap::AddRef()':

action.cpp:23: error: expected `)' before ';' token

action.cpp: In member function 'virtual void eActionMap::Release()':

action.cpp:23: error: expected `)' before ';' token

make[2]: *** [action.o] Error 1

To solve this (Eddi):

--- lib/base/object.h.orig       2008-01-06 00:21:12.000000000 +0100
+++ lib/base/object.h    2008-01-05 23:41:11.000000000 +0100
@@ -5,7 +5,7 @@
 #include <lib/base/smartptr.h>
 #include <lib/base/elock.h>
 
-//#define OBJECT_DEBUG
+#define OBJECT_DEBUG
 
 #include <lib/base/eerror.h>
 
--- lib/base/ioprio.cpp.orig 2008-01-06 00:19:51.000000000 +0100
+++ lib/base/ioprio.cpp  2008-01-06 00:15:48.000000000 +0100
@@ -31,8 +31,25 @@
 #error "Unsupported arch"
 #endif
 
-_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
-_syscall2(int, ioprio_get, int, which, int, who);
+//_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
+//_syscall2(int, ioprio_get, int, which, int, who);
+static inline int ioprio_set(int which, int who, int ioprio)
+{
+#ifdef __NR_ioprio_set
+        return syscall(__NR_ioprio_set, which, who, ioprio);
+#else
+        return ENOSYS;
+#endif
+}
+
+static inline int ioprio_get(int which, int who)
+{
+#ifdef __NR_ioprio_get
+        return syscall(__NR_ioprio_get, which, who);
+#else
+        return ENOSYS;
+#endif
+}
 
 #define IOPRIO_CLASS_SHIFT     13
 

Since i using freetype 2.1.6 now I get: ../../lib/gdi/font.h:45: error: ‘FTC_Image_Cache’ does not name a type ../../lib/gdi/font.h:46: error: ‘FTC_SBit_Cache’ does not name a type ../../lib/gdi/font.h:49: error: ‘FTC_Image_Desc’ has not been declared ../../lib/gdi/font.h:183: error: ‘FTC_Image_Desc’ does not name a type make: *** [grc.o] Error 1

Next patch based on http://tuxbox-upload.wittnet.de/files/Diffs/freetype-api.diff may solve...

--- font.h.orig 2008-01-06 01:02:48.000000000 +0100
+++ font.h      2008-01-06 01:27:33.000000000 +0100
@@ -42,11 +42,11 @@
 
        FT_Library library;
        FTC_Manager                     cacheManager;                           /* the cache manager                                                     */
-       FTC_Image_Cache imageCache;                                     /* the glyph image cache                                         */
-       FTC_SBit_Cache   sbitsCache;                            /* the glyph small bitmaps cache         */
+       FTC_ImageCache  imageCache;                                     /* the glyph image cache                                         */
+       FTC_SBitCache    sbitsCache;                            /* the glyph small bitmaps cache         */
 
        FTC_FaceID getFaceID(const std::string &face);
-       FT_Error getGlyphBitmap(FTC_Image_Desc *font, FT_ULong glyph_index, FTC_SBit *sbit);
+       FT_Error getGlyphBitmap(FTC_ImageType font, FT_ULong glyph_index, FTC_SBit *sbit);
        static fontRenderClass *instance;
 #else
        fontRenderClass();
@@ -180,7 +180,7 @@
 {
 DECLARE_REF(Font);
 public:
-       FTC_Image_Desc font;
+       FTC_ImageTypeRec font;
        fontRenderClass *renderer;
        FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit);
        FT_Face face;
--- font.cpp.orig       2008-01-06 01:01:04.000000000 +0100
+++ font.cpp    2008-01-06 01:31:02.000000000 +0100
@@ -32,7 +32,7 @@
 static pthread_mutex_t ftlock=PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
 static pthread_mutex_t refcntlck=PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
 
-static FTC_Font cache_current_font=0;
+static FTC_ImageType cache_current_font=0;
 
 struct fntColorCacheKey
 {
@@ -111,9 +111,9 @@
        return 0;
 }
 
-FT_Error fontRenderClass::getGlyphBitmap(FTC_Image_Desc *font, FT_ULong glyph_index, FTC_SBit *sbit)
+FT_Error fontRenderClass::getGlyphBitmap(FTC_ImageType font, FT_ULong glyph_index, FTC_SBit *sbit)
 {
-       FT_Error res=FTC_SBit_Cache_Lookup(sbitsCache, font, glyph_index, sbit);
+       FT_Error res=FTC_SBitCache_Lookup(sbitsCache, font, glyph_index, sbit, NULL);
        return res;
 }
 
@@ -175,12 +175,12 @@
                        eDebug("[FONT] initializing font cache manager error.");
                        return;
                }
-               if (FTC_SBit_Cache_New(cacheManager, &sbitsCache))
+               if (FTC_SBitCache_New(cacheManager, &sbitsCache))
                {
                        eDebug("[FONT] initializing font cache sbit failed!");
                        return;
                }
-               if (FTC_Image_Cache_New(cacheManager, &imageCache))
+               if (FTC_ImageCache_New(cacheManager, &imageCache))
                {
                        eDebug("[FONT] initializing font cache imagecache failed!");
                }
@@ -190,6 +190,7 @@
 
 float fontRenderClass::getLineHeight(const gFont& font)
 {
+       FTC_ScalerRec scaler;
        if (!instance)
                return 0;
        ePtr<Font> fnt;
@@ -197,15 +198,19 @@
        if (!fnt)
                return 0;
        singleLock s(ftlock);
-       FT_Face current_face;
-       if (FTC_Manager_Lookup_Size(cacheManager, &fnt->font.font, &current_face, &fnt->size)<0)
+       scaler.face_id = fnt->font.face_id;
+       scaler.width   = fnt->font.width;
+       scaler.height  = fnt->font.height;
+       scaler.pixel   = true;
+
+       if (FTC_Manager_LookupSize(cacheManager, &scaler, &fnt->size)<0)
        {
                delete fnt;
                eDebug("FTC_Manager_Lookup_Size failed!");
                return 0;
        }
-       int linegap=current_face->size->metrics.height-(current_face->size->metrics.ascender+current_face->size->metrics.descender);
-       float height=(current_face->size->metrics.ascender+current_face->size->metrics.descender+linegap)/64.0;
+       int linegap=fnt->size->metrics.height-(fnt->size->metrics.ascender+fnt->size->metrics.descender);                                                    
+       float height=(fnt->size->metrics.ascender+fnt->size->metrics.descender+linegap/2.0)/64;                   
        return height;
 }
 
@@ -247,10 +252,10 @@
 Font::Font(fontRenderClass *render, FTC_FaceID faceid, int isize, int tw): tabwidth(tw)
 {
        renderer=render;
-       font.font.face_id=faceid;
-       font.font.pix_width     = isize;
-       font.font.pix_height = isize;
-       font.image_type = ftc_image_grays;
+       font.face_id=faceid;                                                                                                                                 
+       font.width      = isize;                                                                                                                             
+       font.height = isize;                                                                                                                                 
+       font.flags = FT_LOAD_DEFAULT; 
        height=isize;
        if (tabwidth==-1)
                tabwidth=8*isize;
@@ -429,6 +434,7 @@
 
 void eTextPara::setFont(Font *fnt, Font *replacement)
 {
+       FTC_ScalerRec scaler;
        if (!fnt)
                return;
        current_font=fnt;
@@ -438,9 +444,13 @@
                        // we ask for replacment_font first becauseof the cache
        if (replacement_font)
        {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, 
-                               &replacement_font->font.font, &replacement_face, 
-                               &replacement_font->size)<0)
+               scaler.face_id = replacement_font->font.face_id;
+               scaler.width   = replacement_font->font.width;
+               scaler.height  = replacement_font->font.height;
+               scaler.pixel   = true;
+
+               if (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager,
+                               &scaler, &replacement_font->size)<0)
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return;
@@ -448,15 +458,20 @@
        }
        if (current_font)
        {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
+               scaler.face_id = current_font->font.face_id;                                                                                                 
+               scaler.width   = current_font->font.width;                                                                                                   
+               scaler.height  = current_font->font.height;                                                                                                  
+               scaler.pixel   = true;                                                                                                 
+
+               if (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager, &scaler, &current_font->size)<0) 
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return;
                }
        }
-       cache_current_font=&current_font->font.font;
+       cache_current_font=&current_font->font;
        previous=0;
-       use_kerning=FT_HAS_KERNING(current_face);
+       use_kerning=FT_HAS_KERNING(current_font->size->face);
 }
 
 void
@@ -464,6 +479,7 @@
 
 int eTextPara::renderString(const char *string, int rflags)
 {
+       FTC_ScalerRec scaler;
        singleLock s(ftlock);
 
        if (!current_font)
@@ -475,14 +491,19 @@
                left=cursor.x();
        }
 
-       if (&current_font->font.font != cache_current_font)
+       if (&current_font->font != cache_current_font)
        {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
+               scaler.face_id = current_font->font.face_id;                                                                                                 
+               scaler.width   = current_font->font.width;                                                                                                   
+               scaler.height  = current_font->font.height;                                                                                                  
+               scaler.pixel   = true;                                                                                                                       
+
+               if (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager, &scaler, &current_font->size)<0) 
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return -1;
                }
-               cache_current_font=&current_font->font.font;
+               cache_current_font=&current_font->font;
        }
 
        std::vector<unsigned long> uc_string, uc_visual;
@@ -651,19 +672,25 @@
 
 void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, const gRGB &foreground)
 {
+       FTC_ScalerRec scaler;
        singleLock s(ftlock);
 
        if (!current_font)
                return;
 
-       if (&current_font->font.font != cache_current_font)
+       if (&current_font->font != cache_current_font)
        {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
+               scaler.face_id = current_font->font.face_id;
+               scaler.width   = current_font->font.width;
+               scaler.height  = current_font->font.height;
+               scaler.pixel   = true;
+
+               if (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager, &scaler, &current_font->size)<0)
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return;
                }
-               cache_current_font=&current_font->font.font;
+               cache_current_font=&current_font->font;
        }
 
        ePtr<gPixmap> target;

download http://cvs.tuxbox.org/cgi-bin/viewcvs.cgi/*checkout*/tuxbox/driver/include/dbox/lcd-ks0713.h?rev=1.11 and http://cvs.tuxbox.org/cgi-bin/viewcvs.cgi/*checkout*/tuxbox/driver/include/dbox/fp.h?rev=1.21 and put them in enigma2/dbox/

--- picload.cpp.orig    2008-01-06 01:46:42.000000000 +0100
+++ picload.cpp 2008-01-06 01:46:50.000000000 +0100
@@ -1,9 +1,9 @@
+#include <png.h>
+
 #include <lib/gdi/picload.h>
 #include "picexif.h"
 #include <lib/python/python.h>
 
-#include <png.h>
-
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdio.h>

Now passes various error but it fail at: event.cpp: In member function ‘RESULT eServiceEvent::getComponentData(ePtr<eComponentData>&, int) const’: event.cpp:235: error: no matching function for call to ‘eComponentData::eComponentData(const eComponentData&)’ [...]

--- event.h.orig        2008-01-06 14:50:47.000000000 +0100
+++ event.h     2008-01-06 14:49:53.000000000 +0100
@@ -58,7 +58,8 @@
        std::string getShortDescription() const { return m_short_description; }
        std::string getExtendedDescription() const { return m_extended_description; }
        std::string getBeginTimeString() const;
-       SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
+//     SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
+       SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &dest, int tagnum) const;
        int getNumOfLinkageServices() const { return m_linkage_services.size(); }
        SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
 };

I hope to add news...

I guess I'll need the complete tuxbox sourcetree to compile it?

How to Help

TODO

Screenshots

See [1].

Weblinks

enigma2 changelog
enigma2 CVS commit mailing list - if you want to track enigma2 development.
enigma2 developer mailing list - please ask your development related questions here.
[2] - externally developed plugins can be hosted here.



Persönliche Werkzeuge