summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2016-04-27 12:52:33 +0200
committerThomas Reufer <thomas@reufer.ch>2016-04-27 14:04:12 +0200
commit6e447f1855a76b2a590b34472ca1fb4dfa835a39 (patch)
treeb7ed096b36fb1b982e32b083d5353548d267178b
parent8828f1e8dd7b64d142053269b3f9387ef35ceb38 (diff)
downloadvdr-plugin-rpihddevice-6e447f1855a76b2a590b34472ca1fb4dfa835a39.tar.gz
vdr-plugin-rpihddevice-6e447f1855a76b2a590b34472ca1fb4dfa835a39.tar.bz2
add debug option to log number of executed OpenVG commands and flushes
-rw-r--r--HISTORY3
-rw-r--r--Makefile5
-rw-r--r--ovgosd.c23
3 files changed, 31 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index a9acf89..ed58435 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,9 @@
VDR Plugin 'rpihddevice' Revision History
-----------------------------------------
+- new:
+ - add debug option to log number of executed OpenVG commands and flushes
+
2016-04-23: Version 1.0.3
-------------------------
- new:
diff --git a/Makefile b/Makefile
index a0605b8..36e9ad5 100644
--- a/Makefile
+++ b/Makefile
@@ -79,6 +79,11 @@ ifeq ($(DEBUG_BUFFERS), 1)
DEFINES += -DDEBUG_BUFFERS
endif
+DEBUG_OVGSTAT ?= 0
+ifeq ($(DEBUG_OVGSTAT), 1)
+ DEFINES += -DDEBUG_OVGSTAT
+endif
+
ENABLE_AAC_LATM ?= 0
ifeq ($(ENABLE_AAC_LATM), 1)
DEFINES += -DENABLE_AAC_LATM
diff --git a/ovgosd.c b/ovgosd.c
index 685dadb..542d830 100644
--- a/ovgosd.c
+++ b/ovgosd.c
@@ -757,6 +757,7 @@ public:
virtual bool Execute(cEgl *egl) = 0;
virtual const char* Description(void) = 0;
+ virtual bool IsFlush(void) { return false; };
protected:
@@ -776,6 +777,7 @@ public:
cOvgCmd(target) { }
virtual const char* Description(void) { return "Flush"; }
+ virtual bool IsFlush(void) { return true; };
virtual bool Execute(cEgl *egl)
{
@@ -1866,6 +1868,11 @@ protected:
vgSetfv(VG_CLEAR_COLOR, 4, color);
vgClear(0, 0, egl.window.width, egl.window.height);
+#ifdef DEBUG_OVGSTAT
+ cTimeMs timer;
+ int commands = 0, flushes = 0;
+#endif
+
bool reset = false;
while (!reset)
{
@@ -1878,6 +1885,22 @@ protected:
m_commands.pop();
Unlock();
+#ifdef DEBUG_OVGSTAT
+ if (timer.TimedOut())
+ {
+ if (commands || flushes)
+ {
+ DLOG("[OpenVG] commands executed: %d, flushes: %d",
+ commands, flushes);
+ commands = 0;
+ flushes = 0;
+ }
+ timer.Set(1000);
+ }
+ commands++;
+ if (cmd->IsFlush())
+ flushes++;
+#endif
reset = cmd ? !cmd->Execute(&egl) : true;
VGErrorCode err = vgGetError();