summaryrefslogtreecommitdiffstats
path: root/src/StatsServer.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-25 11:34:46 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-25 11:34:46 +0200
commit450300013cdcc34570365832b31024959e19b107 (patch)
treec4d9a9d5c6b118d9e584434bc3b7d055d36151bb /src/StatsServer.h
parente79bbb00757cb6e7a415aa613d52253b12ca26a8 (diff)
downloaddabmux-450300013cdcc34570365832b31024959e19b107.tar.gz
dabmux-450300013cdcc34570365832b31024959e19b107.tar.bz2
dabmux-450300013cdcc34570365832b31024959e19b107.zip
Add peak audio levels to statistics
Diffstat (limited to 'src/StatsServer.h')
-rw-r--r--src/StatsServer.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/StatsServer.h b/src/StatsServer.h
index 9510520..9eb08df 100644
--- a/src/StatsServer.h
+++ b/src/StatsServer.h
@@ -65,6 +65,10 @@ struct InputStat
long num_underruns;
long num_overruns;
+ // peak audio levels (linear 16-bit PCM) for the two channels
+ int peak_left;
+ int peak_right;
+
void reset()
{
min_fill_buffer = MIN_FILL_BUFFER_UNDEF;
@@ -72,6 +76,9 @@ struct InputStat
num_underruns = 0;
num_overruns = 0;
+
+ peak_left = 0;
+ peak_right = 0;
}
std::string encodeJSON();
@@ -99,9 +106,12 @@ class StatsServer
}
void registerInput(std::string id);
- // The input notifies the StatsServer about a new buffer size
- void notifyBuffer(std::string id, long bufsize);
+ /* The following notify functions are used by the input to
+ * inform the StatsServer about new values
+ */
+ void notifyBuffer(std::string id, long bufsize);
+ void notifyPeakLevels(std::string id, int peak_left, int peak_right);
void notifyUnderrun(std::string id);
void notifyOverrun(std::string id);