diff --git a/acinclude.m4 b/acinclude.m4 index a411475ba..4f029d06a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -58,11 +58,10 @@ elif test "$TARGET" = "cdk"; then AC_MSG_RESULT(cdk) if test "$CC" = "" -a "$CXX" = ""; then - CC=powerpc-tuxbox-linux-gnu-gcc CXX=powerpc-tuxbox-linux-gnu-g++ + AC_MSG_ERROR([you need to specify variables CC or CXX in cdk]) fi - if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then - CFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS" - CXXFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS" + if test "$CFLAGS" = "" -o "$CXXFLAGS" = ""; then + AC_MSG_ERROR([you need to specify variables CFLAGS and CXXFLAGS in cdk]) fi if test "$prefix" = "NONE"; then AC_MSG_ERROR([invalid prefix, you need to specify one in cdk mode]) @@ -74,10 +73,6 @@ elif test "$TARGET" = "cdk"; then AC_MSG_ERROR([invalid targetprefix, you need to specify one in cdk mode]) TARGET_PREFIX="" fi - if test "$host_alias" = ""; then - cross_compiling=yes - host_alias=powerpc-tuxbox-linux-gnu - fi else AC_MSG_RESULT(none) AC_MSG_ERROR([invalid target $TARGET, choose on from native,cdk]); @@ -228,79 +223,6 @@ AC_SUBST(PUBLIC_HTTPDDIR) AC_SUBST(HOSTED_HTTPDDIR) dnl end workaround -AC_DEFUN([TUXBOX_APPS_ENDIAN],[ -AC_CHECK_HEADERS(endian.h) -AC_C_BIGENDIAN -]) - -AC_DEFUN([TUXBOX_APPS_DRIVER],[ -AC_ARG_WITH(driver, - [ --with-driver=PATH path for driver sources [[NONE]]], - [DRIVER="$withval"],[DRIVER=""]) - -if test -d "$DRIVER/include"; then - AC_DEFINE(HAVE_DBOX2_DRIVER,1,[Define to 1 if you have the dbox2 driver sources]) -else - AC_MSG_ERROR([can't find driver sources]) -fi - -AC_SUBST(DRIVER) - -CPPFLAGS="$CPPFLAGS -I$DRIVER/include" -]) - -AC_DEFUN([TUXBOX_APPS_DVB],[ -AC_ARG_WITH(dvbincludes, - [ --with-dvbincludes=PATH path for dvb includes [[NONE]]], - [DVBINCLUDES="$withval"],[DVBINCLUDES=""]) - -if test "$DVBINCLUDES"; then - CPPFLAGS="-I$DVBINCLUDES $CPPFLAGS" - CFLAGS="-I$DVBINCLUDES $CFLAGS" - CXXFLAGS="-I$DVBINCLUDES $CXXFLAGS" -fi - -AC_CHECK_HEADERS(linux/dvb/version.h,[ - AC_LANG_PREPROC_REQUIRE() - AC_REQUIRE([AC_PROG_EGREP]) - AC_LANG_CONFTEST([AC_LANG_SOURCE([[ -#include -version DVB_API_VERSION - ]])]) - DVB_API_VERSION=`(eval "$ac_cpp -traditional-cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"` - - AC_LANG_CONFTEST([AC_LANG_SOURCE([[ -#include -version DVB_API_VERSION_MINOR - ]])]) - DVB_API_VERSION_MINOR=`(eval "$ac_cpp -traditional-cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"` - rm -f conftest* - - AC_MSG_NOTICE([found dvb version $DVB_API_VERSION.$DVB_API_VERSION_MINOR]) -]) - -if test "$DVB_API_VERSION"; then - AC_DEFINE(HAVE_DVB,1,[Define to 1 if you have the dvb includes]) - AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION,$DVB_API_VERSION,[Define to the version of the dvb api]) -else - AC_MSG_ERROR([can't find dvb headers]) -fi - -if test "$DVB_API_VERSION_MINOR"; then - AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION_MINOR,$DVB_API_VERSION_MINOR,[Define to the minor version of the dvb api]) -else - AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION_MINOR,0,[Define to the minor version of the dvb api]) -fi -]) - -AC_DEFUN([TUXBOX_APPS_CAPTURE],[ -AC_CHECK_HEADER(linux/dvb/avia/avia_gt_capture.h,[ - AC_DEFINE(HAVE_OLD_CAPTURE_API,1,[Define this if you want to use the old dbox2 capture API]) - AC_MSG_NOTICE([using old demux capture API])],[ - AC_MSG_NOTICE([using v4l2 capture API]) - ]) -]) - AC_DEFUN([_TUXBOX_APPS_LIB_CONFIG],[ AC_PATH_PROG($1_CONFIG,$2,no) if test "$$1_CONFIG" != "no"; then @@ -376,128 +298,20 @@ AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG_CHECK],[ _TUXBOX_APPS_LIB_PKGCONFIG($1,$2) ]) -AC_DEFUN([_TUXBOX_APPS_LIB_SYMBOL],[ -AC_CHECK_LIB($2,$3,HAVE_$1="yes",HAVE_$1="no") -if test "$HAVE_$1" = "yes"; then - $1_LIBS=-l$2 -fi - -AC_SUBST($1_LIBS) -]) - -AC_DEFUN([TUXBOX_APPS_LIB_SYMBOL],[ -_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,ERROR) -if test "$HAVE_$1" = "no"; then - AC_MSG_ERROR([could not find $2]); -fi -]) - -AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_SYMBOL],[ -_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,WARN) -]) - -AC_DEFUN([TUXBOX_APPS_GETTEXT],[ -AC_PATH_PROG(MSGFMT, msgfmt, no) -AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) -AC_PATH_PROG(XGETTEXT, xgettext, no) -AC_PATH_PROG(MSGMERGE, msgmerge, no) - -AC_MSG_CHECKING([whether NLS is requested]) -AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) -AC_MSG_RESULT($USE_NLS) -AC_SUBST(USE_NLS) - -if test "$USE_NLS" = "yes"; then - AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,[ - AC_TRY_LINK([ - #include - #ifndef __GNU_GETTEXT_SUPPORTED_REVISION - #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) - #endif - extern int _nl_msg_cat_cntr; - extern int *_nl_domain_bindings; - ],[ - bindtextdomain ("", ""); - return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings; - ], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no - )] - ) - - if test "$gt_cv_func_gnugettext_libc" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) - gt_use_preinstalled_gnugettext=yes - else - USE_NLS=no - fi -fi - -if test -f "$srcdir/po/LINGUAS"; then - ALL_LINGUAS=$(sed -e "/^#/d" "$srcdir/po/LINGUAS") -fi - -POFILES= -GMOFILES= -UPDATEPOFILES= -DUMMYPOFILES= -for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" -done -INST_LINGUAS= -if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test -n "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done -fi -CATALOGS= -if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done -fi -AC_SUBST(POFILES) -AC_SUBST(GMOFILES) -AC_SUBST(UPDATEPOFILES) -AC_SUBST(DUMMYPOFILES) -AC_SUBST(CATALOGS) -]) - AC_DEFUN([TUXBOX_BOXTYPE],[ AC_ARG_WITH(boxtype, - [ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,spark,azbox,generic], + [ --with-boxtype valid values: tripledragon,coolstream,spark,azbox,generic], [case "${withval}" in - dbox2|dreambox|ipbox|tripledragon|coolstream|spark|azbox|generic) + tripledragon|coolstream|spark|azbox|generic) BOXTYPE="$withval" ;; - dm*) - BOXTYPE="dreambox" - BOXMODEL="$withval" - ;; *) AC_MSG_ERROR([bad value $withval for --with-boxtype]) ;; esac], [BOXTYPE="coolstream"]) AC_ARG_WITH(boxmodel, [ --with-boxmodel valid for coolstream: hd1, hd2 - valid for dreambox: dm500, dm500plus, dm600pvr, dm56x0, dm7000, dm7020, dm7025 - valid for ipbox: ip200, ip250, ip350, ip400], + valid for generic: raspi], [case "${withval}" in hd1|hd2) if test "$BOXTYPE" = "coolstream"; then @@ -518,15 +332,8 @@ AC_ARG_WITH(boxmodel, AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE]) fi ;; - dm500|dm500plus|dm600pvr|dm56x0|dm7000|dm7020|dm7025) - if test "$BOXTYPE" = "dreambox"; then - BOXMODEL="$withval" - else - AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE]) - fi - ;; - ip200|ip250|ip350|ip400) - if test "$BOXTYPE" = "ipbox"; then + raspi) + if test "$BOXTYPE" = "generic"; then BOXMODEL="$withval" else AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE]) @@ -543,18 +350,13 @@ AC_ARG_WITH(boxmodel, AC_MSG_ERROR([unsupported value $withval for --with-boxmodel]) ;; esac], [test "$BOXTYPE" = "coolstream" && BOXMODEL="hd1" || true] - [if test "$BOXTYPE" = "dreambox" -o "$BOXTYPE" = "ipbox" && test -z "$BOXMODEL"; then - AC_MSG_ERROR([Dreambox/IPBox needs --with-boxmodel]) - fi]) + ) 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") -AM_CONDITIONAL(BOXTYPE_IPBOX, test "$BOXTYPE" = "ipbox") AM_CONDITIONAL(BOXTYPE_COOL, test "$BOXTYPE" = "coolstream") AM_CONDITIONAL(BOXTYPE_SPARK, test "$BOXTYPE" = "spark") AM_CONDITIONAL(BOXTYPE_GENERIC, test "$BOXTYPE" = "generic") @@ -562,29 +364,12 @@ AM_CONDITIONAL(BOXTYPE_GENERIC, test "$BOXTYPE" = "generic") AM_CONDITIONAL(BOXMODEL_CS_HD1,test "$BOXMODEL" = "hd1") AM_CONDITIONAL(BOXMODEL_CS_HD2,test "$BOXMODEL" = "hd2") -AM_CONDITIONAL(BOXMODEL_DM500,test "$BOXMODEL" = "dm500") -AM_CONDITIONAL(BOXMODEL_DM500PLUS,test "$BOXMODEL" = "dm500plus") -AM_CONDITIONAL(BOXMODEL_DM600PVR,test "$BOXMODEL" = "dm600pvr") -AM_CONDITIONAL(BOXMODEL_DM56x0,test "$BOXMODEL" = "dm56x0") -AM_CONDITIONAL(BOXMODEL_DM7000,test "$BOXMODEL" = "dm7000" -o "$BOXMODEL" = "dm7020" -o "$BOXMODEL" = "dm7025") - -AM_CONDITIONAL(BOXMODEL_IP200,test "$BOXMODEL" = "ip200") -AM_CONDITIONAL(BOXMODEL_IP250,test "$BOXMODEL" = "ip250") -AM_CONDITIONAL(BOXMODEL_IP350,test "$BOXMODEL" = "ip350") -AM_CONDITIONAL(BOXMODEL_IP400,test "$BOXMODEL" = "ip400") - AM_CONDITIONAL(BOXMODEL_RASPI,test "$BOXMODEL" = "raspi") -if test "$BOXTYPE" = "dbox2"; then - AC_DEFINE(HAVE_DBOX_HARDWARE, 1, [building for a dbox2]) -elif test "$BOXTYPE" = "azbox"; then +if 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 - AC_DEFINE(HAVE_DREAMBOX_HARDWARE, 1, [building for a dreambox]) -elif test "$BOXTYPE" = "ipbox"; then - AC_DEFINE(HAVE_IPBOX_HARDWARE, 1, [building for an ipbox]) elif test "$BOXTYPE" = "coolstream"; then AC_DEFINE(HAVE_COOL_HARDWARE, 1, [building for a coolstream]) elif test "$BOXTYPE" = "spark"; then @@ -597,18 +382,8 @@ fi if test "$BOXMODEL" = "hd1"; then AC_DEFINE(BOXMODEL_CS_HD1, 1, [coolstream hd1/neo/neo2/zee]) elif test "$BOXMODEL" = "hd2"; then - AC_DEFINE(BOXMODEL_CS_HD2, 1, [coolstream tank/trinity/trinity v2/trinity duo/zeeČ/link]) + AC_DEFINE(BOXMODEL_CS_HD2, 1, [coolstream tank/trinity/trinity v2/trinity duo/zee2/link]) AC_DEFINE(ENABLE_CHANGE_OSD_RESOLUTION,1,[enable change the osd resolution]) -elif test "$BOXMODEL" = "dm500"; then - AC_DEFINE(BOXMODEL_DM500, 1, [dreambox 500]) -elif test "$BOXMODEL" = "ip200"; then - AC_DEFINE(BOXMODEL_IP200, 1, [ipbox 200]) -elif test "$BOXMODEL" = "ip250"; then - AC_DEFINE(BOXMODEL_IP250, 1, [ipbox 250]) -elif test "$BOXMODEL" = "ip350"; then - AC_DEFINE(BOXMODEL_IP350, 1, [ipbox 350]) -elif test "$BOXMODEL" = "ip400"; then - AC_DEFINE(BOXMODEL_IP400, 1, [ipbox 400]) elif test "$BOXMODEL" = "raspi"; then AC_DEFINE(BOXMODEL_RASPI, 1, [Raspberry pi]) fi @@ -635,4 +410,3 @@ AC_DEFUN([AC_PROG_EGREP], EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ]) - diff --git a/configure.ac b/configure.ac index 9ea124d84..79a8cf0ea 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,6 @@ AM_INIT_AUTOMAKE([1.0.1 nostdinc]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) TUXBOX_APPS -TUXBOX_APPS_DVB TUXBOX_APPS_DIRECTORY TUXBOX_APPS_PKGCONFIG TUXBOX_BOXTYPE diff --git a/data/cables.xml b/data/cables.xml index 4970d600c..e05516a44 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -442,10 +442,10 @@ - - + + @@ -456,15 +456,21 @@ + + - - - - - + + + + + + + + + @@ -473,6 +479,11 @@ + + + + + diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index 1051c99c0..9a4e77259 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -47,6 +47,9 @@ enum CS_LOG_MODULE { void cs_api_init(void); void cs_api_exit(void); +/* Dummy for compatibility with HD2 */ +#define cs_new_auto_videosystem(); + // Memory helpers void *cs_malloc_uncached(size_t size); void cs_free_uncached(void *ptr); diff --git a/lib/hardware/coolstream/hd1/libcoolstream/helpers_cs.h b/lib/hardware/coolstream/hd1/libcoolstream/helpers_cs.h new file mode 100644 index 000000000..8e7ea0b93 --- /dev/null +++ b/lib/hardware/coolstream/hd1/libcoolstream/helpers_cs.h @@ -0,0 +1,16 @@ +#ifndef __HELPERS_CS_H__ +#define __HELPERS_CS_H__ + +enum { + CS_EXTRA_DEBUG_OFF = 0x00000000, + CS_EXTRA_DEBUG_VIDEO1 = 0x00000001, + CS_EXTRA_DEBUG_ALL = 0xFFFFFFFF +}; + +void cs_set_extra_debug(uint32_t mode); + +const char* __func_ext__f(const char* _func_, int _line_, const char* _file_, bool havePathFile); +#define __func_ext__ __func_ext__f(__PRETTY_FUNCTION__, __LINE__, NULL, true) +#define __func_ext_file__ __func_ext__f(__PRETTY_FUNCTION__, __LINE__, __path_file__, true) + +#endif // __HELPERS_CS_H__ diff --git a/lib/hardware/coolstream/hd1/libcoolstream/video_cs.h b/lib/hardware/coolstream/hd1/libcoolstream/video_cs.h index 47524c1b6..b29677e83 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/video_cs.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/video_cs.h @@ -9,9 +9,11 @@ #ifndef __VIDEO_CS_H_ #define __VIDEO_CS_H_ +#include #include #include #include +#include #include "cs_types.h" @@ -123,6 +125,18 @@ typedef enum VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS } VIDEO_CONTROL; +typedef struct cs_vs_format_t +{ + char format[16]; +} cs_vs_format_struct_t; + +enum { + CS_FBCOPY_BB2FB = 0, + CS_FBCOPY_FB2FB = 1, + CS_FBCOPY_MEM2FB = 2, + CS_FBCOPY_FB2MEM = 3 +}; + class cVideo { private: CS_VIDEO_PDATA *privateData; @@ -155,6 +169,11 @@ private: vfd_icon mode_icon; unsigned int unit; cDemux *demux; + int current_video_system; + bool isReadScreeninfo; + fb_var_screeninfo varScreeninfo; + fb_fix_screeninfo fixScreeninfo; + // int SelectAutoFormat(); void ScalePic(); @@ -163,6 +182,9 @@ public: cVideo(int mode, void * hChannel, void * hBuffer, unsigned int Unit = 0); ~cVideo(void); + /* Important! + Call this function when osd resolution has been changed */ + void updateOsdScreenInfo(); void * GetDRM(void); void * GetTVEnc(); void * GetTVEncSD(); @@ -207,6 +229,11 @@ public: int64_t GetPTS(void); int Flush(void); + /* get video system infos */ + int GetVideoSystem(); + /* when system = -1 then use current video system */ + void GetVideoSystemFormatName(cs_vs_format_t* format, int system = -1); + /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); @@ -234,6 +261,8 @@ public: int StartVBI(unsigned short pid); int StopVBI(void); bool GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false); + int fbCopy(uint32_t *mem_p, int width, int height, int dst_x, int dst_y, int src_x, int src_y, int mode); + int fbFill(int sx, int sy, int width, int height, fb_pixel_t col, int mode=0); void SetDemux(cDemux *Demux); }; diff --git a/lib/hardware/coolstream/hd2/libcoolstream/helpers_cs.h b/lib/hardware/coolstream/hd2/libcoolstream/helpers_cs.h new file mode 100644 index 000000000..8e7ea0b93 --- /dev/null +++ b/lib/hardware/coolstream/hd2/libcoolstream/helpers_cs.h @@ -0,0 +1,16 @@ +#ifndef __HELPERS_CS_H__ +#define __HELPERS_CS_H__ + +enum { + CS_EXTRA_DEBUG_OFF = 0x00000000, + CS_EXTRA_DEBUG_VIDEO1 = 0x00000001, + CS_EXTRA_DEBUG_ALL = 0xFFFFFFFF +}; + +void cs_set_extra_debug(uint32_t mode); + +const char* __func_ext__f(const char* _func_, int _line_, const char* _file_, bool havePathFile); +#define __func_ext__ __func_ext__f(__PRETTY_FUNCTION__, __LINE__, NULL, true) +#define __func_ext_file__ __func_ext__f(__PRETTY_FUNCTION__, __LINE__, __path_file__, true) + +#endif // __HELPERS_CS_H__ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h index 71f4e6db5..515d4ad3f 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h @@ -9,6 +9,7 @@ #ifndef __VIDEO_CS_H_ #define __VIDEO_CS_H_ +#include #include #include @@ -158,6 +159,13 @@ typedef struct cs_vs_format_t char formatSD[16]; } cs_vs_format_struct_t; +enum { + CS_FBCOPY_BB2FB = 0, + CS_FBCOPY_FB2FB = 1, + CS_FBCOPY_MEM2FB = 2, + CS_FBCOPY_FB2MEM = 3 +}; + class cDemux; class cAudio; @@ -206,6 +214,10 @@ public: cVideo(int mode, void * hChannel, void * hBuffer); ~cVideo(void); + /* Important! + Call this function when osd resolution has been changed */ + void updateOsdScreenInfo(); + void * GetVPP(void); void * GetTVEnc(); void * GetTVEncSD(); @@ -282,6 +294,8 @@ public: int StartVBI(unsigned short pid); int StopVBI(void); bool GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false); + int fbCopy(uint32_t *mem_p, int width, int height, int dst_x, int dst_y, int src_x, int src_y, int mode); + int fbFill(int sx, int sy, int width, int height, fb_pixel_t col, int mode=0); void SetDemux(cDemux *Demux); static cVideo *GetDecoder(unsigned int Unit); bool SyncSTC(void); diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 0c4234b8e..07ff23c09 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -234,29 +234,35 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int if (osd_resolutions.empty()) setOsdResolutions(); - if (fullHdAvailable()) { - screeninfo.xres=nxRes; - screeninfo.yres=nyRes; - screeninfo.xres_virtual=nxRes; - screeninfo.yres_virtual=nyRes*2; - screeninfo.height=0; - screeninfo.width=0; - screeninfo.xoffset=screeninfo.yoffset=0; - screeninfo.bits_per_pixel=nbpp; + unsigned int nxRes_ = nxRes; + unsigned int nyRes_ = nyRes; + unsigned int nbpp_ = nbpp; + if (!fullHdAvailable()) { + nxRes_ = 1280; + nyRes_ = 720; + nbpp_ = 32; + } + screeninfo.xres=nxRes_; + screeninfo.yres=nyRes_; + screeninfo.xres_virtual=nxRes_; + screeninfo.yres_virtual=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(LOGTAG "FBIOPUT_VSCREENINFO"); + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) + perror(LOGTAG "FBIOPUT_VSCREENINFO"); - printf(LOGTAG "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 ((screeninfo.xres != nxRes) || - (screeninfo.yres != nyRes) || - (screeninfo.bits_per_pixel != nbpp)) { - printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", - nxRes, nyRes, nbpp, - screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); - return -1; - } + printf(LOGTAG "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 ((screeninfo.xres != nxRes_) || + (screeninfo.yres != nyRes_) || + (screeninfo.bits_per_pixel != nbpp_)) { + printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", + nxRes_, nyRes_, nbpp_, + screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); + return -1; } fb_fix_screeninfo _fix; @@ -337,8 +343,10 @@ int CFbAccelCSHD2::scale2Res(int size) bool CFbAccelCSHD2::fullHdAvailable() { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */ return true; +#endif return false; } diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 477c6fb99..97d94ff75 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -170,7 +170,8 @@ bool CPictureViewer::DecodeImage (const std::string & _name, bool showBusySign, m_NextPic_Buffer = NULL; } size_t bufsize = x * y * 3; - if (!checkfreemem(bufsize)){ + size_t resizeBuf = (m_endx - m_startx) * (m_endy - m_starty)*3; + if (!checkfreemem(bufsize + resizeBuf)){ return false; } m_NextPic_Buffer = (unsigned char *) malloc (bufsize); @@ -885,8 +886,8 @@ bool CPictureViewer::checkfreemem(size_t bufsize) { struct sysinfo info; sysinfo( &info ); - if(bufsize*2 + 4096 > (size_t)info.freeram + (size_t)info.freeswap){ - dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory\n", __func__, __LINE__); + if(bufsize + 4096 > (size_t)info.freeram + (size_t)info.freeswap){ + dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory: need %zu > free %zu\n", __func__, __LINE__,bufsize,(size_t)info.freeram + (size_t)info.freeswap); return false; } return true; diff --git a/src/gui/lcd4l.cpp b/src/gui/lcd4l.cpp index 209cb505d..652049f2e 100644 --- a/src/gui/lcd4l.cpp +++ b/src/gui/lcd4l.cpp @@ -615,6 +615,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) Logo = ICONSDIR "/" NEUTRINO_ICON_MOVIEPLAYER ICONSEXT; } } + else if (parseID == MODE_UPNP) + { + Service = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD); + } else if (parseID == MODE_STANDBY) { Service = "STANDBY"; @@ -722,8 +726,14 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (m_ModeChannel) { + t_channel_id channel_id = parseID & 0xFFFFFFFFFFFFULL; + + CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); + if (channel) + channel_id = channel->getEpgID(); + CSectionsdClient::CurrentNextInfo CurrentNext; - CEitManager::getInstance()->getCurrentNextServiceKey(parseID & 0xFFFFFFFFFFFFULL, CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(channel_id, CurrentNext); if (CSectionsdClient::epgflags::has_current) { @@ -792,10 +802,12 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); } - //else if (parseID == MODE_PIC) - //{ +#if 0 + else if (parseID == MODE_PIC) + { // TODO: Event = Bildname - //} + } +#endif else if (parseID == MODE_TS) { if (CMoviePlayerGui::getInstance().p_movie_info) @@ -803,8 +815,8 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (!CMoviePlayerGui::getInstance().p_movie_info->epgTitle.empty()) Event = CMoviePlayerGui::getInstance().p_movie_info->epgTitle; } - else if (!CMoviePlayerGui::getInstance().pretty_name.empty()) - Event = CMoviePlayerGui::getInstance().pretty_name; + else if (!CMoviePlayerGui::getInstance().GetFile().empty()) + Event = CMoviePlayerGui::getInstance().GetFile(); if (Event.empty()) Event = "MOVIE"; @@ -829,7 +841,12 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) snprintf(End, sizeof(End), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); } - +#if 0 + else if (parseID == MODE_UPNP) + { + // TODO? + } +#endif /* ----------------------------------------------------------------- */ Event += "\n"; // make sure we have at least two lines in event-file @@ -907,7 +924,7 @@ uint64_t CLCD4l::GetParseID() m_Mode = (int) ID; m_ModeChannel = 0; - if (ID == MODE_TV || ID == MODE_RADIO) + if (ID == MODE_TV || ID == MODE_WEBTV || ID == MODE_RADIO) { if (!(g_RemoteControl->subChannels.empty()) && (g_RemoteControl->selected_subchannel > 0)) m_ModeChannel = 2; diff --git a/src/gui/lcd4l.h b/src/gui/lcd4l.h index 73ab62dfa..9708cbf14 100644 --- a/src/gui/lcd4l.h +++ b/src/gui/lcd4l.h @@ -62,6 +62,8 @@ class CLCD4l MODE_PIC = 6, MODE_TS = 7, MODE_OFF = 8, + MODE_WEBTV = 9, + MODE_UPNP = 10, MODE_MASK = 0xFF, NOREZAP = 0x100 }; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 6820ed677..67f1b4991 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -157,6 +158,8 @@ void CMoviePlayerGui::Init(void) { playing = false; stopped = true; + currentVideoSystem = -1; + currentOsdResolution = 0; frameBuffer = CFrameBuffer::getInstance(); @@ -242,6 +245,12 @@ void CMoviePlayerGui::cutNeutrino() if (playing) return; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + COsdHelpers *coh = COsdHelpers::getInstance(); + currentVideoSystem = coh->getVideoSystem(); + currentOsdResolution = coh->getOsdResolution(); +#endif + playing = true; /* set g_InfoViewer update timer to 1 sec, should be reset to default from restoreNeutrino->set neutrino mode */ if (!isWebTV) @@ -277,6 +286,17 @@ void CMoviePlayerGui::restoreNeutrino() if (!playing) return; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + if ((currentVideoSystem > -1) && (g_settings.video_Mode == VIDEO_STD_AUTO)) { + COsdHelpers *coh = COsdHelpers::getInstance(); + if (currentVideoSystem != coh->getVideoSystem()) { + coh->setVideoSystem(currentVideoSystem, false); + coh->changeOsdResolution(currentOsdResolution, false, true); + } + currentVideoSystem = -1; + } +#endif + playing = false; #ifdef HAVE_AZBOX_HARDWARE g_Zapit->setStandby(false); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 8ed81ff41..098d723bd 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -102,7 +102,7 @@ class CMoviePlayerGui : public CMenuTarget int m_LastMode; //NI std::string file_name; -//NI std::string pretty_name; + std::string pretty_name; std::string cookie_header; std::string info_1, info_2; std::string currentaudioname; @@ -118,6 +118,8 @@ class CMoviePlayerGui : public CMenuTarget int startposition; int position; int duration; + int currentVideoSystem; + uint32_t currentOsdResolution; unsigned short numpida; unsigned short vpid; @@ -269,7 +271,6 @@ class CMoviePlayerGui : public CMenuTarget //NI MI_MOVIE_INFO * p_movie_info; std::string file_name; - std::string pretty_name; int getState() { return playstate; }; }; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 432b58e9d..30160ed64 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -95,6 +95,8 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I height = 0; actObserv = NULL; parent_widget = NULL; + + lcd4l_text = ""; //NI lcd4l-support } void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) @@ -222,15 +224,19 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text CVFD::getInstance()->showMenuText(0, str, -1, true); //NI lcd4l-support if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", str, g_settings.lcd4l_convert); + lcd4l_text = str; } else { CVFD::getInstance()->showMenuText(0, left_text, -1, true); //NI lcd4l-support - if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", left_text, g_settings.lcd4l_convert); + if (g_settings.lcd4l_support) + lcd4l_text = left_text; } + + //NI lcd4l-support + if (g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", lcd4l_text, g_settings.lcd4l_convert); } //left text @@ -937,6 +943,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) case (CRCInput::RC_ok): { if(hasItem() && selected > -1 && (int)items.size() > selected) { + //NI lcd4l-support + LCD4l->RemoveFile("/tmp/lcd/menu"); + //exec this item... CMenuItem* item = items[selected]; if (!item->isSelectable()) @@ -944,6 +953,11 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) item->msg = msg; fader.StopFade(); int rv = item->exec( this ); + + //NI lcd4l-support + if (g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", item->lcd4l_text, g_settings.lcd4l_convert); + switch ( rv ) { case menu_return::RETURN_EXIT_ALL: retval = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index ff4f3e008..84ba02510 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -197,6 +197,9 @@ class CMenuItem : public CComponentsSignals void activateNotify(void); virtual void disableByCondition(const menu_item_disable_cond_t& condition); void setParentWidget(CMenuWidget* parent){parent_widget = parent;} + + //NI lcd4l-support + std::string lcd4l_text; }; class CMenuSeparator : public CMenuItem diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 17938247d..93f1534d3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2286,7 +2286,7 @@ int CNeutrinoApp::run(int argc, char **argv) TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); -#ifdef BOXMODEL_CS_HD2 +#if defined(HAVE_COOL_HARDWARE) && defined(ENABLE_CHANGE_OSD_RESOLUTION) cs_new_auto_videosystem(); #endif @@ -3239,16 +3239,11 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); COsdHelpers *coh = COsdHelpers::getInstance(); int videoSystem = (int)data; - if (coh->getVideoSystem() == videoSystem) - return messages_return::handled; - - if (!frameBufferInitialized) { + if (coh->getVideoSystem() != videoSystem) { coh->setVideoSystem(videoSystem, false); - return messages_return::handled; + if (frameBufferInitialized) + coh->changeOsdResolution(0, true, false); } - - coh->setVideoSystem(videoSystem, false); - coh->changeOsdResolution(0, true, false); return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {