From 4e013de774c48cf15199e96feb433d7b3fae3d1c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 6 Mar 2017 15:50:06 +0100 Subject: [PATCH 01/28] subpagetable is unsigned Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e10cb00613898eb4a67fae3166fec019876c86e4 Author: Jacek Jendrzej Date: 2017-03-06 (Mon, 06 Mar 2017) Origin message was: ------------------ subpagetable is unsigned ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d83df3251..5eae7e587 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5234,7 +5234,7 @@ void RenderPage() { page_atrb[32].fg = yellow; page_atrb[32].bg = menu1; - int showpage = tuxtxt_cache.page_receiving; + int showpage = tuxtxt_cache.page_receiving < 0 ? 0 : tuxtxt_cache.page_receiving; int showsubpage = tuxtxt_cache.subpagetable[showpage]; if (showsubpage!=0xff) { From 8b8723a29779c35112ae1bebc63d12451a1155b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 02/28] CMovieBrowser: remove wrong progress value Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/26a0f319231bf1bb0865e283ceb1fb35b5df6b1a Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 724048fa9..d6c29d8c4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2766,7 +2766,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) for (i=0; i < size;i++) { if (*m_dir[i].used == true){ - OnLoadDir(i+1, size, m_dir[i].name); + OnLoadDir(i, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); } } From 562dbec77cc6bd0b285f1f1d75ff3ebd43a7d01f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 03/28] CProgressWindow/CProgressSignals: add prepared signals Required for inhertance of signals used with CProgressWindow. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7f511ebd1a394aa1650fcefa81423dc6c679099d Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.h | 76 ++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index e94d08755..4943fb0e2 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -89,10 +89,10 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * status.hide(); * } * - * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. - * //Working with signals have the advantage that the implementation could be more compactly, because - * //complex constructions within the classes are usually unnecessary, - * //beacuse of the signals can be installed where they directly take the required values. See next example: + * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. + * //Working with signals have the advantage that the implementation could be more compactly, because + * //complex constructions within the classes are usually unnecessary, + * //beacuse of the signals can be installed where they directly catching the required values. See next example: * * class CFooClass * { @@ -101,6 +101,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * private: * //other members... * sigc::signal OnProgress; + * void DoCount(); * //other members... * public: * //other members... @@ -132,8 +133,53 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * //finally remove window from screen * progress.hide(); * } + * + * //Another and a recommended way to implement signals is to inherit prepared signals with + * //class CProgressSignals. This class contains prepared signals for implemantation and disconnetion of slots + * //is performed automatically. + * //See next example: + * class CFooClass : public CProgressSignals + * { + * private: + * //other members... + * void DoCount(); + * //other members... + * public: + * //other members... + * void DoAnything(); + * //other members... + * }; + * + * //add the OnGlobalProgress and OnLocalProgress signals into a counter methode + * void CFooClass::DoCount();{ + * size_t max = 10; + * for (size_t i = 0; i < max; i++){ + * OnGlobalProgress(i, max, "Test"); //visualize global progress + * for (size_t j = 0; j < max; j++){ + * OnLocalProgress(ij, max, "Test"); // visualize local progress + * } + * } + * } + * + * void CFooClass::DoAnything{ + * //inside of methode which calls the progress define a CProgressWindow object and the counter method: + * //...any code + * CProgressWindow progress(NULL, 500, 150, NULL, &OnLocalProgress, &OnGlobalProgress); + * progress.paint(); // paint window + * + * //... + * + * void DoCount(); + * + * //... + * + * //finally remove window from screen + * progress.hide(); + * } + * * @note - * Don't use status_Signal at same time with localSignal and globalSignal. In This case please set status_Signal = NULL + * Don't use status_Signal at same time with localSignal and globalSignal. \n + * In This case please set prameter 'status_Signal' = NULL */ CProgressWindow(CComponentsForm *parent = NULL, const int &dx = PW_MIN_WIDTH, @@ -241,5 +287,25 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget void paint(bool do_save_bg = true); }; +class CProgressSignals : public sigc::trackable +{ + public: + /**CProgressSignals Constructor: + * Additional class for inherited signal implemantations into classes with used CProgressWindow instances. + */ + CProgressSignals() + { + //obligatory init of signals. Not really required but just to be safe. + OnProgress.clear(); + OnLocalProgress.clear(); + OnGlobalProgress.clear(); + }; + + /** + * For general usage for implementations of signals for classes which are using CProgressBar() window instances based on inheritance. + * @see Take a look into examples to find in progressbar.h + */ + sigc::signal OnProgress, OnLocalProgress, OnGlobalProgress; +}; #endif From a41f318adc49ac23742e7dcbe7ea7fc7c9e3b3ec Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 04/28] CMovieBrowser/cYTFeedParser: implement signals from CProgressSignals Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c6a47ee3a8047cd2f1c7ba6635ae3923d1ef127 Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 6 +++--- src/gui/moviebrowser/mb.h | 5 ++--- src/system/ytparser.cpp | 2 +- src/system/ytparser.h | 5 ++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d6c29d8c4..2e3c0780f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2766,7 +2766,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) for (i=0; i < size;i++) { if (*m_dir[i].used == true){ - OnLoadDir(i, size, m_dir[i].name); + OnGlobalProgress(i, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); } } @@ -2887,7 +2887,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLoadFile(i, flist.size(), dirname ); + OnLocalProgress(i, flist.size(), dirname ); } //result = true; } @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 0b37d4c2e..762fba5c6 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -57,6 +57,7 @@ #include #include #include +#include #define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items) #define MOVIEBROWSER_SETTINGS_FILE CONFIGDIR "/moviebrowser.conf" @@ -133,7 +134,7 @@ class CYTCacheSelectorTarget : public CMenuTarget }; // Priorities for Developmemt: P1: critical feature, P2: important feature, P3: for next release, P4: looks nice, lets see -class CMovieBrowser : public CMenuTarget +class CMovieBrowser : public CMenuTarget, public CProgressSignals { friend class CYTCacheSelectorTarget; @@ -362,8 +363,6 @@ class CMovieBrowser : public CMenuTarget void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); - sigc::signal OnLoadFile; - sigc::signal OnLoadDir; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 3c558ee1b..407d452a4 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -323,7 +323,7 @@ bool cYTFeedParser::parseFeedJSON(std::string &answer) Json::Value elements = root["items"]; for(unsigned int i=0; igetText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + OnProgress(i, elements.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); #ifdef DEBUG_PARSER printf("=========================================================\n"); printf("Element %d in elements\n", i); diff --git a/src/system/ytparser.h b/src/system/ytparser.h index c54c2239b..dcc8f1322 100644 --- a/src/system/ytparser.h +++ b/src/system/ytparser.h @@ -30,6 +30,7 @@ #include #include #include +#include class cYTVideoUrl { @@ -68,7 +69,7 @@ class cYTVideoInfo typedef std::vector yt_video_list_t; -class cYTFeedParser +class cYTFeedParser : public CProgressSignals { private: std::string error; @@ -155,8 +156,6 @@ class cYTFeedParser void SetMaxResults(int count) { max_results = count; } void SetConcurrentDownloads(int count) { concurrent_downloads = count; } void SetThumbnailDir(std::string &_thumbnail_dir); - - sigc::signal OnLoadVideoInfo; }; #endif From 78a2c71634d0448cb2a94385838ac35fad1ee3fb Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 6 Mar 2017 10:51:43 +0100 Subject: [PATCH 05/28] Fix osd mode switch in videosystem auto mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1bb9fc6687390a429bd8db89a6c4ec2a339aa627 Author: Michael Liebmann Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_helpers.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c4c78ca95..2675cffef 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -58,8 +58,15 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo } int videoSystem = getVideoSystem(); - if (!isVideoSystem1080(videoSystem)) + + if ((g_settings.video_Mode == VIDEO_STD_AUTO) && + (g_settings.enabled_auto_modes[videoSystem] == 1) && + (!isVideoSystem1080(videoSystem))) modeNew = OSDMODE_720; + +// if (!isVideoSystem1080(videoSystem)) +// modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 From f3fe4a116f92b0722fee7c0aaa315e0b73c0729d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 6 Mar 2017 13:20:02 +0100 Subject: [PATCH 06/28] allow to force given osd resolution in "videosystem = auto" mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fc24e990b3923d72c571477110102c9e3ddbbfa Author: vanhofen Date: 2017-03-06 (Mon, 06 Mar 2017) Origin message was: ------------------ - allow to force given osd resolution in "videosystem = auto" mode ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 ++++++- data/locale/english.locale | 5 +++++ src/gui/osd_helpers.cpp | 39 ++++++++++++++++++-------------------- src/gui/osd_helpers.h | 8 +++++++- src/gui/osd_setup.cpp | 16 +++++++++++++++- src/neutrino.cpp | 2 ++ src/system/locals.h | 5 +++++ src/system/locals_intern.h | 5 +++++ src/system/settings.h | 1 + 9 files changed, 64 insertions(+), 24 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5b9c45c61..bec07ffea 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,6 +325,10 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung +colormenu.osd_resolution_force OSD-Auflösung erzwingen +colormenu.osd_resolution_force_all in allen Modi +colormenu.osd_resolution_force_hd in HD-Modi +colormenu.osd_resolution_force_never nie colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1252,7 +1256,8 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) -menu.hint_osd_resolution Wählen Sie eine OSD Auflösung +menu.hint_osd_resolution Wählen Sie eine OSD-Auflösung +menu.hint_osd_resolution_force Erzwingt die eingestellte OSD-Auflösung, auch wenn das Videosystem automatisch umgeschalten wird menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index d8d2fbe20..b568e7b53 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,6 +325,10 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution +colormenu.osd_resolution_force Force OSD resolution +colormenu.osd_resolution_force_all in all modes +colormenu.osd_resolution_force_hd in HD modes +colormenu.osd_resolution_force_never never colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1253,6 +1257,7 @@ menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV menu.hint_osd_resolution Change OSD resolution +menu.hint_osd_resolution_force Forces the given OSD resolution, even when the videosystem is auto-changed menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index 2675cffef..ed257ce49 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -61,12 +61,9 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo if ((g_settings.video_Mode == VIDEO_STD_AUTO) && (g_settings.enabled_auto_modes[videoSystem] == 1) && - (!isVideoSystem1080(videoSystem))) + (!allow_OSDMODE_1080(videoSystem))) modeNew = OSDMODE_720; -// if (!isVideoSystem1080(videoSystem)) -// modeNew = OSDMODE_720; - idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 @@ -130,28 +127,28 @@ void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) } #endif -int COsdHelpers::isVideoSystem1080(int res) +bool COsdHelpers::allow_OSDMODE_1080(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; - + if (g_settings.osd_resolution_force == FORCE_ALL || ( + (res == VIDEO_STD_1080I50) + || (res == VIDEO_STD_1080I60) + || (res == VIDEO_STD_1080P24) + || (res == VIDEO_STD_1080P25) + || (res == VIDEO_STD_1080P30) #ifdef BOXMODEL_CS_HD2 - if ((res == VIDEO_STD_1080P50) || - (res == VIDEO_STD_1080P60) || - (res == VIDEO_STD_1080P2397) || - (res == VIDEO_STD_1080P2997)) - return true; + || (res == VIDEO_STD_1080P50) + || (res == VIDEO_STD_1080P60) + || (res == VIDEO_STD_1080P2397) + || (res == VIDEO_STD_1080P2997) #endif + )) + return true; -#if 0 - /* for testing only */ - if (res == VIDEO_STD_720P50) + if (g_settings.osd_resolution_force == FORCE_HD && ( + (res == VIDEO_STD_720P50) + || (res == VIDEO_STD_720P60) + )) return true; -#endif return false; } diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index 9c78886f0..d9fa0c035 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,10 +19,16 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - int isVideoSystem1080(int res); + bool allow_OSDMODE_1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); int setVideoSystem(int newSystem, bool remember = true); + + enum { + FORCE_NEVER = 0, + FORCE_HD, + FORCE_ALL + }; }; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 281999311..9e8b9db00 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -397,6 +397,14 @@ const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; +const CMenuOptionChooser::keyval OSD_RESOLUTION_FORCE_OPTIONS[]= +{ + { COsdHelpers::FORCE_NEVER, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER }, + { COsdHelpers::FORCE_HD, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD }, + { COsdHelpers::FORCE_ALL, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL } +}; +int OSD_RESOLUTION_FORCE_OPTIONS_COUNT = sizeof(OSD_RESOLUTION_FORCE_OPTIONS)/sizeof(OSD_RESOLUTION_FORCE_OPTIONS[0]); + #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_MODE_OPTION_COUNT] = { @@ -662,11 +670,17 @@ int COsdSetup::showOsdSetup() } int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); bool enable = ((resCount > 1) && - COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && + COsdHelpers::getInstance()->allow_OSDMODE_1080(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); + + // force resolution in auto-mode + enable = (g_settings.video_Mode == VIDEO_STD_AUTO); + CMenuOptionChooser * osd_res_force = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, &g_settings.osd_resolution_force, OSD_RESOLUTION_FORCE_OPTIONS, OSD_RESOLUTION_FORCE_OPTIONS_COUNT, enable, this); + osd_res_force->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE); + osd_menu->addItem(osd_res_force); #endif //monitor diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d417ababe..1266f9e83 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -724,6 +724,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.osd_resolution_force = configfile.getInt32("osd_resolution_force", COsdHelpers::FORCE_NEVER); 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); @@ -1365,6 +1366,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //screen configuration configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); + configfile.setInt32("osd_resolution_force", g_settings.osd_resolution_force); 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); diff --git a/src/system/locals.h b/src/system/locals.h index b39748482..3ddb368d7 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,6 +352,10 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1280,6 +1284,7 @@ typedef enum LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, LOCALE_MENU_HINT_OSD_RESOLUTION, + LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b39ca2c98..0f327937a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,6 +352,10 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", + "colormenu.osd_resolution_force", + "colormenu.osd_resolution_force_all", + "colormenu.osd_resolution_force_hd", + "colormenu.osd_resolution_force_never", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1280,6 +1284,7 @@ const char * locale_real_names[] = "menu.hint_osd_language", "menu.hint_osd_preset", "menu.hint_osd_resolution", + "menu.hint_osd_resolution_force", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 3a063669e..70c23c731 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -626,6 +626,7 @@ struct SNeutrinoSettings int screen_EndX_lcd_1; int screen_EndY_lcd_1; int osd_resolution; + int osd_resolution_force; int screen_preset; int screen_width; int screen_height; From 4c19475bd1a6f83da949acba17a9202620be9458 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 7 Mar 2017 15:00:17 +0100 Subject: [PATCH 07/28] make neutrino compatible with new ffmpeg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bfa589eb08a087ebfdff55a6b0676473f86db3fe Author: Jacek Jendrzej Date: 2017-03-07 (Tue, 07 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libdvbsub/dvbsubtitle.cpp | 15 +++++++- src/driver/audiodec/ffmpegdec.cpp | 62 +++++++++++++++++++++++++++---- src/driver/record.cpp | 61 +++++++++++++++++++++++++++--- src/driver/streamts.cpp | 54 ++++++++++++++++++++++++--- src/driver/streamts.h | 4 ++ src/gui/movieplayer.cpp | 12 +++++- 6 files changed, 184 insertions(+), 24 deletions(-) diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index 0be467e10..e2c41188b 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -68,8 +68,13 @@ cDvbSubtitleBitmaps::~cDvbSubtitleBitmaps() if(sub.rects) { for (i = 0; i < Count(); i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) av_freep(&sub.rects[i]->pict.data[0]); av_freep(&sub.rects[i]->pict.data[1]); +#else + av_freep(&sub.rects[i]->data[0]); + av_freep(&sub.rects[i]->data[1]); +#endif av_freep(&sub.rects[i]); } @@ -122,7 +127,11 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int xf = int(xc * (double) 720); for (i = 0; i < Count(); i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) uint32_t * colors = (uint32_t *) sub.rects[i]->pict.data[1]; +#else + uint32_t * colors = (uint32_t *) sub.rects[i]->data[1]; +#endif int width = sub.rects[i]->w; int height = sub.rects[i]->h; int xoff, yoff; @@ -142,9 +151,11 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) dbgconverter("cDvbSubtitleBitmaps::Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, sub.rects[i]->x, sub.rects[i]->y, sub.rects[i]->w, sub.rects[i]->h, sub.rects[i]->nb_colors, xoff, yoff, nw, nh); - +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->pict.data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh); - +#else + fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh); +#endif fb_pixel_t * ptr = newdata; for (int y2 = 0; y2 < nh; y2++) { int y = (yoff + y2) * stride; diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index c97497175..695f67d89 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -47,6 +47,11 @@ extern "C" { #define av_frame_unref avcodec_get_frame_defaults #define av_frame_free avcodec_free_frame #endif + +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + #include #include @@ -218,9 +223,16 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *c = avc->streams[best_stream]->codec; - +#else + AVCodecContext *c = avcodec_alloc_context3(codec); + if(avcodec_parameters_to_context(c,avc->streams[best_stream]->codecpar) < 0){ + DeInit(); + Status=DATA_ERR; + return Status; + } +#endif mutex.lock(); int r = avcodec_open2(c, codec, NULL); mutex.unlock(); @@ -326,9 +338,10 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; break; } - } else + } else{ av_frame_unref(frame); - + } +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57,37,100) int len = avcodec_decode_audio4(c, frame, &got_frame, &packet); if (len < 0) { // skip frame @@ -340,6 +353,27 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, mutex.unlock(); continue; } + packet.size -= len; + packet.data += len; +#else + int ret = avcodec_send_packet(c, &packet); + if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF){ + break; + } + if (ret >= 0){ + packet.size = 0; + } + ret = avcodec_receive_frame(c, frame); + if (ret < 0){ + if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF){ + break; + } + else{ + continue; + } + } + got_frame = 1; +#endif if (got_frame && *state!=PAUSE) { int out_samples; outsamples = av_rescale_rnd(swr_get_delay(swr, c->sample_rate) + frame->nb_samples, @@ -368,8 +402,6 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, if (!start_pts) start_pts = pts; } - packet.size -= len; - packet.data += len; } if (time_played && avc->streams[best_stream]->time_base.den) *time_played = (pts - start_pts) * avc->streams[best_stream]->time_base.num / avc->streams[best_stream]->time_base.den; @@ -428,7 +460,11 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) +#else + if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) +#endif GetMeta(avc->streams[i]->metadata); } } @@ -445,12 +481,17 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; mChannels = av_get_channel_layout_nb_channels(avc->streams[best_stream]->codec->channel_layout); - +#else + if (!codec) + codec = avcodec_find_decoder(avc->streams[best_stream]->codecpar->codec_id); + samplerate = avc->streams[best_stream]->codecpar->sample_rate; + mChannels = av_get_channel_layout_nb_channels(avc->streams[best_stream]->codecpar->channel_layout); +#endif std::stringstream ss; if (codec && codec->long_name != NULL) @@ -470,8 +511,13 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; +#else + if (avc->streams[i]->codecpar->bit_rate > 0) + bitrate += avc->streams[i]->codecpar->bit_rate; +#endif if (save_cover && (avc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC)) { mkdir(COVERDIR, 0755); std::string cover(COVERDIR); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 517ecff64..0c234cbe6 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -68,12 +68,20 @@ extern "C" { #include } +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + class CStreamRec : public CRecordInstance, OpenThreads::Thread { private: AVFormatContext *ifcx; AVFormatContext *ofcx; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) AVBitStreamFilterContext *bsfc; +#else + AVBSFContext *bsfc; +#endif bool stopped; bool interrupt; time_t time_started; @@ -1912,8 +1920,13 @@ void CStreamRec::Close() } avformat_free_context(ofcx); } - if (bsfc) + if (bsfc){ +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) av_bitstream_filter_close(bsfc); +#else + av_bsf_free(&bsfc); +#endif + } ifcx = NULL; ofcx = NULL; bsfc = NULL; @@ -1930,7 +1943,11 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * codec = st->codec; +#else + AVCodecParameters * codec = st->codecpar; +#endif if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); @@ -2159,12 +2176,17 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; - AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); +#else + AVCodecParameters * iccx = ifcx->streams[i]->codecpar; + AVStream *ost = avformat_new_stream(ofcx, NULL); + avcodec_parameters_copy(ost->codecpar, iccx); +#endif av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); - ost->time_base = iccx->time_base; + ost->time_base = ifcx->streams[i]->time_base; ost->id = stid++; if (iccx->codec_type == AVMEDIA_TYPE_VIDEO) { stream_index = i; @@ -2174,10 +2196,19 @@ bool CStreamRec::Open(CZapitChannel * channel) av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); - +#else + const AVBitStreamFilter *bsf = av_bsf_get_by_name("h264_mp4toannexb"); + if(!bsf) { + return false; + } + if ((av_bsf_alloc(bsf, &bsfc))) { + return false; + } +#endif return true; } @@ -2201,16 +2232,34 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; +#else + AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; +#endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } +#else + int ret = av_bsf_send_packet(bsfc, &pkt); + if (ret < 0){ + break; + } + ret = av_bsf_receive_packet(bsfc, &newpkt); + if (ret == AVERROR(EAGAIN)){ + break; + } + if(ret != AVERROR_EOF){ + av_packet_unref(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } +#endif } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f0144806c..d2f4a2d3c 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -59,6 +59,10 @@ #include #include +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 )) +#define av_packet_unref av_free_packet +#endif + /* experimental mode: * stream not possible, if record running * pids in url ignored, and added from channel, with fake PAT/PMT @@ -753,8 +757,13 @@ void CStreamStream::Close() if (avio_ctx) av_free(avio_ctx); - if (bsfc) + if (bsfc){ +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) av_bitstream_filter_close(bsfc); +#else + av_bsf_free(&bsfc); +#endif + } ifcx = NULL; ofcx = NULL; @@ -837,21 +846,35 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; - AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); +#else + AVCodecParameters * iccx = ifcx->streams[i]->codecpar; + AVStream *ost = avformat_new_stream(ofcx, NULL); + avcodec_parameters_copy(ost->codecpar, iccx); +#endif av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); - ost->time_base = iccx->time_base; + ost->time_base = ifcx->streams[i]->time_base; ost->id = stid++; } av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); - +#else + const AVBitStreamFilter *bsf = av_bsf_get_by_name("h264_mp4toannexb"); + if(!bsf) { + return false; + } + if ((av_bsf_alloc(bsf, &bsfc))) { + return false; + } +#endif return true; } @@ -896,15 +919,34 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; +#else + AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; +#endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; - +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; - } + } +#else + int ret = av_bsf_send_packet(bsfc, &pkt); + if (ret < 0){ + break; + } + ret = av_bsf_receive_packet(bsfc, &newpkt); + if (ret == AVERROR(EAGAIN)){ + break; + } + if(ret != AVERROR_EOF){ + av_packet_unref(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } +#endif } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); diff --git a/src/driver/streamts.h b/src/driver/streamts.h index da2708e51..7ec1bd321 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -73,7 +73,11 @@ class CStreamStream : public CStreamInstance private: AVFormatContext *ifcx; AVFormatContext *ofcx; +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) AVBitStreamFilterContext *bsfc; +#else + AVBSFContext *bsfc; +#endif AVIOContext *avio_ctx; bool stopped; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index eabe0e255..46e222231 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2468,8 +2468,11 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) clearSubtitle(); for (unsigned i = 0; i < sub->num_rects; i++) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) uint32_t * colors = (uint32_t *) sub->rects[i]->pict.data[1]; - +#else + uint32_t * colors = (uint32_t *) sub->rects[i]->data[1]; +#endif int xoff = (double) sub->rects[i]->x * xc; int yoff = (double) sub->rects[i]->y * yc; int nw = frameBuffer->getWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc); @@ -2478,9 +2481,14 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, sub->rects[i]->x, sub->rects[i]->y, sub->rects[i]->w, sub->rects[i]->h, sub->rects[i]->nb_colors, xoff, yoff, nw, nh); - +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 5, 0) fb_pixel_t * newdata = simple_resize32 (sub->rects[i]->pict.data[0], colors, sub->rects[i]->nb_colors, sub->rects[i]->w, sub->rects[i]->h, nw, nh); +#else + fb_pixel_t * newdata = simple_resize32 (sub->rects[i]->data[0], colors, + sub->rects[i]->nb_colors, sub->rects[i]->w, sub->rects[i]->h, nw, nh); +#endif + frameBuffer->blit2FB(newdata, nw, nh, xoff, yoff); free(newdata); From 5891499504c59823523a3f60bffa98f92cbef881 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 8 Mar 2017 00:32:21 +0100 Subject: [PATCH 08/28] Fix malloc_stats() call for newer uClibc-ng versions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b58aa9ad6ff0972f8fe3297fe9efcedaacb1b506 Author: Michael Liebmann Date: 2017-03-08 (Wed, 08 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 28 +++++++++++++--------------- src/neutrino.cpp | 4 ++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 4b79b389b..b271f6338 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,6 +55,16 @@ #include "xmlutil.h" #include "debug.h" +#ifdef __UCLIBC__ +#if (__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10) +#define MALLOC_STATS(a) malloc_stats() +#else +#define MALLOC_STATS(a) malloc_stats(a) +#endif +#else +#define MALLOC_STATS(a) malloc_stats() +#endif + //#define ENABLE_SDT //FIXME //#define DEBUG_SDT_THREAD @@ -1067,11 +1077,7 @@ static void commandDumpStatusInformation(int /*connfd*/, char* /*data*/, const u // resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss, ); printf("%s\n", stati); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + MALLOC_STATS(NULL); return ; } @@ -1200,11 +1206,7 @@ static void FreeMemory() unlockEvents(); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + MALLOC_STATS(NULL); xprintf("[sectionsd] free memory done\n"); //wakeupAll(); //FIXME should we re-start eit here ? } @@ -2054,11 +2056,7 @@ static void print_meminfo(void) if (!sections_debug) return; -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + MALLOC_STATS(NULL); } //--------------------------------------------------------------------- diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0b9848d3a..93f104ce6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4707,7 +4707,11 @@ void CNeutrinoApp::Cleanup() printf("cleanup 6\n");fflush(stdout); delete CVFD::getInstance(); #ifdef __UCLIBC__ +#if (__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10) + malloc_stats(); +#else malloc_stats(NULL); +#endif #else malloc_stats(); #endif From 3d5b84fb78adbdc313043af9faf43a15ec5a26bc Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 8 Mar 2017 12:22:43 +0100 Subject: [PATCH 09/28] Add src/compatibility.h to include software-dependency macros Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/87b7260c48a1743eb9fe513376da82624181ed5c Author: Michael Liebmann Date: 2017-03-08 (Wed, 08 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/compatibility.h | 34 ++++++++++++++++++++++++++++++++++ src/eitd/sectionsd.cpp | 16 ++++------------ src/neutrino.cpp | 13 ++++--------- 3 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 src/compatibility.h diff --git a/src/compatibility.h b/src/compatibility.h new file mode 100644 index 000000000..aa03d1ef8 --- /dev/null +++ b/src/compatibility.h @@ -0,0 +1,34 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Copyright (C) 2017, Michael Liebmann 'micha-bbg' + + License: GPL + + 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 the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __COMPATIBILITY_H__ +#define __COMPATIBILITY_H__ + + +#if !defined __UCLIBC__ || ((__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10)) +#define comp_malloc_stats(a) malloc_stats() +#else +#define comp_malloc_stats(a) malloc_stats(a) +#endif + + +#endif // __COMPATIBILITY_H__ diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index b271f6338..b7443d575 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,15 +55,7 @@ #include "xmlutil.h" #include "debug.h" -#ifdef __UCLIBC__ -#if (__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10) -#define MALLOC_STATS(a) malloc_stats() -#else -#define MALLOC_STATS(a) malloc_stats(a) -#endif -#else -#define MALLOC_STATS(a) malloc_stats() -#endif +#include //#define ENABLE_SDT //FIXME @@ -1077,7 +1069,7 @@ static void commandDumpStatusInformation(int /*connfd*/, char* /*data*/, const u // resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss, ); printf("%s\n", stati); - MALLOC_STATS(NULL); + comp_malloc_stats(NULL); return ; } @@ -1206,7 +1198,7 @@ static void FreeMemory() unlockEvents(); - MALLOC_STATS(NULL); + comp_malloc_stats(NULL); xprintf("[sectionsd] free memory done\n"); //wakeupAll(); //FIXME should we re-start eit here ? } @@ -2056,7 +2048,7 @@ static void print_meminfo(void) if (!sections_debug) return; - MALLOC_STATS(NULL); + comp_malloc_stats(NULL); } //--------------------------------------------------------------------- diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 93f104ce6..55f19b35a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -138,6 +138,8 @@ #include #include +#include + #include #include #include @@ -4706,15 +4708,8 @@ void CNeutrinoApp::Cleanup() delete CEitManager::getInstance(); printf("cleanup 6\n");fflush(stdout); delete CVFD::getInstance(); -#ifdef __UCLIBC__ -#if (__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10) - malloc_stats(); -#else - malloc_stats(NULL); -#endif -#else - malloc_stats(); -#endif + + comp_malloc_stats(NULL); #endif } From ff3043a1fa255a9ac6795e9cc8759a7d7f1aa117 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 9 Mar 2017 12:51:44 +0100 Subject: [PATCH 10/28] hardware_caps: add latest coolstream models Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b546ed517e71a31e7c4b5867599248b881fe40a3 Author: vanhofen Date: 2017-03-09 (Thu, 09 Mar 2017) Origin message was: ------------------ - hardware_caps: add latest coolstream models ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 216a6dcae..fa4492ae7 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -18,6 +18,7 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); + int chip = cs_get_chip_type(); caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); @@ -54,13 +55,29 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 11: - strcpy(caps.boxname, "Trinity"); - strcpy(caps.boxarch, "Shiner"); + if (chip == 33904 /*0x8470*/) + { + strcpy(caps.boxname, "Trinity"); + strcpy(caps.boxarch, "Shiner"); + } + else + { + strcpy(caps.boxname, "Trinity V2"); + strcpy(caps.boxarch, "Kronos"); + } break; case 12: strcpy(caps.boxname, "Zee2"); strcpy(caps.boxarch, "Kronos"); break; + case 13: + strcpy(caps.boxname, "Link"); + strcpy(caps.boxarch, "Kronos"); + break; + case 14: + strcpy(caps.boxname, "Trinity Duo"); + strcpy(caps.boxarch, "Kronos"); + break; default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); @@ -69,4 +86,3 @@ hw_caps_t *get_hwcaps(void) { initialized = 1; return ∩︀ } - From 5b9c48fbf1dd53a1942f7f7e90b2d5f5b038374a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 9 Mar 2017 16:49:52 +0100 Subject: [PATCH 11/28] hardware_caps.cpp: Add hw ifdef for cs_get_chip_type() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f5cdaff28227801e7f9e76a03b4d01db9edc1ba3 Author: Michael Liebmann Date: 2017-03-09 (Thu, 09 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index fa4492ae7..4a71d764c 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -18,7 +18,6 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); - int chip = cs_get_chip_type(); caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); @@ -54,8 +53,9 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Zee"); caps.force_tuner_2G = 1; break; +#ifdef BOXMODEL_CS_HD2 case 11: - if (chip == 33904 /*0x8470*/) + if (cs_get_chip_type() == CS_CHIP_SHINER) { strcpy(caps.boxname, "Trinity"); strcpy(caps.boxarch, "Shiner"); @@ -78,6 +78,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Trinity Duo"); strcpy(caps.boxarch, "Kronos"); break; +#endif default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); From e0afe07ae2dc80cb04b08c99e0acc9b0d3da01a9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 10 Mar 2017 14:20:35 +0100 Subject: [PATCH 12/28] hd1/libcoolstream/cs_api.h: Update for new libcoolstream functions - cs_get_lib_version() - cs_compare_lib_versions() - cs_get_chip_type() (dummy function for compatibility with hd2) - Add CS_CHIP_xxx definitions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7eecd09eca64a35023d9a1c4d61ae0ea77aa3381 Author: Michael Liebmann Date: 2017-03-10 (Fri, 10 Mar 2017) ------------------ This commit was generated by Migit --- .../coolstream/hd1/libcoolstream/cs_api.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index f778e149b..1051c99c0 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -17,6 +17,13 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); +#define CS_CHIP_APOLLO 0x8490 +#define CS_CHIP_SHINER 0x8470 +#define CS_CHIP_KRONOS_S 0x7540 +#define CS_CHIP_KRONOS_C 0x7550 +#define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ + enum CS_LOG_MODULE { CS_LOG_CI = 0, CS_LOG_HDMI_CEC, @@ -71,6 +78,29 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); // Serial nr and revision accessors unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); +/* Dummy function for compatibility with hd2 */ +unsigned int cs_get_chip_type(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ From 063adf347d0b089e15f2379e7c67f3cca3fdb805 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 10 Mar 2017 14:25:06 +0100 Subject: [PATCH 13/28] hd2/libcoolstream/*.h: Update for new libcoolstream functions - cs_get_lib_version() - cs_compare_lib_versions() - GetVideoSystem() - GetVideoSystemFormatName() - Add CS_CHIP_NEVIS definitions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab6ca5b6069cefd4caf2cc84e9b1b0ba5ed452dc Author: Michael Liebmann Date: 2017-03-10 (Fri, 10 Mar 2017) ------------------ This commit was generated by Migit --- .../coolstream/hd2/libcoolstream/cs_api.h | 24 +++++++++++++++++++ .../coolstream/hd2/libcoolstream/video_cs.h | 12 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h index fe1b463da..120dcc5ac 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h @@ -26,6 +26,7 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); #define CS_CHIP_KRONOS_S 0x7540 #define CS_CHIP_KRONOS_C 0x7550 #define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ enum CS_LOG_MODULE { CS_LOG_CI = 0, @@ -49,6 +50,8 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +/* Preliminary function (for compatibility with older neutrino sources) */ +void cs_new_auto_videosystem(); // Memory helpers void *cs_malloc_uncached(size_t size); @@ -89,4 +92,25 @@ bool cs_box_has_ci(void); unsigned int cs_get_chip_id(void); unsigned int cs_get_chip_rev_id(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h index 6c1da4931..71f4e6db5 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h @@ -152,6 +152,12 @@ typedef enum VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS } VIDEO_CONTROL; +typedef struct cs_vs_format_t +{ + char formatHD[16]; + char formatSD[16]; +} cs_vs_format_struct_t; + class cDemux; class cAudio; @@ -190,6 +196,7 @@ private: analog_mode_t analog_mode_scart; fp_icon mode_icon; cDemux *demux; + int current_video_system; // int SelectAutoFormat(); void ScalePic(); @@ -243,6 +250,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); From 096ef211b2eb7231c64d06909c6eaebe9a6bd794 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 14/28] Revert "hardware_caps.cpp: Add hw ifdef for cs_get_chip_type()" This reverts commit 5b9c48fbf1dd53a1942f7f7e90b2d5f5b038374a because libcoolstream now is updated Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/83de4ba05575ce096ec1485cc8b447e108a53693 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 4a71d764c..fa4492ae7 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -18,6 +18,7 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); + int chip = cs_get_chip_type(); caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); @@ -53,9 +54,8 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Zee"); caps.force_tuner_2G = 1; break; -#ifdef BOXMODEL_CS_HD2 case 11: - if (cs_get_chip_type() == CS_CHIP_SHINER) + if (chip == 33904 /*0x8470*/) { strcpy(caps.boxname, "Trinity"); strcpy(caps.boxarch, "Shiner"); @@ -78,7 +78,6 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Trinity Duo"); strcpy(caps.boxarch, "Kronos"); break; -#endif default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); From c3a4e426cad2fa920492ee2207324c0adcdbe24c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 15/28] hardware_caps: use define instead of value; better readability Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7cca1e02c344ed553064e54913ca94d02899d76e Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps: use define instead of value; better readability ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index fa4492ae7..48c0cb7a6 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -55,7 +55,7 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 11: - if (chip == 33904 /*0x8470*/) + if (chip == CS_CHIP_SHINER) { strcpy(caps.boxname, "Trinity"); strcpy(caps.boxarch, "Shiner"); From 76ef7b2aefaedba9bfef221c03d42106c37ea8d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 16/28] hardware_caps/Makefile: use @HWLIB_CFLAGS@ instead of defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/24b159f84c5b15af727d00f79f27e5b18d47acaa Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps/Makefile: use @HWLIB_CFLAGS@ instead of defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/Makefile.am | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index d460837c3..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,12 +1,9 @@ -noinst_LIBRARIES = libhwcaps.a - AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing -if BOXMODEL_CS_HD2 -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd2/libcoolstream -else -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd1/libcoolstream -endif +AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libhwcaps.a libhwcaps_a_SOURCES = \ hardware_caps.cpp From bafdb8ba90c9ae39ea322d5795833bc1ad0075a8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 17/28] controlapi: /control/info => return right name Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e092059f32cd88e80ce52858bfe7d66712adc3a9 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: /control/info => return right name ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 6f64faf4c..0059a8336 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -786,18 +786,18 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList.empty()) - hh->Write("Neutrino HD\n"); + hh->Write("Tuxbox-Neutrino\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); else if (hh->ParamList["1"] == "version") // send version file hh->SendFile(TARGET_PREFIX "/.version"); - else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) + else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility) hh->Write("3"); else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version hh->printf("%s\n", HTTPD_VERSION); - else if (hh->ParamList["1"] == "hwinfo")// print hwinfo + else if (hh->ParamList["1"] == "hwinfo") // print hwinfo HWInfoCGI(hh); else hh->SendError(); From aa974ec7f85c9c1d87d7004b31e9b1cd43390809 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 18/28] controlapi: use hw_caps in HWInfoCGI() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b902648b085afa20ef1eef437d67b7c8a0176620 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: use hw_caps in HWInfoCGI() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 0059a8336..733c5f2c3 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -806,14 +806,11 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { - std::string boxname = NeutrinoAPI->NeutrinoYParser->func_get_boxtype(hh, ""); - std::string boxmodel = NeutrinoAPI->NeutrinoYParser->func_get_boxmodel(hh, ""); - static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); - hh->printf("%s (%s)\nMAC:%s\n", boxname.c_str(), boxmodel.c_str(), eth_id.c_str()); + hh->printf("%s %s (%s)\nMAC:%s\n", g_info.hw_caps->boxvendor, g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str()); } //----------------------------------------------------------------------------- void CControlAPI::ShutdownCGI(CyhookHandler *hh) From 734e15b5ff9d3910898b86e398cf4850bb23b389 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 19/28] neutrinoyparser: use hw_caps in func_get_boxtype() ... ... and func_get_boxmodel() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/305b1a6da5c731e235c2570d97c0bb289b82e4b6 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - neutrinoyparser: use hw_caps in func_get_boxtype() ... ... and func_get_boxmodel() ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 96 ++---------------------- 1 file changed, 7 insertions(+), 89 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 7b142a2ef..8692f5298 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -838,103 +838,21 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { - unsigned int system_rev = cs_get_revision(); - std::string boxname = "CST "; + std::string boxvendor(g_info.hw_caps->boxvendor); + std::string boxname(g_info.hw_caps->boxname); -#if HAVE_TRIPLEDRAGON - boxname = "Armas "; -#endif + /* workaround for Neo2 */ + if ((boxname.compare("Neo") == 0) && (CFEManager::getInstance()->getFrontendCount() > 1)) + boxname += " Twin"; - switch(system_rev) - { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; -#ifdef BOXMODEL_CS_HD1 - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - boxname += "Neo"; - if (CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; - break; - case 10: - boxname += "Zee"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxname += "Tank"; - break; - case 11: - boxname += "Trinity"; - if (cs_get_chip_type() != 33904 /*0x8470*/) - boxname += " V2"; - break; - case 12: - boxname += "Zee2"; - break; - case 13: - boxname += "Link"; - break; - case 14: - boxname += "Trinity Duo"; - break; -#endif - default: - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - break; - } - - return boxname; + return boxvendor + " " + boxname; } //------------------------------------------------------------------------- // y-func : get boxmodel //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) { - unsigned int system_rev = cs_get_revision(); - std::string boxmodel = "Unknown"; - - switch(system_rev) - { -#ifdef BOXMODEL_CS_HD1 - case 6: - case 7: - case 8: - case 10: - boxmodel = "Nevis"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxmodel = "Apollo"; - break; - case 11: - if (cs_get_chip_type() == 33904 /*0x8470*/) - boxmodel = "Shiner"; - else - boxmodel = "Kronos"; - break; - case 12: - case 13: - case 14: - boxmodel = "Kronos"; - break; -#endif - default: - break; - } - - return boxmodel; + return g_info.hw_caps->boxarch; } //------------------------------------------------------------------------- // y-func : get stream info From 283c5857f53c557c85a92fd37b8519af556fc4c6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 20/28] hardware_caps: just changes in comments Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff6046bb5650b4237b3fd6f69e0b7b685185e8aa Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps: just changes in comments ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 48c0cb7a6..592202285 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -34,7 +34,6 @@ hw_caps_t *get_hwcaps(void) { caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); - /* list of boxnames from neutrinoyparser.cpp */ strcpy(caps.boxarch, "Nevis"); switch (rev) { case 6: @@ -42,7 +41,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "HD1"); caps.force_tuner_2G = 1; break; - case 8: + case 8: // TODO: Neo2 - Twin strcpy(caps.boxname, "Neo"); caps.force_tuner_2G = 1; break; From 29a00a81ae7f90c86864d0192386581e46af5f1b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:27:30 +0100 Subject: [PATCH 21/28] remove obsolete ifdef's Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4aecc9f1b58229d2de80bc73d80a879b0178eaa2 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - remove obsolete ifdef's ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/info_menue.cpp | 2 -- src/gui/update.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index b1354e132..985e41593 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -72,9 +72,7 @@ int CInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey) //NI { char str[1024]; sprintf(str, "cs_get_revision(): 0x%02X\n", cs_get_revision()); -#ifdef BOXMODEL_CS_HD2 sprintf(str, "%scs_get_chip_type(): 0x%04X\n", str, cs_get_chip_type()); -#endif ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack); return res; } diff --git a/src/gui/update.cpp b/src/gui/update.cpp index fa899a272..8f01a0375 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -141,9 +141,7 @@ void CFlashUpdate::update_php(std::string &url, const char* type) if (url.find("update.php") != std::string::npos) { url += "?revision=" + to_string(cs_get_revision()); -#ifdef BOXMODEL_CS_HD2 url += "&chip_type=" + to_string(cs_get_chip_type()); -#endif url += "&image_type=" + (std::string)type; printf("[update_php] url %s\n", url.c_str()); } From 938e4c22f8da2464eca4165b0c5732517118c4ac Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:36:13 +0100 Subject: [PATCH 22/28] controlapi: /control/info => return PACKAGE_NAME and PACKAGE_VERSION Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0203de264f6b4e03c512e88c5c08c5f8beb823f7 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: /control/info => return PACKAGE_NAME and PACKAGE_VERSION ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 733c5f2c3..bb5eb829b 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -786,7 +786,7 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList.empty()) - hh->Write("Tuxbox-Neutrino\n"); + hh->Write(PACKAGE_NAME " " PACKAGE_VERSION "\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo From 00b109d321658792cdfba618bccc433ad61befae Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 7 Mar 2017 19:46:30 +0100 Subject: [PATCH 23/28] msgbox: deobfuscate assignment of default result value Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2cef61bd8e249cf9118566d9eaa54cdcfab7f965 Author: Stefan Seyfried Date: 2017-03-07 (Tue, 07 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 48921105b..b89220a13 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -101,10 +101,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t shadow = CC_SHADOW_ON; //set result - if (Default_result != mbrNone) - result = default_result = Default_result; - else - result = mbrNone; + result = default_result = Default_result; + //add and initialize footer buttons with required buttons and basic properties if (ShowButtons > -1) mb_show_button = ShowButtons; From ff2eb924011450972d3caccbf731d4199c3e9e59 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 7 Mar 2017 19:55:25 +0100 Subject: [PATCH 24/28] bouquetlist: don't block RC keys while list is opened Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c857fc49be6a27e9c5137893980841514892fb1d Author: Stefan Seyfried Date: 2017-03-07 (Tue, 07 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index f112c8d4f..4794e2579 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -2,7 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Copyright (C) 2009,2011,2013,2015-2016 Stefan Seyfried + Copyright (C) 2009,2011,2013,2015-2017 Stefan Seyfried License: GPL @@ -579,7 +579,7 @@ int CBouquetList::show(bool bShowChannelList) g_RCInput->postMsg(msg, data); loop = false; res = CHANLIST_CANCEL_ALL; - } else if (msg > CRCInput::RC_MaxRC) { + } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = CHANLIST_CANCEL_ALL; From e7daf551b3c1e3f60be1281d63d984ca6e7f68c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 11 Mar 2017 00:45:25 +0100 Subject: [PATCH 25/28] CCDraw: add possibility to use background images as item background Provides functionality to use a backround image instead to render usual box. If an image is defined, box render is disabled, but behavior for hide, kill, cache... is not changed. TODO: - maybe needs global caching because images are not yet managed like icons in framebuffer class Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ccb82083e26147214a782c7407c12bb1dc03b9a9 Author: Thilo Graf Date: 2017-03-11 (Sat, 11 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 180 ++++++++++++++++++++++----------- src/gui/components/cc_draw.h | 32 +++++- 2 files changed, 152 insertions(+), 60 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 9ca52c03c..5c4d8448b 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -27,8 +27,9 @@ #include "cc_draw.h" #include "cc_timer.h" #include - +#include #include +extern CPictureViewer * g_PicViewer; CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { @@ -44,6 +45,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) col_frame = col_frame_old = COL_FRAME_PLUS_0; col_shadow_clean = 0; + cc_body_image = cc_body_image_old = string(); + fr_thickness = fr_thickness_old = 0; corner_type = corner_type_old = CORNER_ALL; @@ -176,6 +179,11 @@ inline bool CCDraw::applyColChanges() cc_body_gradient_direction_old = cc_body_gradient_direction; ret = true; } + if (cc_body_image != cc_body_image_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], col changes cc_body_image %s != cc_body_image_old %s...\033[0m\n", __func__, __LINE__, cc_body_image.c_str(), cc_body_image_old.c_str()); + cc_body_image_old = cc_body_image; + ret = true; + } return ret; } @@ -467,13 +475,13 @@ void CCDraw::enablePaintCache(bool enable) //paint framebuffer layers void CCDraw::paintFbItems(bool do_save_bg) { - //pick up signal if filled + //Pick up signal if filled and execute slots. OnBeforePaintLayers(); - //first modify background handling + //First we modify background handling. enableSaveBg(do_save_bg); - //save background before first paint, cc_save_bg must be true + //Save background before first paint, cc_save_bg must be true. if (firstPaint && cc_save_bg){ /* On first we must ensure that screen buffer is empty. * Here we clean possible screen buffers in bg layers, @@ -482,7 +490,7 @@ void CCDraw::paintFbItems(bool do_save_bg) clearSavedScreen(); /* On second step we check for - * usable item dimensions and exit here if found any problem + * usable item dimensions and exit here if found any problem. */ for(size_t i=0; i 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); @@ -550,10 +558,10 @@ void CCDraw::paintFbItems(bool do_save_bg) } if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { if (fbdata.enabled) { - /* here we paint the shadow around the body - * on 1st step we check for already cached screen buffer, if true - * then restore this instead to call the paint methode. - * This could be usally, if we use existant instances of "this" object + /* Here we paint the shadow around the body. + * On 1st step we check for already cached screen buffer, if true + * then restore this instead to call the paint methode. + * This could be usally, if we use an existant instances of "this" object */ if (cc_allow_paint){ if (fbdata.pixbuf){ @@ -562,7 +570,7 @@ void CCDraw::paintFbItems(bool do_save_bg) }else{ frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); } - //if is paint cache enabled + //If is paint cache enabled, catch screen into cache if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); fbdata.is_painted = true; @@ -572,63 +580,104 @@ void CCDraw::paintFbItems(bool do_save_bg) if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BOX){ if(cc_allow_paint) { - /* here we paint the main body of box - * on 1st step we check for already cached background buffer, if true - * then restore this instead to call the paint methodes and gradient creation - * paint cache can be enable/disable with enablePaintCache() + /* Here we paint the main body of box. + * On 1st step we check for already cached background buffer, if true + * then restore this instead to call the paint methodes and gradient creation. + * Paint cache can be enable/disable with enablePaintCache() */ if (fbdata.pixbuf){ + /* If is paint cache enabled and cache is filled, it's prefered to paint + * from cache. Cache is also filled if body background images are used + */ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint body from cache...\033[0m\n", __func__, __LINE__); frameBuffer->RestoreScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.pixbuf); }else{ - //ensure clean gradient data on disabled gradient + //Ensure clean gradient data on disabled gradient. if(cc_body_gradient_enable == CC_COLGRAD_OFF && fbdata.gradient_data){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], gradient mode is disabled but filled\033[0m\n", __func__, __LINE__); clearFbGradientData(); } - if (cc_body_gradient_enable != CC_COLGRAD_OFF){ - /* if color gradient enabled we create a gradient_data - * instance and add it to the fbdata object - * On disabled coloor gradient we do paint only a default box - */ - if (fbdata.gradient_data == NULL){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], crate new gradient data)...\033[0m\n", __func__, __LINE__); - fbdata.gradient_data = getGradientData(); + + /* If background image is defined, + * we try to render an image instead to render default box. + * Paint of background image is prefered, next steps will be ignored! + */ + if (!cc_body_image.empty()){ + if (g_PicViewer->DisplayImage(cc_body_image, fbdata.x, fbdata.y, fbdata.dx, fbdata.dy)){ + // catch screen and store into paint cache + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; + }else{ + if (fbdata.pixbuf){ + delete[] fbdata.pixbuf; + fbdata.pixbuf = NULL; + } + fbdata.is_painted = false; } - // if found empty gradient buffer, create it, otherwise paint from gradient cache - if (fbdata.gradient_data->boxBuf == NULL){ - if (!fbdata.pixbuf){ - // on enabled clean up, paint blank screen before create gradient box, this prevents possible ghost text with hw acceleration - if (cc_gradient_bg_cleanup) - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + // On failed image paint, write this into log and reset image name. + if (!fbdata.is_painted){ + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], WARNING: bg image %s defined, but paint failed,\nfallback to default rendering...\033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + cc_body_image = ""; + } + } - // create gradient buffer and paint gradient box - fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + /* If no background image is defined, we paint default box or box with gradient + * This is also possible if any background image is defined but image paint ist failed + */ + if (cc_body_image.empty()){ + if (cc_body_gradient_enable != CC_COLGRAD_OFF ){ + + /* If color gradient enabled we create a gradient_data + * instance and add it to the fbdata object + * On disabled color gradient or image paint was failed, we do paint only a default box + */ + if (fbdata.gradient_data == NULL){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], create new gradient data)...\033[0m\n", __func__, __LINE__); + fbdata.gradient_data = getGradientData(); } - /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. - * If we don't do this, gradient cache is used. - */ - if (cc_paint_cache || cc_gradient_bg_cleanup){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); - if (clearFbGradientData()) - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + if (fbdata.gradient_data->boxBuf == NULL){ + if (fbdata.pixbuf == NULL){ + /* Before we paint any gradient box with hw acceleration, we must cleanup first. + * FIXME: This is only a workaround for this framebuffer behavior on enabled hw acceleration. + * Without this, ugly ghost letters or ghost images inside gradient boxes are possible. + */ + if (cc_gradient_bg_cleanup) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + + // create gradient buffer and paint gradient box + fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + } + + /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. + * If we don't do this explicit, gradient cache is used. + */ + if (cc_paint_cache || cc_gradient_bg_cleanup){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + if (clearFbGradientData()) + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + } + }else{ + // If found gradient buffer, paint box from gradient cache. + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); } }else{ - //use gradient cache to repaint gradient box - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); + /* If is nothihng cached or no background image was defined or image paint was failed, + * render a default box. + */ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); + + //If is paint cache enabled, catch screen into cache. + if (cc_paint_cache) + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } - }else{ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); - if (cc_paint_cache) - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } v_fbdata[i].is_painted = true; @@ -653,7 +702,6 @@ void CCDraw::paintFbItems(bool do_save_bg) //reset is painted ignore flag to default value force_paint_bg = false; - //pick up signal if filled OnAfterPaintLayers(); } @@ -797,3 +845,21 @@ bool CCDraw::cancelBlink(bool keep_on_screen) return res; } + +bool CCDraw::setBodyBGImage(const std::string& image_path) +{ + if (cc_body_image == image_path) + return false; + + cc_body_image = image_path; + + if (clearPaintCache()) + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], new body background image defined: %s , \033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + + return true; +} + +bool CCDraw::setBodyBGImageName(const std::string& image_name) +{ + return setBodyBGImage(frameBuffer->getIconPath(image_name)); +} diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 50be8a71d..26b8875d5 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -78,6 +78,8 @@ class CCDraw : public COSDFader, public CComponentsSignals fb_pixel_t col_frame, col_frame_old; ///internal property: color for shadow clean up fb_pixel_t col_shadow_clean; + ///property: background image, see also setBodyBGImage() + std::string cc_body_image, cc_body_image_old; ///property: frame thickness, see also setFrameThickness() int fr_thickness, fr_thickness_old; @@ -407,8 +409,32 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void killShadow(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); - virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; - virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; } + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); } + + /**Sets an image path for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_path Path to image. + * + * @see + * cc_body_image + * setBodyBGImageName() + */ + virtual bool setBodyBGImage(const std::string& image_path); + + /**Sets an image name for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_name Basename of image. + * + * @see + * cc_body_image + * setBodyBGImage() + */ + virtual bool setBodyBGImageName(const std::string& image_name); }; #endif From 5368732f2ffd6655b5887e8fe0eb86d7dfcbfeb4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 11 Mar 2017 00:45:25 +0100 Subject: [PATCH 26/28] CComponentsFooter: simplify implementation of button labels button_label_l and button_label_s are now merged to button_label_cc with prepared default values for text and locales.This type contains all possible button label properties. Values for locales and string are evaluated in setButtonLabels(), so it's possible to remove some overloaded methodes. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c766a970dc352eef77464a19a512758ff767535f Author: Thilo Graf Date: 2017-03-11 (Sat, 11 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 48 +++++----------------------- src/gui/components/cc_frm_footer.h | 26 ++++----------- src/gui/lua/lua_cc_window.cpp | 10 +++--- src/gui/widget/msgbox.cpp | 6 ++-- 4 files changed, 23 insertions(+), 67 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 2b1c568ff..37372ba2f 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2013-2014, Thilo Graf 'dbt' + Copyright (C) 2013-2017, Thilo Graf 'dbt' License: GPL @@ -102,7 +102,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const initParent(parent); } -void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) { /* clean up before init*/ if (chain) @@ -178,7 +178,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont vector v_btns; int h_btn = /*(ccf_enable_button_bg ? */chain->getHeight()-2*fr_thickness/*-OFFSET_INNER_SMALL*//* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ - string txt = content[i].text; + string txt = content[i].locale == NONEXISTANT_LOCALE ? content[i].text : g_Locale->getText(content[i].locale); string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; @@ -244,26 +244,10 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont } } -void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width) -{ - button_label_s buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = content[i].button; - buttons[i].text = content[i].locale != NONEXISTANT_LOCALE ? g_Locale->getText(content[i].locale) : ""; - buttons[i].directKey = content[i].directKey; - buttons[i].directKeyAlt = content[i].directKeyAlt; - buttons[i].btn_result = content[i].btn_result; - buttons[i].btn_alias = content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width) { //conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h - button_label_l buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i = 0; i< label_count; i++){ buttons[i].button = content[i].button; buttons[i].locale = content[i].locale; @@ -276,31 +260,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten setButtonLabels(buttons, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) { size_t label_count = v_content.size(); - button_label_l buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = v_content[i].button; - buttons[i].locale = v_content[i].locale; - buttons[i].directKey = v_content[i].directKey; - buttons[i].directKeyAlt = v_content[i].directKeyAlt; - buttons[i].btn_result = v_content[i].btn_result; - buttons[i].btn_alias = v_content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) -{ - size_t label_count = v_content.size(); - button_label_s buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; buttons[i].text = v_content[i].text; + buttons[i].locale = v_content[i].locale; buttons[i].directKey = v_content[i].directKey; buttons[i].directKeyAlt = v_content[i].directKeyAlt; buttons[i].btn_result = v_content[i].btn_result; @@ -319,7 +287,7 @@ void CComponentsFooter::setButtonLabel( const char *button_icon, const int& alias_value, const neutrino_msg_t& directKeyAlt) { - button_label_s button[1]; + button_label_cc button[1]; button[0].button = button_icon; button[0].text = text; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 59a90e8f5..5add6ffae 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' License: GPL @@ -30,25 +30,17 @@ #include //for compatibility with 'button_label' type //for 'button_label' type with string -typedef struct button_label_s +typedef struct button_label_cc { const char * button; std::string text; + neutrino_locale_t locale; neutrino_msg_t directKey; neutrino_msg_t directKeyAlt; int btn_result; int btn_alias; -} button_label_s_struct; - -typedef struct button_label_l -{ - const char * button; - neutrino_locale_t locale; - neutrino_msg_t directKey; - neutrino_msg_t directKeyAlt; - int btn_result; - int btn_alias; -} button_label_l_struct; + button_label_cc(): text(std::string()), locale(NONEXISTANT_LOCALE){} +} button_label_cc_struct; /*! CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer @@ -101,13 +93,9 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); ///add button labels with string label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); ///enable/disable button frame in icon color, predefined for red, green, yellow and blue inline void enableButtonFrameColor(bool enable = true){btn_auto_frame_col = enable;} diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 494487614..2225797bc 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -139,27 +139,27 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) else { CComponentsFooter* footer = (*udata)->w->getFooterObject(); if (footer) { - vector buttons; + vector buttons; if (!btnRed.empty()) { - button_label_s btnSred; + button_label_cc btnSred; btnSred.button = NEUTRINO_ICON_BUTTON_RED; btnSred.text = btnRed; buttons.push_back(btnSred); } if (!btnGreen.empty()) { - button_label_s btnSgreen; + button_label_cc btnSgreen; btnSgreen.button = NEUTRINO_ICON_BUTTON_GREEN; btnSgreen.text = btnGreen; buttons.push_back(btnSgreen); } if (!btnYellow.empty()) { - button_label_s btnSyellow; + button_label_cc btnSyellow; btnSyellow.button = NEUTRINO_ICON_BUTTON_YELLOW; btnSyellow.text = btnYellow; buttons.push_back(btnSyellow); } if (!btnBlue.empty()) { - button_label_s btnSblue; + button_label_cc btnSblue; btnSblue.button = NEUTRINO_ICON_BUTTON_BLUE; btnSblue.text = btnBlue; buttons.push_back(btnSblue); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index b89220a13..bcdd23e8a 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2016 Thilo Graf 'dbt' + Copyright (C) 2014-2017 Thilo Graf 'dbt' License: GPL @@ -117,8 +117,8 @@ void CMsgBox::initTimeOut() void CMsgBox::initButtons() { - button_label_s btn; - vector v_buttons; + button_label_cc btn; + vector v_buttons; //evaluate combinations if (mb_show_button & mbAll) From de0263121b167f88337e1279dbf110a3be40094f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 11 Mar 2017 12:50:36 +0100 Subject: [PATCH 27/28] tuxtxt.cpp: align to tuxbox-neutrino Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f599f3aa98e4670d9dcb86b0c37284086f50e162 Author: vanhofen Date: 2017-03-11 (Sat, 11 Mar 2017) Origin message was: ------------------ - tuxtxt.cpp: align to tuxbox-neutrino ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index bf47055f0..5eae7e587 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -2087,7 +2087,7 @@ int Init(int source) return 0; } - if ((error = FTC_Manager_New(library, 0, 0, 1024*1024, &MyFaceRequester, NULL, &manager))) + if ((error = FTC_Manager_New(library, 7, 2, 1024*1024, &MyFaceRequester, NULL, &manager))) { FT_Done_FreeType(library); printf("TuxTxt \n", error); From e7d1a446936dd0eca61f43d6b922fd7aa34a4e42 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 12 Mar 2017 06:32:52 +0100 Subject: [PATCH 28/28] Revert "- allow to force given osd resolution in "videosystem = auto" mode" This reverts commit f3fe4a116f92b0722fee7c0aaa315e0b73c0729d. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ce34d5cf95bd496a59ba9dd23aeddb35a5746d7 Author: Michael Liebmann Date: 2017-03-12 (Sun, 12 Mar 2017) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 +------ data/locale/english.locale | 5 ----- src/gui/osd_helpers.cpp | 41 ++++++++++++++++++++------------------ src/gui/osd_helpers.h | 8 +------- src/gui/osd_setup.cpp | 16 +-------------- src/neutrino.cpp | 2 -- src/system/locals.h | 5 ----- src/system/locals_intern.h | 5 ----- src/system/settings.h | 1 - 9 files changed, 25 insertions(+), 65 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bec07ffea..5b9c45c61 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,10 +325,6 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung -colormenu.osd_resolution_force OSD-Auflösung erzwingen -colormenu.osd_resolution_force_all in allen Modi -colormenu.osd_resolution_force_hd in HD-Modi -colormenu.osd_resolution_force_never nie colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1256,8 +1252,7 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) -menu.hint_osd_resolution Wählen Sie eine OSD-Auflösung -menu.hint_osd_resolution_force Erzwingt die eingestellte OSD-Auflösung, auch wenn das Videosystem automatisch umgeschalten wird +menu.hint_osd_resolution Wählen Sie eine OSD Auflösung menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index b568e7b53..d8d2fbe20 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,10 +325,6 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution -colormenu.osd_resolution_force Force OSD resolution -colormenu.osd_resolution_force_all in all modes -colormenu.osd_resolution_force_hd in HD modes -colormenu.osd_resolution_force_never never colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1257,7 +1253,6 @@ menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV menu.hint_osd_resolution Change OSD resolution -menu.hint_osd_resolution_force Forces the given OSD resolution, even when the videosystem is auto-changed menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index ed257ce49..2675cffef 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -61,9 +61,12 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo if ((g_settings.video_Mode == VIDEO_STD_AUTO) && (g_settings.enabled_auto_modes[videoSystem] == 1) && - (!allow_OSDMODE_1080(videoSystem))) + (!isVideoSystem1080(videoSystem))) modeNew = OSDMODE_720; +// if (!isVideoSystem1080(videoSystem)) +// modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 @@ -127,28 +130,28 @@ void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) } #endif -bool COsdHelpers::allow_OSDMODE_1080(int res) +int COsdHelpers::isVideoSystem1080(int res) { - if (g_settings.osd_resolution_force == FORCE_ALL || ( - (res == VIDEO_STD_1080I50) - || (res == VIDEO_STD_1080I60) - || (res == VIDEO_STD_1080P24) - || (res == VIDEO_STD_1080P25) - || (res == VIDEO_STD_1080P30) -#ifdef BOXMODEL_CS_HD2 - || (res == VIDEO_STD_1080P50) - || (res == VIDEO_STD_1080P60) - || (res == VIDEO_STD_1080P2397) - || (res == VIDEO_STD_1080P2997) -#endif - )) + if ((res == VIDEO_STD_1080I60) || + (res == VIDEO_STD_1080I50) || + (res == VIDEO_STD_1080P30) || + (res == VIDEO_STD_1080P24) || + (res == VIDEO_STD_1080P25)) return true; - if (g_settings.osd_resolution_force == FORCE_HD && ( - (res == VIDEO_STD_720P50) - || (res == VIDEO_STD_720P60) - )) +#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; } diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index d9fa0c035..9c78886f0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,16 +19,10 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - bool allow_OSDMODE_1080(int res); + int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); int setVideoSystem(int newSystem, bool remember = true); - - enum { - FORCE_NEVER = 0, - FORCE_HD, - FORCE_ALL - }; }; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9e8b9db00..281999311 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -397,14 +397,6 @@ const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; -const CMenuOptionChooser::keyval OSD_RESOLUTION_FORCE_OPTIONS[]= -{ - { COsdHelpers::FORCE_NEVER, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER }, - { COsdHelpers::FORCE_HD, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD }, - { COsdHelpers::FORCE_ALL, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL } -}; -int OSD_RESOLUTION_FORCE_OPTIONS_COUNT = sizeof(OSD_RESOLUTION_FORCE_OPTIONS)/sizeof(OSD_RESOLUTION_FORCE_OPTIONS[0]); - #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_MODE_OPTION_COUNT] = { @@ -670,17 +662,11 @@ int COsdSetup::showOsdSetup() } int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); bool enable = ((resCount > 1) && - COsdHelpers::getInstance()->allow_OSDMODE_1080(videoSystem) && + 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); - - // force resolution in auto-mode - enable = (g_settings.video_Mode == VIDEO_STD_AUTO); - CMenuOptionChooser * osd_res_force = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, &g_settings.osd_resolution_force, OSD_RESOLUTION_FORCE_OPTIONS, OSD_RESOLUTION_FORCE_OPTIONS_COUNT, enable, this); - osd_res_force->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE); - osd_menu->addItem(osd_res_force); #endif //monitor diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 67ff7e77e..fb9c3eeaa 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -726,7 +726,6 @@ 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.osd_resolution_force = configfile.getInt32("osd_resolution_force", COsdHelpers::FORCE_NEVER); 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); @@ -1368,7 +1367,6 @@ void CNeutrinoApp::saveSetup(const char * fname) //screen configuration configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); - configfile.setInt32("osd_resolution_force", g_settings.osd_resolution_force); 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); diff --git a/src/system/locals.h b/src/system/locals.h index 3ddb368d7..b39748482 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,10 +352,6 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1284,7 +1280,6 @@ typedef enum LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, LOCALE_MENU_HINT_OSD_RESOLUTION, - LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0f327937a..b39ca2c98 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,10 +352,6 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", - "colormenu.osd_resolution_force", - "colormenu.osd_resolution_force_all", - "colormenu.osd_resolution_force_hd", - "colormenu.osd_resolution_force_never", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1284,7 +1280,6 @@ const char * locale_real_names[] = "menu.hint_osd_language", "menu.hint_osd_preset", "menu.hint_osd_resolution", - "menu.hint_osd_resolution_force", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 70c23c731..3a063669e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -626,7 +626,6 @@ struct SNeutrinoSettings int screen_EndX_lcd_1; int screen_EndY_lcd_1; int osd_resolution; - int osd_resolution_force; int screen_preset; int screen_width; int screen_height;