Replace DataSize and DataRate factories with newer versions
This is search and replace change:
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::Bytes<\(.*\)>()/DataSize::Bytes(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::bytes/DataSize::Bytes/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BitsPerSec<\(.*\)>()/DataRate::BitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BytesPerSec<\(.*\)>()/DataRate::BytesPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::KilobitsPerSec<\(.*\)>()/DataRate::KilobitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::bps/DataRate::BitsPerSec/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::kbps/DataRate::KilobitsPerSec/g"
git cl format
Bug: webrtc:9709
Change-Id: I65aaca69474ba038c1fe2dd8dc30d3f8e7b94c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168647
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30545}
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index 17ab5d7..9c709d8 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -804,12 +804,12 @@
constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12;
const TimeDelta kMinPacketDuration = TimeDelta::Millis(20);
DataRate max_overhead =
- DataSize::bytes(kOverheadPerPacket) / kMinPacketDuration;
+ DataSize::Bytes(kOverheadPerPacket) / kMinPacketDuration;
priority_bitrate += max_overhead;
} else {
RTC_DCHECK(frame_length_range_);
const DataSize kOverheadPerPacket =
- DataSize::bytes(total_packet_overhead_bytes_);
+ DataSize::Bytes(total_packet_overhead_bytes_);
DataRate max_overhead = kOverheadPerPacket / frame_length_range_->first;
priority_bitrate += max_overhead;
}
@@ -841,8 +841,8 @@
AudioSendStream::TargetAudioBitrateConstraints
AudioSendStream::GetMinMaxBitrateConstraints() const {
TargetAudioBitrateConstraints constraints{
- DataRate::bps(config_.min_bitrate_bps),
- DataRate::bps(config_.max_bitrate_bps)};
+ DataRate::BitsPerSec(config_.min_bitrate_bps),
+ DataRate::BitsPerSec(config_.max_bitrate_bps)};
// If bitrates were explicitly overriden via field trial, use those values.
if (allocation_settings_.min_bitrate)
@@ -856,7 +856,7 @@
if (send_side_bwe_with_overhead_) {
if (use_legacy_overhead_calculation_) {
// OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
- const DataSize kOverheadPerPacket = DataSize::bytes(20 + 8 + 10 + 12);
+ const DataSize kOverheadPerPacket = DataSize::Bytes(20 + 8 + 10 + 12);
const TimeDelta kMaxFrameLength =
TimeDelta::Millis(60); // Based on Opus spec
const DataRate kMinOverhead = kOverheadPerPacket / kMaxFrameLength;
@@ -865,7 +865,7 @@
} else {
RTC_DCHECK(frame_length_range_);
const DataSize kOverheadPerPacket =
- DataSize::bytes(total_packet_overhead_bytes_);
+ DataSize::Bytes(total_packet_overhead_bytes_);
constraints.min += kOverheadPerPacket / frame_length_range_->second;
constraints.max += kOverheadPerPacket / frame_length_range_->first;
}