From 9fecf3d4c5e4b52e47d29a9aee9a91cd55ceb1bd Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 27 Feb 2017 00:13:33 +0100 Subject: [PATCH 1/8] fb_generic: Add "#define SCALE2RES_DEFINED" to check... ...presence of 'CFrameBuffer::scale2Res()' - Revert this patch when pu/fb-setmode branch is merged to master Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1fea75f428d9d70b65d353e58feb31b359691182 Author: Michael Liebmann Date: 2017-02-27 (Mon, 27 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/fb_generic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 37c5a1572..810fcc063 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -278,6 +278,8 @@ class CFrameBuffer : public sigc::trackable virtual void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); +/* Remove this when pu/fb-setmode branch is merged to master */ +#define SCALE2RES_DEFINED virtual int scale2Res(int size) { return size; }; virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); From efd889897d124ad155189446c5824c0c569b2578 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 27 Feb 2017 00:20:49 +0100 Subject: [PATCH 2/8] CLuaInstance: Add script fumction 'scale2Res' - Set Lua api version to 1.69 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6166f4a6f44fd8e300bf0994839cf210e5915242 Author: Michael Liebmann Date: 2017-02-27 (Mon, 27 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/luainstance.cpp | 19 +++++++++++++++++++ src/gui/lua/luainstance.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 54fa105fa..6c8b8bc22 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 68 +#define LUA_API_VERSION_MINOR 69 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index e3ac5aa40..b3aaea15b 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -568,6 +568,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) { "saveScreen", CLuaInstance::saveScreen }, { "restoreScreen", CLuaInstance::restoreScreen }, { "deleteSavedScreen", CLuaInstance::deleteSavedScreen }, + { "scale2Res", CLuaInstance::scale2Res }, /* lua_misc.cpp @@ -1183,4 +1184,22 @@ int CLuaInstance::deleteSavedScreen(lua_State *L) return 0; } +int CLuaInstance::scale2Res(lua_State *L) +{ + CLuaData *W = CheckData(L, 1); + if (!W || !W->fbwin) return 0; + + int value, ret; + value = luaL_checkint(L, 2); + +/* Remove this when pu/fb-setmode branch is merged to master */ +#ifdef SCALE2RES_DEFINED + ret = CFrameBuffer::getInstance()->scale2Res(value); +#else + ret = value; +#endif + lua_pushinteger(L, ret); + return 1; +} + /* --------------------------------------------------------------- */ diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 69311a9b9..21ebb625b 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -73,6 +73,7 @@ public: static int saveScreen(lua_State *L); static int restoreScreen(lua_State *L); static int deleteSavedScreen(lua_State *L); + static int scale2Res(lua_State *L); private: lua_State* lua; From a7cdb2e0240ea749a0a8623cb94298ff2d21ffb5 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 20 Feb 2017 15:20:39 +0100 Subject: [PATCH 3/8] configure: --enable-libcoolstream-static --with-libcoolstream-static-dir= for path to static libcoolstream Example for neutrino.mk: N_CONFIG_OPTS += --enable-libcoolstream-static # path for static libcoolstream N_CONFIG_OPTS += --with-libcoolstream-static-dir="$(TARGETPREFIX)/lib" Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/544b8c76b31bd15a1e50a3579d53b03c478dda36 Author: Michael Liebmann Date: 2017-02-20 (Mon, 20 Feb 2017) Origin message was: ------------------ configure: --enable-libcoolstream-static --with-libcoolstream-static-dir= for path to static libcoolstream Example for neutrino.mk: N_CONFIG_OPTS += --enable-libcoolstream-static # path for static libcoolstream N_CONFIG_OPTS += --with-libcoolstream-static-dir="$(TARGETPREFIX)/lib" ------------------ This commit was generated by Migit --- acinclude.m4 | 8 ++++++++ configure.ac | 1 + src/Makefile.am | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index e5093e045..dc181f7e5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -21,6 +21,14 @@ if test "$DEBUG" = "yes"; then AC_DEFINE(DEBUG,1,[Enable debug messages]) fi +AC_ARG_WITH(libcoolstream-static-dir, + [ --with-libcoolstream-static-dir=PATH path for static libcoolstream], + [LIBCOOLSTREAM_STATIC_DIR="$withval"],[LIBCOOLSTREAM_STATIC_DIR=""]) + +AC_ARG_ENABLE(libcoolstream-static, + AS_HELP_STRING(--enable-libcoolstream-static,[libcoolstream static linked for testing])) +AM_CONDITIONAL(ENABLE_LIBCOOLSTREAM_STATIC,test "$enable_libcoolstream_static" = "yes") + AC_ARG_ENABLE(reschange, AS_HELP_STRING(--enable-reschange,enable change the osd resolution (default for hd2))) diff --git a/configure.ac b/configure.ac index a895e6bc0..79f55ddcc 100644 --- a/configure.ac +++ b/configure.ac @@ -272,6 +272,7 @@ AC_SUBST(VORBISIDEC_LIBS) AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) AC_SUBST(BLURAY_LIBS) +AC_SUBST(LIBCOOLSTREAM_STATIC_DIR) AC_OUTPUT([ Makefile diff --git a/src/Makefile.am b/src/Makefile.am index cf70612f1..743bfaf7e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -142,7 +142,13 @@ neutrino_LDADD += \ endif if BOXTYPE_COOL +if ENABLE_LIBCOOLSTREAM_STATIC +neutrino_LDADD += -lca-sc +neutrino_LDADD += @LIBCOOLSTREAM_STATIC_DIR@/libcoolstream-mt.a +else neutrino_LDADD += -lcoolstream-mt -lca-sc +endif + if ENABLE_TMSDK else if BOXMODEL_CS_HD2 From 788a0d9f3ddecdc7020ac57e1e75beb1b023f287 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 4/8] osd resolution: Add src/gui/osd_helpers.cpp - Move switch osd resolution from COsdSetup::changeNotify() to COsdHelpers::changeOsdResolution() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/84b2af00fb86a03df12ae7eb20acf01290d30077 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) Origin message was: ------------------ osd resolution: Add src/gui/osd_helpers.cpp - Move switch osd resolution from COsdSetup::changeNotify() to COsdHelpers::changeOsdResolution() ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 1 + src/gui/osd_helpers.cpp | 183 ++++++++++++++++++++++++++++++++++++++++ src/gui/osd_helpers.h | 29 +++++++ src/gui/osd_setup.cpp | 8 ++ 4 files changed, 221 insertions(+) create mode 100644 src/gui/osd_helpers.cpp create mode 100644 src/gui/osd_helpers.h diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 86a06903f..ce717471c 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -74,6 +74,7 @@ libneutrino_gui_a_SOURCES = \ network_setup.cpp \ nfs.cpp \ opkg_manager.cpp \ + osd_helpers.cpp \ osd_progressbar_setup.cpp \ osd_setup.cpp \ osdlang_setup.cpp \ diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp new file mode 100644 index 000000000..c06563f5a --- /dev/null +++ b/src/gui/osd_helpers.cpp @@ -0,0 +1,183 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +extern CInfoClock *InfoClock; +extern CTimeOSD *FileTimeOSD; +extern cVideo *videoDecoder; + +COsdHelpers::COsdHelpers() +{ + g_settings_osd_resolution_save = 0; +} + +COsdHelpers::~COsdHelpers() +{ +} + +COsdHelpers* COsdHelpers::getInstance() +{ + static COsdHelpers* osdh = NULL; + if(!osdh) + osdh = new COsdHelpers(); + + return osdh; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bool forceOsdReset/*=false*/) +{ + size_t idx = 0; + bool resetOsd = false; + uint32_t modeNew; + + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + + if (automode) { + if (g_settings.video_Mode == VIDEO_STD_AUTO) + modeNew = OSDMODE_1080; + else + modeNew = g_settings_osd_resolution_save; + } + else { + modeNew = mode; + } + + int videoSystem = getVideoSystem(); + if (!isVideoSystem1080(videoSystem)) + modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); + resetOsd = (modeNew != getOsdResolution()) ? true : false; + + if (forceOsdReset) + resetOsd = true; + + if (frameBuffer->fullHdAvailable()) { + if (frameBuffer->osd_resolutions.empty()) + return; + + bool ivVisible = false; + if (g_InfoViewer && g_InfoViewer->is_visible) { + g_InfoViewer->killTitle(); + ivVisible = true; + } + + int switchFB = frameBuffer->setMode(frameBuffer->osd_resolutions[idx].xRes, + frameBuffer->osd_resolutions[idx].yRes, + frameBuffer->osd_resolutions[idx].bpp); + + if (switchFB == 0) { +//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp); + g_settings.osd_resolution = modeNew; + if (InfoClock) + InfoClock->enableInfoClock(false); + frameBuffer->Clear(); + if (resetOsd) { + CNeutrinoApp::getInstance()->setScreenSettings(); + CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); + CVolumeHelper::getInstance()->refresh(); + if (InfoClock) + CInfoClock::getInstance()->ClearDisplay(); + if (FileTimeOSD) + FileTimeOSD->Init(); + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); + } + if (InfoClock) + InfoClock->enableInfoClock(true); + } + if (g_InfoViewer) { + g_InfoViewer->ResetModules(); + g_InfoViewer->start(); + } + if (ivVisible) { + CNeutrinoApp::getInstance()->StopSubtitles(); + g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel(), true, 0, true); + CNeutrinoApp::getInstance()->StartSubtitles(); + } + } +} + +void COsdHelpers::resetOsdResolution(int newSystem) +{ + int videoSystem = getVideoSystem(); + if ((isVideoSystem1080(videoSystem)) && (!isVideoSystem1080(newSystem))) { + CFrameBuffer::getInstance()->setMode(1280, 720, 32); + } +} +#else +void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) +{ +} + +void COsdHelpers::resetOsdResolution(int) +{ +} +#endif + + +int COsdHelpers::isVideoSystem1080(int res) +{ + if ((res == VIDEO_STD_1080I60) || + (res == VIDEO_STD_1080I50) || + (res == VIDEO_STD_1080P30) || + (res == VIDEO_STD_1080P24) || + (res == VIDEO_STD_1080P25)) + return true; + +#ifdef BOXMODEL_CS_HD2 + if ((res == VIDEO_STD_1080P50) || + (res == VIDEO_STD_1080P60) || + (res == VIDEO_STD_1080P2397) || + (res == VIDEO_STD_1080P2997)) + return true; +#endif + +#if 0 + /* for testing only */ + if (res == VIDEO_STD_720P50) + return true; +#endif + + return false; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +int COsdHelpers::getVideoSystem() +{ + return videoDecoder->GetVideoSystem(); +} +#else +int COsdHelpers::getVideoSystem() +{ + return g_settings.video_Mode; +} +#endif + +uint32_t COsdHelpers::getOsdResolution() +{ + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + if (frameBuffer->osd_resolutions.size() == 1) + return 0; + + uint32_t yRes = frameBuffer->getScreenHeight(true); + for (size_t i = 0; i < frameBuffer->osd_resolutions.size(); i++) { + if (frameBuffer->osd_resolutions[i].yRes == yRes) + return frameBuffer->osd_resolutions[i].mode; + } + return 0; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h new file mode 100644 index 000000000..d2c735e50 --- /dev/null +++ b/src/gui/osd_helpers.h @@ -0,0 +1,29 @@ + +#ifndef __osd_helpers__ +#define __osd_helpers__ + +enum { + OSDMODE_720 = 0, + OSDMODE_1080 = 1 +}; + +class COsdHelpers +{ + private: + + public: + COsdHelpers(); + ~COsdHelpers(); + static COsdHelpers* getInstance(); + + int g_settings_osd_resolution_save; + + void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); + void resetOsdResolution(int newSystem); + int isVideoSystem1080(int res); + int getVideoSystem(); + uint32_t getOsdResolution(); +}; + + +#endif //__osd_helpers__ diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 4e5128c67..ad4b6b51e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -39,6 +39,7 @@ #include #include "osd_setup.h" +#include "osd_helpers.h" #include "themes.h" #include "screensetup.h" #include "osdlang_setup.h" @@ -1389,6 +1390,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) #ifdef ENABLE_CHANGE_OSD_RESOLUTION else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION)) { + if (frameBuffer->osd_resolutions.empty()) + return true; + osd_menu->hide(); + uint32_t osd_mode = (uint32_t)*(int*)data; + COsdHelpers::getInstance()->changeOsdResolution(osd_mode, osd_mode); +#if 0 if (frameBuffer->fullHdAvailable()) { if (frameBuffer->osd_resolutions.empty()) return true; @@ -1418,6 +1425,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_InfoViewer->ResetModules(); } } +#endif return true; } #endif From 760a820f7834cd06994839b4e4ae081d78d372e7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 5/8] osd resolution: Add 'mode' to osd_resolution_struct_t - Use COsdSetup::OSDMODE_XXX enums to identify various resolutions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/653e574937874e8d0a0841372dbd9b1cc96462ae Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd1.cpp | 1 + src/driver/fb_accel_cs_hd2.cpp | 2 ++ src/driver/fb_accel_cs_hdx_inc.h | 1 + src/driver/fb_generic.cpp | 14 ++++++++++++++ src/driver/fb_generic.h | 2 ++ 5 files changed, 20 insertions(+) diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index af62fea21..f890cfbcc 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -344,6 +344,7 @@ void CFbAccelCSHD1::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 8a6b42767..0b027ece9 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -215,11 +215,13 @@ void CFbAccelCSHD2::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); if (fullHdAvailable()) { res.xRes = 1920; res.yRes = 1080; res.bpp = 32; + res.mode = OSDMODE_1080; osd_resolutions.push_back(res); } } diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index cd38baa72..da858312e 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index a530b67b8..126146459 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -362,9 +363,22 @@ void CFrameBuffer::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } +size_t CFrameBuffer::getIndexOsdResolution(uint32_t mode) +{ + if (osd_resolutions.size() == 1) + return 0; + + for (size_t i = 0; i < osd_resolutions.size(); i++) { + if (osd_resolutions[i].mode == mode) + return i; + } + return 0; +} + #if 0 //never used void CFrameBuffer::setTransparency( int /*tr*/ ) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 810fcc063..2209e7f2d 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -44,6 +44,7 @@ typedef struct osd_resolution_t uint32_t yRes; uint32_t xRes; uint32_t bpp; + uint32_t mode; } osd_resolution_struct_t; typedef struct gradientData_t @@ -284,6 +285,7 @@ class CFrameBuffer : public sigc::trackable virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); std::vector osd_resolutions; + size_t getIndexOsdResolution(uint32_t mode); enum { From 7329fb62943e7b1f124269f742e9398a31243710 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 6/8] CInfoViewer::showTitle: Add parameter forcePaintButtonBar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc05d272f2af7017d6e41810883fbcfc7989203f Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 11 ++++++----- src/gui/infoviewer.h | 4 ++-- src/gui/infoviewer_bb.cpp | 6 ++++-- src/gui/infoviewer_bb.h | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c32a4e9e2..cf640d883 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -696,15 +696,15 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() } } -void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); if(channel) - showTitle(channel, calledFromNumZap, epgpos); + showTitle(channel, calledFromNumZap, epgpos, forcePaintButtonBar); } -void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); @@ -728,7 +728,8 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap check_channellogo_ca_SettingsChange(); aspectRatio = 0; last_curr_id = last_next_id = 0; - showButtonBar = !calledFromNumZap; + showButtonBar = (!calledFromNumZap || forcePaintButtonBar); + bool noTimer = (calledFromNumZap && forcePaintButtonBar); fileplay = (ChanNum == 0); newfreq = true; @@ -780,7 +781,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap show_dot = !show_dot; if (showButtonBar) { - infoViewerBB->paintshowButtonBar(); + infoViewerBB->paintshowButtonBar(noTimer); } int ChanNumWidth = 0; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 69d1ce595..d5f605e7a 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -173,8 +173,8 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); - void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); + void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); + void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update void killTitle(); CSectionsdClient::CurrentNextInfo getEPG(const t_channel_id for_channel_id, CSectionsdClient::CurrentNextInfo &info); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 6cdd0d85b..cea2656eb 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -458,7 +458,7 @@ void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon) } } -void CInfoViewerBB::paintshowButtonBar() +void CInfoViewerBB::paintshowButtonBar(bool noTimer/*=false*/) { if (!is_visible) return; @@ -466,7 +466,9 @@ void CInfoViewerBB::paintshowButtonBar() for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = ""; } - g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); + + if (!noTimer) + g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); if (g_settings.infobar_casystem_display < 2) paint_ca_bar(); diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index 753e32a2e..765ddc20a 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -141,7 +141,7 @@ class CInfoViewerBB void showIcon_Tuner(void); void showIcon_DD(void); void showBBButtons(bool paintFooter = false); - void paintshowButtonBar(); + void paintshowButtonBar(bool noTimer = false); void getBBButtonInfo(void); void reset_allScala(void); void initBBOffset(void); From 3ce94ff8e7ecd0ac59e3e8da09267c846c4b03a2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 7/8] NeutrinoMessages: Add EVT_AUTO_SET_VIDEOSYSTEM Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bf32265c1547695c0be1186dc30cbf5b0b76cd2 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrinoMessages.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index fe89d019a..81f77fa6c 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -123,6 +123,7 @@ struct NeutrinoMessages { /* NEVER CHANGE THIS */ EVT_CA_MESSAGE = CRCInput::RC_Events + 60, /* data = CA_MESSAGE pointer */ EVT_SUBT_MESSAGE = CRCInput::RC_Events + 61, /* data = subtitles pointer */ + EVT_AUTO_SET_VIDEOSYSTEM = CRCInput::RC_Events + 62, /* data = new video system */ /* END */ EVT_CURRENTEPG = CRCInput::RC_WithData + 1, From ff6188530e2398f90fbacfc3957893b988d99d52 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 8/8] osd resolution: Use COsdHelpers::changeOsdResolution() to adjust... ...OSD resolution after switching video format Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff11dd44ab76d3d9a716ab20903449a27a2a5025 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ This commit was generated by Migit --- lib/libcoolstream2/cs_api.h | 1 + lib/libcoolstream2/video_cs.h | 2 ++ src/gui/osd_setup.cpp | 9 +++++++-- src/gui/videosettings.cpp | 7 +++++++ src/neutrino.cpp | 34 ++++++++++++++++++++++++++++++++- src/neutrino.h | 1 + src/zapit/include/zapit/zapit.h | 1 + src/zapit/src/zapit.cpp | 4 ++++ 8 files changed, 56 insertions(+), 3 deletions(-) diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h index fe1b463da..bbb03eb46 100644 --- a/lib/libcoolstream2/cs_api.h +++ b/lib/libcoolstream2/cs_api.h @@ -49,6 +49,7 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +void cs_new_auto_videosystem(); // Memory helpers void *cs_malloc_uncached(size_t size); diff --git a/lib/libcoolstream2/video_cs.h b/lib/libcoolstream2/video_cs.h index 6c1da4931..3bfa62793 100644 --- a/lib/libcoolstream2/video_cs.h +++ b/lib/libcoolstream2/video_cs.h @@ -190,6 +190,7 @@ private: analog_mode_t analog_mode_scart; fp_icon mode_icon; cDemux *demux; + int current_video_system; // int SelectAutoFormat(); void ScalePic(); @@ -244,6 +245,7 @@ public: int Flush(void); /* set video_system */ + int GetVideoSystem(); int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); void SetSyncMode(AVSYNC_TYPE mode); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index ad4b6b51e..281999311 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -660,7 +660,11 @@ int COsdSetup::showOsdSetup() kext[0].valname = "-"; resCount = 1; } - CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this); + int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); + bool enable = ((resCount > 1) && + COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && + (g_settings.video_Mode != VIDEO_STD_AUTO)); + CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); #endif @@ -1394,7 +1398,8 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) return true; osd_menu->hide(); uint32_t osd_mode = (uint32_t)*(int*)data; - COsdHelpers::getInstance()->changeOsdResolution(osd_mode, osd_mode); + COsdHelpers::getInstance()->g_settings_osd_resolution_save = osd_mode; + COsdHelpers::getInstance()->changeOsdResolution(osd_mode); #if 0 if (frameBuffer->fullHdAvailable()) { if (frameBuffer->osd_resolutions.empty()) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 9a013a6af..6cb14bcd4 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,9 @@ void CVideoSettings::setVideoSettings() void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); if (do_ask) { @@ -422,7 +425,9 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); } else prev_video_mode = g_settings.video_Mode; @@ -606,7 +611,9 @@ void CVideoSettings::nextMode(void) else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); //return; disp_cur = 1; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 87f4dcf2f..99eff149b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -81,6 +81,7 @@ #include "gui/infoviewer.h" #include "gui/mediaplayer.h" #include "gui/movieplayer.h" +#include "gui/osd_helpers.h" #include "gui/osd_setup.h" #include "gui/osdlang_setup.h" #include "gui/pictureviewer.h" @@ -226,6 +227,7 @@ CNeutrinoApp::CNeutrinoApp() { standby_pressed_at.tv_sec = 0; osd_resolution_tmp = -1; + frameBufferInitialized = false; frameBuffer = CFrameBuffer::getInstance(); frameBuffer->setIconBasePath(ICONSDIR); @@ -719,6 +721,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; + COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution; g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); @@ -1359,7 +1362,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32("osd_resolution" , g_settings.osd_resolution); + configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); @@ -1870,6 +1873,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) /************************************************************************************** * CNeutrinoApp - setup the framebuffer * **************************************************************************************/ + void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); @@ -1898,6 +1902,10 @@ void CNeutrinoApp::SetupFrameBuffer() frameBuffer->osd_resolutions[ort].yRes, frameBuffer->osd_resolutions[ort].bpp); +/* + setFbMode = 0; + COsdHelpers::getInstance()->changeOsdResolution(0, true); +*/ #else /* all other hardware ignores setMode parameters */ setFbMode = frameBuffer->setMode(0, 0, 0); @@ -1908,6 +1916,7 @@ void CNeutrinoApp::SetupFrameBuffer() exit(-1); } frameBuffer->Clear(); + frameBufferInitialized = true; } /************************************************************************************** @@ -2121,6 +2130,9 @@ int CNeutrinoApp::run(int argc, char **argv) TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); +#ifdef BOXMODEL_CS_HD2 + cs_new_auto_videosystem(); +#endif g_Locale = new CLocaleManager; @@ -2179,6 +2191,8 @@ TIMER_START(); ZapStart_arg.volume = g_settings.current_volume; ZapStart_arg.webtv_xml = &g_settings.webtv_xml; + ZapStart_arg.osd_resolution = g_settings.osd_resolution; + CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner); /* create decoders, read channels */ bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); @@ -2970,6 +2984,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CMoviePlayerGui::getInstance(true).showSubtitle(data); return messages_return::handled; } + if (msg == NeutrinoMessages::EVT_AUTO_SET_VIDEOSYSTEM) { + 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) { + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + return messages_return::handled; + } + + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + coh->changeOsdResolution(0, true, true); + return messages_return::handled; + } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) diff --git a/src/neutrino.h b/src/neutrino.h index 291a018ea..6d8749865 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -109,6 +109,7 @@ private: bool channelList_painted; int first_mode_found; int osd_resolution_tmp; + bool frameBufferInitialized; void SDT_ReloadChannels(); void setupNetwork( bool force= false ); diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index a60c79fb5..989f3cc7c 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -42,6 +42,7 @@ typedef struct ZAPIT_start_arg t_channel_id startchannelradio_id; int uselastchannel; int video_mode; + uint32_t osd_resolution; int volume; int ci_clock; std::list *webtv_xml; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index e8682ba1b..7d1b517e7 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -76,6 +76,7 @@ #include #include +#include /* globals */ int sig_delay = 2; // seconds between signal check @@ -1664,6 +1665,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } @@ -2368,6 +2370,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) videoDecoder->SetDemux(videoDemux); videoDecoder->SetVideoSystem(video_mode); + uint32_t osd_resolution = ZapStart_arg->osd_resolution; + COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false); audioDecoder->SetDemux(audioDemux);