From fb8a993e776330db30c67b4e10388da74a69761b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 23 Sep 2012 22:57:47 +0200 Subject: [PATCH 1/8] - movieinfo.h: typo in xml-entry "quality" --- src/gui/movieinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 4fb907407..876ed2b49 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -86,7 +86,7 @@ #define MI_XML_TAG_LENGTH "length" #define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" #define MI_XML_TAG_PRODUCT_DATE "productiondate" -#define MI_XML_TAG_QUALITY "qualitiy" +#define MI_XML_TAG_QUALITY "quality" #define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage" #define MI_XML_TAG_BOOKMARK "bookmark" #define MI_XML_TAG_BOOKMARK_START "bookmarkstart" From 2133b25783acfb4bc290267194dd92e574844cca Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 24 Sep 2012 11:26:42 +0200 Subject: [PATCH 2/8] - movieinfo: supplement to fb8a993e776330db30c67b4e10388da74a69761b re-insert the wrong -tag to keep compatibility but this tag will not longer be written into xml-files. --- src/gui/movieinfo.cpp | 2 ++ src/gui/movieinfo.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 004a573bc..188464d89 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -393,6 +393,7 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) XML_GET_DATA_STRING(xam1, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); //if(!strcmp(xam1->GetType(), MI_XML_TAG_PRODUCT_COUNTRY)) if(xam1->GetData() != NULL)strncpy(movie_info->productionCountry, xam1->GetData(),4); XML_GET_DATA_INT(xam1, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); + XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITIY, movie_info->quality); XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITY, movie_info->quality); XML_GET_DATA_INT(xam1, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); XML_GET_DATA_INT(xam1, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay); @@ -673,6 +674,7 @@ bool CMovieInfo::parseXmlQuickFix(char *text, MI_MOVIE_INFO * movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITIY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay) if (strncmp(&text[pos], MI_XML_TAG_AUDIOPIDS, sizeof(MI_XML_TAG_AUDIOPIDS) - 1) == 0) diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 876ed2b49..d90369b63 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -87,6 +87,7 @@ #define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" #define MI_XML_TAG_PRODUCT_DATE "productiondate" #define MI_XML_TAG_QUALITY "quality" +#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files #define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage" #define MI_XML_TAG_BOOKMARK "bookmark" #define MI_XML_TAG_BOOKMARK_START "bookmarkstart" From 59ea9c05f3d1bfe8ad8a9fdf371d29c5b22ea9a3 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 25 Sep 2012 17:13:25 +0400 Subject: [PATCH 3/8] locals: add locales for record status --- data/locale/english.locale | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index 3f3100cbf..1d5307a08 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1648,6 +1648,8 @@ streaminfo.resolution Resolution streaminfo.signal Receipt signal streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart Neutrino-HD. streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. +streaming.overflow Record buffer overflow, consider to stop some records +streaming.slow System/hdd too slow, consider to stop some records streaming.write_error The recording was aborted,\nsince an error occured during the writing process. stringinput.caps caps / no caps stringinput.clear clear all diff --git a/src/system/locals.h b/src/system/locals.h index 272c29188..113bf9cc9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1675,6 +1675,8 @@ typedef enum LOCALE_STREAMINFO_SIGNAL, LOCALE_STREAMING_BUSY, LOCALE_STREAMING_DIR_NOT_WRITABLE, + LOCALE_STREAMING_OVERFLOW, + LOCALE_STREAMING_SLOW, LOCALE_STREAMING_WRITE_ERROR, LOCALE_STRINGINPUT_CAPS, LOCALE_STRINGINPUT_CLEAR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2879066a0..15b277c1a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1675,6 +1675,8 @@ const char * locale_real_names[] = "streaminfo.signal", "streaming.busy", "streaming.dir_not_writable", + "streaming.overflow", + "streaming.slow", "streaming.write_error", "stringinput.caps", "stringinput.clear", From 70836baa483f0aed9822291b12ed7ac33b8b0b86 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 25 Sep 2012 17:13:43 +0400 Subject: [PATCH 4/8] lib/libcoolstream/record_cs.h: update header --- lib/libcoolstream/record_cs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libcoolstream/record_cs.h b/lib/libcoolstream/record_cs.h index e139495f2..4ef6f3df0 100644 --- a/lib/libcoolstream/record_cs.h +++ b/lib/libcoolstream/record_cs.h @@ -14,6 +14,10 @@ class cRecordData; +#define REC_STATUS_OK 0 +#define REC_STATUS_SLOW 1 +#define REC_STATUS_OVERFLOW 2 + class cRecord { private: cRecordData * rd; @@ -29,6 +33,8 @@ public: bool Start(int fd, unsigned short vpid, unsigned short * apids, int numapids, uint64_t chid); bool Stop(void); bool AddPid(unsigned short pid); + int GetStatus(); + void ResetStatus(); }; #endif // __RECORD_CS_H_ From b8ff3bbdd5f48973c55a8e9b0908bf9b2a93b90a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 25 Sep 2012 17:19:28 +0400 Subject: [PATCH 5/8] driver/record.cpp: add timer to monitor record status; add warning, when record buffer close to or already overflow; change single record stop to sync mode - under high load stopTimerEvent() takes too long --- src/driver/record.cpp | 59 ++++++++++++++++++++++++++++++++++++++++--- src/driver/record.h | 4 +++ 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4f2f723e2..6e637611d 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -129,6 +129,13 @@ void CRecordInstance::WaitRecMsg(time_t StartTime, time_t WaitTime) usleep(100000); } +int CRecordInstance::GetStatus() +{ + if (record) + return record->GetStatus(); + return 0; +} + record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) { int fd; @@ -642,8 +649,9 @@ void CRecordInstance::GetRecordString(std::string &str) return; } char stime[15]; + int err = GetStatus(); strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time)); - str = stime + channel->getName() + ": " + GetEpgTitle(); + str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!]" : ""); } //------------------------------------------------------------------------- @@ -660,6 +668,9 @@ CRecordManager::CRecordManager() nextmap.clear(); autoshift = false; shift_timer = 0; + check_timer = 0; + error_display = true; + warn_display = true; } CRecordManager::~CRecordManager() @@ -891,8 +902,15 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons mutex.unlock(); - if (error_msg == RECORD_OK) + if (error_msg == RECORD_OK) { + if (check_timer == 0) + check_timer = g_RCInput->addTimer(5*1000*1000, false); + + /* set flag to show record error if any */ + error_display = true; + warn_display = true; return true; + } printf("[recordmanager] %s: error code: %d\n", __FUNCTION__, error_msg); /* RestoreNeutrino must be called always if record start failed */ @@ -1115,6 +1133,8 @@ void CRecordManager::StopPostProcess() RestoreNeutrino(); StartNextRecording(); RunStopScript(); + if(!RecordingStatus()) + g_RCInput->killTimer(check_timer); } bool CRecordManager::Update(const t_channel_id channel_id) @@ -1147,6 +1167,27 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data StartAutoRecord(); return messages_return::handled; } + else if(data == check_timer) { + if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby) { + mutex.lock(); + int have_err = 0; + for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) + have_err |= it->second->GetStatus(); + mutex.unlock(); + //printf("%s: check status: show err %d warn %d have_err %d\n", __FUNCTION__, error_display, warn_display, have_err); //FIXME + if (have_err) { + if ((have_err & REC_STATUS_OVERFLOW) && error_display) { + error_display = false; + warn_display = false; + DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); + } else if (warn_display) { + warn_display = false; + DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW)); + } + } + return messages_return::handled; + } + } } return messages_return::unhandled; } @@ -1418,7 +1459,7 @@ bool CRecordManager::ShowMenu(void) bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) { - int recording_id = 0; + //int recording_id = 0; std::string title; CRecordInstance * inst; @@ -1429,7 +1470,7 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) inst = FindInstance(channel_id); if(inst) { - recording_id = inst->GetRecordingId(); + //recording_id = inst->GetRecordingId(); inst->GetRecordString(title); } mutex.unlock(); @@ -1438,7 +1479,17 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) if(ShowMsgUTF(LOCALE_SHUTDOWN_RECODING_QUERY, title.c_str(), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { +#if 0 g_Timerd->stopTimerEvent(recording_id); +#endif + mutex.lock(); + if (recid) + inst = FindInstanceID(recid); + else + inst = FindInstance(channel_id); + if (inst) + StopInstance(inst); + mutex.unlock(); return true; } return false; diff --git a/src/driver/record.h b/src/driver/record.h index 05c226e82..60d9e03fd 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -124,6 +124,7 @@ class CRecordInstance bool Timeshift() { return autoshift; }; int tshift_mode; void SetStopMessage(const char* text) {rec_stop_msg = text;} ; + int GetStatus(); CFrontend * frontend; }; @@ -150,6 +151,9 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ int last_mode; bool autoshift; uint32_t shift_timer; + uint32_t check_timer; + bool error_display; + bool warn_display; OpenThreads::Mutex mutex; static OpenThreads::Mutex sm; From f7bcb3dd642409ff8c222e3007a13c731223af0a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 29 Sep 2012 14:44:48 +0400 Subject: [PATCH 6/8] zapit/src/zapit.cpp: add missing initial volume set --- src/zapit/src/zapit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 6215f1772..19b574d35 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2042,6 +2042,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/); videoDecoder->SetAudioHandle(audioDecoder->GetHandle()); + /* set initial volume with 100% */ + SetVolumePercent(100); #ifdef USE_VBI videoDecoder->OpenVBI(1); #endif From 410b19aaf3ecff2fba571939c213506122c3f86f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 29 Sep 2012 14:45:57 +0400 Subject: [PATCH 7/8] locals: add locales for start wizard initial settings --- data/locale/english.locale | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index 1d5307a08..d9d25012b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1799,6 +1799,8 @@ videomenu.videoformat_149 14:9 videomenu.videoformat_169 16:9 videomenu.videoformat_43 4:3 videomenu.videomode Digital video mode +wizard.initial_settings Initial settings found +wizard.install_settings Do you want to install channels for Astra 19.2°E ? wizard.welcome_head Welcome to the Setup Wizard wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CoolStream set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from diff --git a/src/system/locals.h b/src/system/locals.h index 113bf9cc9..857ffefc8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1826,6 +1826,8 @@ typedef enum LOCALE_VIDEOMENU_VIDEOFORMAT_169, LOCALE_VIDEOMENU_VIDEOFORMAT_43, LOCALE_VIDEOMENU_VIDEOMODE, + LOCALE_WIZARD_INITIAL_SETTINGS, + LOCALE_WIZARD_INSTALL_SETTINGS, LOCALE_WIZARD_WELCOME_HEAD, LOCALE_WIZARD_WELCOME_TEXT, LOCALE_WORD_FROM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 15b277c1a..7f13792bb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1826,6 +1826,8 @@ const char * locale_real_names[] = "videomenu.videoformat_169", "videomenu.videoformat_43", "videomenu.videomode", + "wizard.initial_settings", + "wizard.install_settings", "wizard.welcome_head", "wizard.welcome_text", "word.from", From 4c41541f20fc2f521c6ffb68e6a5fa51f3d613f4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 29 Sep 2012 14:46:43 +0400 Subject: [PATCH 8/8] gui/start_wizard.cpp: copy initial zapit settings from /var/tuxbox/config/initial/ if found --- src/gui/start_wizard.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 79b7168d3..29a4ef9fe 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -46,6 +46,8 @@ #include "osd_setup.h" #include "osdlang_setup.h" #include "scan_setup.h" +#include +#include #include @@ -103,6 +105,17 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) res = CScanSetup::getInstance()->exec(NULL, ""); CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO); } + bool init_settings = file_exists("/var/tuxbox/config/initial/"); + if(init_settings && (res != menu_return::RETURN_EXIT_ALL)) + { + if (ShowMsgUTF(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), + CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { + system("/bin/cp /var/tuxbox/config/initial/* /var/tuxbox/config/zapit/"); + CFEManager::getInstance()->loadSettings(); + CFEManager::getInstance()->saveSettings(); + CZapit::getInstance()->PrepareChannels(); + } + } }