diff --git a/acinclude.m4 b/acinclude.m4 index 645f07c54..372e37f4b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -389,9 +389,9 @@ AC_SUBST(CATALOGS) AC_DEFUN([TUXBOX_BOXTYPE],[ AC_ARG_WITH(boxtype, - [ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,generic], + [ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,spark,azbox,generic], [case "${withval}" in - dbox2|dreambox|ipbox|tripledragon|coolstream|spark|generic) + dbox2|dreambox|ipbox|tripledragon|coolstream|spark|azbox|generic) BOXTYPE="$withval" ;; dm*) @@ -431,6 +431,7 @@ AC_ARG_WITH(boxmodel, AC_SUBST(BOXTYPE) AC_SUBST(BOXMODEL) +AM_CONDITIONAL(BOXTYPE_AZBOX, test "$BOXTYPE" = "azbox") AM_CONDITIONAL(BOXTYPE_DBOX2, test "$BOXTYPE" = "dbox2") AM_CONDITIONAL(BOXTYPE_TRIPLE, test "$BOXTYPE" = "tripledragon") AM_CONDITIONAL(BOXTYPE_DREAMBOX, test "$BOXTYPE" = "dreambox") @@ -452,6 +453,8 @@ AM_CONDITIONAL(BOXMODEL_IP400,test "$BOXMODEL" = "ip400") if test "$BOXTYPE" = "dbox2"; then AC_DEFINE(HAVE_DBOX_HARDWARE, 1, [building for a dbox2]) +elif test "$BOXTYPE" = "azbox"; then + AC_DEFINE(HAVE_AZBOX_HARDWARE, 1, [building for an azbox]) elif test "$BOXTYPE" = "tripledragon"; then AC_DEFINE(HAVE_TRIPLEDRAGON, 1, [building for a tripledragon]) elif test "$BOXTYPE" = "dreambox"; then diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index 2b9924ac1..218232de2 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -12,6 +12,8 @@ * ported 2006 to Dreambox 7025 / 32Bit framebuffer * * by Seddi * * * + * * + * ported to Tripledragon, SPARK and AZbox 2010-2012 Stefan Seyfried * ******************************************************************************/ #define TUXTXT_CFG_STANDALONE 0 // 1:plugin only 0:use library @@ -33,7 +35,7 @@ #include #ifndef NEW_CST_KERNEL -#include +//#include #endif #include diff --git a/src/Makefile.am b/src/Makefile.am index 6ef8dee53..dccfc6bbd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -91,6 +91,7 @@ neutrino_LDADD = \ @LIBCS_LIBS@ \ @AVFORMAT_LIBS@ \ @AVUTIL_LIBS@ \ + @AVCODEC_LIBS@ \ $(FLACLIBS) \ $(VORBISLIBS) \ -lungif \ diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index d7587742c..b2584d5d3 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -59,6 +59,10 @@ if BOXTYPE_SPARK libneutrino_driver_a_SOURCES += \ spark_led.cpp endif +if BOXTYPE_AZBOX +libneutrino_driver_a_SOURCES += \ + spark_led.cpp +endif if USE_STB_HAL INCLUDES += \ -I$(STB_HAL_INC) \ diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 1f545fe29..05e03e500 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy + Copyright (C) 2007-2012 Stefan Seyfried License: GPL @@ -487,28 +488,52 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign if (!available&&!active) return -1; -#if 0 +#if HAVE_AZBOX_HARDWARE +#ifndef FBIO_BLIT +#define FBIO_SET_MANUAL_BLIT _IOW('F', 0x21, __u8) +#define FBIO_BLIT 0x22 +#endif + // set manual blit + unsigned char tmp = 1; + if (ioctl(fd, FBIO_SET_MANUAL_BLIT, &tmp)<0) + perror("FBIO_SET_MANUAL_BLIT"); + + const unsigned int nxRes = 1280; + const unsigned int nyRes = 720; + const unsigned int nbpp = 32; screeninfo.xres_virtual=screeninfo.xres=nxRes; - screeninfo.yres_virtual=screeninfo.yres=nyRes; + screeninfo.yres_virtual = (screeninfo.yres = nyRes) * 2; screeninfo.height=0; screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; screeninfo.bits_per_pixel=nbpp; - if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) { - perror("FBIOPUT_VSCREENINFO"); - } + screeninfo.transp.offset = 24; + screeninfo.transp.length = 8; + screeninfo.red.offset = 16; + screeninfo.red.length = 8; + screeninfo.green.offset = 8; + screeninfo.green.length = 8; + screeninfo.blue.offset = 0; + screeninfo.blue.length = 8; - if(1) { - printf("SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", - screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) { + // try single buffering + screeninfo.yres_virtual = screeninfo.yres = nyRes; + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo) < 0) + perror("FBIOPUT_VSCREENINFO"); + printf("FB: double buffering not available.\n"); } + else + printf("FB: double buffering available!\n"); + + ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo); + if ((screeninfo.xres!=nxRes) && (screeninfo.yres!=nyRes) && (screeninfo.bits_per_pixel!=nbpp)) { printf("SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", nxRes, nyRes, nbpp, screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); - return -1; } #endif @@ -533,9 +558,11 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign //memset(getFrameBufferPointer(), 0, stride * yRes); paintBackground(); +#if HAVE_COOL_HARDWARE if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) { printf("screen unblanking failed\n"); } +#endif return 0; } @@ -1917,6 +1944,25 @@ void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, in cs_free_uncached(fbbuff); } +#ifdef HAVE_AZBOX_HARDWARE +#ifndef FBIO_WAITFORVSYNC +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) +#endif + +void CFrameBuffer::blit() +{ + // blit + if (ioctl(fd, FBIO_BLIT) < 0) + perror("FBIO_BLIT"); +#if 0 + // sync bliter + int c = 0; + if( ioctl(fd, FBIO_WAITFORVSYNC, &c) < 0 ) + perror("FBIO_WAITFORVSYNC"); +#endif +} +#endif + void CFrameBuffer::paintMuteIcon(bool paint, int ax, int ay, int dx, int dy, bool paintFrame) { if(paint) { diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 1d3d5a7db..de5790fa6 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -4,6 +4,8 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2007-2012 Stefan Seyfried + License: GPL This program is free software; you can redistribute it and/or modify @@ -235,6 +237,9 @@ class CFrameBuffer #if HAVE_SPARK_HARDWARE void mark(int x, int y, int dx, int dy); void blit(void); +#elif HAVE_AZBOX_HARDWARE + void mark(int, int, int, int) {}; + void blit(void); #else void mark(int, int, int, int) {}; void blit(void) {}; diff --git a/src/driver/lcdd.h b/src/driver/lcdd.h index e701c2737..b131295f3 100644 --- a/src/driver/lcdd.h +++ b/src/driver/lcdd.h @@ -6,7 +6,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - + Copyright (C) 2008-2012 Stefan Seyfried License: GPL @@ -79,7 +79,7 @@ typedef enum #include #include -#ifndef HAVE_SPARK_HARDWARE +#ifdef HAVE_TRIPLEDRAGON #include @@ -117,7 +117,7 @@ class CLCD private: -#ifndef HAVE_SPARK_HARDWARE +#ifdef HAVE_TRIPLEDRAGON class FontsDef { public: diff --git a/src/global.h b/src/global.h index 16baa195a..f1c937db9 100644 --- a/src/global.h +++ b/src/global.h @@ -47,7 +47,7 @@ #include "driver/vfd.h" #include "driver/rfmod.h" #endif -#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE +#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE #include "driver/lcdd.h" #define CVFD CLCD #endif diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 1306ff63c..ac8a9f44e 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -10,6 +10,8 @@ Copyright (C) 2009 T. Graf 'dbt' Homepage: http://www.dbox2-tuning.net/ + Copyright (C) 2010-2012 Stefan Seyfried + License: GPL This program is free software; you can redistribute it and/or modify @@ -177,7 +179,7 @@ CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_O }; #endif -#if HAVE_SPARK_HARDWARE +#if HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_OPTION_COUNT] = { { VIDEO_STD_PAL, NONEXISTANT_LOCALE, "PAL" }, diff --git a/src/system/settings.h b/src/system/settings.h index c16f4411d..cf91819a6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -4,6 +4,8 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2007-2012 Stefan Seyfried + Kommentar: Diese GUI wurde von Grund auf neu programmiert und sollte nun vom @@ -49,6 +51,9 @@ #if HAVE_SPARK_HARDWARE #define VIDEOMENU_VIDEOMODE_OPTION_COUNT 9 #endif +#if HAVE_AZBOX_HARDWARE +#define VIDEOMENU_VIDEOMODE_OPTION_COUNT 9 +#endif struct SNeutrinoSettings { @@ -495,7 +500,7 @@ struct SNeutrinoSettings LCD_SHOW_VOLUME , LCD_AUTODIMM , LCD_DEEPSTANDBY_BRIGHTNESS, -#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE +#if HAVE_TRIPLEDRAGON || USE_STB_HAL LCD_EPGMODE , #endif LCD_SETTING_COUNT diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index c81bb2623..8513068be 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -4,6 +4,7 @@ * zapit - d-box2 linux project * * (C) 2001, 2002 by Philipp Leusmann + * (C) 2007-2012 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1792,6 +1793,32 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) videoDecoder->SetStreamType((VIDEO_FORMAT)thisChannel->type); // videoDecoder->SetSync(VIDEO_PLAY_MOTION); +#if HAVE_AZBOX_HARDWARE + if (have_audio) { + audioDemux->pesFilter(thisChannel->getAudioPid()); + } + /* select audio output and start audio */ + if (have_audio) { + SetAudioStreamType(thisChannel->getAudioChannel()->audioChannelType); + audioDemux->Start(); + audioDecoder->Start(); + } + if (have_video) { + videoDemux->pesFilter(thisChannel->getVideoPid()); + } + /* start video */ + if (have_video) { + videoDemux->Start(); + videoDecoder->Start(0, thisChannel->getPcrPid(), thisChannel->getVideoPid()); + } + if (have_pcr) { + pcrDemux->pesFilter(thisChannel->getPcrPid()); + } + if (have_pcr) { + printf("[zapit] starting PCR 0x%X\n", thisChannel->getPcrPid()); + pcrDemux->Start(); + } +#else if (have_pcr) { pcrDemux->pesFilter(thisChannel->getPcrPid()); } @@ -1829,6 +1856,7 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) #ifdef USE_VBI if(have_teletext) videoDecoder->StartVBI(thisChannel->getTeletextPid()); +#endif #endif playing = true; @@ -1850,9 +1878,15 @@ bool CZapit::StopPlayBack(bool send_pmt) if (playbackStopForced) return false; +#if HAVE_AZBOX_HARDWARE + pcrDemux->Stop(); + audioDemux->Stop(); + videoDemux->Stop(); +#else videoDemux->Stop(); audioDemux->Stop(); pcrDemux->Stop(); +#endif audioDecoder->Stop(); /* hack. if standby, dont blank video -> for paused timeshift */