diff options
author | Tim Na <natim@webrtc.org> | 2021-01-06 12:09:26 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-12 18:55:41 +0000 |
commit | 444e04be6988fbdcc039d775481ac22481ff9ff4 (patch) | |
tree | 43f2d5955ea9620b748e25a52824ad1b6f1a6810 /audio/voip/audio_channel.cc | |
parent | 2accc7d6e0bf51c1a2ce3e83e1f95321277b6afe (diff) | |
download | webrtc-444e04be6988fbdcc039d775481ac22481ff9ff4.tar.gz |
ChannelStatistics used for RTP stats in VoipStatistics.
- Added local and remote RTP statistics query API.
- Change includes simplifying remote SSRC change handling
via received RTP and RTCP packets.
Bug: webrtc:11989
Change-Id: Ia3ee62c1191baaedc67e033ea3c661d8c9301abc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199060
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Tim Na <natim@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32954}
Diffstat (limited to 'audio/voip/audio_channel.cc')
-rw-r--r-- | audio/voip/audio_channel.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/audio/voip/audio_channel.cc b/audio/voip/audio_channel.cc index dc53acf3ad..d11e6d79f9 100644 --- a/audio/voip/audio_channel.cc +++ b/audio/voip/audio_channel.cc @@ -79,6 +79,12 @@ AudioChannel::~AudioChannel() { } audio_mixer_->RemoveSource(ingress_.get()); + + // AudioEgress could hold current global TaskQueueBase that we need to clear + // before ProcessThread::DeRegisterModule. + egress_.reset(); + ingress_.reset(); + process_thread_->DeRegisterModule(rtp_rtcp_.get()); } @@ -159,4 +165,17 @@ IngressStatistics AudioChannel::GetIngressStatistics() { return ingress_stats; } +ChannelStatistics AudioChannel::GetChannelStatistics() { + ChannelStatistics channel_stat = ingress_->GetChannelStatistics(); + + StreamDataCounters rtp_stats, rtx_stats; + rtp_rtcp_->GetSendStreamDataCounters(&rtp_stats, &rtx_stats); + channel_stat.bytes_sent = + rtp_stats.transmitted.payload_bytes + rtx_stats.transmitted.payload_bytes; + channel_stat.packets_sent = + rtp_stats.transmitted.packets + rtx_stats.transmitted.packets; + + return channel_stat; +} + } // namespace webrtc |