ACLOCAL_AMFLAGS = -I m4
installdir = $(pkglibdir)/python
-
install_PYTHON = \
Navigation.py NavigationInstance.py RecordTimer.py SleepTimer.py ServiceReference.py \
- keyids.py keymapparser.py mytest.py skin.py timer.py tools.py GlobalActions.py \
+ keyids.py keymapparser.py mytest.py skin.py timer.py GlobalActions.py \
e2reactor.py
- install-exec-hook:
- $(PYTHON) $(srcdir)/tools/genmetaindex.py $(DESTDIR)$(datadir)/meta/plugin_*.xml > $(DESTDIR)$(datadir)/meta/index-enigma2.xml
+ metadir = $(datadir)/meta
+ meta_DATA = index-enigma2.xml
+ CLEANFILES = index-enigma2.xml
+
+ EXTRA_DIST = lamedb
- uninstall-hook:
- $(RM) $(DESTDIR)$(datadir)/meta/index-enigma2.xml
+ index-enigma2.xml: $(top_srcdir)/tools/genmetaindex.py $(top_srcdir)/lib/python/Plugins/*/*/meta/plugin_*.xml
+ $(AM_V_GEN)$(PYTHON) $^ > $@
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
- TUXBOX_APPS_DIRECTORY
- TUXBOX_APPS_PKGCONFIG
-
AC_PROG_CC
AC_PROG_CXX
- LT_INIT
+ m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
AC_CONFIG_MACRO_DIR([m4])
+ AC_CHECK_HEADERS([dbox/fp.h dbox/lcd-ks0713.h])
+
+ AC_PATH_PROG(MSGFMT,[msgfmt])
+ AC_PATH_PROG(MSGINIT,[msginit])
+ AC_PATH_PROG(MSGMERGE,[msgmerge])
+ AC_PATH_PROG(MSGUNIQ,[msguniq])
+ AC_PATH_PROG(XGETTEXT,[xgettext])
+ if test -z "$MSGFMT" -o -z "$MSGINIT" -o -z "$MSGMERGE" -o -z "$MSGUNIQ" -o -z "$XGETTEXT"; then
+ AC_MSG_ERROR([Could not find required gettext tools])
+ fi
+
+ AM_PATH_PYTHON
+ AX_PYTHON_DEVEL
+ AX_PKG_SWIG
+ AX_SWIG_ENABLE_CXX
+ AX_SWIG_PYTHON
+ AX_PTHREAD
+
+ TUXBOX_APPS_DVB
+
+ AM_CONDITIONAL(HAVE_GIT_DIR, test -d "$srcdir/.git")
+ AM_CONDITIONAL(HAVE_FAKE_GIT_DIR, test -f "$srcdir/.git/last_commit_info")
+
+ PKG_CHECK_MODULES(BASE, [freetype2 fribidi gstreamer-0.10 gstreamer-pbutils-0.10 libdvbsi++ libpng libxml-2.0 sigc++-1.2])
+ PKG_CHECK_MODULES(LIBDDVD, libdreamdvd, HAVE_LIBDDVD="yes", HAVE_LIBDDVD="no")
+ AM_CONDITIONAL(HAVE_LIBDDVD, test "$HAVE_LIBDDVD" = "yes")
+
+ AC_CHECK_LIB([dl], [dlopen], [LIBDL_LIBS="-ldl"], [AC_MSG_ERROR([Could not find libdl])])
+ AC_SUBST(LIBDL_LIBS)
+ AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [LIBJPEG_LIBS="-ljpeg"], [AC_MSG_ERROR([Could not find libjpeg])])
+ AC_SUBST(LIBJPEG_LIBS)
+ AC_CHECK_LIB([ungif], [DGifOpen], [LIBGIF_LIBS="-lungif"], [AC_CHECK_LIB([gif], [DGifOpen], [LIBGIF_LIBS="-lgif"], [AC_MSG_ERROR([Could not find libgif or libungif])])])
+ AC_SUBST(LIBGIF_LIBS)
+
+ AC_LANG_PUSH([C++])
+ AC_CHECK_LIB([xmlccwrap], [exit], [LIBXMLCCWRAP_LIBS="-lxmlccwrap"], [AC_MSG_ERROR([Could not find libxmlccwrap])])
+ AC_SUBST(LIBXMLCCWRAP_LIBS)
+ AC_LANG_POP
+
+AC_ARG_WITH(boxtype,
+ [ --with-boxtype=NAME box type [[none,dm7025,dm800...]]],
+ [BOXTYPE="$withval"],[BOXTYPE="dm800"])
-
+AC_SUBST(BOXTYPE)
+AC_DEFINE_UNQUOTED(BOXTYPE,"$BOXTYPE",[box type])
+
- if test x"$BOXTYPE" == "xdm8000" ; then
- AC_DEFINE(KEY_PLAY_ACTUALLY_IS_KEY_PLAYPAUSE, 1,[define when rc sends a KEY_PLAY event for its KEY_PLAYPAUSE key])
- fi
-
- AC_ARG_WITH(libsdl,
- AS_HELP_STRING([--with-libsdl],[use sdl, yes or no]),
- [[with_sdl=$withval]],
- [[with_sdl=no]]
- )
-
+AC_ARG_WITH(textlcd,
+ AC_HELP_STRING([--with-textlcd], [use ascii based lcd, yes or no]),
+ [[withtextlcd=$withval]],
+ [[withtextlcd=no]]
+)
+if test x"$withtextlcd" != xno ; then
+ AC_DEFINE(HAVE_TEXTLCD, 1,[Define when using an ascii based lcd device])
+fi
+AM_CONDITIONAL(HAVE_TEXTLCD, test x"$withtextlcd" != xno)
+
+AC_ARG_WITH(colorlcd,
+ AC_HELP_STRING([--with-colorlcd], [use 96x64 16bpp color display, yes or no]),
+ [[withcolorlcd=$withval]],
+ [[withcolorlcd=no]]
+)
+if test x"$withcolorlcd" != xno ; then
+ AC_DEFINE(HAVE_COLORLCD, 1,[Define when using a 96x64 color display device])
+fi
+AM_CONDITIONAL(HAVE_COLORLCD, test x"$withcolorlcd" != xno)
+
- AC_CHECK_HEADER(dreamdvd/ddvdlib.h,have_ddvdlib="yes",have_ddvdlib="no")
- if test x"${have_ddvdlib}" = xyes ; then
- AC_DEFINE(HAVE_DDVDLIB, 1,[Define if ddvdlib is available])
- else
- AC_MSG_NOTICE([ddvdlib not found... dont build dvd plugin])
+ AC_ARG_WITH(libsdl,
+ AS_HELP_STRING([--with-libsdl],[use libsdl, yes or no]),
+ [with_libsdl=$withval],[with_libsdl=no])
+ if test "$with_libsdl" = "yes"; then
+ PKG_CHECK_MODULES(LIBSDL, sdl)
fi
- AM_CONDITIONAL(HAVE_DDVDLIB, test "$have_ddvdlib" = "yes")
-
- AM_PATH_PYTHON
- AX_PYTHON_DEVEL
- AX_PTHREAD
-
- TUXBOX_APPS_DVB
-
- PKG_CHECK_MODULES(BASE, [freetype2 fribidi gstreamer-0.10 gstreamer-pbutils-0.10 libdvbsi++ libpng libxml-2.0 sigc++-1.2])
- PKG_CHECK_MODULES(LIBXINE, libxine, HAVE_LIBXINE="yes", HAVE_LIBXINE="no")
-
- AC_CHECK_LIB([dl], [dlopen], [LIBDL_LIBS="-ldl"])
- AC_SUBST(LIBDL_LIBS)
- AC_CHECK_LIB([jpeg], [jpeg_set_defaults])
- AC_CHECK_LIB([xmlccwrap], [exit])
-
- AC_CHECK_HEADERS(gif_lib.h,
- AC_CHECK_LIB(ungif,DGifOpen,
- [AC_DEFINE(HAVE_LIBUNGIF,1,[Define if you have libgif/libungif including devel headers])
- LIBUNGIF_LIBS="-lungif"],
- [AC_CHECK_LIB(gif,DGifOpen,
- [AC_DEFINE(HAVE_LIUNBGIF,1)
- LIBUNGIF_LIBS="-lgif"])]))
- AC_SUBST(LIBUNGIF_LIBS)
-
- if test "$with_sdl" = "yes" ; then
- PKG_CHECK_MODULES(SDL, sdl)
- AC_DEFINE([WITH_SDL],[1],[Define to 1 if you have libsdl])
+ AM_CONDITIONAL(HAVE_LIBSDL, test "$with_libsdl" = "yes")
+
+ AC_ARG_WITH(libxine,
+ AS_HELP_STRING([--with-libxine],[use libxine, yes or no]),
+ [with_libxine=$withval],[with_libxine=no])
+ if test "$with_libxine" = "yes"; then
+ PKG_CHECK_MODULES(LIBXINE, libxine)
+ AC_DEFINE([WITH_XINE],[1],[Define to 1 if you have libxine])
+ fi
+ AM_CONDITIONAL(HAVE_LIBXINE, test "$with_libxine" = "yes")
+
+ AC_ARG_WITH(debug,
+ AS_HELP_STRING([--without-debug],[disable debugging code]),
+ [with_debug="$withval"],[with_debug="yes"])
+ if test "$with_debug" = "yes"; then
+ DEBUG_CFLAGS="-ggdb3"
+ AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code])
fi
- # allow 'if WITH_SDL' conditionals in Makefile.am
- AM_CONDITIONAL(WITH_SDL, test "$with_sdl" = "yes")
- CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
- CXXFLAGS="$CXXFLAGS $BASE_CFLAGS $LIBUNGIF_CFLAGS $LIBXINE_CFLAGS $PTHREAD_CFLAGS $SDL_CFLAGS -fno-rtti -fno-exceptions -Wall"
- LDFLAGS="$LDFLAGS $BASE_LDFLAGS $PYTHON_LDFLAGS $SDL_LDFLAGS $LIBUNGIF_LDFLAGS $LIBXINE_LDFLAGS"
+ AC_ARG_WITH(memcheck,
+ AS_HELP_STRING([--with-memcheck],[enable memory leak checks]),
+ [with_memcheck="$withval"],[with_memcheck="no"])
+ if test "$with_memcheck" = "yes"; then
+ AC_DEFINE([MEMLEAK_CHECK],[1],[Define to 1 to enable memory leak checks])
+ fi
- #CPPFLAGS="$CPPFLAGS -DMEMLEAK_CHECK"
- CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions -Wall"
+ AC_ARG_WITH(po,
+ AS_HELP_STRING([--without-po],[disable updating of po files]),
+ [with_po="$withval"],[with_po="yes"])
+ AM_CONDITIONAL(UPDATE_PO, test "$with_po" = "yes")
- TUXBOX_APPS_GETTEXT
+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+ CXXFLAGS="$CXXFLAGS $BASE_CFLAGS $PTHREAD_CFLAGS $DEBUG_CFLAGS -fno-rtti -fno-exceptions -Wall"
AC_CONFIG_FILES([
Makefile
dist_install_DATA = \
ae_AlMateen.ttf \
+ andale.ttf \
lcd.ttf \
md_khmurabi_10.ttf \
- nmsbd.ttf
+ nmsbd.ttf \
+ tuxtxt.ttf
DESCRIPTION = "Enigma2 is an experimental, but useful framebuffer-based frontend for DVB functions"
+MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
+DEPENDS = "jpeg libungif libmad libpng libsigc++-1.2 gettext-native \
+ dreambox-dvbincludes freetype libdvbsi++ python python-twisted swig-native \
+ dvd+rw-tools dvdauthor mjpegtools cdrkit python-imaging replex \
+ libfribidi libxmlccwrap libdreamdvd libdvdcss tuxtxt-enigma2 ethtool \
+ gstreamer gst-plugins-bad gst-plugins-good gst-plugins-ugly"
+RDEPENDS_${PN} = "python-codecs python-core python-lang python-re python-threading \
+ python-xml python-fcntl gst-plugin-decodebin gst-plugin-decodebin2 python-stringold \
+ python-pickle gst-plugin-app \
+ gst-plugin-id3demux gst-plugin-mad gst-plugin-ogg gst-plugin-playbin \
+ gst-plugin-typefindfunctions gst-plugin-audioconvert gst-plugin-audioresample \
+ gst-plugin-wavparse python-netclient gst-plugin-mpegstream gst-plugin-selector \
+ gst-plugin-flac gst-plugin-mpegdemux \
+ gst-plugin-neonhttpsrc gst-plugin-mpegaudioparse gst-plugin-subparse \
+ gst-plugin-apetag gst-plugin-icydemux gst-plugin-autodetect \
+ python-twisted-core python-elementtree \
+ enigma2-fonts \
+ glibc-gconv-iso8859-15 ethtool"
+
+RDEPENDS_${PN} += "${@base_contains("MACHINE_FEATURES", "blindscan", "virtual/blindscanutils" , "", d)}"
+
+# Magic is the default skin, so we should depend on it.
+DEPENDS += "enigma2-plugin-skins-magic"
+RDEPENDS_${PN} += "enigma2-plugin-skins-magic"
+
+# We depend on the font which we use for TXT subtitles (defined in skin_subtitles.xml)
+DEPENDS += "font-valis-enigma"
+RDEPENDS_${PN} += "font-valis-enigma"
+
+RDEPENDS_${PN} += "${@base_contains("MACHINE_FEATURES", "alsa", "gst-plugin-alsa alsa-conf", "", d)}"
+
+# proper hdtv hardware should be able to playback these codecs
+RDEPENDS_${PN} += "${@base_contains("MACHINE_FEATURES", "hdtv", "gst-plugin-avi gst-plugin-matroska \
+ gst-plugin-qtdemux gst-plugin-cdxaparse gst-plugin-cdio gst-plugin-vcdsrc gst-plugin-vorbis", "", d)}"
+
+RDEPENDS_enigma2_append_dm7020 = " gst-plugin-ossaudio gst-plugin-ivorbisdec"
+RDEPENDS_enigma2_append_dm7025 = " gst-plugin-ivorbisdec"
+RDEPENDS_enigma2_append_dm800 = " gst-plugin-ivorbisdec"
+
+# FPU hardware should be able to downmix DTS
+RRECOMMENDS_${PN} = "${@["","gst-plugin-dtsdec"][bb.data.getVar("TARGET_FPU",d,1) == 'hard']}"
+
+# 'forward depends' - no two providers can have the same PACKAGES_DYNAMIC, however both
+# enigma2 and enigma2-plugins produce enigma2-plugin-*.
+#DEPENDS += "enigma2-plugins"
+#PACKAGES_DYNAMIC = "enigma2-plugin-*"
+
+DESCRIPTION_append_enigma2-plugin-extensions-cutlisteditor = "enables you to cut your movies."
+RDEPENDS_enigma2-plugin-extensions-cutlisteditor = "aio-grab"
+ DESCRIPTION_append_enigma2-plugin-extensions-cutlisteditor = "enables you to cut your movies."
DESCRIPTION_append_enigma2-plugin-extensions-graphmultiepg = "shows a graphical timeline EPG."
DESCRIPTION_append_enigma2-plugin-extensions-pictureplayer = "displays photos on the TV."
DESCRIPTION_append_enigma2-plugin-systemplugins-frontprocessorupdate = "keeps your frontprocessor up to date."
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
- -include Python.h
+ -include Python.h \
+ -include $(top_builddir)/enigma2_config.h
- noinst_LTLIBRARIES = libenigma_base.la
+ noinst_LIBRARIES = libenigma_base.a
- libenigma_base_la_SOURCES = \
- buffer.cpp ebase.cpp eerror.cpp elock.cpp \
- init.cpp message.cpp thread.cpp \
- smartptr.cpp estring.cpp connection.cpp \
- filepush.cpp encoding.cpp console.cpp rawfile.cpp \
- nconfig.cpp ioprio.cpp etpm.cpp \
- freesatv2.cpp
+ libenigma_base_a_SOURCES = \
+ buffer.cpp \
+ connection.cpp \
+ console.cpp \
+ ebase.cpp \
+ eenv.cpp \
+ eerror.cpp \
+ elock.cpp \
+ encoding.cpp \
+ estring.cpp \
+ etpm.cpp \
+ filepush.cpp \
++ freesatv2.cpp \
+ init.cpp \
+ ioprio.cpp \
+ message.cpp \
+ nconfig.cpp \
+ rawfile.cpp \
+ smartptr.cpp \
+ thread.cpp
+
+ EXTRA_DIST = \
+ eenv.cpp.in
+
+ baseincludedir = $(pkgincludedir)/lib/base
+ baseinclude_HEADERS = \
+ buffer.h \
+ console.h \
+ ebase.h \
+ eenv.h \
+ eerror.h \
+ elock.h \
+ encoding.h \
+ eptrlist.h \
+ estring.h \
+ etpm.h \
+ filepush.h \
+ i18n.h \
+ itssource.h \
+ init.h \
+ init_num.h \
+ ioprio.h \
+ message.h \
+ nconfig.h \
+ object.h \
+ rawfile.h \
+ ringbuffer.h \
+ smartptr.h \
+ thread.h
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <netdb.h>
+//#define SHOW_WRITE_TIME
+
+#ifdef SHOW_WRITE_TIME
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <sys/time.h>
+#endif
+
+// For SYS_ stuff
+#include <syscall.h>
+
#define PVR_COMMIT 1
-//FILE *f = fopen("/log.ts", "wb");
+static size_t flushSize = 512 * 1024;
+
+// Defined and exported to SWIG in systemsettings.h
+int getFlushSize(void)
+{
+ return (int)flushSize;
+}
+
+void setFlushSize(int size)
+{
+ if (size >= 0)
+ {
+ flushSize = (size_t)size;
+ }
+}
+
-eFilePushThread::eFilePushThread(int io_prio_class, int io_prio_level, int blocksize)
- :prio_class(io_prio_class), prio(io_prio_level), m_messagepump(eApp, 0)
+eFilePushThread::eFilePushThread(int io_prio_class, int io_prio_level, int blocksize, size_t buffersize)
+ :prio_class(io_prio_class),
+ prio(io_prio_level),
- streamFd(-1),
+ m_sg(NULL),
+ m_stop(0),
+ m_buf_start(0),
+ m_send_pvr_commit(0),
+ m_stream_mode(0),
+ m_blocksize(blocksize),
+ m_buffersize(buffersize),
+ m_buffer((unsigned char*)malloc(buffersize)),
+ m_messagepump(eApp, 0)
{
- m_stop = 0;
- m_sg = 0;
- m_send_pvr_commit = 0;
- m_stream_mode = 0;
- m_blocksize = blocksize;
flush();
enablePVRCommit(0);
CONNECT(m_messagepump.recv_msg, eFilePushThread::recvEvent);
}
+eFilePushThread::~eFilePushThread()
+{
- if (streamFd >= 0) ::close(streamFd);
+ free(m_buffer);
+}
+
static void signal_handler(int x)
{
}
- int eFilePushThread::connectStream(std::string &url)
- {
- std::string host;
- int port = 80;
- std::string uri;
-
- int slash = url.find("/", 7);
- if (slash > 0)
- {
- host = url.substr(7, slash - 7);
- uri = url.substr(slash, url.length() - slash);
- }
- else
- {
- host = url.substr(7, url.length() - 7);
- uri = "";
- }
- int dp = host.find(":");
- if (dp == 0)
- {
- port = atoi(host.substr(1, host.length() - 1).c_str());
- host = "localhost";
- }
- else if (dp > 0)
- {
- port = atoi(host.substr(dp + 1, host.length() - dp - 1).c_str());
- host = host.substr(0, dp);
- }
-
- struct hostent* h = gethostbyname(host.c_str());
- if (h == NULL || h->h_addr_list == NULL) return -1;
- int fd = socket(PF_INET, SOCK_STREAM, 0);
- if (fd == -1) return -1;
-
- struct sockaddr_in addr;
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = *((in_addr_t*)h->h_addr_list[0]);
- addr.sin_port = htons(port);
-
- eDebug("connecting to %s", url.c_str());
-
- if (::connect(fd, (sockaddr*)&addr, sizeof(addr)) == -1)
- {
- ::close(fd);
- std::string msg = "connect failed for: " + url;
- eDebug(msg.c_str());
- return -1;
- }
-
- std::string request = "GET ";
- request.append(uri).append(" HTTP/1.1\n");
- request.append("Host: ").append(host).append("\n");
- request.append("Accept: */*\n");
- request.append("Connection: close\n");
- request.append("\n");
- socketWrite(fd, request.c_str(), request.length());
-
- char linebuf[1024] = {0};
- if (timedSocketRead(fd, linebuf, sizeof(linebuf) - 1, 5000) <= 0)
- {
- ::close(fd);
- eDebug("read timeout");
- return -1;
- }
-
- char proto[100];
- int statuscode = 0;
- char statusmsg[100];
- int rc = sscanf(linebuf, "%99s %d %99s", proto, &statuscode, statusmsg);
- if (rc != 3 || statuscode != 200)
- {
- eDebug("wrong response: \"200 OK\" expected.\n %d --- %d", rc, statuscode);
- ::close(fd);
- return -1;
- }
-
- return fd;
- }
-
- ssize_t eFilePushThread::socketRead(int fd, void *buf, size_t count)
- {
- int retval;
- while (1)
- {
- retval = ::read(fd, buf, count);
- if (retval < 0)
- {
- if (errno == EINTR)
- {
- if (m_stop) return -1;
- continue;
- }
- eDebug("eFilePushThread::socketRead %m");
- }
- return retval;
- }
- }
-
- ssize_t eFilePushThread::timedSocketRead(int fd, void *data, size_t size, int msinitial, int msinterbyte)
- {
- fd_set rset;
- struct timeval timeout;
- int result;
- size_t totalread = 0;
-
- while (totalread < size)
- {
- int maxfd = 0;
- FD_ZERO(&rset);
- FD_SET(fd, &rset);
- maxfd = fd + 1;
- if (totalread == 0)
- {
- timeout.tv_sec = msinitial/1000;
- timeout.tv_usec = (msinitial%1000) * 1000;
- }
- else
- {
- timeout.tv_sec = msinterbyte/1000;
- timeout.tv_usec = (msinterbyte%1000) * 1000;
- }
- result = ::select(maxfd, &rset, NULL, NULL, &timeout);
- if (result < 0)
- {
- if (errno == EINTR)
- {
- if (m_stop) return -1;
- continue;
- }
- return -1;
- }
- if (result == 0) break;
- if ((result = socketRead(fd, ((char*)data) + totalread, size - totalread)) < 0)
- {
- return -1;
- }
- if (result == 0) break;
- totalread += result;
- }
- return totalread;
- }
-
- ssize_t eFilePushThread::socketWrite(int fd, const void *buf, size_t count)
- {
- int retval;
- char *ptr = (char*)buf;
- size_t handledcount = 0;
- while (handledcount < count)
- {
- retval = ::write(fd, &ptr[handledcount], count - handledcount);
-
- if (retval == 0) return -1;
- if (retval < 0)
- {
- if (errno == EINTR)
- {
- if (m_stop) return -1;
- continue;
- }
- eDebug("eFilePushThread::socketWrite %m");
- return retval;
- }
- handledcount += retval;
- }
- return handledcount;
- }
-
void eFilePushThread::thread()
{
- if (m_raw_source.valid()) setIoPrio(prio_class, prio);
+ setIoPrio(prio_class, prio);
- off_t source_pos = 0;
- off_t dest_pos = 0;
size_t bytes_read = 0;
--
off_t current_span_offset = 0;
size_t current_span_remaining = 0;
-
-
+ off_t offset_last_sync = 0;
size_t written_since_last_sync = 0;
eDebug("FILEPUSH THREAD START");
}
/* now fill our buffer. */
-
- if (m_raw_source.valid() && m_sg && !current_span_remaining)
+
+ if (m_sg && !current_span_remaining)
{
- m_sg->getNextSourceSpan(source_pos, bytes_read, current_span_offset, current_span_remaining);
+ m_sg->getNextSourceSpan(m_current_position, bytes_read, current_span_offset, current_span_remaining);
ASSERT(!(current_span_remaining % m_blocksize));
-
- if (source_pos != current_span_offset)
- source_pos = m_raw_source.lseek(current_span_offset, SEEK_SET);
+ m_current_position = current_span_offset;
bytes_read = 0;
}
-
- size_t maxread = sizeof(m_buffer);
+
+ size_t maxread = m_buffersize;
/* if we have a source span, don't read past the end */
- if (m_raw_source.valid() && m_sg && maxread > current_span_remaining)
+ if (m_sg && maxread > current_span_remaining)
maxread = current_span_remaining;
/* align to blocksize */
class eFilePushThread: public eThread, public Object
{
int prio_class, prio;
- std::string streamUrl;
- int streamFd;
- int connectStream(std::string &url);
- ssize_t socketRead(int fd, void *buf, size_t count);
- ssize_t timedSocketRead(int fd, void *data, size_t size, int msinitial, int msinterbyte = 200);
- ssize_t socketWrite(int fd, const void *buf, size_t count);
-
public:
- eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188);
+ eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188, size_t buffersize=188*1024);
+ ~eFilePushThread();
void thread();
void stop();
void start(int sourcefd, int destfd);
int m_send_pvr_commit;
int m_stream_mode;
int m_blocksize;
+ size_t m_buffersize;
+ unsigned char* m_buffer;
+ off_t m_current_position;
+
+ ePtr<iTsSource> m_source;
- eRawFile m_raw_source;
eFixedMessagePump<int> m_messagepump;
-
+
void recvEvent(const int &evt);
};
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
- -include Python.h
+ -include Python.h \
+ -include $(top_builddir)/enigma2_config.h
- noinst_LTLIBRARIES = libenigma_components.la
+ noinst_LIBRARIES = libenigma_components.a
- libenigma_components_la_SOURCES = scan.cpp file_eraser.cpp tuxtxtapp.cpp
+ libenigma_components_a_SOURCES = \
+ file_eraser.cpp \
- scan.cpp
++ scan.cpp \
++ tuxtxtapp.cpp
++
+
+ componentsincludedir = $(pkgincludedir)/lib/components
+ componentsinclude_HEADERS = \
+ file_eraser.h \
+ scan.h
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
- -include Python.h
+ -include Python.h \
+ -include $(top_builddir)/enigma2_config.h
- noinst_LTLIBRARIES = libenigma_dvb.la
+ noinst_LIBRARIES = libenigma_dvb.a
- libenigma_dvb_la_SOURCES = dvb.cpp demux.cpp frontend.cpp esection.cpp db.cpp \
- sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp rotor_calc.cpp \
- epgcache.cpp dvbtime.cpp metaparser.cpp volume.cpp tstools.cpp pvrparse.cpp \
- pesparse.cpp teletext.cpp radiotext.cpp subtitle.cpp cahandler.cpp \
- fastscan.cpp cablescan.cpp
+ libenigma_dvb_a_SOURCES = \
++ cablescan.cpp \
+ crc32.cpp \
+ db.cpp \
+ decoder.cpp \
+ demux.cpp \
+ dvb.cpp \
+ dvbtime.cpp \
+ eit.cpp \
+ epgcache.cpp \
+ esection.cpp \
++ fastscan.cpp \
+ frontend.cpp \
+ metaparser.cpp \
+ pesparse.cpp \
+ pmt.cpp \
+ pvrparse.cpp \
+ radiotext.cpp \
+ rotor_calc.cpp \
+ scan.cpp \
+ sec.cpp \
+ subtitle.cpp \
+ teletext.cpp \
+ tstools.cpp \
+ volume.cpp
+
+ dvbincludedir = $(pkgincludedir)/lib/dvb
+ dvbinclude_HEADERS = \
++ cablescan.h \
+ crc32.h \
+ db.h \
+ decoder.h \
+ demux.h \
+ dvb.h \
+ dvbtime.h \
+ eit.h \
+ epgcache.h \
+ esection.h \
++ fastscan.h \
+ frontend.h \
+ frontendparms.h \
+ idemux.h \
+ idvb.h \
+ isection.h \
+ list.h \
+ metaparser.h \
+ pesparse.h \
+ pmt.h \
+ pvrparse.h \
+ radiotext.h \
+ rotor_calc.h \
+ scan.h \
+ sec.h \
+ specs.h \
+ subtitle.h \
+ teletext.h \
+ tstools.h \
+ volume.h
/* iDVBPVRChannel */
RESULT playFile(const char *file);
+ RESULT playUrl(const char *url);
void stopFile();
-
+
+ RESULT playSource(ePtr<iTsSource>& source, const char *priv=NULL);
+ void stopSource();
+
void setCueSheet(eCueSheet *cuesheet);
RESULT getLength(pts_t &len);
ok, it's going to get better. but still...*/
virtual RESULT playFile(const char *file) = 0;
+ virtual RESULT playUrl(const char *url) = 0;
virtual void stopFile() = 0;
+ /* new interface */
+ virtual RESULT playSource(ePtr<iTsSource> &source, const char *priv=NULL) = 0;
+ virtual void stopSource() = 0;
+
virtual void setCueSheet(eCueSheet *cuesheet) = 0;
virtual RESULT getLength(pts_t &pts) = 0;
std::vector<audioStream> audioStreams;
int defaultAudioStream;
std::vector<subtitleStream> subtitleStreams;
+ int defaultSubtitleStream;
- std::set<uint16_t> caids;
+ std::list<capid_pair> caids;
int pcrPid;
int pmtPid;
int textPid;
#include <lib/dvb/esection.h>
#include <lib/dvb/scan.h>
#include <lib/dvb/frontend.h>
+ #include <lib/base/eenv.h>
#include <lib/base/eerror.h>
#include <lib/base/estring.h>
+#include <lib/dvb/dvb.h>
+#include <lib/dvb/db.h>
#include <lib/python/python.h>
#include <errno.h>
from Components.Harddisk import harddiskmanager
from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations
from Tools.Directories import resolveFilename, SCOPE_HDD
-from enigma import Misc_Options, setTunerTypePriorityOrder, eEnv;
+from enigma import setTunerTypePriorityOrder, setPreferredTuner, setSpinnerOnOff, setEnableTtCachingOnOff;
++from enigma import Misc_Options, eEnv;
+from Components.NimManager import nimmanager
+from Components.Harddisk import harddiskmanager
from SystemInfo import SystemInfo
import os
+import enigma
def InitUsageConfig():
config.usage = ConfigSubsection();
def set12VOutput(configElement):
if configElement.value == "on":
- Misc_Options.getInstance().set_12V_output(1)
+ enigma.Misc_Options.getInstance().set_12V_output(1)
elif configElement.value == "off":
- Misc_Options.getInstance().set_12V_output(0)
+ enigma.Misc_Options.getInstance().set_12V_output(0)
config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)
- SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
+ SystemInfo["12V_Output"] = enigma.Misc_Options.getInstance().detected_12V_output()
- config.usage.keymap = ConfigText(default = "/usr/share/enigma2/keymap.xml")
+ config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))
config.seek = ConfigSubsection()
config.seek.selfdefined_13 = ConfigNumber(default=15)
self.ipkg = IpkgComponent()
self.ipkg.addCallback(self.ipkgCallback)
+ self.offline = "offline" in args
-
- self.updating = True
- self.package.setText(_("Package list update"))
- self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ self.updating = False
self["actions"] = ActionMap(["WizardActions"],
{
"ok": self.exit,
"back": self.exit
}, -1)
+
+ iNetwork.checkNetworkState(self.checkNetworkCB)
+ self.onClose.append(self.cleanup)
+
+ def cleanup(self):
+ iNetwork.stopPingConsole()
+
+ def checkNetworkCB(self,data):
+ if data is not None:
+ if data <= 2:
+ self.updating = True
+ self.activityTimer.start(100, False)
+ self.package.setText(_("Package list update"))
+ self.status.setText(_("Upgrading Dreambox... Please wait"))
+ self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ else:
+ self.package.setText(_("Your network is not working. Please try again."))
+ self.status.setText(self.oktext)
+
def doActivityTimer(self):
self.activity += 1
if self.activity == 100:
- from enigma import eTimer
-from enigma import eTimer, eTPM, eEnv
++from enigma import eTimer, eEnv
from Screens.Screen import Screen
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap,MultiPixmap
from Components.ActionMap import NumberActionMap, ActionMap, HelpableActionMap
from Components.MenuList import MenuList
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
+from Components.SystemInfo import SystemInfo
profile("ChannelSelection.py 1")
from EpgSelection import EPGSelection
- from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode
+ from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode, eEnv
-from Components.config import config, ConfigSubsection, ConfigText
+from Components.config import config, configfile, ConfigSubsection, ConfigText
from Tools.NumericalTextInput import NumericalTextInput
profile("ChannelSelection.py 2")
from Components.NimManager import nimmanager
#include <lib/gdi/fb.h>
#include <lib/gdi/font.h>
#include <lib/gdi/gpixmap.h>
+#include <lib/gdi/gfbdc.h>
+#include <lib/gdi/grc.h>
+ #include <lib/gdi/gmaindc.h>
#include <lib/gui/ewidget.h>
#include <lib/gui/elabel.h>
#include <lib/gui/einput.h>
return 0;
}
+ RESULT eServiceCenter::addFactoryExtension(int id, const char *extension)
+ {
+ std::map<int, std::list<std::string> >::iterator it = extensions.find(id);
+ if (it == extensions.end())
+ return -1;
+ it->second.push_back(extension);
+ return 0;
+ }
+
+ RESULT eServiceCenter::removeFactoryExtension(int id, const char *extension)
+ {
+ std::map<int, std::list<std::string> >::iterator it = extensions.find(id);
+ if (it == extensions.end())
+ return -1;
+ it->second.remove(extension);
+ return 0;
+ }
+
+
int eServiceCenter::getServiceTypeForExtension(const char *str)
{
- for (std::map<int, std::list<std::string> >::iterator sit(extensions.begin()); sit != extensions.end(); ++sit)
- {
- for (std::list<std::string>::iterator eit(sit->second.begin()); eit != sit->second.end(); ++eit)
- {
- if (*eit == str)
- return sit->first;
- }
- }
- return -1;
+ return getServiceTypeForExtension(std::string(str));
}
int eServiceCenter::getServiceTypeForExtension(const std::string &str)
addToLogbuffer(log.c_str(), log.size());
}
- static std::string getConfigFileValue(const char *entry)
+ static const std::string getConfigString(const std::string &key, const std::string &defaultValue)
{
- std::string configfile = "/etc/enigma2/settings";
- std::string configvalue;
- if (entry)
- {
- ePythonConfigQuery::getConfigValue(entry, configvalue);
- if (configvalue != "") //we get at least the default value if python is still alive
- {
- return configvalue;
- }
- else // get value from enigma2 settings file
- {
- FILE *f = fopen(configfile.c_str(), "r");
- if (!f)
- {
- return "Error";
- }
- while (1)
- {
- char line[1024];
- if (!fgets(line, 1024, f))
- break;
- if (!strncmp(line, entry, strlen(entry) ))
- {
- if (strlen(line) && line[strlen(line)-1] == '\r')
- line[strlen(line)-1] = 0;
- if (strlen(line) && line[strlen(line)-1] == '\n')
- line[strlen(line)-1] = 0;
- std::string tmp = line;
- int posEqual = tmp.find("=", 0);
- configvalue = tmp.substr(posEqual+1);
- }
- }
- fclose(f);
- return configvalue;
- }
- }
- return "";
- }
+ std::string value;
- static std::string getFileContent(const char *file)
- {
- std::string filecontent;
+ ePythonConfigQuery::getConfigValue(key.c_str(), value);
+ //we get at least the default value if python is still alive
+ if (!value.empty())
+ return value;
- if (file)
- {
- FILE *f = fopen(file, "r");
- if (!f)
- {
- return "Error";
- }
- while (1)
- {
- char line[1024];
- if (!fgets(line, 1024, f))
+ value = defaultValue;
+
+ // get value from enigma2 settings file
+ std::ifstream in(eEnv::resolve("${sysconfdir}/enigma2/settings").c_str());
+ if (in.good()) {
+ do {
+ std::string line;
+ std::getline(in, line);
+ size_t size = key.size();
+ if (!key.compare(0, size, line) && line[size] == '=') {
+ value = line.substr(size + 1);
break;
- std::string tmp = line;
- std::string password;
- size_t pwdpos = tmp.find(".password=", 0);
- if( pwdpos != std::string::npos)
- {
- filecontent += tmp.substr(0,pwdpos +10);
- for ( size_t pos = pwdpos +10; pos < tmp.length()-1; ++pos )
- {
- filecontent += "X";
- }
- filecontent += "\n";
}
- else {
- filecontent += line;
- }
- }
- fclose(f);
+ } while (in.good());
+ in.close();
}
- return filecontent;
- }
- static std::string execCommand(char* cmd) {
- FILE* pipe = popen(cmd, "r");
- if (!pipe)
- return "Error";
- char buffer[STDBUFFER_SIZE];
- std::string result = "";
- while(!feof(pipe))
- {
- if(!fgets(buffer,STDBUFFER_SIZE, pipe))
- break;
- result += buffer;
- }
- pclose(pipe);
- return result;
+ return value;
}
- extern std::string execCommand();
- extern std::string getConfigFileValue();
- extern std::string getFileContent();
- extern std::string getLogBuffer();
+ static bool getConfigBool(const std::string &key, bool defaultValue)
+ {
+ std::string value = getConfigString(key, defaultValue ? "true" : "false");
+ const char *cvalue = value.c_str();
- #define INFOFILE "/maintainer.info"
+ if (!strcasecmp(cvalue, "true"))
+ return true;
+ if (!strcasecmp(cvalue, "false"))
+ return false;
+
+ return defaultValue;
+ }
+static bool bsodhandled = false;
+
void bsodFatal(const char *component)
{
+ /* show no more than one bsod while shutting down/crashing */
+ if (bsodhandled) return;
+ bsodhandled = true;
+
- char logfile[128];
- sprintf(logfile, "/media/hdd/enigma2_crash_%u.log", (unsigned int)time(0));
- FILE *f = fopen(logfile, "wb");
+ std::ostringstream os;
++ os << "/media/hdd/enigma2_crash_";
+ os << time(0);
++ os << ".log";
+
- std::string logfile("/media/hdd/enigma2_crash_" + os.str() + ".log");
-
- FILE *f = fopen(logfile.c_str(), "wb");
++ FILE *f = fopen(os.str().c_str(), "wb");
std::string lines = getLogBuffer();
if (f)
{
time_t t = time(0);
- char crashtime[STDBUFFER_SIZE];
- sprintf(crashtime, "%s",ctime(&t));
- if (strlen(crashtime) && crashtime[strlen(crashtime)-1] == '\n')
- crashtime[strlen(crashtime)-1] = 0;
- fprintf(f, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<opendreambox>\n");
- fprintf(f, "\t<enigma2>\n");
- fprintf(f, "\t\t<crashdate>%s</crashdate>\n", crashtime);
- #ifdef ENIGMA2_CHECKOUT_TAG
- fprintf(f, "\t\t<checkouttag>" ENIGMA2_CHECKOUT_TAG "</checkouttag>\n");
- #else
- fprintf(f, "\t\t<compiledate>" __DATE__ "</compiledate>\n");
- #endif
- #ifdef ENIGMA2_CHECKOUT_ROOT
- fprintf(f, "\t\t<checkoutroot>" ENIGMA2_CHECKOUT_ROOT "</checkoutroot>\n");
- #endif
- fprintf(f, "\t\t<contactemail>%s</contactemail>\n", crash_emailaddr);
- fprintf(f, "\t\t<!-- Please email this crashlog to above address -->\n");
- std::string activeSkin = getConfigFileValue("config.skin.primary_skin");
- if (activeSkin != "Error")
- {
- if (activeSkin == "")
- activeSkin = "Default Skin";
- fprintf(f, "\t\t<skin>%s</skin>\n", activeSkin.c_str());
- }
- fprintf(f, "\t</enigma2>\n");
+ struct tm tm;
+ char tm_str[32];
- fprintf(f, "\t<image>\n");
- std::string model = getFileContent("/proc/stb/info/model");
- if (model != "Error")
- {
- char modelname[STDBUFFER_SIZE];
- sprintf(modelname, "%s",model.c_str());
- if (strlen(modelname) && modelname[strlen(modelname)-1] == '\n')
- modelname[strlen(modelname)-1] = 0;
- fprintf(f, "\t\t<dreamboxmodel>%s</dreamboxmodel>\n", modelname);
- }
- std::string kernel = getFileContent("/proc/cmdline");
- if (kernel != "Error")
- {
- char kernelcmd[STDBUFFER_SIZE];
- sprintf(kernelcmd, "%s",kernel.c_str());
- if (strlen(kernelcmd) && kernelcmd[strlen(kernelcmd)-1] == '\n')
- kernelcmd[strlen(kernelcmd)-1] = 0;
- fprintf(f, "\t\t<kernelcmdline>%s</kernelcmdline>\n", kernelcmd);
- }
- std::string sendAnonCrashlog = getConfigFileValue("config.plugins.crashlogautosubmit.sendAnonCrashlog");
- if (sendAnonCrashlog == "False" || sendAnonCrashlog == "false") // defaults to true... default anonymized crashlogs
- {
- std::string ca = getFileContent("/proc/stb/info/ca");
- if (ca != "Error")
- {
- char dreamboxca[STDBUFFER_SIZE];
- sprintf(dreamboxca, "%s",ca.c_str());
- if (strlen(dreamboxca) && dreamboxca[strlen(dreamboxca)-1] == '\n')
- dreamboxca[strlen(dreamboxca)-1] = 0;
- fprintf(f, "\t\t<dreamboxca>\n\t\t<![CDATA[\n%s\n\t\t]]>\n\t\t</dreamboxca>\n", dreamboxca);
- }
- std::string settings = getFileContent("/etc/enigma2/settings");
- if (settings != "Error")
- {
- fprintf(f, "\t\t<enigma2settings>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2settings>\n", settings.c_str());
- }
- }
- std::string addNetwork = getConfigFileValue("config.plugins.crashlogautosubmit.addNetwork");
- if (addNetwork == "True" || addNetwork == "true")
- {
- std::string nwinterfaces = getFileContent("/etc/network/interfaces");
- if (nwinterfaces != "Error")
- {
- fprintf(f, "\t\t<networkinterfaces>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</networkinterfaces>\n", nwinterfaces.c_str());
- }
- std::string dns = getFileContent("/etc/resolv.conf");
- if (dns != "Error")
- {
- fprintf(f, "\t\t<dns>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</dns>\n", dns.c_str());
- }
- std::string defaultgw = getFileContent("/etc/default_gw");
- if (defaultgw != "Error")
- {
- char gateway[STDBUFFER_SIZE];
- sprintf(gateway, "%s",defaultgw.c_str());
- if (strlen(gateway) && gateway[strlen(gateway)-1] == '\n')
- gateway[strlen(gateway)-1] = 0;
- fprintf(f, "\t\t<defaultgateway>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</defaultgateway>\n", gateway);
- }
- }
- std::string addWlan = getConfigFileValue("config.plugins.crashlogautosubmit.addWlan");
- if (addWlan == "True" || addWlan == "true")
- {
- std::string wpasupplicant = getFileContent("/etc/wpa_supplicant.conf");
- if (wpasupplicant != "Error")
- {
- fprintf(f, "\t\t<wpasupplicant>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</wpasupplicant>\n", wpasupplicant.c_str());
- }
- }
- std::string imageversion = getFileContent("/etc/image-version");
- if (imageversion != "Error")
- {
- fprintf(f, "\t\t<imageversion>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</imageversion>\n", imageversion.c_str());
+ localtime_r(&t, &tm);
+ strftime(tm_str, sizeof(tm_str), "%a %b %_d %T %Y", &tm);
+
+ XmlGenerator xml(f);
+
+ xml.open("opendreambox");
+
+ xml.open("enigma2");
+ xml.string("crashdate", tm_str);
+ xml.string("compiledate", __DATE__);
+ xml.string("contactemail", crash_emailaddr);
+ xml.comment("Please email this crashlog to above address");
+
+ xml.string("skin", getConfigString("config.skin.primary_skin", "Default Skin"));
+ xml.string("sourcedate", enigma2_date);
+ xml.string("branch", enigma2_branch);
+ xml.string("rev", enigma2_rev);
+ xml.string("version", PACKAGE_VERSION);
+ xml.close();
+
+ xml.open("image");
+ xml.stringFromFile("dreamboxmodel", "/proc/stb/info/model");
+ xml.stringFromFile("kernelcmdline", "/proc/cmdline");
+ if (!getConfigBool("config.plugins.crashlogautosubmit.sendAnonCrashlog", true)) {
+ xml.cDataFromFile("dreamboxca", "/proc/stb/info/ca");
+ xml.cDataFromFile("enigma2settings", eEnv::resolve("${sysconfdir}/enigma2/settings"), ".password=");
}
- std::string imageissue = getFileContent("/etc/issue.net");
- if (imageissue != "Error")
- {
- fprintf(f, "\t\t<imageissue>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</imageissue>\n", imageissue.c_str());
+ if (getConfigBool("config.plugins.crashlogautosubmit.addNetwork", false)) {
+ xml.cDataFromFile("networkinterfaces", "/etc/network/interfaces");
+ xml.cDataFromFile("dns", "/etc/resolv.conf");
+ xml.cDataFromFile("defaultgateway", "/etc/default_gw");
}
- fprintf(f, "\t</image>\n");
+ if (getConfigBool("config.plugins.crashlogautosubmit.addWlan", false))
+ xml.cDataFromFile("wpasupplicant", "/etc/wpa_supplicant.conf");
+ xml.cDataFromFile("imageversion", "/etc/image-version");
+ xml.cDataFromFile("imageissue", "/etc/issue.net");
+ xml.close();
- bool detailedCrash = getConfigFileValue("config.crash.details") == "true";
- if (detailedCrash)
- {
- fprintf(f, "\t<software>\n");
- std::string installedplugins = execCommand("ipkg list_installed 'enigma2*'");
- fprintf(f, "\t\t<enigma2software>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2software>\n", installedplugins.c_str());
- std::string dreambox = execCommand("ipkg list_installed 'dream*'");
- fprintf(f, "\t\t<dreamboxsoftware>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</dreamboxsoftware>\n", dreambox.c_str());
- std::string gstreamer = execCommand("ipkg list_installed 'gst*'");
- fprintf(f, "\t\t<gstreamersoftware>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</gstreamersoftware>\n", gstreamer.c_str());
- fprintf(f, "\t</software>\n");
- }
+ xml.open("software");
+ xml.cDataFromCmd("enigma2software", "ipkg list_installed | grep enigma2");
+ xml.cDataFromCmd("dreamboxsoftware", "ipkg list_installed | grep dream");
+ xml.cDataFromCmd("gstreamersoftware", "ipkg list_installed | grep gst");
+ xml.close();
- fprintf(f, "\t<crashlogs>\n");
- fprintf(f, "\t\t<enigma2crashlog>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2crashlog>\n", getLogBuffer().c_str());
- if (detailedCrash)
- {
- std::string pythonmd5 = execCommand("find /usr/lib/enigma2/python/ -name \"*.py\" | xargs md5sum");
- fprintf(f, "\t\t<pythonMD5sum>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</pythonMD5sum>\n", pythonmd5.c_str());
- }
- fprintf(f, "\t</crashlogs>\n");
+ xml.open("crashlogs");
+ xml.cDataFromString("enigma2crashlog", getLogBuffer());
+ xml.cDataFromCmd("pythonMD5sum", "find " + eEnv::resolve("${libdir}/enigma2/python/") + " -name \"*.py\" | xargs md5sum");
+ xml.close();
+
+ xml.close();
- fprintf(f, "\n</opendreambox>\n");
fclose(f);
-
}
-
- #ifdef WITH_SDL
- ePtr<gSDLDC> my_dc;
- gSDLDC::getInstance(my_dc);
- #else
- ePtr<gFBDC> my_dc;
- gFBDC::getInstance(my_dc);
- #endif
-
- {
- gPainter p(my_dc);
- p.resetOffset();
- p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
- #ifdef ENIGMA2_CHECKOUT_TAG
- if (ENIGMA2_CHECKOUT_TAG[0] == 'T') /* tagged checkout (release) */
- p.setBackgroundColor(gRGB(0x0000C0));
- else if (ENIGMA2_CHECKOUT_TAG[0] == 'D') /* dated checkout (daily experimental build) */
- {
- srand(time(0));
- int r = rand();
- unsigned int col = 0;
- if (r & 1)
- col |= 0x800000;
- if (r & 2)
- col |= 0x008000;
- if (r & 4)
- col |= 0x0000c0;
- p.setBackgroundColor(gRGB(col));
- }
- #else
- p.setBackgroundColor(gRGB(0x008000));
- #endif
- p.setForegroundColor(gRGB(0xFFFFFF));
-
- ePtr<gFont> font = new gFont("Regular", 20);
- p.setFont(font);
- p.clear();
-
- eRect usable_area = eRect(100, 70, my_dc->size().width() - 150, 100);
-
- char text[512];
- snprintf(text, 512, "We are really sorry. Your Dreambox encountered "
- "a software problem, and needs to be restarted. "
- "Please send the logfile created in /hdd/ to %s.\n"
- "Your Dreambox restarts in 10 seconds!\n"
- "Component: %s",
- crash_emailaddr, crash_component);
-
- p.renderText(usable_area, text, gPainter::RT_WRAP|gPainter::RT_HALIGN_LEFT);
-
- usable_area = eRect(100, 170, my_dc->size().width() - 180, my_dc->size().height() - 20);
+ ePtr<gMainDC> my_dc;
+ gMainDC::getInstance(my_dc);
- int i;
+ gPainter p(my_dc);
+ p.resetOffset();
+ p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
+ p.setBackgroundColor(gRGB(0x008000));
+ p.setForegroundColor(gRGB(0xFFFFFF));
+
+ ePtr<gFont> font = new gFont("Regular", 20);
+ p.setFont(font);
+ p.clear();
+
+ eRect usable_area = eRect(100, 70, my_dc->size().width() - 150, 100);
- size_t start = std::string::npos + 1;
- for (i=0; i<20; ++i)
+ std::string text("We are really sorry. Your Dreambox encountered "
+ "a software problem, and needs to be restarted. "
+ "Please send the logfile created in /hdd/ to " + crash_emailaddr + ".\n"
+ "Your Dreambox restarts in 10 seconds!\n"
+ "Component: " + crash_component);
+
+ p.renderText(usable_area, text.c_str(), gPainter::RT_WRAP|gPainter::RT_HALIGN_LEFT);
+
+ usable_area = eRect(100, 170, my_dc->size().width() - 180, my_dc->size().height() - 20);
+
+ int i;
+
+ start = std::string::npos + 1;
+ for (i=0; i<20; ++i)
+ {
+ start = lines.rfind('\n', start - 1);
+ if (start == std::string::npos)
{
- start = lines.rfind('\n', start - 1);
- if (start == std::string::npos)
- {
- start = 0;
- break;
- }
+ start = 0;
+ break;
}
-
- font = new gFont("Regular", 14);
- p.setFont(font);
-
- p.renderText(usable_area,
- lines.substr(start), gPainter::RT_HALIGN_LEFT);
- sleep(10);
}
+ font = new gFont("Regular", 14);
+ p.setFont(font);
+
+ p.renderText(usable_area,
+ lines.substr(start), gPainter::RT_HALIGN_LEFT);
+ sleep(10);
+
- raise(SIGKILL);
+ /*
+ * When 'component' is NULL, we are called because of a python exception.
+ * In that case, we'd prefer to to a clean shutdown of the C++ objects,
+ * and this should be safe, because the crash did not occur in the
+ * C++ part.
+ * However, when we got here for some other reason, a segfault probably,
+ * we prefer to stop immediately instead of performing a clean shutdown.
+ * We'd risk destroying things with every additional instruction we're
+ * executing here.
+ */
+ if (component) raise(SIGKILL);
}
#if defined(__MIPSEL__)
config.misc.epgcache_filename = ConfigText(default = "/hdd/epg.dat")
def setEPGCachePath(configElement):
- eEPGCache.getInstance().setCacheFile(configElement.value)
-
+ enigma.eEPGCache.getInstance().setCacheFile(configElement.value)
- config.misc.epgcache_filename.addNotifier(setEPGCachePath)
#demo code for use of standby enter leave callbacks
#def leaveStandby():
- DOMAIN=enigma2
- #GETTEXT=./pygettext.py
- GETTEXT=xgettext
+ dist_noinst_SCRIPTS = xml2po.py
- #MSGFMT = ./msgfmt.py
- MSGFMT = msgfmt
+ LANGS = ar ca cs da de el en es et fi fr fy hr hu is it lt lv nl no pl pt ru sv sk sl sr tr uk
+ LANGMO = $(LANGS:=.mo)
+ LANGPO = $(LANGS:=.po)
- LANGS = $(shell cat $(srcdir)/LINGUAS)
- LANGPO = $(foreach LANG, $(LANGS),$(LANG).po)
- LANGMO = $(foreach LANG, $(LANGS),$(LANG).mo)
+ EXTRA_DIST = $(LANGPO)
- default: enigma2.pot $(LANGMO)
- for lang in $(LANGS); do \
- mkdir -p $$lang/LC_MESSAGES; \
- cp $$lang.mo $$lang/LC_MESSAGES/enigma2.mo; \
- done
-
- rebuild: clean cleanall enigma2.pot $(LANGPO) merge default
+ if UPDATE_PO
+ # the TRANSLATORS: allows putting translation comments before the to-be-translated line.
+ enigma2-py.pot: $(top_srcdir)/*.py $(top_srcdir)/lib/python/*/*.py $(top_srcdir)/lib/python/Plugins/*/*/*.py
+ $(XGETTEXT) -L Python --from-code=UTF-8 --add-comments="TRANSLATORS:" -d @PACKAGE_NAME@ -s -o $@ $^
- merge:
- for lang in $(LANGS); do \
- msgmerge --no-location -s -N -U $$lang.po enigma2.pot; \
- done
+ enigma2-xml.pot: $(srcdir)/xml2po.py $(top_srcdir)/data/*.xml $(top_srcdir)/lib/python/Plugins/SystemPlugins/*/*.xml
+ $(PYTHON) $^ > $@
+ enigma2.pot: enigma2-py.pot enigma2-xml.pot
+ cat $^ | $(MSGUNIQ) --no-location -o $@ -
- # the TRANSLATORS: allows putting translation comments before the to-be-translated line.
- enigma2.pot:
- $(GETTEXT) -L python --add-comments="TRANSLATORS:" -d enigma2 -s -o enigma2.pot ../lib/python/Screens/*.py ../lib/python/Components/*.py \
- ../lib/python/Components/*/*.py \
- ../lib/python/Tools/*.py \
- ../*.py \
- ../lib/python/Plugins/*/*/*.py
-
- ./xml2po.py ../data/ >> enigma2.pot
- ./xml2po.py ../lib/python/Plugins/SystemPlugins/Videomode/ >> enigma2.pot
- ./xml2po.py ../lib/python/Plugins/SystemPlugins/SoftwareManager/ >> enigma2.pot
- ./xml2po.py ../lib/python/Plugins/SystemPlugins/CleanupWizard/ >> enigma2.pot
- ./xml2po.py ../lib/python/Plugins/SystemPlugins/NetworkWizard/ >> enigma2.pot
- msguniq --no-location -o enigma2uniq.pot enigma2.pot
- $(RM) enigma2.pot
- mv enigma2uniq.pot enigma2.pot
+ %.po: enigma2.pot
+ if [ -f $@ ]; then \
+ $(MSGMERGE) --backup=none --no-location -s -N -U $@ $< && touch $@; \
+ else \
+ $(MSGINIT) -l $@ -o $@ -i $< --no-translator; \
+ fi
+ endif
- %.mo: %.po
+ .po.mo:
+ if [ -f pli_$< ] ; then \
+ mv $< dmm_$< ; \
+ msgcat --use-first -o $< pli_$< dmm_$< ; \
+ fi
$(MSGFMT) -o $@ $<
- %.po:
- msginit -l $@ -o $@ -i enigma2.pot --no-translator
-
- CLEANFILES = $(foreach LANG, $(LANGS),$(LANG).mo)
+ BUILT_SOURCES = $(LANGMO)
+ CLEANFILES = $(LANGMO) enigma2-py.pot enigma2-xml.pot enigma2.pot
- cleanall:
- $(RM) enigma2.pot
+ dist-hook: $(LANGPO)
- clean-local:
- $(RM) -r $(LANGS)
+ install-data-local: $(LANGMO)
+ for lang in $(LANGS); do \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES; \
+ $(INSTALL_DATA) $$lang.mo $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES/@PACKAGE_NAME@.mo; \
+ done
- install-data-am: default
+ uninstall-local:
for lang in $(LANGS); do \
- mkdir -p $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES; \
- cp $$lang.mo $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
+ $(RM) $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES/@PACKAGE_NAME@.mo; \
done