diff options
author | louis <louis.braun@gmx.de> | 2014-11-02 17:32:22 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-11-02 17:32:22 +0100 |
commit | 037e8e0cb128734a447d472ea2345eea02ee65b6 (patch) | |
tree | 032714a0f749d486aa65d0444251154b864970dc /views | |
parent | ef4502cc02b4a1b287b6710826f04f953fd4691b (diff) | |
download | vdr-plugin-skindesigner-037e8e0cb128734a447d472ea2345eea02ee65b6.tar.gz vdr-plugin-skindesigner-037e8e0cb128734a447d472ea2345eea02ee65b6.tar.bz2 |
call drawdevices only every 500ms, added profiling code
Diffstat (limited to 'views')
-rw-r--r-- | views/displaychannelview.c | 10 | ||||
-rw-r--r-- | views/viewhelpers.c | 31 |
2 files changed, 37 insertions, 4 deletions
diff --git a/views/displaychannelview.c b/views/displaychannelview.c index 28b2f9d..6187753 100644 --- a/views/displaychannelview.c +++ b/views/displaychannelview.c @@ -364,8 +364,18 @@ void cDisplayChannelView::DrawSignal(void) { } time_t Now = time(NULL); if (Now != lastSignalDisplay) { +#ifdef DOPROFILE + cStopWatch watch("DrawSignal"); +#endif int SignalStrength = cDevice::ActualDevice()->SignalStrength(); +#ifdef DOPROFILE + watch.Report("SignalStrength"); +#endif int SignalQuality = cDevice::ActualDevice()->SignalQuality(); +#ifdef DOPROFILE + watch.Report("SignalQuality"); + watch.Stop("DrawSignal"); +#endif if (SignalStrength < 0) SignalStrength = 0; if (SignalQuality < 0) SignalQuality = 0; if ((SignalStrength == 0)&&(SignalQuality==0)) diff --git a/views/viewhelpers.c b/views/viewhelpers.c index 00a5619..29c139d 100644 --- a/views/viewhelpers.c +++ b/views/viewhelpers.c @@ -1,5 +1,6 @@ #include <vdr/menu.h> #include "../config.h" +#include "../libcore/helpers.h" #include "viewhelpers.h" cViewHelpers::cViewHelpers(void) { @@ -28,6 +29,9 @@ void cViewHelpers::InitDevices(void) { } bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices) { +#ifdef DOPROFILE + cStopWatch watch("SetDevices"); +#endif int numDevices = cDevice::NumDevices(); if (!initial) { //check if drawing is necessary @@ -37,12 +41,24 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m if (!device || !device->NumProvidedSystems()) { continue; } - if ((device->SignalStrength() != lastSignalStrength[i]) || (device->SignalQuality() != lastSignalQuality[i])) { + int signalStrength = device->SignalStrength(); +#ifdef DOPROFILE + watch.Report(*cString::sprintf("SignalStrength() device %d", i)); +#endif + int signalQuality = device->SignalQuality(); +#ifdef DOPROFILE + watch.Report(*cString::sprintf("SignalQuality() device %d", i)); +#endif + + if ((signalStrength != lastSignalStrength[i]) || (signalQuality != lastSignalQuality[i])) { changed = true; break; - } + } } if (!changed) { +#ifdef DOPROFILE + watch.Stop("SetDevices End"); +#endif return false; } } @@ -55,7 +71,6 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m else deviceLiveTV = primaryDevice->DeviceNumber(); } - //check currently recording devices for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) { if (!timer->Recording()) { @@ -90,7 +105,13 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m deviceVals.insert(pair< string, string >("devices[hascam]", "0")); } int signalStrength = device->SignalStrength(); +#ifdef DOPROFILE + watch.Report(*cString::sprintf("SignalStrength() device %d", i)); +#endif int signalQuality = device->SignalQuality(); +#ifdef DOPROFILE + watch.Report(*cString::sprintf("SignalQuality() device %d", i)); +#endif stringstream strCamNumber; strCamNumber << camNumber; deviceVals.insert(pair< string, string >("devices[cam]", strCamNumber.str())); @@ -129,6 +150,8 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m } intTokens->insert(pair<string, int>("numdevices", actualNumDevices)); - +#ifdef DOPROFILE + watch.Stop("SetDevices End"); +#endif return true; } |