Adding NetEq lifetime stats to event log visualizer.

Bug: webrtc:9147
Change-Id: I798f8ac41192182d50df6fe98fbe56c8cb7f294c
Reviewed-on: https://webrtc-review.googlesource.com/85340
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23738}
This commit is contained in:
Minyue Li
2018-06-26 13:01:32 +02:00
committed by Commit Bot
parent 762289ed13
commit c9ac93fabb
5 changed files with 73 additions and 15 deletions

View File

@ -46,15 +46,17 @@ void NetEqStatsGetter::AfterGetAudio(int64_t time_now_ms,
NetEq* neteq) {
// TODO(minyue): Get stats should better not be called as a call back after
// get audio. It is called independently from get audio in practice.
const auto lifetime_stat = neteq->GetLifetimeStatistics();
if (last_stats_query_time_ms_ == 0 ||
rtc::TimeDiff(time_now_ms, last_stats_query_time_ms_) >=
stats_query_interval_ms_) {
NetEqNetworkStatistics stats;
RTC_CHECK_EQ(neteq->NetworkStatistics(&stats), 0);
stats_.push_back(std::make_pair(time_now_ms, stats));
lifetime_stats_.push_back(std::make_pair(time_now_ms, lifetime_stat));
last_stats_query_time_ms_ = time_now_ms;
}
const auto lifetime_stat = neteq->GetLifetimeStatistics();
if (current_concealment_event_ != lifetime_stat.concealment_events &&
voice_concealed_samples_until_last_event_ <
lifetime_stat.voice_concealed_samples) {

View File

@ -77,8 +77,13 @@ class NetEqStatsGetter : public NetEqGetAudioCallback {
return concealment_events_;
}
const std::vector<std::pair<int64_t, NetEqNetworkStatistics>>& stats() const {
return stats_;
const std::vector<std::pair<int64_t, NetEqNetworkStatistics>>* stats() const {
return &stats_;
}
const std::vector<std::pair<int64_t, NetEqLifetimeStatistics>>*
lifetime_stats() const {
return &lifetime_stats_;
}
Stats AverageStats() const;
@ -88,6 +93,7 @@ class NetEqStatsGetter : public NetEqGetAudioCallback {
int64_t stats_query_interval_ms_ = 1000;
int64_t last_stats_query_time_ms_ = 0;
std::vector<std::pair<int64_t, NetEqNetworkStatistics>> stats_;
std::vector<std::pair<int64_t, NetEqLifetimeStatistics>> lifetime_stats_;
size_t current_concealment_event_ = 1;
uint64_t voice_concealed_samples_until_last_event_ = 0;
std::vector<ConcealmentEvent> concealment_events_;