Implement new stats interface on NetEq to monitor the operations and internal state.

Currently we use the NetworkStatistics to monitor these metrics, but because these get reset on every call, this makes it impossible to use them for other purposes.

Bug: webrtc:9667
Change-Id: If648085f04d2d58aae263cff5b9491bcad373a96
Reviewed-on: https://webrtc-review.googlesource.com/99740
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24727}
This commit is contained in:
Ivo Creusen
2018-09-13 14:39:55 +02:00
committed by Commit Bot
parent 9c38c47630
commit d1c2f78bfe
7 changed files with 70 additions and 18 deletions

View File

@ -371,6 +371,16 @@ NetEqLifetimeStatistics NetEqImpl::GetLifetimeStatistics() const {
return stats_.GetLifetimeStatistics();
}
NetEqOperationsAndState NetEqImpl::GetOperationsAndState() const {
rtc::CritScope lock(&crit_sect_);
auto result = stats_.GetOperationsAndState();
result.current_buffer_size_ms =
(packet_buffer_->NumSamplesInBuffer(decoder_frame_length_) +
sync_buffer_->FutureLength()) *
1000 / fs_hz_;
return result;
}
void NetEqImpl::GetRtcpStatistics(RtcpStatistics* stats) {
rtc::CritScope lock(&crit_sect_);
if (stats) {