From 8fad420914ac67e28b635d320635273742c85671 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Feb 2017 11:25:24 +0100 Subject: [PATCH 01/14] remove udpstreampes from build, it's unlikely to work anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f36a0900c30ee95555f84c0e5eda706845e3fcb Author: Stefan Seyfried Date: 2017-02-11 (Sat, 11 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/Makefile.am | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index 0130f3a8a..96e700284 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -34,7 +34,6 @@ libzapit_a_SOURCES = \ zapit.cpp bin_PROGRAMS = pzapit -sbin_PROGRAMS = udpstreampes pzapit_SOURCES = \ pzapit.cpp @@ -44,12 +43,3 @@ pzapit_LDADD = \ $(top_builddir)/lib/connection/libtuxbox-connection.a \ -lOpenThreads \ -lpthread - -udpstreampes_SOURCES = \ - udpstreampes.cpp - -udpstreampes_LDADD = \ - $(top_builddir)/src/zapit/lib/libzapitclient.a \ - $(top_builddir)/lib/connection/libtuxbox-connection.a \ - -lOpenThreads \ - -lpthread From fc5d95a4d01ddcb2608deb5cf128b2f8cd77fc2c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Feb 2017 14:42:15 +0100 Subject: [PATCH 02/14] remove unnecessary sectionsdclient.h includes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c14c15ea24a1776c374ba0967bb41df6199ddf2b Author: Stefan Seyfried Date: 2017-02-11 (Sat, 11 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.h | 2 -- src/gui/eventlist.h | 1 - src/gui/infoviewer_bb.h | 2 -- src/nhttpd/tuxboxapi/neutrinoapi.h | 1 - 4 files changed, 6 deletions(-) diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 4fe60f9de..b66360d44 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -39,8 +39,6 @@ #include #include "widget/menue.h" -#include - #include #include diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index c0c15af52..90542ba26 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -28,7 +28,6 @@ #define __EVENTLIST_HPP__ #include -#include #include #include diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index e664e516d..753e32a2e 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -33,8 +33,6 @@ #ifndef __infoview_bb__ #define __infoview_bb__ -#include - #include #include #include diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 82c9abbf3..5936e194b 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -7,7 +7,6 @@ // tuxbox #include -#include #include #include From c5cd92dd8c4f401411bb6d63e841bad794f5ff60 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Feb 2017 14:45:37 +0100 Subject: [PATCH 03/14] sectionsdclient: remove unused scanMode variable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/96f86f974e188cbc6ac247476f7af93e7273987f Author: Stefan Seyfried Date: 2017-02-11 (Sat, 11 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/sectionsdclient/sectionsdMsg.h | 2 -- lib/sectionsdclient/sectionsdclient.cpp | 1 - lib/sectionsdclient/sectionsdclient.h | 1 - 3 files changed, 4 deletions(-) diff --git a/lib/sectionsdclient/sectionsdMsg.h b/lib/sectionsdclient/sectionsdMsg.h index 440feabae..fb71f8322 100644 --- a/lib/sectionsdclient/sectionsdMsg.h +++ b/lib/sectionsdclient/sectionsdMsg.h @@ -92,7 +92,6 @@ struct sectionsd struct commandSetConfig { - int scanMode; int epg_cache; int epg_old_events; unsigned int epg_max_events; @@ -327,7 +326,6 @@ struct sectionsd // // setConfig // data of request: -// int scanMode; -> updating of services and bouquets -> saved in auto_scanning // int epg_cache; -> in days -> saved in secondsToCache // int epg_old_events; -> in hours -> saved in oldEventsAre // unsigned int epg_max_events; -> #of saved events -> saved in max_events diff --git a/lib/sectionsdclient/sectionsdclient.cpp b/lib/sectionsdclient/sectionsdclient.cpp index c6be1fac2..a8a3c4648 100644 --- a/lib/sectionsdclient/sectionsdclient.cpp +++ b/lib/sectionsdclient/sectionsdclient.cpp @@ -199,7 +199,6 @@ void CSectionsdClient::setConfig(const epg_config config) char* pData = new char[sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1 + config.epg_dir.length() + 1]; msg = (sectionsd::commandSetConfig *)pData; - msg->scanMode = config.scanMode; msg->epg_cache = config.epg_cache; msg->epg_old_events = config.epg_old_events; msg->epg_max_events = config.epg_max_events; diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index c827d83b5..8ba8dfab0 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -154,7 +154,6 @@ class CSectionsdClient : private CBasicClient typedef struct { - int scanMode; int epg_cache; int epg_old_events; int epg_max_events; From 54ca471493163512c98e6553f63782d7e3b81eb9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Feb 2017 18:52:39 +0100 Subject: [PATCH 04/14] fb_accel_td: implement setBlendMode/Level Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67387a13c6a543db87138d0c8a216e6a94ef63b3 Author: Stefan Seyfried Date: 2017-02-11 (Sat, 11 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel.h | 2 ++ src/driver/fb_accel_td.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index d67dc75d0..54736d331 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -169,6 +169,8 @@ class CFbAccelTD void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col); void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp); void waitForIdle(const char *func = NULL); + void setBlendMode(uint8_t); + void setBlendLevel(int); }; #endif diff --git a/src/driver/fb_accel_td.cpp b/src/driver/fb_accel_td.cpp index 7cddcfa3c..af3bf8f60 100644 --- a/src/driver/fb_accel_td.cpp +++ b/src/driver/fb_accel_td.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -143,6 +144,7 @@ void CFbAccelTD::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t void CFbAccelTD::init(const char *) { CFrameBuffer::init(); + fcntl(fd, F_SETFD, FD_CLOEXEC); if (lfb == NULL) { printf(LOGTAG "CFrameBuffer::init() failed.\n"); return; /* too bad... */ @@ -174,3 +176,29 @@ int CFbAccelTD::setMode(unsigned int, unsigned int, unsigned int) backbuffer = lfb; /* will not work well, but avoid crashes */ return 0; } + +void CFbAccelTD::setBlendMode(uint8_t mode) +{ + Stb04GFXOsdControl g; + ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g); + g.use_global_alpha = (mode == 2); /* 1 == pixel alpha, 2 == global alpha */ + ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g); +} + +void CFbAccelTD::setBlendLevel(int level) +{ + /* this is bypassing directfb, but faster and easier */ + Stb04GFXOsdControl g; + ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g); + if (g.use_global_alpha == 0) + return; + + if (level < 0 || level > 100) + return; + + /* this is the same as convertSetupAlpha2Alpha(), but non-float */ + g.global_alpha = 255 - (255 * level / 100); + ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g); + if (level == 100) // sucks + usleep(20000); +} From 5dbbb152cb79532ccb3800ad7e4ace1771af7512 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Feb 2017 18:54:50 +0100 Subject: [PATCH 05/14] fb_generic: initialization and deinitialization fixes * initialize variables locked and cache_size in constructor * set lfb pointer to NULL after munmap(), fd to -1 after close * remove unused tty fd close() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1dd47e00c0f7ba34d8b76888136b4ffd301b2bb0 Author: Stefan Seyfried Date: 2017-02-11 (Sat, 11 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 0c7df12e4..ddce37dfd 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -82,6 +82,7 @@ CFrameBuffer::CFrameBuffer() fb_name = "generic framebuffer"; iconBasePath = ""; available = 0; + cache_size = 0; cmap.start = 0; cmap.len = 256; cmap.red = red; @@ -93,6 +94,7 @@ CFrameBuffer::CFrameBuffer() background = NULL; backupBackground = NULL; backgroundFilename = ""; + locked = false; fd = 0; tty = 0; m_transparent_default = CFrameBuffer::TM_BLACK; // TM_BLACK: Transparency when black content ('pseudo' transparency) @@ -173,8 +175,6 @@ void CFrameBuffer::init(const char * const fbDevice) goto nolfb; } - cache_size = 0; - /* Windows Colors */ paletteSetColor(0x1, 0x010101, tr); paletteSetColor(0x2, 0x800000, tr); @@ -235,13 +235,14 @@ CFrameBuffer::~CFrameBuffer() if (lfb) munmap(lfb, available); + lfb = NULL; if (virtual_fb){ delete[] virtual_fb; virtual_fb = NULL; } close(fd); - close(tty); + fd = -1; v_fbarea.clear(); } From 7c36e9c08037a911c52541ba78395497782c271f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 11:48:01 +0100 Subject: [PATCH 06/14] zapit: speed up scan by skipping unsupported delivery systems Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e810bfe30b02fde1be7ac87d6073b66295cf6af8 Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/scan.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 150bf5b08..29d59eea8 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -137,6 +137,11 @@ void CServiceScan::CleanAllMaps() bool CServiceScan::tuneFrequency(FrontendParameters *feparams, t_satellite_position satellitePosition) { + if (! frontend->supportsDelivery(feparams->delsys)) { + printf("[scan] [fe%d] does not support delivery system %d, skipping\n", + frontend->getNumber(), feparams->delsys); + return false; + } frontend->setInput(satellitePosition, feparams->frequency, feparams->polarization); int ret = frontend->driveToSatellitePosition(satellitePosition, false); //true); if(ret > 0) { From 001c4e7d05b53bdc6719970f6ec15a5bade24427 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 12:05:03 +0100 Subject: [PATCH 07/14] getservices: don't update channels if only scrambling changed Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ca3ccaa5d57dad1d81228f13cbcb87da15e432b Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/getservices.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 96ad485af..5bb5d24aa 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -1103,7 +1103,11 @@ bool CServiceManager::CopyCurrentServices(transponder_id_t tpid) updated = true; printf("CServiceManager::CopyCurrentServices: [%s] add\n", cI->second.getName().c_str()); } else { - if(cI->second.scrambled != aI->second.scrambled || cI->second.getName() != aI->second.getName()) { + if (cI->second.getName() != aI->second.getName() +#ifdef UPDATE_CHANNELS_ON_SCRAMBLED_CHANGE + || cI->second.scrambled != aI->second.scrambled +#endif + ) { aI->second.setName(cI->second.getName()); aI->second.scrambled = cI->second.scrambled; aI->second.flags = CZapitChannel::UPDATED; @@ -1211,7 +1215,11 @@ bool CServiceManager::SaveCurrentServices(transponder_id_t tpid) if(ccI == allchans.end()) { WriteCurrentService(fd, satfound, tpdone, updated, satstr, tI->second, cI->second, "add"); } else { - if(strcmp(cI->second.getRealname().c_str(), ccI->second.getRealname().c_str()) || cI->second.scrambled != ccI->second.scrambled) { + if (strcmp(cI->second.getRealname().c_str(), ccI->second.getRealname().c_str()) +#ifdef UPDATE_CHANNELS_ON_SCRAMBLED_CHANGE + || cI->second.scrambled != ccI->second.scrambled +#endif + ) { cI->second.number = ccI->second.number; WriteCurrentService(fd, satfound, tpdone, updated, satstr, tI->second, cI->second, "replace"); } From 5cc48eb30a87904931cfcbe0eee942bb1a45799c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 14:09:40 +0100 Subject: [PATCH 08/14] cc: reduce impact of cc_draw header from 161 to 4 files Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58c6dbf4694fd3e8fa8c1d03c052a4207491ba51 Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 3 ++- src/gui/components/cc_draw.h | 2 +- src/gui/components/cc_frm_clock.cpp | 1 + src/gui/components/cc_frm_clock.h | 2 +- src/gui/widget/hintbox.cpp | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index b9035e8db..cedebc332 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -25,6 +25,7 @@ #include #include #include "cc_draw.h" +#include "cc_timer.h" #include #include @@ -794,4 +795,4 @@ bool CCDraw::cancelBlink(bool keep_on_screen) return res; -} \ No newline at end of file +} diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index a144433ec..50be8a71d 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -27,7 +27,6 @@ #include "cc_types.h" #include "cc_signals.h" -#include "cc_timer.h" #include #include #include @@ -38,6 +37,7 @@ Basic paint attributes and member functions for component classes */ +class CComponentsTimer; class CCDraw : public COSDFader, public CComponentsSignals { protected: diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index b52180456..531c1af89 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -29,6 +29,7 @@ #include #include "cc_frm_clock.h" +#include "cc_timer.h" #include #include diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 22da0af26..23eb726ce 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -34,13 +34,13 @@ #include #include "cc_base.h" #include "cc_frm.h" -#include "cc_timer.h" #include "cc_text_screen.h" //! Sub class of CComponents. Show clock with digits on screen. /*! Usable as simple fixed display or as ticking clock. */ +class CComponentsTimer; class CComponentsFrmClock : public CComponentsForm, public CCTextScreen { private: diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 9e367f4d2..4b61201ce 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -34,6 +34,7 @@ #include #include #include "hintbox.h" +#include #include #include From e71631fd8b6e022701b4a3a5ba6ffe7f2dc14ab5 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 14:46:42 +0100 Subject: [PATCH 09/14] CComponentsTimer: allow to set a thread name Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fdd920e4289ad926c2609049da549b97ee5965f Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_timer.cpp | 5 ++++- src/gui/components/cc_timer.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index 11ae9b35e..a7b7e13ca 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -33,11 +33,13 @@ #include #include #include +#include using namespace std; CComponentsTimer::CComponentsTimer(const int& interval, bool is_nano) { + name = "unnamed"; tm_thread = 0; tm_interval = interval; tm_enable_nano = is_nano; @@ -56,7 +58,8 @@ CComponentsTimer::~CComponentsTimer() void CComponentsTimer::runSharedTimerAction() { //start loop - + string tn = "cc:"+name; + set_threadname(tn.c_str()); while(tm_enable && tm_interval > 0) { tm_mutex.lock(); OnTimer(); diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index 530224f40..c7e2d21cd 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -63,6 +63,9 @@ class CComponentsTimer : public sigc::trackable ///flag to control thread state bool tm_enable; + ///name for the thread + std::string name; + ///mutex for timer OpenThreads::Mutex tm_mutex; ///slot for restart signals @@ -120,6 +123,13 @@ class CComponentsTimer : public sigc::trackable */ void setTimerInterval(const int& interval, bool is_nano = false); + /**set thread name + * @param[in] thread name + * @return + * void + */ + void setThreadName(const std::string& n) { name = n; }; + /**Provides a signal handler to receive any function or methode. * Use this in your class where ever you need time controled actions. * From 184f520208023c92f26d4b4bba8b7a494c271fe6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 15:17:32 +0100 Subject: [PATCH 10/14] set useful thread names for all spawned threads Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5188f721c4ecd77dbaeb337a23f05aa49cb9ca16 Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libdvbsub/dvbsub.cpp | 4 +++- lib/libtuxtxt/tuxtxt.cpp | 2 ++ lib/libtuxtxt/tuxtxt_common.h | 2 ++ src/driver/audioplay.cpp | 2 ++ src/driver/lcdd.cpp | 2 ++ src/driver/netfile.cpp | 2 ++ src/driver/shutdown_count.cpp | 2 ++ src/eitd/sectionsd.cpp | 1 + src/gui/components/cc_draw.cpp | 1 + src/gui/components/cc_frm_clock.cpp | 1 + src/gui/widget/hintbox.cpp | 5 +++-- src/nhttpd/yhttpd_core/ywebserver.cpp | 2 +- src/timerd/timerd.cpp | 3 ++- src/timerd/timermanager.cpp | 3 ++- 14 files changed, 26 insertions(+), 6 deletions(-) diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index a0f061202..828f09849 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -15,6 +15,7 @@ #include "PacketQueue.hpp" #include "helpers.hpp" #include "dvbsubtitle.h" +#include #define Log2File printf #define RECVBUFFER_STEPSIZE 1024 @@ -243,6 +244,7 @@ static void* reader_thread(void * /*arg*/) int len; uint16_t packlen; uint8_t* buf; + set_threadname("dvbsub:reader"); dmx = new cDemux(0); dmx->Open(DMX_PES_CHANNEL, NULL, 64*1024); @@ -339,7 +341,7 @@ static void* dvbsub_thread(void* /*arg*/) { struct timespec restartWait; struct timeval now; - + set_threadname("dvbsub:main"); sub_debug.print(Debug::VERBOSE, "%s started\n", __FUNCTION__); if (!dvbSubtitleConverter) dvbSubtitleConverter = new cDvbSubtitleConverter; diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 91722ee88..e2a5bd5fd 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -19,6 +19,7 @@ #include #include #include +#include /* same as in rcinput.h... */ #define KEY_TTTV KEY_FN_1 @@ -1510,6 +1511,7 @@ static void cleanup_fb_pan() static void* reader_thread(void * /*arg*/) { printf("TuxTxt subtitle thread started\n"); + set_threadname("tuxtxt:reader"); reader_running = 1; //ttx_paused = 0; while(reader_running) { diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 7f95dbc41..8a99bd2b5 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -12,6 +12,7 @@ #endif #include +#include tuxtxt_cache_struct tuxtxt_cache; static pthread_mutex_t tuxtxt_cache_lock = PTHREAD_MUTEX_INITIALIZER; @@ -587,6 +588,7 @@ void *tuxtxt_CacheThread(void * /*arg*/) unsigned char pagedata[9][23*40]; tstPageinfo *pageinfo_thread; + set_threadname("tuxtxt:cache"); printf("TuxTxt running thread...(%04x)\n",tuxtxt_cache.vtxtpid); tuxtxt_cache.receiving = 1; nice(3); diff --git a/src/driver/audioplay.cpp b/src/driver/audioplay.cpp index 4359956ba..956319297 100644 --- a/src/driver/audioplay.cpp +++ b/src/driver/audioplay.cpp @@ -43,6 +43,7 @@ #include #include #include // UTF8 +#include void CAudioPlayer::stop() { @@ -88,6 +89,7 @@ CAudioPlayer* CAudioPlayer::getInstance() void* CAudioPlayer::PlayThread( void* /*dummy*/ ) { int soundfd = -1; + set_threadname("audio:play"); g_RCInput->close_click(); /* Decode stdin to stdout. */ CBaseDec::RetCode Status = diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 74193ed4b..3ff7e111c 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -47,6 +47,7 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ @@ -139,6 +140,7 @@ void CLCD::wake_up() { #ifndef BOXMODEL_DM500 void* CLCD::TimeThread(void *) { + set_threadname("lcd:time"); while(1) { sleep(1); diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index f7ac9658e..12270fb93 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -108,6 +108,7 @@ #include #include #include +#include /* TODO: - ICECAST support @@ -1603,6 +1604,7 @@ void CacheFillThread(void *c) if(scache->closed) return; + set_threadname("netfile:cache"); dprintf(stderr, "CacheFillThread: thread started, using stream %p\n", scache->fd); buf = (char*)malloc(CACHEBTRANS); diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index 0bd113656..9bba124cf 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -35,6 +35,7 @@ #include #include #include +#include SHTDCNT::SHTDCNT() @@ -55,6 +56,7 @@ SHTDCNT* SHTDCNT::getInstance() void* SHTDCNT::TimeThread(void *) { + set_threadname("n:shtdcnt"); while(1) { sleep(1); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 38b9300e1..7095a6b03 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2067,6 +2067,7 @@ static void print_meminfo(void) static void *houseKeepingThread(void *) { int count = 0, scount = 0, ecount = 0; + set_threadname("sd:housekeeping"); dprintf("housekeeping-thread started.\n"); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index cedebc332..9ca52c03c 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -775,6 +775,7 @@ bool CCDraw::paintBlink(const int& interval, bool is_nano) { if (cc_draw_timer == NULL) cc_draw_timer = new CComponentsTimer(interval, is_nano); + cc_draw_timer->setThreadName(__func__); return paintBlink(cc_draw_timer); } diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 531c1af89..0f4329ea3 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -321,6 +321,7 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); + cl_timer->setThreadName("frmClock"); if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); cl_timer->OnTimer.connect(cl_sl_show); diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 4b61201ce..45ef2b6ed 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -188,8 +188,10 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb = new CProgressBar(); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, 100*timeout); - if (!timeout_pb_timer) + if (!timeout_pb_timer) { timeout_pb_timer = new CComponentsTimer(1, true); + timeout_pb_timer->setThreadName("hb:tmoutbar"); + } timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); timeout_pb_timer->startTimer(); } @@ -200,7 +202,6 @@ int CHintBox::exec() neutrino_msg_t msg; neutrino_msg_data_t data; int res = messages_return::none; - if (timeout == NO_TIMEOUT || timeout == DEFAULT_TIMEOUT) timeout = HINTBOX_DEFAULT_TIMEOUT; diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 0a8b4d77a..e1a5f149d 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -118,7 +118,7 @@ CWebserver::~CWebserver() { #define MAX_TIMEOUTS_TO_CLOSE 10 #define MAX_TIMEOUTS_TO_TEST 100 bool CWebserver::run(void) { - set_threadname(__func__); + set_threadname("ywebsrv::run"); if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) { if (port != 80) { fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port); diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 6589e62c0..385afac85 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "debug.h" #include "timermanager.h" @@ -480,7 +481,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) int timerd_main_thread(void *data) { pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); - + set_threadname("n:timerd"); printf("timerd startup, tid %ld\n", syscall(__NR_gettid)); CBasicServer timerd_server; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index fec447b79..8998ea2d2 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -42,7 +42,7 @@ #include "debug.h" #include "timermanager.h" - +#include extern bool timeset; time_t timer_minutes; @@ -89,6 +89,7 @@ void* CTimerManager::timerThread(void *arg) pthread_mutex_t dummy_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t dummy_cond = PTHREAD_COND_INITIALIZER; struct timespec wait; + set_threadname("n:timermanager"); CTimerManager *timerManager = (CTimerManager*) arg; From f64fb649b2a022b08a28bcdbdcbc347ea7094970 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 15:18:35 +0100 Subject: [PATCH 11/14] remove spurious newlines from debug output Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/66041784854ea92fe27eee6a07c7329351927dcd Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/scanepg.cpp | 2 +- src/zapit/src/femanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index 24c6e3d33..bd903b162 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -91,7 +91,7 @@ void CEpgScan::ConfigureEIT() count++; } } - INFO("added %d channels to EIT white list\n", count); + INFO("added %d channels to EIT white list", count); } void CEpgScan::Clear() diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index c79f34153..2cf50a6a4 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -115,7 +115,7 @@ bool CFEManager::Init() for (unsigned i = 0; i < MAX_DMX_UNITS; i++) dmap.push_back(CFeDmx(i)); - INFO("found %d frontends, %d demuxes\n", (int)femap.size(), (int)dmap.size()); + INFO("found %d frontends, %d demuxes", (int)femap.size(), (int)dmap.size()); if (femap.empty()) return false; @@ -463,7 +463,7 @@ void CFEManager::linkFrontends(bool init) for(unsigned i = 0; i < MAX_DMX_UNITS; i++) { if (demuxes[i] == 0) { unused_demux = i; - INFO("pip demux: %d\n", unused_demux); + INFO("pip demux: %d", unused_demux); break; } } From 500c6d7032caee70fe512a0b1a904a0e52553503 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 15:19:51 +0100 Subject: [PATCH 12/14] neutrino: move start of standby epgscan forward this avoids that cpufreq is set to standby value before epgscan is started, resulting in poor performance Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7384e2155ec40069a0aadb71cec735eb3c2a23c4 Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6ad2c2c84..8ab84bd88 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3849,6 +3849,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); + CEpgScan::getInstance()->Start(true); bool alive = recordingstatus || CEpgScan::getInstance()->Running() || CStreamManager::getInstance()->StreamStatus(); if(!alive) @@ -3861,7 +3862,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) frameBuffer->setActive(false); // Active standby on powerManager->SetStandby(false, false); - CEpgScan::getInstance()->Start(true); if (scansettings.fst_update) fst_timer = g_RCInput->addTimer(30*1000*1000, true); } else { From 6f1ae25be59f032740e523f51b660afe74cd0558 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 16:56:10 +0100 Subject: [PATCH 13/14] streamts: don't overflow receive buffer, better diag message Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff0d98bcc30dba2fa09bd6d5823d2a77a12a568f Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/streamts.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 7efd37d77..f0144806c 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -369,9 +369,11 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro bp = &cbuf[0]; /* read one line */ - while (bp - &cbuf[0] < (int) sizeof(cbuf)) { + while (bp - &cbuf[0] < (int) sizeof(cbuf) - 1) { unsigned char c; int res = read(fd, &c, 1); + if (res == 0) + break; if (res < 0) { perror("read"); return false; @@ -379,12 +381,11 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro if ((*bp++ = c) == '\n') break; } + *bp = 0; - *bp++ = 0; + printf("CStreamManager::Parse: got %d bytes '%s'", (int)(bp-&cbuf[0]), cbuf); bp = &cbuf[0]; - printf("CStreamManager::Parse: got %s\n", cbuf); - /* send response to http client */ if (!strncmp(cbuf, "GET /", 5)) { fprintf(fp, "HTTP/1.1 200 OK\r\nServer: streamts (%s)\r\n\r\n", "ts" /*&argv[1][1]*/); From c7bf13abb75236d4e4f1d7cf2f8d557eee336f51 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Feb 2017 18:10:11 +0100 Subject: [PATCH 14/14] fb_generic: add sanity check and missing mark() to painIcon8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec40cf7986dd6640502eb6acee8293dc8e56ba5e Author: Stefan Seyfried Date: 2017-02-12 (Sun, 12 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index ddce37dfd..9377d77da 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -744,6 +744,12 @@ bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const i width = (header.width_hi << 8) | header.width_lo; height = (header.height_hi << 8) | header.height_lo; + if (width > 768) { + /* this is not going to happen, but check anyway */ + printf("%s: icon %s too wide (%d)\n", __func__, filename.c_str(), (int)width); + close(lfd); + return false; + } unsigned char pixbuf[768]; uint8_t * d = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y; @@ -764,6 +770,7 @@ bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const i d += stride; } close(lfd); + mark(x, y, x + width, y + height); return true; }