aboutsummaryrefslogtreecommitdiff
path: root/audio/channel_send.cc
diff options
context:
space:
mode:
authorMirko Bonadei <mbonadei@webrtc.org>2019-10-15 08:54:49 +0000
committerCommit Bot <commit-bot@chromium.org>2019-10-15 08:55:06 +0000
commitef0627fb509dc5c4629c122e55fa9d1890989ac8 (patch)
treedfae5318f9ff876f1f441ae8258bb767779ee0c2 /audio/channel_send.cc
parent55c7694a9fed6dfbd1511b03097c2141cf940034 (diff)
downloadwebrtc-ef0627fb509dc5c4629c122e55fa9d1890989ac8.tar.gz
Revert "Fix GetStats bytesSent/Received, wireup headerBytesSent/Received"
This reverts commit fbde32e596f06893d6dda13eb7d29f4c251cf08b. Reason for revert: It seems to break WebRTC FYI tests in Chromium. https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Linux%20Tester/4763 Original change's description: > Fix GetStats bytesSent/Received, wireup headerBytesSent/Received > > Changes the standard GetStats, legacy GetStats unchanged. > > Bug: webrtc:10525 > Change-Id: Ie10fe8079f1d8b4cc6bbe513f6a2fc91477b5441 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156084 > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > Reviewed-by: Henrik Boström <hbos@webrtc.org> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Commit-Queue: Niels Moller <nisse@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29462} TBR=kwiberg@webrtc.org,hbos@webrtc.org,nisse@webrtc.org,hta@webrtc.org Change-Id: I6a983ea4d5ff38e49f096a8ff5cd9b426768f955 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:10525 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157043 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29478}
Diffstat (limited to 'audio/channel_send.cc')
-rw-r--r--audio/channel_send.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index f803bf9f63..2a969ab1b4 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -52,6 +52,11 @@ namespace {
constexpr int64_t kMaxRetransmissionWindowMs = 1000;
constexpr int64_t kMinRetransmissionWindowMs = 30;
+// Field trial which controls whether to report standard-compliant bytes
+// sent/received per stream. If enabled, padding and headers are not included
+// in bytes sent or received.
+constexpr char kUseStandardBytesStats[] = "WebRTC-UseStandardBytesStats";
+
MediaTransportEncodedAudioFrame::FrameType
MediaTransportFrameTypeForWebrtcFrameType(webrtc::AudioFrameType frame_type) {
switch (frame_type) {
@@ -258,6 +263,7 @@ class ChannelSend : public ChannelSendInterface,
rtc::ThreadChecker construction_thread_;
const bool use_twcc_plr_for_ana_;
+ const bool use_standard_bytes_stats_;
bool encoder_queue_is_active_ RTC_GUARDED_BY(encoder_queue_) = false;
@@ -603,6 +609,8 @@ ChannelSend::ChannelSend(Clock* clock,
new RateLimiter(clock, kMaxRetransmissionWindowMs)),
use_twcc_plr_for_ana_(
webrtc::field_trial::FindFullName("UseTwccPlrForAna") == "Enabled"),
+ use_standard_bytes_stats_(
+ webrtc::field_trial::IsEnabled(kUseStandardBytesStats)),
media_transport_config_(media_transport_config),
frame_encryptor_(frame_encryptor),
crypto_options_(crypto_options),
@@ -1011,12 +1019,17 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
StreamDataCounters rtp_stats;
StreamDataCounters rtx_stats;
_rtpRtcpModule->GetSendStreamDataCounters(&rtp_stats, &rtx_stats);
- stats.payload_bytes_sent =
- rtp_stats.transmitted.payload_bytes + rtx_stats.transmitted.payload_bytes;
- stats.header_and_padding_bytes_sent =
- rtp_stats.transmitted.padding_bytes + rtp_stats.transmitted.header_bytes +
- rtx_stats.transmitted.padding_bytes + rtx_stats.transmitted.header_bytes;
-
+ if (use_standard_bytes_stats_) {
+ stats.bytesSent = rtp_stats.transmitted.payload_bytes +
+ rtx_stats.transmitted.payload_bytes;
+ } else {
+ stats.bytesSent = rtp_stats.transmitted.payload_bytes +
+ rtp_stats.transmitted.padding_bytes +
+ rtp_stats.transmitted.header_bytes +
+ rtx_stats.transmitted.payload_bytes +
+ rtx_stats.transmitted.padding_bytes +
+ rtx_stats.transmitted.header_bytes;
+ }
// TODO(https://crbug.com/webrtc/10555): RTX retransmissions should show up in
// separate outbound-rtp stream objects.
stats.retransmitted_bytes_sent = rtp_stats.retransmitted.payload_bytes;