summaryrefslogtreecommitdiff
path: root/media/eco/include
diff options
context:
space:
mode:
authorHangyu Kuang <hkuang@google.com>2019-04-26 17:03:49 -0700
committerHangyu Kuang <hkuang@google.com>2019-05-01 14:48:18 -0700
commitf1b9180c8a29fc31c7e46f575af7583f84c358fd (patch)
tree85fd6182330d314ebd248d2b84c1766bc06d2ea3 /media/eco/include
parent546bfe07fce6fa9712edb2fbfa6a983cd34021b1 (diff)
downloadav-f1b9180c8a29fc31c7e46f575af7583f84c358fd.tar.gz
[ECOService] Add stats/info logging support.
Bug: 117877984 Test: Unit test. Change-Id: If8d0423f5610a435931af9ea7ece3da3263a5b27
Diffstat (limited to 'media/eco/include')
-rw-r--r--media/eco/include/eco/ECODebug.h4
-rw-r--r--media/eco/include/eco/ECOSession.h15
2 files changed, 19 insertions, 0 deletions
diff --git a/media/eco/include/eco/ECODebug.h b/media/eco/include/eco/ECODebug.h
index 1b25a33..b250f64 100644
--- a/media/eco/include/eco/ECODebug.h
+++ b/media/eco/include/eco/ECODebug.h
@@ -27,6 +27,10 @@ namespace media {
namespace eco {
static const char* kDebugLogsLevelProperty = "media.ecoservice.log.level";
+static const char* kDebugLogStats = "media.ecoservice.log.stats";
+static const char* kDebugLogStatsSize = "media.ecoservice.log.stats.size";
+static const char* kDebugLogInfos = "media.ecoservice.log.info";
+static const char* kDebugLogInfosSize = "media.ecoservice.log.info.size";
// A debug variable that should only be accessed by ECOService through updateLogLevel. It is rare
// that this variable will have race condition. But if so, it is ok as this is just for debugging.
diff --git a/media/eco/include/eco/ECOSession.h b/media/eco/include/eco/ECOSession.h
index 921efbd..afde89c 100644
--- a/media/eco/include/eco/ECOSession.h
+++ b/media/eco/include/eco/ECOSession.h
@@ -160,6 +160,21 @@ private:
// Frame rate in frames per second. -1 means not available.
float mFramerateFps;
+
+ // Debug related flags.
+ bool mLogStats;
+ uint32_t mLogStatsEntries; // number of stats received from the provider.
+ std::list<ECOData> mStatsDebugBuffer;
+
+ // Pushes the ECOData to the debug buffer.
+ void logStats(const ECOData& data);
+
+ bool mLogInfo;
+ uint32_t mLogInfoEntries; // number of infos sent to the listener.
+ std::list<ECOData> mInfosDebugBuffer;
+
+ // Pushes the ECOData to the debug buffer.
+ void logInfos(const ECOData& data);
};
} // namespace eco