Move string_builder.h to webrtc namespace

Bug: webrtc:42232595
Change-Id: Iad12b11767c3bbaddcf0e87357e8e6037608defb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/377740
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43926}
This commit is contained in:
Evan Shrubsole 2025-02-19 10:06:32 +00:00 committed by WebRTC LUCI CQ
parent afae3c2252
commit 0ebd67f89d
190 changed files with 386 additions and 392 deletions

View File

@ -154,7 +154,7 @@ class AudioParameters {
}
std::string ToString() const {
char ss_buf[1024];
rtc::SimpleStringBuilder ss(ss_buf);
SimpleStringBuilder ss(ss_buf);
ss << "AudioParameters: ";
ss << "sample_rate=" << sample_rate() << ", channels=" << channels();
ss << ", frames_per_buffer=" << frames_per_buffer();

View File

@ -128,7 +128,7 @@ operator==(const AudioProcessing::Config::CaptureLevelAdjustment::
std::string AudioProcessing::Config::ToString() const {
char buf[2048];
rtc::SimpleStringBuilder builder(buf);
SimpleStringBuilder builder(buf);
builder << "AudioProcessing::Config{ "
"pipeline: { "
"maximum_internal_processing_rate: "

View File

@ -23,7 +23,7 @@ NetEq::Config& NetEq::Config::operator=(Config&&) = default;
std::string NetEq::Config::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "sample_rate_hz=" << sample_rate_hz
<< ", max_packets_in_buffer=" << max_packets_in_buffer
<< ", min_delay_ms=" << min_delay_ms << ", enable_fast_accelerate="

View File

@ -128,7 +128,7 @@ RtpParameters::~RtpParameters() = default;
std::string RtpExtension::ToString() const {
char buf[256];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
sb << "{uri: " << uri;
sb << ", id: " << id;
if (encrypt) {

View File

@ -30,7 +30,7 @@ int64_t IntegralPart(double value) {
void AppendWithPrecision(double value,
int digits_after_comma,
rtc::StringBuilder& out) {
StringBuilder& out) {
int64_t multiplier = std::lround(std::pow(10, digits_after_comma));
int64_t integral_part = IntegralPart(value);
double decimal_part = std::abs(value) - integral_part;
@ -78,7 +78,7 @@ bool StdoutMetricsExporter::Export(rtc::ArrayView<const Metric> metrics) {
}
void StdoutMetricsExporter::PrintMetric(const Metric& metric) {
rtc::StringBuilder value_stream;
StringBuilder value_stream;
value_stream << metric.test_case << " / " << metric.name << "= {mean=";
if (metric.stats.mean.has_value()) {
AppendWithPrecision(*metric.stats.mean, 8, value_stream);

View File

@ -44,7 +44,7 @@ absl::string_view SpecToString(VideoResolution::Spec spec) {
}
void AppendResolution(const VideoResolution& resolution,
rtc::StringBuilder& builder) {
StringBuilder& builder) {
builder << "_" << resolution.width() << "x" << resolution.height() << "_"
<< resolution.fps();
}
@ -95,7 +95,7 @@ bool VideoResolution::IsRegular() const {
return spec_ == Spec::kNone;
}
std::string VideoResolution::ToString() const {
rtc::StringBuilder out;
StringBuilder out;
out << "{ width=" << width_ << ", height=" << height_ << ", fps=" << fps_
<< ", spec=" << SpecToString(spec_) << " }";
return out.Release();
@ -162,7 +162,7 @@ VideoDumpOptions::Y4mVideoFrameWriterFactory(
std::string VideoDumpOptions::GetInputDumpFileName(
absl::string_view stream_label,
const VideoResolution& resolution) const {
rtc::StringBuilder file_name;
StringBuilder file_name;
file_name << stream_label;
AppendResolution(resolution, file_name);
return test::JoinFilename(output_directory_, file_name.Release());
@ -181,7 +181,7 @@ std::string VideoDumpOptions::GetOutputDumpFileName(
absl::string_view stream_label,
absl::string_view receiver,
const VideoResolution& resolution) const {
rtc::StringBuilder file_name;
StringBuilder file_name;
file_name << stream_label << "_" << receiver;
AppendResolution(resolution, file_name);
return test::JoinFilename(output_directory_, file_name.Release());
@ -199,7 +199,7 @@ std::optional<std::string> VideoDumpOptions::GetOutputFrameIdsDumpFileName(
}
std::string VideoDumpOptions::ToString() const {
rtc::StringBuilder out;
StringBuilder out;
out << "{ output_directory_=" << output_directory_
<< ", sampling_modulo_=" << sampling_modulo_
<< ", export_frame_ids_=" << export_frame_ids_ << " }";
@ -298,7 +298,7 @@ std::vector<std::string> VideoSubscription::GetSubscribedPeers() const {
}
std::string VideoSubscription::ToString() const {
rtc::StringBuilder out;
StringBuilder out;
out << "{ default_resolution_=[";
if (default_resolution_.has_value()) {
out << default_resolution_->ToString();

View File

@ -27,7 +27,7 @@ VideoCodecTestStats::FrameStatistics::FrameStatistics(size_t frame_number,
spatial_idx(spatial_idx) {}
std::string VideoCodecTestStats::FrameStatistics::ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
for (const auto& entry : ToMap()) {
if (ss.size() > 0) {
ss << " ";
@ -66,7 +66,7 @@ std::map<std::string, std::string> VideoCodecTestStats::FrameStatistics::ToMap()
std::string VideoCodecTestStats::VideoStatistics::ToString(
std::string prefix) const {
rtc::StringBuilder ss;
StringBuilder ss;
for (const auto& entry : ToMap()) {
if (ss.size() > 0) {
ss << "\n";

View File

@ -19,7 +19,7 @@ namespace webrtc {
std::string ToString(DataRate value) {
char buf[64];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
if (value.IsPlusInfinity()) {
sb << "+inf bps";
} else if (value.IsMinusInfinity()) {

View File

@ -19,7 +19,7 @@ namespace webrtc {
std::string ToString(DataSize value) {
char buf[64];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
if (value.IsPlusInfinity()) {
sb << "+inf bytes";
} else if (value.IsMinusInfinity()) {

View File

@ -17,7 +17,7 @@
namespace webrtc {
std::string ToString(Frequency value) {
char buf[64];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
if (value.IsPlusInfinity()) {
sb << "+inf Hz";
} else if (value.IsMinusInfinity()) {

View File

@ -19,7 +19,7 @@ namespace webrtc {
std::string ToString(TimeDelta value) {
char buf[64];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
if (value.IsPlusInfinity()) {
sb << "+inf ms";
} else if (value.IsMinusInfinity()) {

View File

@ -18,7 +18,7 @@
namespace webrtc {
std::string ToString(Timestamp value) {
char buf[64];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
if (value.IsPlusInfinity()) {
sb << "+inf ms";
} else if (value.IsMinusInfinity()) {

View File

@ -139,7 +139,7 @@ const HdrMetadata* ColorSpace::hdr_metadata() const {
std::string ColorSpace::AsString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{primaries:";
switch (primaries_) {
PRINT_ENUM_CASE(PrimaryID, kBT709)

View File

@ -35,7 +35,7 @@ VideoAdaptationCounters VideoAdaptationCounters::operator+(
}
std::string VideoAdaptationCounters::ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "{ res=" << resolution_adaptations << " fps=" << fps_adaptations
<< " }";
return ss.Release();

View File

@ -147,7 +147,7 @@ std::string VideoBitrateAllocation::ToString() const {
// Max string length in practice is 260, but let's have some overhead and
// round up to nearest power of two.
char string_buf[512];
rtc::SimpleStringBuilder ssb(string_buf);
SimpleStringBuilder ssb(string_buf);
ssb << "VideoBitrateAllocation [";
uint32_t spatial_cumulator = 0;

View File

@ -89,7 +89,7 @@ std::string TimingFrameInfo::ToString() const {
}
char buf[1024];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
sb << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms << ','
<< encode_finish_ms << ',' << packetization_finish_ms << ','

View File

@ -515,7 +515,7 @@ aom_svc_ref_frame_config_t GetSvcRefFrameConfig(
}
char buf[256];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
sb << " spatial_id=" << settings.spatial_id;
sb << " ref_idx=[ ";
for (auto r : ref_frame_config.ref_idx) {
@ -618,7 +618,7 @@ aom_svc_params_t GetSvcParams(
}
char buf[512];
rtc::SimpleStringBuilder sb(buf);
SimpleStringBuilder sb(buf);
sb << "GetSvcParams" << " layer bitrates kbps";
for (int s = 0; s < svc_params.number_spatial_layers; ++s) {
sb << " S" << s << "=[ ";

View File

@ -160,7 +160,7 @@ SdpVideoFormat& SdpVideoFormat::operator=(SdpVideoFormat&&) = default;
SdpVideoFormat::~SdpVideoFormat() = default;
std::string SdpVideoFormat::ToString() const {
rtc::StringBuilder builder;
StringBuilder builder;
builder << "Codec name: " << name << ", parameters: {";
for (const auto& kv : parameters) {
builder << " " << kv.first << "=" << kv.second;

View File

@ -79,7 +79,7 @@ VideoCodec::VideoCodec()
std::string VideoCodec::ToString() const {
char string_buf[2048];
rtc::SimpleStringBuilder ss(string_buf);
SimpleStringBuilder ss(string_buf);
ss << "VideoCodec {" << "type: " << CodecTypeToPayloadString(codecType)
<< ", mode: "

View File

@ -44,7 +44,7 @@ const char* VideoDecoder::ImplementationName() const {
std::string VideoDecoder::DecoderInfo::ToString() const {
char string_buf[2048];
rtc::SimpleStringBuilder oss(string_buf);
SimpleStringBuilder oss(string_buf);
oss << "DecoderInfo { "
<< "prefers_late_decoding = " << "implementation_name = '"

View File

@ -120,7 +120,7 @@ VideoEncoder::EncoderInfo::EncoderInfo(const EncoderInfo&) = default;
VideoEncoder::EncoderInfo::~EncoderInfo() = default;
std::string VideoEncoder::EncoderInfo::ToString() const {
rtc::StringBuilder oss;
StringBuilder oss;
oss << "EncoderInfo { "
"ScalingSettings { ";
if (scaling_settings.thresholds) {

View File

@ -49,7 +49,7 @@ namespace webrtc {
std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const {
char ss_buf[1024];
rtc::SimpleStringBuilder ss(ss_buf);
SimpleStringBuilder ss(ss_buf);
ss << "{remote_ssrc: " << remote_ssrc;
ss << ", local_ssrc: " << local_ssrc;
ss << ", nack: " << nack.ToString();
@ -63,7 +63,7 @@ std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const {
std::string AudioReceiveStreamInterface::Config::ToString() const {
char ss_buf[1024];
rtc::SimpleStringBuilder ss(ss_buf);
SimpleStringBuilder ss(ss_buf);
ss << "{rtp: " << rtp.ToString();
ss << ", rtcp_send_transport: "
<< (rtcp_send_transport ? "(Transport)" : "null");

View File

@ -749,7 +749,7 @@ void ChannelReceive::ReceivePacket(const uint8_t* packet,
// Asynchronously transform the received payload. After the payload is
// transformed, the delegate will call OnReceivedPayloadData to handle it.
char buf[1024];
rtc::SimpleStringBuilder mime_type(buf);
SimpleStringBuilder mime_type(buf);
auto it = payload_type_map_.find(header.payloadType);
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
<< (it != payload_type_map_.end() ? it->second.name

View File

@ -384,7 +384,7 @@ int32_t ChannelSend::SendData(AudioFrameType frameType,
// Asynchronously transform the payload before sending it. After the payload
// is transformed, the delegate will call SendRtpAudio to send it.
char buf[1024];
rtc::SimpleStringBuilder mime_type(buf);
SimpleStringBuilder mime_type(buf);
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
<< encoder_format_.name;
frame_transformer_delegate_->Transform(

View File

@ -163,7 +163,7 @@ TEST_F(ChannelMixerTest, ConstructAllPossibleLayouts) {
continue;
}
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input Layout: " << input_layout
<< ", Output Layout: " << output_layout;
SCOPED_TRACE(ss.str());

View File

@ -43,7 +43,7 @@ TEST(ChannelMixingMatrixTest, ConstructAllPossibleLayouts) {
continue;
}
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input Layout: " << input_layout
<< ", Output Layout: " << output_layout;
SCOPED_TRACE(ss.str());

View File

@ -230,7 +230,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
// How can this stream be adapted up?
Adaptation adaptation = stream_adapter_->GetAdaptationUp();
if (adaptation.status() != Adaptation::Status::kValid) {
rtc::StringBuilder message;
StringBuilder message;
message << "Not adapting up because VideoStreamAdapter returned "
<< Adaptation::StatusToString(adaptation.status());
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
@ -251,7 +251,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
// adaptation.
if (absl::c_find(most_limited_resources, reason_resource) ==
most_limited_resources.end()) {
rtc::StringBuilder message;
StringBuilder message;
message << "Resource \"" << reason_resource->Name()
<< "\" was not the most limited resource.";
return MitigationResultAndLogMessage(
@ -263,7 +263,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
// before the adaptation is applied.
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
adaptation.counters());
rtc::StringBuilder message;
StringBuilder message;
message << "Resource \"" << reason_resource->Name()
<< "\" was not the only most limited resource.";
return MitigationResultAndLogMessage(
@ -272,7 +272,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
}
// Apply adaptation.
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
rtc::StringBuilder message;
StringBuilder message;
message << "Adapted up successfully. Unfiltered adaptations: "
<< stream_adapter_->adaptation_counters().ToString();
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,
@ -293,7 +293,7 @@ ResourceAdaptationProcessor::OnResourceOveruse(
restrictions.counters);
}
if (adaptation.status() != Adaptation::Status::kValid) {
rtc::StringBuilder message;
StringBuilder message;
message << "Not adapting down because VideoStreamAdapter returned "
<< Adaptation::StatusToString(adaptation.status());
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
@ -303,7 +303,7 @@ ResourceAdaptationProcessor::OnResourceOveruse(
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
adaptation.counters());
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
rtc::StringBuilder message;
StringBuilder message;
message << "Adapted down successfully. Unfiltered adaptations: "
<< stream_adapter_->adaptation_counters().ToString();
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,

View File

@ -39,7 +39,7 @@ VideoSourceRestrictions::VideoSourceRestrictions(
}
std::string VideoSourceRestrictions::ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "{";
if (max_frame_rate_)
ss << " max_fps=" << max_frame_rate_.value();

View File

@ -31,7 +31,7 @@ AudioSendStream::Config::Config(Transport* send_transport)
AudioSendStream::Config::~Config() = default;
std::string AudioSendStream::Config::ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "{rtp: " << rtp.ToString();
ss << ", rtcp_report_interval_ms: " << rtcp_report_interval_ms;
ss << ", send_transport: " << (send_transport ? "(Transport)" : "null");
@ -52,7 +52,7 @@ AudioSendStream::Config::Rtp::~Rtp() = default;
std::string AudioSendStream::Config::Rtp::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ssrc: " << ssrc;
if (!rid.empty()) {
ss << ", rid: " << rid;
@ -82,7 +82,7 @@ AudioSendStream::Config::SendCodecSpec::~SendCodecSpec() = default;
std::string AudioSendStream::Config::SendCodecSpec::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{nack_enabled: " << (nack_enabled ? "true" : "false");
ss << ", enable_non_sender_rtt: "
<< (enable_non_sender_rtt ? "true" : "false");

View File

@ -516,7 +516,7 @@ class Call final : public webrtc::Call,
std::string Call::Stats::ToString(int64_t time_ms) const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "Call stats: " << time_ms << ", {";
ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";

View File

@ -31,7 +31,7 @@ namespace webrtc {
std::string FlexfecReceiveStream::Config::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{payload_type: " << payload_type;
ss << ", remote_ssrc: " << rtp.remote_ssrc;
ss << ", local_ssrc: " << rtp.local_ssrc;

View File

@ -48,7 +48,7 @@ std::string LntfConfig::ToString() const {
std::string NackConfig::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{rtp_history_ms: " << rtp_history_ms;
ss << '}';
return ss.str();
@ -56,7 +56,7 @@ std::string NackConfig::ToString() const {
std::string UlpfecConfig::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
ss << ", red_payload_type: " << red_payload_type;
ss << ", red_rtx_payload_type: " << red_rtx_payload_type;
@ -72,7 +72,7 @@ bool UlpfecConfig::operator==(const UlpfecConfig& other) const {
std::string RtpStreamConfig::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ssrc: " << ssrc;
ss << ", rid: " << rid;
ss << ", payload_name: " << payload_name;
@ -87,7 +87,7 @@ std::string RtpStreamConfig::ToString() const {
std::string RtpStreamConfig::Rtx::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ssrc: " << ssrc;
ss << ", payload_type: " << payload_type;
ss << '}';
@ -104,7 +104,7 @@ RtpConfig::Flexfec::~Flexfec() = default;
std::string RtpConfig::ToString() const {
char buf[2 * 1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ssrcs: [";
for (size_t i = 0; i < ssrcs.size(); ++i) {
ss << ssrcs[i];
@ -168,7 +168,7 @@ RtpConfig::Rtx::~Rtx() = default;
std::string RtpConfig::Rtx::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{ssrcs: [";
for (size_t i = 0; i < ssrcs.size(); ++i) {
ss << ssrcs[i];

View File

@ -70,7 +70,7 @@ bool RtpDemuxerCriteria::operator!=(const RtpDemuxerCriteria& other) const {
}
std::string RtpDemuxerCriteria::ToString() const {
rtc::StringBuilder sb;
StringBuilder sb;
sb << "{mid: " << (mid_.empty() ? "<empty>" : mid_)
<< ", rsid: " << (rsid_.empty() ? "<empty>" : rsid_) << ", ssrcs: [";
@ -90,7 +90,7 @@ std::string RtpDemuxerCriteria::ToString() const {
// static
std::string RtpDemuxer::DescribePacket(const RtpPacketReceived& packet) {
rtc::StringBuilder sb;
StringBuilder sb;
sb << "PT=" << packet.PayloadType() << " SSRC=" << packet.Ssrc();
std::string mid;
if (packet.GetExtension<RtpMid>(&mid)) {

View File

@ -37,7 +37,7 @@ bool VideoReceiveStreamInterface::Decoder::operator==(
std::string VideoReceiveStreamInterface::Decoder::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{payload_type: " << payload_type;
ss << ", payload_name: " << video_format.name;
ss << ", codec_params: {";
@ -60,7 +60,7 @@ VideoReceiveStreamInterface::Stats::~Stats() = default;
std::string VideoReceiveStreamInterface::Stats::ToString(
int64_t time_ms) const {
char buf[2048];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "VideoReceiveStreamInterface stats: " << time_ms << ", {ssrc: " << ssrc
<< ", ";
ss << "total_bps: " << total_bitrate_bps << ", ";
@ -120,7 +120,7 @@ VideoReceiveStreamInterface::Config::Config::~Config() = default;
std::string VideoReceiveStreamInterface::Config::ToString() const {
char buf[4 * 1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{decoders: [";
for (size_t i = 0; i < decoders.size(); ++i) {
ss << decoders[i].ToString();
@ -144,7 +144,7 @@ VideoReceiveStreamInterface::Config::Rtp::~Rtp() = default;
std::string VideoReceiveStreamInterface::Config::Rtp::ToString() const {
char buf[2 * 1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{remote_ssrc: " << remote_ssrc;
ss << ", local_ssrc: " << local_ssrc;
ss << ", rtcp_mode: "

View File

@ -43,7 +43,7 @@ VideoSendStream::StreamStats::~StreamStats() = default;
std::string VideoSendStream::StreamStats::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "type: " << StreamTypeToString(type);
if (referenced_media_ssrc.has_value())
ss << " (for: " << referenced_media_ssrc.value() << ")";
@ -72,7 +72,7 @@ VideoSendStream::Stats::~Stats() = default;
std::string VideoSendStream::Stats::ToString(int64_t time_ms) const {
char buf[2048];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "VideoSendStream stats: " << time_ms << ", {";
ss << "input_fps: " << StringFormat("%.1f", input_frame_rate) << ", ";
ss << "encode_fps: " << encode_frame_rate << ", ";
@ -114,7 +114,7 @@ VideoSendStream::Config::Config::~Config() = default;
std::string VideoSendStream::Config::ToString() const {
char buf[2 * 1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
ss << "{encoder_settings: { experiment_cpu_load_estimator: "
<< (encoder_settings.experiment_cpu_load_estimator ? "on" : "off") << "}}";
ss << ", rtp: " << rtp.ToString();

View File

@ -66,7 +66,7 @@ void ResamplerTest::TearDown() {}
void ResamplerTest::ResetIfNeededAndPush(int in_rate,
int out_rate,
int num_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input rate: " << in_rate << ", output rate: " << out_rate
<< ", channel count: " << num_channels;
SCOPED_TRACE(ss.str());
@ -92,7 +92,7 @@ TEST_F(ResamplerTest, Reset) {
for (size_t i = 0; i < kRatesSize; ++i) {
for (size_t j = 0; j < kRatesSize; ++j) {
for (size_t k = 0; k < kNumChannelsSize; ++k) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j]
<< ", channels: " << kNumChannels[k];
SCOPED_TRACE(ss.str());
@ -111,7 +111,7 @@ TEST_F(ResamplerTest, Mono) {
const int kChannels = 1;
for (size_t i = 0; i < kRatesSize; ++i) {
for (size_t j = 0; j < kRatesSize; ++j) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
SCOPED_TRACE(ss.str());
@ -133,7 +133,7 @@ TEST_F(ResamplerTest, Stereo) {
const int kChannels = 2;
for (size_t i = 0; i < kRatesSize; ++i) {
for (size_t j = 0; j < kRatesSize; ++j) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
SCOPED_TRACE(ss.str());

View File

@ -128,7 +128,7 @@ TEST(SplTest, AddSubSatW32) {
INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) + b));
const int64_t diff = std::max<int64_t>(
INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) - b));
rtc::StringBuilder ss;
webrtc::StringBuilder ss;
ss << a << " +/- " << b << ": sum " << sum << ", diff " << diff;
SCOPED_TRACE(ss.str());
EXPECT_EQ(sum, WebRtcSpl_AddSatW32(a, b));

View File

@ -1005,7 +1005,7 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const {
}
if (!encoder_names.empty()) {
rtc::StringBuilder implementation_name_builder(" (");
StringBuilder implementation_name_builder(" (");
implementation_name_builder << StrJoin(encoder_names, ", ");
implementation_name_builder << ")";
encoder_info.implementation_name += implementation_name_builder.Release();

View File

@ -158,7 +158,7 @@ DcSctpTransport::DcSctpTransport(
}) {
RTC_DCHECK_RUN_ON(network_thread_);
static std::atomic<int> instance_count = 0;
rtc::StringBuilder sb;
StringBuilder sb;
sb << debug_name_ << instance_count++;
debug_name_ = sb.Release();
ConnectTransportSignals();

View File

@ -31,7 +31,7 @@ TEST(BufferLevelFilter, ConvergenceTest) {
for (int value = 100; value <= 200; value += 10) {
filter.Reset();
filter.SetTargetBufferLevel(20); // Makes filter coefficient 251/256.
rtc::StringBuilder ss;
StringBuilder ss;
ss << "times = " << times << ", value = " << value;
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
for (int i = 0; i < times; ++i) {

View File

@ -34,7 +34,7 @@ class DtmfToneGeneratorTest : public ::testing::Test {
AudioMultiVector signal(channels);
for (int event = 0; event <= 15; ++event) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Checking event " << event << " at sample rate " << fs_hz;
SCOPED_TRACE(ss.str());
const int kAttenuation = 0;
@ -73,7 +73,7 @@ class DtmfToneGeneratorTest : public ::testing::Test {
EXPECT_EQ(kNumSamples, tone_gen_.Generate(kNumSamples, &ref_signal));
// Test every 5 steps (to save time).
for (int attenuation = 1; attenuation <= 63; attenuation += 5) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Checking event " << event << " at sample rate " << fs_hz;
ss << "; attenuation " << attenuation;
SCOPED_TRACE(ss.str());

View File

@ -198,7 +198,7 @@ class NetEqStereoTest : public ::testing::TestWithParam<TestParameters> {
EXPECT_EQ(num_channels_, output_multi_channel_.num_channels_);
EXPECT_EQ(output_size_samples_,
output_multi_channel_.samples_per_channel_);
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Lap number " << k << ".";
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
// Compare mono and multi-channel.

View File

@ -261,7 +261,7 @@ TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
static const int kExpectedOutputLength = 160; // 10 ms at 16 kHz sample rate.
const int16_t* const_out_frame_data = out_frame_.data();
for (int i = 0; i < kExpectedOutputLength; ++i) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "i = " << i;
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
EXPECT_EQ(0, const_out_frame_data[i]);
@ -283,7 +283,7 @@ TEST_F(NetEqDecodingTest, GetAudioBeforeInsertPacket) {
kInitSampleRateHz / 100; // 10 ms at initial sample rate.
const int16_t* const_out_frame_data = out_frame_.data();
for (int i = 0; i < kExpectedOutputLength; ++i) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "i = " << i;
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
EXPECT_EQ(0, const_out_frame_data[i]);
@ -799,7 +799,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
AudioFrame out_frame1, out_frame2;
bool muted;
for (int i = 0; i < 1000; ++i) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "i = " << i;
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
@ -825,7 +825,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
int counter = 0;
while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {
ASSERT_LT(counter++, 1000) << "Test timed out";
rtc::StringBuilder ss;
StringBuilder ss;
ss << "counter = " << counter;
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));

View File

@ -154,7 +154,7 @@ void NetEqDecodingTest::DecodeAndCompare(
uint64_t last_concealed_samples = 0;
uint64_t last_total_samples_received = 0;
while (packet_) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Lap number " << i++ << " in DecodeAndCompare while loop";
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
ASSERT_NO_FATAL_FAILURE(Process());

View File

@ -19,7 +19,7 @@ NetEqInput::PacketData::PacketData() = default;
NetEqInput::PacketData::~PacketData() = default;
std::string NetEqInput::PacketData::ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "{"
"time_ms: "
<< static_cast<int64_t>(time_ms)

View File

@ -285,13 +285,13 @@ std::optional<std::string> CreateOptionalOutputFileName(
}
if (!basename.empty()) {
// Override the automatic assignment.
rtc::StringBuilder sb(basename);
webrtc::StringBuilder sb(basename);
sb << suffix;
return sb.str();
}
if (!output_audio_filename.empty()) {
// Automatically assign name.
rtc::StringBuilder sb(output_audio_filename);
webrtc::StringBuilder sb(output_audio_filename);
sb << suffix;
return sb.str();
}

View File

@ -23,7 +23,7 @@ namespace test {
std::string NetEqStatsGetter::ConcealmentEvent::ToString() const {
char ss_buf[256];
rtc::SimpleStringBuilder ss(ss_buf);
SimpleStringBuilder ss(ss_buf);
ss << "ConcealmentEvent duration_ms:" << duration_ms
<< " event_number:" << concealment_event_number
<< " time_from_previous_event_end_ms:" << time_from_previous_event_end_ms;

View File

@ -219,7 +219,7 @@ Channel::Channel(int16_t chID)
}
if (chID >= 0) {
_saveBitStream = true;
rtc::StringBuilder ss;
StringBuilder ss;
ss.AppendFormat("bitStream_%d.dat", chID);
_bitStreamFile = fopen(ss.str().c_str(), "wb");
} else {

View File

@ -136,7 +136,7 @@ void Receiver::Setup(NetEq* neteq,
int playSampFreq;
std::string file_name;
rtc::StringBuilder file_stream;
StringBuilder file_stream;
file_stream << webrtc::test::OutputPath() << out_file_name << file_num
<< ".pcm";
file_name = file_stream.str();

View File

@ -41,7 +41,7 @@ void ReceiverWithPacketLoss::Setup(NetEq* neteq,
loss_rate_ = loss_rate;
burst_length_ = burst_length;
burst_lost_counter_ = burst_length_; // To prevent first packet gets lost.
rtc::StringBuilder ss;
StringBuilder ss;
ss << out_file_name << "_" << loss_rate_ << "_" << burst_length_ << "_";
Receiver::Setup(neteq, rtpStream, ss.str(), channels, file_num);
}

View File

@ -373,7 +373,7 @@ void TestAllCodecs::Run(TestPack* channel) {
void TestAllCodecs::OpenOutFile(int test_number) {
std::string filename = webrtc::test::OutputPath();
rtc::StringBuilder test_number_str;
StringBuilder test_number_str;
test_number_str << test_number;
filename += "testallcodecs_out_";
filename += test_number_str.str();

View File

@ -192,7 +192,7 @@ void TestRedFec::Run() {
void TestRedFec::OpenOutFile(int16_t test_number) {
std::string file_name;
rtc::StringBuilder file_stream;
StringBuilder file_stream;
file_stream << webrtc::test::OutputPath();
file_stream << "TestRedFec_outFile_";
file_stream << test_number << ".pcm";

View File

@ -603,7 +603,7 @@ void TestStereo::Run(TestPackStereo* channel,
void TestStereo::OpenOutFile(int16_t test_number) {
std::string file_name;
rtc::StringBuilder file_stream;
StringBuilder file_stream;
file_stream << webrtc::test::OutputPath() << "teststereo_out_" << test_number
<< ".pcm";
file_name = file_stream.str();

View File

@ -205,7 +205,7 @@ void TestWebRtcVadDtx::Test(bool new_outfile, bool expect_dtx_enabled) {
if (new_outfile) {
output_file_num_++;
}
rtc::StringBuilder out_filename;
StringBuilder out_filename;
out_filename << webrtc::test::OutputPath() << "testWebRtcVadDtx_outFile_"
<< output_file_num_ << ".pcm";
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), 32000, 1,

View File

@ -61,7 +61,7 @@ void ResetFrame(AudioFrame* frame) {
std::string ProduceDebugText(int sample_rate_hz,
int number_of_channels,
int number_of_sources) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz << " ";
ss << "Number of channels: " << number_of_channels << " ";
ss << "Number of sources: " << number_of_sources;

View File

@ -78,7 +78,7 @@ class FilePlayingSource : public AudioMixer::Source {
bool FileHasEnded() const { return file_has_ended_; }
std::string ToString() const {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "{rate: " << sample_rate_hz_ << ", channels: " << number_of_channels_
<< ", samples_tot: " << wav_reader_->num_samples() << "}";
return ss.Release();

View File

@ -48,7 +48,7 @@ struct FrameCombinerConfig {
std::string ProduceDebugText(int sample_rate_hz,
int number_of_channels,
int number_of_sources) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz << " ,";
ss << "number of channels: " << number_of_channels << " ,";
ss << "number of sources: " << number_of_sources;
@ -56,7 +56,7 @@ std::string ProduceDebugText(int sample_rate_hz,
}
std::string ProduceDebugText(const FrameCombinerConfig& config) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << config.sample_rate_hz << " ,";
ss << "number of channels: " << config.number_of_channels << " ,";
ss << "limiter active: " << (config.use_limiter ? "on" : "off") << " ,";

View File

@ -44,7 +44,7 @@ namespace aec3 {
namespace {
std::string ProduceDebugText(size_t num_render_channels, size_t delay) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "delay: " << delay << ", ";
ss << "num_render_channels:" << num_render_channels;
return ss.Release();

View File

@ -28,7 +28,7 @@ std::string ProduceDebugText(bool initial_silence,
bool prefer_first_two_channels,
int num_channels,
int strongest_ch) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << ", Initial silence: " << initial_silence;
ss << ", Huge activity threshold: " << huge_activity_threshold;
ss << ", Prefer first two channels: " << prefer_first_two_channels;

View File

@ -39,7 +39,7 @@ void PopulateInputFrame(size_t frame_length,
std::string ProduceDebugText(int sample_rate_hz, size_t delay) {
char log_stream_buffer[8 * 1024];
rtc::SimpleStringBuilder ss(log_stream_buffer);
SimpleStringBuilder ss(log_stream_buffer);
ss << "Sample rate: " << sample_rate_hz;
ss << ", Delay: " << delay;
return ss.str();

View File

@ -188,7 +188,7 @@ void RunWronglyInsertOrderTest(int sample_rate_hz,
#endif
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
ss << ", number of channels: " << num_channels;
return ss.Release();

View File

@ -104,7 +104,7 @@ void RunCaptureNumBandsVerificationTest(const Environment& env,
#endif
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}

View File

@ -118,13 +118,13 @@ void RunFilterUpdateTest(int num_blocks_to_process,
}
std::string ProduceDebugText(int filter_length_blocks) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Length: " << filter_length_blocks;
return ss.Release();
}
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Delay: " << delay << ", ";
ss << ProduceDebugText(filter_length_blocks);
return ss.Release();

View File

@ -29,7 +29,7 @@ namespace webrtc {
namespace {
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}

View File

@ -176,13 +176,13 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
};
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}
std::string ProduceDebugText(int sample_rate_hz, int variant) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz << ", variant: " << variant;
return ss.Release();
}

View File

@ -26,7 +26,7 @@ namespace webrtc {
namespace {
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Delay: " << delay;
ss << ", Down sampling factor: " << down_sampling_factor;
return ss.Release();

View File

@ -29,13 +29,13 @@
namespace webrtc {
namespace {
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}
std::string ProduceDebugText(int sample_rate_hz, int delay) {
rtc::StringBuilder ss(ProduceDebugText(sample_rate_hz));
StringBuilder ss(ProduceDebugText(sample_rate_hz));
ss << ", Delay: " << delay;
return ss.Release();
}

View File

@ -18,7 +18,7 @@ namespace webrtc {
namespace {
std::string ProduceDebugText(size_t num_render_channels,
size_t num_capture_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Render channels: " << num_render_channels;
ss << ", Capture channels: " << num_capture_channels;
return ss.Release();

View File

@ -260,7 +260,7 @@ void RunWrongExtractOrderTest(int sample_rate_hz,
#endif
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
ss << ", number of channels: " << num_channels;
return ss.Release();

View File

@ -35,7 +35,7 @@ namespace aec3 {
namespace {
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Delay: " << delay;
ss << ", Down sampling factor: " << down_sampling_factor;
return ss.Release();

View File

@ -219,13 +219,13 @@ void RunFilterUpdateTest(const Environment& env,
}
std::string ProduceDebugText(int filter_length_blocks) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Length: " << filter_length_blocks;
return ss.Release();
}
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Delay: " << delay << ", ";
ss << ProduceDebugText(filter_length_blocks);
return ss.Release();

View File

@ -25,7 +25,7 @@ namespace webrtc {
namespace {
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}

View File

@ -29,7 +29,7 @@ namespace webrtc {
namespace {
std::string ProduceDebugText(int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz;
return ss.Release();
}
@ -38,7 +38,7 @@ std::string ProduceDebugText(int sample_rate_hz,
size_t delay,
size_t num_render_channels,
size_t num_capture_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << ProduceDebugText(sample_rate_hz) << ", Delay: " << delay
<< ", Num render channels: " << num_render_channels
<< ", Num capture channels: " << num_capture_channels;

View File

@ -107,7 +107,7 @@ void RunNarrowBandDetectionTest(size_t num_channels) {
}
std::string ProduceDebugText(size_t num_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "number of channels: " << num_channels;
return ss.Release();
}

View File

@ -179,7 +179,7 @@ std::string ProduceDebugText(size_t num_render_channels,
size_t num_capture_channels,
size_t delay,
int filter_length_blocks) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "delay: " << delay << ", ";
ss << "filter_length_blocks:" << filter_length_blocks << ", ";
ss << "num_render_channels:" << num_render_channels << ", ";

View File

@ -152,7 +152,7 @@ constexpr char kMinMicLevelFieldTrial[] =
std::string GetAgcMinMicLevelExperimentFieldTrial(const std::string& value) {
char field_trial_buffer[64];
rtc::SimpleStringBuilder builder(field_trial_buffer);
SimpleStringBuilder builder(field_trial_buffer);
builder << kMinMicLevelFieldTrial << "/" << value << "/";
return builder.str();
}
@ -163,7 +163,7 @@ std::string GetAgcMinMicLevelExperimentFieldTrialEnabled(
RTC_DCHECK_GE(enabled_value, 0);
RTC_DCHECK_LE(enabled_value, 255);
char field_trial_buffer[64];
rtc::SimpleStringBuilder builder(field_trial_buffer);
SimpleStringBuilder builder(field_trial_buffer);
builder << kMinMicLevelFieldTrial << "/Enabled-" << enabled_value << suffix
<< "/";
return builder.str();

View File

@ -18,7 +18,7 @@ namespace webrtc {
std::string AvailableCpuFeatures::ToString() const {
char buf[64];
rtc::SimpleStringBuilder builder(buf);
SimpleStringBuilder builder(buf);
bool first = true;
if (sse2) {
builder << (first ? "SSE2" : "_SSE2");

View File

@ -52,7 +52,7 @@ constexpr absl::string_view MetricNamePrefix(
metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
char buffer[64];
rtc::SimpleStringBuilder builder(buffer);
SimpleStringBuilder builder(buffer);
builder << MetricNamePrefix(input_volume_type) << "OnChange";
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
/*min=*/1,
@ -63,7 +63,7 @@ metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
absl::string_view name) {
char buffer[64];
rtc::SimpleStringBuilder builder(buffer);
SimpleStringBuilder builder(buffer);
builder << MetricNamePrefix(input_volume_type) << name;
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
/*min=*/1,
@ -74,7 +74,7 @@ metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
metrics::Histogram* CreateAverageHistogram(InputVolumeType input_volume_type,
absl::string_view name) {
char buffer[64];
rtc::SimpleStringBuilder builder(buffer);
SimpleStringBuilder builder(buffer);
builder << MetricNamePrefix(input_volume_type) << name;
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
/*min=*/1,

View File

@ -32,37 +32,33 @@ class InputVolumeStatsReporterTest
protected:
InputVolumeType InputVolumeType() const { return GetParam(); }
std::string VolumeLabel() const {
return (rtc::StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "OnChange")
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "OnChange")
.str();
}
std::string DecreaseRateLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "DecreaseRate")
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "DecreaseRate")
.str();
}
std::string DecreaseAverageLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
return (StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "DecreaseAverage")
.str();
}
std::string IncreaseRateLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "IncreaseRate")
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "IncreaseRate")
.str();
}
std::string IncreaseAverageLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
return (StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "IncreaseAverage")
.str();
}
std::string UpdateRateLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "UpdateRate")
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "UpdateRate")
.str();
}
std::string UpdateAverageLabel() const {
return (rtc::StringBuilder(kLabelPrefix)
<< VolumeTypeLabel() << "UpdateAverage")
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "UpdateAverage")
.str();
}

View File

@ -34,16 +34,16 @@ InterpolatedGainCurve::InterpolatedGainCurve(
ApmDataDumper* apm_data_dumper,
absl::string_view histogram_name_prefix)
: region_logger_(
(rtc::StringBuilder("WebRTC.Audio.")
(StringBuilder("WebRTC.Audio.")
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Identity")
.str(),
(rtc::StringBuilder("WebRTC.Audio.")
(StringBuilder("WebRTC.Audio.")
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Knee")
.str(),
(rtc::StringBuilder("WebRTC.Audio.")
(StringBuilder("WebRTC.Audio.")
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Limiter")
.str(),
(rtc::StringBuilder("WebRTC.Audio.")
(StringBuilder("WebRTC.Audio.")
<< histogram_name_prefix
<< ".FixedDigitalGainCurveRegion.Saturation")
.str()),

View File

@ -33,7 +33,7 @@ constexpr float kTestPitchStrengthHigh = 0.75f;
template <class T>
std::string PrintTestIndexAndCpuFeatures(
const ::testing::TestParamInfo<T>& info) {
rtc::StringBuilder builder;
StringBuilder builder;
builder << info.index << "_" << info.param.cpu_features.ToString();
return builder.str();
}

View File

@ -172,7 +172,7 @@ void OpenFileAndWriteMessage(absl::string_view filename,
}
std::string ResourceFilePath(absl::string_view name, int sample_rate_hz) {
rtc::StringBuilder ss;
StringBuilder ss;
// Resource files are all stereo.
ss << name << sample_rate_hz / 1000 << "_stereo";
return test::ResourcePath(ss.str(), "pcm");
@ -193,7 +193,7 @@ std::string OutputFilePath(absl::string_view name,
size_t num_reverse_input_channels,
size_t num_reverse_output_channels,
StreamDirection file_direction) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << name << "_i" << num_input_channels << "_" << input_rate / 1000 << "_ir"
<< num_reverse_input_channels << "_" << reverse_input_rate / 1000 << "_";
if (num_output_channels == 1) {
@ -2341,7 +2341,7 @@ std::string ProduceDebugText(int render_input_sample_rate_hz,
size_t render_output_num_channels,
size_t capture_input_num_channels,
size_t capture_output_num_channels) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rates:"
"\n Render input: "
<< render_input_sample_rate_hz

View File

@ -26,7 +26,7 @@ namespace {
std::string ProduceDebugText(int sample_rate_hz,
size_t num_channels,
NsConfig::SuppressionLevel level) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "Sample rate: " << sample_rate_hz << ", num_channels: " << num_channels
<< ", level: " << static_cast<int>(level);
return ss.Release();

View File

@ -42,7 +42,7 @@ namespace {
std::string GetIndexedOutputWavFilename(absl::string_view wav_name,
int counter) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << wav_name.substr(0, wav_name.size() - 4) << "_" << counter
<< wav_name.substr(wav_name.size() - 4);
return ss.Release();

View File

@ -430,7 +430,7 @@ void Aec3ConfigFromJsonString(absl::string_view json_string,
}
std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) {
rtc::StringBuilder ost;
StringBuilder ost;
ost << "{";
ost << "\"aec3\": {";
ost << "\"buffering\": {";

View File

@ -98,13 +98,13 @@ void CheckSameSign(const ChannelBuffer<float>* src,
}
std::string FakeRecordingDeviceKindToString(int fake_rec_device_kind) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "fake recording device: " << fake_rec_device_kind;
return ss.Release();
}
std::string AnalogLevelToString(int level) {
rtc::StringBuilder ss;
StringBuilder ss;
ss << "analog level: " << level;
return ss.Release();
}

View File

@ -38,7 +38,7 @@ class LossBasedBweV2Test : public ::testing::TestWithParam<bool> {
protected:
std::string Config(bool enabled, bool valid) {
char buffer[1024];
rtc::SimpleStringBuilder config_string(buffer);
SimpleStringBuilder config_string(buffer);
config_string << "WebRTC-Bwe-LossBasedBweV2/";
@ -79,7 +79,7 @@ class LossBasedBweV2Test : public ::testing::TestWithParam<bool> {
std::string ShortObservationConfig(std::string custom_config) {
char buffer[1024];
rtc::SimpleStringBuilder config_string(buffer);
SimpleStringBuilder config_string(buffer);
config_string << "WebRTC-Bwe-LossBasedBweV2/"
"MinNumObservations:1,ObservationWindowSize:2,";

View File

@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
toffset != 0)
++non_zero_ts_offsets;
if (arrival_time_only) {
rtc::StringBuilder ss;
webrtc::StringBuilder ss;
ss << static_cast<int64_t>(packet.time_ms) * 1000000;
fprintf(stdout, "%s\n", ss.str().c_str());
} else {

View File

@ -75,7 +75,7 @@ TEST(RtcpPacketSdesTest, CreateWithTooManyChunks) {
Sdes sdes;
for (size_t i = 0; i < kMaxChunks; ++i) {
uint32_t ssrc = kSenderSsrc + i;
rtc::StringBuilder oss;
StringBuilder oss;
oss << "cname" << i;
EXPECT_TRUE(sdes.AddCName(ssrc, oss.str()));
}

View File

@ -693,7 +693,7 @@ bool RtpPacket::RemoveExtension(ExtensionType type) {
}
std::string RtpPacket::ToString() const {
rtc::StringBuilder result;
StringBuilder result;
result << "{payload_type=" << payload_type_ << ", marker=" << marker_
<< ", sequence_number=" << sequence_number_
<< ", padding_size=" << padding_size_ << ", timestamp=" << timestamp_

View File

@ -42,7 +42,7 @@ int GetLimitedNumSpatialLayers(int width, int height) {
std::optional<ScalabilityMode> BuildScalabilityMode(int num_temporal_layers,
int num_spatial_layers) {
char name[20];
rtc::SimpleStringBuilder ss(name);
SimpleStringBuilder ss(name);
ss << "L" << num_spatial_layers << "T" << num_temporal_layers;
if (num_spatial_layers > 1) {
ss << "_KEY";

View File

@ -172,7 +172,7 @@ std::string TestName() {
std::string TestOutputPath() {
std::string output_path =
(rtc::StringBuilder() << OutputPath() << TestName()).str();
(StringBuilder() << OutputPath() << TestName()).str();
std::string output_dir = DirName(output_path);
bool result = CreateDir(output_dir);
RTC_CHECK(result) << "Cannot create " << output_dir;
@ -618,7 +618,7 @@ TEST(VideoCodecTest, DISABLED_EncodeDecode) {
for (int sidx = 0; sidx < num_spatial_layers; ++sidx) {
for (int tidx = 0; tidx < num_temporal_layers; ++tidx) {
std::string metric_name_prefix =
(rtc::StringBuilder() << "s" << sidx << "t" << tidx << "_").str();
(StringBuilder() << "s" << sidx << "t" << tidx << "_").str();
stream = stats->Aggregate(
{.layer_id = {{.spatial_idx = sidx, .temporal_idx = tidx}}});
stream.LogMetrics(GetGlobalMetricsLogger(), TestName(),
@ -628,8 +628,7 @@ TEST(VideoCodecTest, DISABLED_EncodeDecode) {
}
if (absl::GetFlag(FLAGS_write_csv)) {
stats->LogMetrics(
(rtc::StringBuilder() << TestOutputPath() << ".csv").str(),
stats->LogMetrics((StringBuilder() << TestOutputPath() << ".csv").str(),
stats->Slice(Filter{}, /*merge=*/false), /*metadata=*/
{{"test_name", TestName()}});
}

View File

@ -120,7 +120,7 @@ void ConfigureSvc(VideoCodec* codec_settings) {
std::string CodecSpecificToString(const VideoCodec& codec) {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
SimpleStringBuilder ss(buf);
switch (codec.codecType) {
case kVideoCodecVP8:
ss << "\nnum_temporal_layers: "
@ -309,7 +309,7 @@ size_t VideoCodecTestFixtureImpl::Config::NumberOfSimulcastStreams() const {
std::string VideoCodecTestFixtureImpl::Config::ToString() const {
std::string codec_type = CodecTypeToPayloadString(codec_settings.codecType);
rtc::StringBuilder ss;
StringBuilder ss;
ss << "test_name: " << test_name;
ss << "\nfilename: " << filename;
ss << "\nnum_frames: " << num_frames;
@ -563,7 +563,7 @@ void VideoCodecTestFixtureImpl::AnalyzeAllFrames(
// For perf dashboard.
char modifier_buf[256];
rtc::SimpleStringBuilder modifier(modifier_buf);
SimpleStringBuilder modifier(modifier_buf);
modifier << "_r" << rate_profile_idx << "_sl" << layer_stat.spatial_idx;
auto PrintResultHelper = [&modifier, this](

View File

@ -128,7 +128,7 @@ std::unique_ptr<ScalableVideoController> CreateVp9ScalabilityStructure(
}
char name[20];
rtc::SimpleStringBuilder ss(name);
SimpleStringBuilder ss(name);
if (codec.mode == VideoCodecMode::kScreensharing) {
// TODO(bugs.webrtc.org/11999): Compose names of the structures when they
// are implemented.

View File

@ -45,7 +45,7 @@ using ::testing::TestWithParam;
using ::testing::Values;
std::string FrameDependencyTemplateToString(const FrameDependencyTemplate& t) {
rtc::StringBuilder sb;
StringBuilder sb;
sb << "S" << t.spatial_id << "T" << t.temporal_id;
sb << ": dtis = ";
for (const auto dtis : t.decode_target_indications) {

View File

@ -252,7 +252,7 @@ const Vp9InterpolationFilter kLiteralToType[4] = {
std::string Vp9UncompressedHeader::ToString() const {
char buf[1024];
rtc::SimpleStringBuilder oss(buf);
SimpleStringBuilder oss(buf);
oss << "Vp9UncompressedHeader { " << "profile = " << profile;

View File

@ -40,7 +40,7 @@ namespace dcsctp {
template <class Chunk>
bool ParseAndPrint(uint8_t chunk_type,
rtc::ArrayView<const uint8_t> data,
rtc::StringBuilder& sb) {
webrtc::StringBuilder& sb) {
if (chunk_type == Chunk::kType) {
std::optional<Chunk> c = Chunk::Parse(data);
if (c.has_value()) {
@ -54,7 +54,7 @@ bool ParseAndPrint(uint8_t chunk_type,
}
std::string DebugConvertChunkToString(rtc::ArrayView<const uint8_t> data) {
rtc::StringBuilder sb;
webrtc::StringBuilder sb;
if (data.empty()) {
sb << "Failed to parse chunk due to empty data";

View File

@ -86,7 +86,7 @@ void DataChunk::SerializeTo(std::vector<uint8_t>& out) const {
}
std::string DataChunk::ToString() const {
rtc::StringBuilder sb;
webrtc::StringBuilder sb;
sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
<< "::"
<< (*options().is_beginning && *options().is_end ? "complete"

View File

@ -85,7 +85,7 @@ void ForwardTsnChunk::SerializeTo(std::vector<uint8_t>& out) const {
}
std::string ForwardTsnChunk::ToString() const {
rtc::StringBuilder sb;
webrtc::StringBuilder sb;
sb << "FORWARD-TSN, new_cumulative_tsn=" << *new_cumulative_tsn();
for (const auto& skipped : skipped_streams()) {
sb << ", skip " << skipped.stream_id.value() << ":" << *skipped.ssn;

View File

@ -89,7 +89,7 @@ void IDataChunk::SerializeTo(std::vector<uint8_t>& out) const {
}
std::string IDataChunk::ToString() const {
rtc::StringBuilder sb;
webrtc::StringBuilder sb;
sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
<< "::"
<< (*options().is_beginning && *options().is_end ? "complete"

Some files were not shown because too many files have changed in this diff Show More