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:
parent
afae3c2252
commit
0ebd67f89d
@ -154,7 +154,7 @@ class AudioParameters {
|
|||||||
}
|
}
|
||||||
std::string ToString() const {
|
std::string ToString() const {
|
||||||
char ss_buf[1024];
|
char ss_buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(ss_buf);
|
SimpleStringBuilder ss(ss_buf);
|
||||||
ss << "AudioParameters: ";
|
ss << "AudioParameters: ";
|
||||||
ss << "sample_rate=" << sample_rate() << ", channels=" << channels();
|
ss << "sample_rate=" << sample_rate() << ", channels=" << channels();
|
||||||
ss << ", frames_per_buffer=" << frames_per_buffer();
|
ss << ", frames_per_buffer=" << frames_per_buffer();
|
||||||
|
|||||||
@ -128,7 +128,7 @@ operator==(const AudioProcessing::Config::CaptureLevelAdjustment::
|
|||||||
|
|
||||||
std::string AudioProcessing::Config::ToString() const {
|
std::string AudioProcessing::Config::ToString() const {
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
rtc::SimpleStringBuilder builder(buf);
|
SimpleStringBuilder builder(buf);
|
||||||
builder << "AudioProcessing::Config{ "
|
builder << "AudioProcessing::Config{ "
|
||||||
"pipeline: { "
|
"pipeline: { "
|
||||||
"maximum_internal_processing_rate: "
|
"maximum_internal_processing_rate: "
|
||||||
|
|||||||
@ -23,7 +23,7 @@ NetEq::Config& NetEq::Config::operator=(Config&&) = default;
|
|||||||
|
|
||||||
std::string NetEq::Config::ToString() const {
|
std::string NetEq::Config::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "sample_rate_hz=" << sample_rate_hz
|
ss << "sample_rate_hz=" << sample_rate_hz
|
||||||
<< ", max_packets_in_buffer=" << max_packets_in_buffer
|
<< ", max_packets_in_buffer=" << max_packets_in_buffer
|
||||||
<< ", min_delay_ms=" << min_delay_ms << ", enable_fast_accelerate="
|
<< ", min_delay_ms=" << min_delay_ms << ", enable_fast_accelerate="
|
||||||
|
|||||||
@ -128,7 +128,7 @@ RtpParameters::~RtpParameters() = default;
|
|||||||
|
|
||||||
std::string RtpExtension::ToString() const {
|
std::string RtpExtension::ToString() const {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
sb << "{uri: " << uri;
|
sb << "{uri: " << uri;
|
||||||
sb << ", id: " << id;
|
sb << ", id: " << id;
|
||||||
if (encrypt) {
|
if (encrypt) {
|
||||||
|
|||||||
@ -30,7 +30,7 @@ int64_t IntegralPart(double value) {
|
|||||||
|
|
||||||
void AppendWithPrecision(double value,
|
void AppendWithPrecision(double value,
|
||||||
int digits_after_comma,
|
int digits_after_comma,
|
||||||
rtc::StringBuilder& out) {
|
StringBuilder& out) {
|
||||||
int64_t multiplier = std::lround(std::pow(10, digits_after_comma));
|
int64_t multiplier = std::lround(std::pow(10, digits_after_comma));
|
||||||
int64_t integral_part = IntegralPart(value);
|
int64_t integral_part = IntegralPart(value);
|
||||||
double decimal_part = std::abs(value) - integral_part;
|
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) {
|
void StdoutMetricsExporter::PrintMetric(const Metric& metric) {
|
||||||
rtc::StringBuilder value_stream;
|
StringBuilder value_stream;
|
||||||
value_stream << metric.test_case << " / " << metric.name << "= {mean=";
|
value_stream << metric.test_case << " / " << metric.name << "= {mean=";
|
||||||
if (metric.stats.mean.has_value()) {
|
if (metric.stats.mean.has_value()) {
|
||||||
AppendWithPrecision(*metric.stats.mean, 8, value_stream);
|
AppendWithPrecision(*metric.stats.mean, 8, value_stream);
|
||||||
|
|||||||
@ -44,7 +44,7 @@ absl::string_view SpecToString(VideoResolution::Spec spec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AppendResolution(const VideoResolution& resolution,
|
void AppendResolution(const VideoResolution& resolution,
|
||||||
rtc::StringBuilder& builder) {
|
StringBuilder& builder) {
|
||||||
builder << "_" << resolution.width() << "x" << resolution.height() << "_"
|
builder << "_" << resolution.width() << "x" << resolution.height() << "_"
|
||||||
<< resolution.fps();
|
<< resolution.fps();
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ bool VideoResolution::IsRegular() const {
|
|||||||
return spec_ == Spec::kNone;
|
return spec_ == Spec::kNone;
|
||||||
}
|
}
|
||||||
std::string VideoResolution::ToString() const {
|
std::string VideoResolution::ToString() const {
|
||||||
rtc::StringBuilder out;
|
StringBuilder out;
|
||||||
out << "{ width=" << width_ << ", height=" << height_ << ", fps=" << fps_
|
out << "{ width=" << width_ << ", height=" << height_ << ", fps=" << fps_
|
||||||
<< ", spec=" << SpecToString(spec_) << " }";
|
<< ", spec=" << SpecToString(spec_) << " }";
|
||||||
return out.Release();
|
return out.Release();
|
||||||
@ -162,7 +162,7 @@ VideoDumpOptions::Y4mVideoFrameWriterFactory(
|
|||||||
std::string VideoDumpOptions::GetInputDumpFileName(
|
std::string VideoDumpOptions::GetInputDumpFileName(
|
||||||
absl::string_view stream_label,
|
absl::string_view stream_label,
|
||||||
const VideoResolution& resolution) const {
|
const VideoResolution& resolution) const {
|
||||||
rtc::StringBuilder file_name;
|
StringBuilder file_name;
|
||||||
file_name << stream_label;
|
file_name << stream_label;
|
||||||
AppendResolution(resolution, file_name);
|
AppendResolution(resolution, file_name);
|
||||||
return test::JoinFilename(output_directory_, file_name.Release());
|
return test::JoinFilename(output_directory_, file_name.Release());
|
||||||
@ -181,7 +181,7 @@ std::string VideoDumpOptions::GetOutputDumpFileName(
|
|||||||
absl::string_view stream_label,
|
absl::string_view stream_label,
|
||||||
absl::string_view receiver,
|
absl::string_view receiver,
|
||||||
const VideoResolution& resolution) const {
|
const VideoResolution& resolution) const {
|
||||||
rtc::StringBuilder file_name;
|
StringBuilder file_name;
|
||||||
file_name << stream_label << "_" << receiver;
|
file_name << stream_label << "_" << receiver;
|
||||||
AppendResolution(resolution, file_name);
|
AppendResolution(resolution, file_name);
|
||||||
return test::JoinFilename(output_directory_, file_name.Release());
|
return test::JoinFilename(output_directory_, file_name.Release());
|
||||||
@ -199,7 +199,7 @@ std::optional<std::string> VideoDumpOptions::GetOutputFrameIdsDumpFileName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string VideoDumpOptions::ToString() const {
|
std::string VideoDumpOptions::ToString() const {
|
||||||
rtc::StringBuilder out;
|
StringBuilder out;
|
||||||
out << "{ output_directory_=" << output_directory_
|
out << "{ output_directory_=" << output_directory_
|
||||||
<< ", sampling_modulo_=" << sampling_modulo_
|
<< ", sampling_modulo_=" << sampling_modulo_
|
||||||
<< ", export_frame_ids_=" << export_frame_ids_ << " }";
|
<< ", export_frame_ids_=" << export_frame_ids_ << " }";
|
||||||
@ -298,7 +298,7 @@ std::vector<std::string> VideoSubscription::GetSubscribedPeers() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string VideoSubscription::ToString() const {
|
std::string VideoSubscription::ToString() const {
|
||||||
rtc::StringBuilder out;
|
StringBuilder out;
|
||||||
out << "{ default_resolution_=[";
|
out << "{ default_resolution_=[";
|
||||||
if (default_resolution_.has_value()) {
|
if (default_resolution_.has_value()) {
|
||||||
out << default_resolution_->ToString();
|
out << default_resolution_->ToString();
|
||||||
|
|||||||
@ -27,7 +27,7 @@ VideoCodecTestStats::FrameStatistics::FrameStatistics(size_t frame_number,
|
|||||||
spatial_idx(spatial_idx) {}
|
spatial_idx(spatial_idx) {}
|
||||||
|
|
||||||
std::string VideoCodecTestStats::FrameStatistics::ToString() const {
|
std::string VideoCodecTestStats::FrameStatistics::ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
for (const auto& entry : ToMap()) {
|
for (const auto& entry : ToMap()) {
|
||||||
if (ss.size() > 0) {
|
if (ss.size() > 0) {
|
||||||
ss << " ";
|
ss << " ";
|
||||||
@ -66,7 +66,7 @@ std::map<std::string, std::string> VideoCodecTestStats::FrameStatistics::ToMap()
|
|||||||
|
|
||||||
std::string VideoCodecTestStats::VideoStatistics::ToString(
|
std::string VideoCodecTestStats::VideoStatistics::ToString(
|
||||||
std::string prefix) const {
|
std::string prefix) const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
for (const auto& entry : ToMap()) {
|
for (const auto& entry : ToMap()) {
|
||||||
if (ss.size() > 0) {
|
if (ss.size() > 0) {
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string ToString(DataRate value) {
|
std::string ToString(DataRate value) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
if (value.IsPlusInfinity()) {
|
if (value.IsPlusInfinity()) {
|
||||||
sb << "+inf bps";
|
sb << "+inf bps";
|
||||||
} else if (value.IsMinusInfinity()) {
|
} else if (value.IsMinusInfinity()) {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string ToString(DataSize value) {
|
std::string ToString(DataSize value) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
if (value.IsPlusInfinity()) {
|
if (value.IsPlusInfinity()) {
|
||||||
sb << "+inf bytes";
|
sb << "+inf bytes";
|
||||||
} else if (value.IsMinusInfinity()) {
|
} else if (value.IsMinusInfinity()) {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
std::string ToString(Frequency value) {
|
std::string ToString(Frequency value) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
if (value.IsPlusInfinity()) {
|
if (value.IsPlusInfinity()) {
|
||||||
sb << "+inf Hz";
|
sb << "+inf Hz";
|
||||||
} else if (value.IsMinusInfinity()) {
|
} else if (value.IsMinusInfinity()) {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string ToString(TimeDelta value) {
|
std::string ToString(TimeDelta value) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
if (value.IsPlusInfinity()) {
|
if (value.IsPlusInfinity()) {
|
||||||
sb << "+inf ms";
|
sb << "+inf ms";
|
||||||
} else if (value.IsMinusInfinity()) {
|
} else if (value.IsMinusInfinity()) {
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
std::string ToString(Timestamp value) {
|
std::string ToString(Timestamp value) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
if (value.IsPlusInfinity()) {
|
if (value.IsPlusInfinity()) {
|
||||||
sb << "+inf ms";
|
sb << "+inf ms";
|
||||||
} else if (value.IsMinusInfinity()) {
|
} else if (value.IsMinusInfinity()) {
|
||||||
|
|||||||
@ -139,7 +139,7 @@ const HdrMetadata* ColorSpace::hdr_metadata() const {
|
|||||||
|
|
||||||
std::string ColorSpace::AsString() const {
|
std::string ColorSpace::AsString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{primaries:";
|
ss << "{primaries:";
|
||||||
switch (primaries_) {
|
switch (primaries_) {
|
||||||
PRINT_ENUM_CASE(PrimaryID, kBT709)
|
PRINT_ENUM_CASE(PrimaryID, kBT709)
|
||||||
|
|||||||
@ -35,7 +35,7 @@ VideoAdaptationCounters VideoAdaptationCounters::operator+(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string VideoAdaptationCounters::ToString() const {
|
std::string VideoAdaptationCounters::ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "{ res=" << resolution_adaptations << " fps=" << fps_adaptations
|
ss << "{ res=" << resolution_adaptations << " fps=" << fps_adaptations
|
||||||
<< " }";
|
<< " }";
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -147,7 +147,7 @@ std::string VideoBitrateAllocation::ToString() const {
|
|||||||
// Max string length in practice is 260, but let's have some overhead and
|
// Max string length in practice is 260, but let's have some overhead and
|
||||||
// round up to nearest power of two.
|
// round up to nearest power of two.
|
||||||
char string_buf[512];
|
char string_buf[512];
|
||||||
rtc::SimpleStringBuilder ssb(string_buf);
|
SimpleStringBuilder ssb(string_buf);
|
||||||
|
|
||||||
ssb << "VideoBitrateAllocation [";
|
ssb << "VideoBitrateAllocation [";
|
||||||
uint32_t spatial_cumulator = 0;
|
uint32_t spatial_cumulator = 0;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ std::string TimingFrameInfo::ToString() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
|
|
||||||
sb << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms << ','
|
sb << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms << ','
|
||||||
<< encode_finish_ms << ',' << packetization_finish_ms << ','
|
<< encode_finish_ms << ',' << packetization_finish_ms << ','
|
||||||
|
|||||||
@ -515,7 +515,7 @@ aom_svc_ref_frame_config_t GetSvcRefFrameConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
sb << " spatial_id=" << settings.spatial_id;
|
sb << " spatial_id=" << settings.spatial_id;
|
||||||
sb << " ref_idx=[ ";
|
sb << " ref_idx=[ ";
|
||||||
for (auto r : ref_frame_config.ref_idx) {
|
for (auto r : ref_frame_config.ref_idx) {
|
||||||
@ -618,7 +618,7 @@ aom_svc_params_t GetSvcParams(
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buf[512];
|
char buf[512];
|
||||||
rtc::SimpleStringBuilder sb(buf);
|
SimpleStringBuilder sb(buf);
|
||||||
sb << "GetSvcParams" << " layer bitrates kbps";
|
sb << "GetSvcParams" << " layer bitrates kbps";
|
||||||
for (int s = 0; s < svc_params.number_spatial_layers; ++s) {
|
for (int s = 0; s < svc_params.number_spatial_layers; ++s) {
|
||||||
sb << " S" << s << "=[ ";
|
sb << " S" << s << "=[ ";
|
||||||
|
|||||||
@ -160,7 +160,7 @@ SdpVideoFormat& SdpVideoFormat::operator=(SdpVideoFormat&&) = default;
|
|||||||
SdpVideoFormat::~SdpVideoFormat() = default;
|
SdpVideoFormat::~SdpVideoFormat() = default;
|
||||||
|
|
||||||
std::string SdpVideoFormat::ToString() const {
|
std::string SdpVideoFormat::ToString() const {
|
||||||
rtc::StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder << "Codec name: " << name << ", parameters: {";
|
builder << "Codec name: " << name << ", parameters: {";
|
||||||
for (const auto& kv : parameters) {
|
for (const auto& kv : parameters) {
|
||||||
builder << " " << kv.first << "=" << kv.second;
|
builder << " " << kv.first << "=" << kv.second;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ VideoCodec::VideoCodec()
|
|||||||
|
|
||||||
std::string VideoCodec::ToString() const {
|
std::string VideoCodec::ToString() const {
|
||||||
char string_buf[2048];
|
char string_buf[2048];
|
||||||
rtc::SimpleStringBuilder ss(string_buf);
|
SimpleStringBuilder ss(string_buf);
|
||||||
|
|
||||||
ss << "VideoCodec {" << "type: " << CodecTypeToPayloadString(codecType)
|
ss << "VideoCodec {" << "type: " << CodecTypeToPayloadString(codecType)
|
||||||
<< ", mode: "
|
<< ", mode: "
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const char* VideoDecoder::ImplementationName() const {
|
|||||||
|
|
||||||
std::string VideoDecoder::DecoderInfo::ToString() const {
|
std::string VideoDecoder::DecoderInfo::ToString() const {
|
||||||
char string_buf[2048];
|
char string_buf[2048];
|
||||||
rtc::SimpleStringBuilder oss(string_buf);
|
SimpleStringBuilder oss(string_buf);
|
||||||
|
|
||||||
oss << "DecoderInfo { "
|
oss << "DecoderInfo { "
|
||||||
<< "prefers_late_decoding = " << "implementation_name = '"
|
<< "prefers_late_decoding = " << "implementation_name = '"
|
||||||
|
|||||||
@ -120,7 +120,7 @@ VideoEncoder::EncoderInfo::EncoderInfo(const EncoderInfo&) = default;
|
|||||||
VideoEncoder::EncoderInfo::~EncoderInfo() = default;
|
VideoEncoder::EncoderInfo::~EncoderInfo() = default;
|
||||||
|
|
||||||
std::string VideoEncoder::EncoderInfo::ToString() const {
|
std::string VideoEncoder::EncoderInfo::ToString() const {
|
||||||
rtc::StringBuilder oss;
|
StringBuilder oss;
|
||||||
oss << "EncoderInfo { "
|
oss << "EncoderInfo { "
|
||||||
"ScalingSettings { ";
|
"ScalingSettings { ";
|
||||||
if (scaling_settings.thresholds) {
|
if (scaling_settings.thresholds) {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const {
|
std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const {
|
||||||
char ss_buf[1024];
|
char ss_buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(ss_buf);
|
SimpleStringBuilder ss(ss_buf);
|
||||||
ss << "{remote_ssrc: " << remote_ssrc;
|
ss << "{remote_ssrc: " << remote_ssrc;
|
||||||
ss << ", local_ssrc: " << local_ssrc;
|
ss << ", local_ssrc: " << local_ssrc;
|
||||||
ss << ", nack: " << nack.ToString();
|
ss << ", nack: " << nack.ToString();
|
||||||
@ -63,7 +63,7 @@ std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const {
|
|||||||
|
|
||||||
std::string AudioReceiveStreamInterface::Config::ToString() const {
|
std::string AudioReceiveStreamInterface::Config::ToString() const {
|
||||||
char ss_buf[1024];
|
char ss_buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(ss_buf);
|
SimpleStringBuilder ss(ss_buf);
|
||||||
ss << "{rtp: " << rtp.ToString();
|
ss << "{rtp: " << rtp.ToString();
|
||||||
ss << ", rtcp_send_transport: "
|
ss << ", rtcp_send_transport: "
|
||||||
<< (rtcp_send_transport ? "(Transport)" : "null");
|
<< (rtcp_send_transport ? "(Transport)" : "null");
|
||||||
|
|||||||
@ -749,7 +749,7 @@ void ChannelReceive::ReceivePacket(const uint8_t* packet,
|
|||||||
// Asynchronously transform the received payload. After the payload is
|
// Asynchronously transform the received payload. After the payload is
|
||||||
// transformed, the delegate will call OnReceivedPayloadData to handle it.
|
// transformed, the delegate will call OnReceivedPayloadData to handle it.
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder mime_type(buf);
|
SimpleStringBuilder mime_type(buf);
|
||||||
auto it = payload_type_map_.find(header.payloadType);
|
auto it = payload_type_map_.find(header.payloadType);
|
||||||
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
|
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
|
||||||
<< (it != payload_type_map_.end() ? it->second.name
|
<< (it != payload_type_map_.end() ? it->second.name
|
||||||
|
|||||||
@ -384,7 +384,7 @@ int32_t ChannelSend::SendData(AudioFrameType frameType,
|
|||||||
// Asynchronously transform the payload before sending it. After the payload
|
// Asynchronously transform the payload before sending it. After the payload
|
||||||
// is transformed, the delegate will call SendRtpAudio to send it.
|
// is transformed, the delegate will call SendRtpAudio to send it.
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder mime_type(buf);
|
SimpleStringBuilder mime_type(buf);
|
||||||
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
|
mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/"
|
||||||
<< encoder_format_.name;
|
<< encoder_format_.name;
|
||||||
frame_transformer_delegate_->Transform(
|
frame_transformer_delegate_->Transform(
|
||||||
|
|||||||
@ -163,7 +163,7 @@ TEST_F(ChannelMixerTest, ConstructAllPossibleLayouts) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input Layout: " << input_layout
|
ss << "Input Layout: " << input_layout
|
||||||
<< ", Output Layout: " << output_layout;
|
<< ", Output Layout: " << output_layout;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
|
|||||||
@ -43,7 +43,7 @@ TEST(ChannelMixingMatrixTest, ConstructAllPossibleLayouts) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input Layout: " << input_layout
|
ss << "Input Layout: " << input_layout
|
||||||
<< ", Output Layout: " << output_layout;
|
<< ", Output Layout: " << output_layout;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
|
|||||||
@ -230,7 +230,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
|
|||||||
// How can this stream be adapted up?
|
// How can this stream be adapted up?
|
||||||
Adaptation adaptation = stream_adapter_->GetAdaptationUp();
|
Adaptation adaptation = stream_adapter_->GetAdaptationUp();
|
||||||
if (adaptation.status() != Adaptation::Status::kValid) {
|
if (adaptation.status() != Adaptation::Status::kValid) {
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Not adapting up because VideoStreamAdapter returned "
|
message << "Not adapting up because VideoStreamAdapter returned "
|
||||||
<< Adaptation::StatusToString(adaptation.status());
|
<< Adaptation::StatusToString(adaptation.status());
|
||||||
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
|
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
|
||||||
@ -251,7 +251,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
|
|||||||
// adaptation.
|
// adaptation.
|
||||||
if (absl::c_find(most_limited_resources, reason_resource) ==
|
if (absl::c_find(most_limited_resources, reason_resource) ==
|
||||||
most_limited_resources.end()) {
|
most_limited_resources.end()) {
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Resource \"" << reason_resource->Name()
|
message << "Resource \"" << reason_resource->Name()
|
||||||
<< "\" was not the most limited resource.";
|
<< "\" was not the most limited resource.";
|
||||||
return MitigationResultAndLogMessage(
|
return MitigationResultAndLogMessage(
|
||||||
@ -263,7 +263,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
|
|||||||
// before the adaptation is applied.
|
// before the adaptation is applied.
|
||||||
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
|
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
|
||||||
adaptation.counters());
|
adaptation.counters());
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Resource \"" << reason_resource->Name()
|
message << "Resource \"" << reason_resource->Name()
|
||||||
<< "\" was not the only most limited resource.";
|
<< "\" was not the only most limited resource.";
|
||||||
return MitigationResultAndLogMessage(
|
return MitigationResultAndLogMessage(
|
||||||
@ -272,7 +272,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse(
|
|||||||
}
|
}
|
||||||
// Apply adaptation.
|
// Apply adaptation.
|
||||||
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
|
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Adapted up successfully. Unfiltered adaptations: "
|
message << "Adapted up successfully. Unfiltered adaptations: "
|
||||||
<< stream_adapter_->adaptation_counters().ToString();
|
<< stream_adapter_->adaptation_counters().ToString();
|
||||||
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,
|
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,
|
||||||
@ -293,7 +293,7 @@ ResourceAdaptationProcessor::OnResourceOveruse(
|
|||||||
restrictions.counters);
|
restrictions.counters);
|
||||||
}
|
}
|
||||||
if (adaptation.status() != Adaptation::Status::kValid) {
|
if (adaptation.status() != Adaptation::Status::kValid) {
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Not adapting down because VideoStreamAdapter returned "
|
message << "Not adapting down because VideoStreamAdapter returned "
|
||||||
<< Adaptation::StatusToString(adaptation.status());
|
<< Adaptation::StatusToString(adaptation.status());
|
||||||
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
|
return MitigationResultAndLogMessage(MitigationResult::kRejectedByAdapter,
|
||||||
@ -303,7 +303,7 @@ ResourceAdaptationProcessor::OnResourceOveruse(
|
|||||||
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
|
UpdateResourceLimitations(reason_resource, adaptation.restrictions(),
|
||||||
adaptation.counters());
|
adaptation.counters());
|
||||||
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
|
stream_adapter_->ApplyAdaptation(adaptation, reason_resource);
|
||||||
rtc::StringBuilder message;
|
StringBuilder message;
|
||||||
message << "Adapted down successfully. Unfiltered adaptations: "
|
message << "Adapted down successfully. Unfiltered adaptations: "
|
||||||
<< stream_adapter_->adaptation_counters().ToString();
|
<< stream_adapter_->adaptation_counters().ToString();
|
||||||
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,
|
return MitigationResultAndLogMessage(MitigationResult::kAdaptationApplied,
|
||||||
|
|||||||
@ -39,7 +39,7 @@ VideoSourceRestrictions::VideoSourceRestrictions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string VideoSourceRestrictions::ToString() const {
|
std::string VideoSourceRestrictions::ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "{";
|
ss << "{";
|
||||||
if (max_frame_rate_)
|
if (max_frame_rate_)
|
||||||
ss << " max_fps=" << max_frame_rate_.value();
|
ss << " max_fps=" << max_frame_rate_.value();
|
||||||
|
|||||||
@ -31,7 +31,7 @@ AudioSendStream::Config::Config(Transport* send_transport)
|
|||||||
AudioSendStream::Config::~Config() = default;
|
AudioSendStream::Config::~Config() = default;
|
||||||
|
|
||||||
std::string AudioSendStream::Config::ToString() const {
|
std::string AudioSendStream::Config::ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "{rtp: " << rtp.ToString();
|
ss << "{rtp: " << rtp.ToString();
|
||||||
ss << ", rtcp_report_interval_ms: " << rtcp_report_interval_ms;
|
ss << ", rtcp_report_interval_ms: " << rtcp_report_interval_ms;
|
||||||
ss << ", send_transport: " << (send_transport ? "(Transport)" : "null");
|
ss << ", send_transport: " << (send_transport ? "(Transport)" : "null");
|
||||||
@ -52,7 +52,7 @@ AudioSendStream::Config::Rtp::~Rtp() = default;
|
|||||||
|
|
||||||
std::string AudioSendStream::Config::Rtp::ToString() const {
|
std::string AudioSendStream::Config::Rtp::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ssrc: " << ssrc;
|
ss << "{ssrc: " << ssrc;
|
||||||
if (!rid.empty()) {
|
if (!rid.empty()) {
|
||||||
ss << ", rid: " << rid;
|
ss << ", rid: " << rid;
|
||||||
@ -82,7 +82,7 @@ AudioSendStream::Config::SendCodecSpec::~SendCodecSpec() = default;
|
|||||||
|
|
||||||
std::string AudioSendStream::Config::SendCodecSpec::ToString() const {
|
std::string AudioSendStream::Config::SendCodecSpec::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{nack_enabled: " << (nack_enabled ? "true" : "false");
|
ss << "{nack_enabled: " << (nack_enabled ? "true" : "false");
|
||||||
ss << ", enable_non_sender_rtt: "
|
ss << ", enable_non_sender_rtt: "
|
||||||
<< (enable_non_sender_rtt ? "true" : "false");
|
<< (enable_non_sender_rtt ? "true" : "false");
|
||||||
|
|||||||
@ -516,7 +516,7 @@ class Call final : public webrtc::Call,
|
|||||||
|
|
||||||
std::string Call::Stats::ToString(int64_t time_ms) const {
|
std::string Call::Stats::ToString(int64_t time_ms) const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "Call stats: " << time_ms << ", {";
|
ss << "Call stats: " << time_ms << ", {";
|
||||||
ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
|
ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
|
||||||
ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";
|
ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string FlexfecReceiveStream::Config::ToString() const {
|
std::string FlexfecReceiveStream::Config::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{payload_type: " << payload_type;
|
ss << "{payload_type: " << payload_type;
|
||||||
ss << ", remote_ssrc: " << rtp.remote_ssrc;
|
ss << ", remote_ssrc: " << rtp.remote_ssrc;
|
||||||
ss << ", local_ssrc: " << rtp.local_ssrc;
|
ss << ", local_ssrc: " << rtp.local_ssrc;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ std::string LntfConfig::ToString() const {
|
|||||||
|
|
||||||
std::string NackConfig::ToString() const {
|
std::string NackConfig::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{rtp_history_ms: " << rtp_history_ms;
|
ss << "{rtp_history_ms: " << rtp_history_ms;
|
||||||
ss << '}';
|
ss << '}';
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -56,7 +56,7 @@ std::string NackConfig::ToString() const {
|
|||||||
|
|
||||||
std::string UlpfecConfig::ToString() const {
|
std::string UlpfecConfig::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
|
ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
|
||||||
ss << ", red_payload_type: " << red_payload_type;
|
ss << ", red_payload_type: " << red_payload_type;
|
||||||
ss << ", red_rtx_payload_type: " << red_rtx_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 {
|
std::string RtpStreamConfig::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ssrc: " << ssrc;
|
ss << "{ssrc: " << ssrc;
|
||||||
ss << ", rid: " << rid;
|
ss << ", rid: " << rid;
|
||||||
ss << ", payload_name: " << payload_name;
|
ss << ", payload_name: " << payload_name;
|
||||||
@ -87,7 +87,7 @@ std::string RtpStreamConfig::ToString() const {
|
|||||||
|
|
||||||
std::string RtpStreamConfig::Rtx::ToString() const {
|
std::string RtpStreamConfig::Rtx::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ssrc: " << ssrc;
|
ss << "{ssrc: " << ssrc;
|
||||||
ss << ", payload_type: " << payload_type;
|
ss << ", payload_type: " << payload_type;
|
||||||
ss << '}';
|
ss << '}';
|
||||||
@ -104,7 +104,7 @@ RtpConfig::Flexfec::~Flexfec() = default;
|
|||||||
|
|
||||||
std::string RtpConfig::ToString() const {
|
std::string RtpConfig::ToString() const {
|
||||||
char buf[2 * 1024];
|
char buf[2 * 1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ssrcs: [";
|
ss << "{ssrcs: [";
|
||||||
for (size_t i = 0; i < ssrcs.size(); ++i) {
|
for (size_t i = 0; i < ssrcs.size(); ++i) {
|
||||||
ss << ssrcs[i];
|
ss << ssrcs[i];
|
||||||
@ -168,7 +168,7 @@ RtpConfig::Rtx::~Rtx() = default;
|
|||||||
|
|
||||||
std::string RtpConfig::Rtx::ToString() const {
|
std::string RtpConfig::Rtx::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{ssrcs: [";
|
ss << "{ssrcs: [";
|
||||||
for (size_t i = 0; i < ssrcs.size(); ++i) {
|
for (size_t i = 0; i < ssrcs.size(); ++i) {
|
||||||
ss << ssrcs[i];
|
ss << ssrcs[i];
|
||||||
|
|||||||
@ -70,7 +70,7 @@ bool RtpDemuxerCriteria::operator!=(const RtpDemuxerCriteria& other) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string RtpDemuxerCriteria::ToString() const {
|
std::string RtpDemuxerCriteria::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
StringBuilder sb;
|
||||||
sb << "{mid: " << (mid_.empty() ? "<empty>" : mid_)
|
sb << "{mid: " << (mid_.empty() ? "<empty>" : mid_)
|
||||||
<< ", rsid: " << (rsid_.empty() ? "<empty>" : rsid_) << ", ssrcs: [";
|
<< ", rsid: " << (rsid_.empty() ? "<empty>" : rsid_) << ", ssrcs: [";
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ std::string RtpDemuxerCriteria::ToString() const {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
std::string RtpDemuxer::DescribePacket(const RtpPacketReceived& packet) {
|
std::string RtpDemuxer::DescribePacket(const RtpPacketReceived& packet) {
|
||||||
rtc::StringBuilder sb;
|
StringBuilder sb;
|
||||||
sb << "PT=" << packet.PayloadType() << " SSRC=" << packet.Ssrc();
|
sb << "PT=" << packet.PayloadType() << " SSRC=" << packet.Ssrc();
|
||||||
std::string mid;
|
std::string mid;
|
||||||
if (packet.GetExtension<RtpMid>(&mid)) {
|
if (packet.GetExtension<RtpMid>(&mid)) {
|
||||||
|
|||||||
@ -37,7 +37,7 @@ bool VideoReceiveStreamInterface::Decoder::operator==(
|
|||||||
|
|
||||||
std::string VideoReceiveStreamInterface::Decoder::ToString() const {
|
std::string VideoReceiveStreamInterface::Decoder::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{payload_type: " << payload_type;
|
ss << "{payload_type: " << payload_type;
|
||||||
ss << ", payload_name: " << video_format.name;
|
ss << ", payload_name: " << video_format.name;
|
||||||
ss << ", codec_params: {";
|
ss << ", codec_params: {";
|
||||||
@ -60,7 +60,7 @@ VideoReceiveStreamInterface::Stats::~Stats() = default;
|
|||||||
std::string VideoReceiveStreamInterface::Stats::ToString(
|
std::string VideoReceiveStreamInterface::Stats::ToString(
|
||||||
int64_t time_ms) const {
|
int64_t time_ms) const {
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "VideoReceiveStreamInterface stats: " << time_ms << ", {ssrc: " << ssrc
|
ss << "VideoReceiveStreamInterface stats: " << time_ms << ", {ssrc: " << ssrc
|
||||||
<< ", ";
|
<< ", ";
|
||||||
ss << "total_bps: " << total_bitrate_bps << ", ";
|
ss << "total_bps: " << total_bitrate_bps << ", ";
|
||||||
@ -120,7 +120,7 @@ VideoReceiveStreamInterface::Config::Config::~Config() = default;
|
|||||||
|
|
||||||
std::string VideoReceiveStreamInterface::Config::ToString() const {
|
std::string VideoReceiveStreamInterface::Config::ToString() const {
|
||||||
char buf[4 * 1024];
|
char buf[4 * 1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{decoders: [";
|
ss << "{decoders: [";
|
||||||
for (size_t i = 0; i < decoders.size(); ++i) {
|
for (size_t i = 0; i < decoders.size(); ++i) {
|
||||||
ss << decoders[i].ToString();
|
ss << decoders[i].ToString();
|
||||||
@ -144,7 +144,7 @@ VideoReceiveStreamInterface::Config::Rtp::~Rtp() = default;
|
|||||||
|
|
||||||
std::string VideoReceiveStreamInterface::Config::Rtp::ToString() const {
|
std::string VideoReceiveStreamInterface::Config::Rtp::ToString() const {
|
||||||
char buf[2 * 1024];
|
char buf[2 * 1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{remote_ssrc: " << remote_ssrc;
|
ss << "{remote_ssrc: " << remote_ssrc;
|
||||||
ss << ", local_ssrc: " << local_ssrc;
|
ss << ", local_ssrc: " << local_ssrc;
|
||||||
ss << ", rtcp_mode: "
|
ss << ", rtcp_mode: "
|
||||||
|
|||||||
@ -43,7 +43,7 @@ VideoSendStream::StreamStats::~StreamStats() = default;
|
|||||||
|
|
||||||
std::string VideoSendStream::StreamStats::ToString() const {
|
std::string VideoSendStream::StreamStats::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "type: " << StreamTypeToString(type);
|
ss << "type: " << StreamTypeToString(type);
|
||||||
if (referenced_media_ssrc.has_value())
|
if (referenced_media_ssrc.has_value())
|
||||||
ss << " (for: " << referenced_media_ssrc.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 {
|
std::string VideoSendStream::Stats::ToString(int64_t time_ms) const {
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "VideoSendStream stats: " << time_ms << ", {";
|
ss << "VideoSendStream stats: " << time_ms << ", {";
|
||||||
ss << "input_fps: " << StringFormat("%.1f", input_frame_rate) << ", ";
|
ss << "input_fps: " << StringFormat("%.1f", input_frame_rate) << ", ";
|
||||||
ss << "encode_fps: " << encode_frame_rate << ", ";
|
ss << "encode_fps: " << encode_frame_rate << ", ";
|
||||||
@ -114,7 +114,7 @@ VideoSendStream::Config::Config::~Config() = default;
|
|||||||
|
|
||||||
std::string VideoSendStream::Config::ToString() const {
|
std::string VideoSendStream::Config::ToString() const {
|
||||||
char buf[2 * 1024];
|
char buf[2 * 1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
ss << "{encoder_settings: { experiment_cpu_load_estimator: "
|
ss << "{encoder_settings: { experiment_cpu_load_estimator: "
|
||||||
<< (encoder_settings.experiment_cpu_load_estimator ? "on" : "off") << "}}";
|
<< (encoder_settings.experiment_cpu_load_estimator ? "on" : "off") << "}}";
|
||||||
ss << ", rtp: " << rtp.ToString();
|
ss << ", rtp: " << rtp.ToString();
|
||||||
|
|||||||
@ -66,7 +66,7 @@ void ResamplerTest::TearDown() {}
|
|||||||
void ResamplerTest::ResetIfNeededAndPush(int in_rate,
|
void ResamplerTest::ResetIfNeededAndPush(int in_rate,
|
||||||
int out_rate,
|
int out_rate,
|
||||||
int num_channels) {
|
int num_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input rate: " << in_rate << ", output rate: " << out_rate
|
ss << "Input rate: " << in_rate << ", output rate: " << out_rate
|
||||||
<< ", channel count: " << num_channels;
|
<< ", channel count: " << num_channels;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
@ -92,7 +92,7 @@ TEST_F(ResamplerTest, Reset) {
|
|||||||
for (size_t i = 0; i < kRatesSize; ++i) {
|
for (size_t i = 0; i < kRatesSize; ++i) {
|
||||||
for (size_t j = 0; j < kRatesSize; ++j) {
|
for (size_t j = 0; j < kRatesSize; ++j) {
|
||||||
for (size_t k = 0; k < kNumChannelsSize; ++k) {
|
for (size_t k = 0; k < kNumChannelsSize; ++k) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j]
|
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j]
|
||||||
<< ", channels: " << kNumChannels[k];
|
<< ", channels: " << kNumChannels[k];
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
@ -111,7 +111,7 @@ TEST_F(ResamplerTest, Mono) {
|
|||||||
const int kChannels = 1;
|
const int kChannels = 1;
|
||||||
for (size_t i = 0; i < kRatesSize; ++i) {
|
for (size_t i = 0; i < kRatesSize; ++i) {
|
||||||
for (size_t j = 0; j < kRatesSize; ++j) {
|
for (size_t j = 0; j < kRatesSize; ++j) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
|
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ TEST_F(ResamplerTest, Stereo) {
|
|||||||
const int kChannels = 2;
|
const int kChannels = 2;
|
||||||
for (size_t i = 0; i < kRatesSize; ++i) {
|
for (size_t i = 0; i < kRatesSize; ++i) {
|
||||||
for (size_t j = 0; j < kRatesSize; ++j) {
|
for (size_t j = 0; j < kRatesSize; ++j) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
|
ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j];
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,7 @@ TEST(SplTest, AddSubSatW32) {
|
|||||||
INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) + b));
|
INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) + b));
|
||||||
const int64_t diff = std::max<int64_t>(
|
const int64_t diff = std::max<int64_t>(
|
||||||
INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) - b));
|
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;
|
ss << a << " +/- " << b << ": sum " << sum << ", diff " << diff;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
EXPECT_EQ(sum, WebRtcSpl_AddSatW32(a, b));
|
EXPECT_EQ(sum, WebRtcSpl_AddSatW32(a, b));
|
||||||
|
|||||||
@ -1005,7 +1005,7 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!encoder_names.empty()) {
|
if (!encoder_names.empty()) {
|
||||||
rtc::StringBuilder implementation_name_builder(" (");
|
StringBuilder implementation_name_builder(" (");
|
||||||
implementation_name_builder << StrJoin(encoder_names, ", ");
|
implementation_name_builder << StrJoin(encoder_names, ", ");
|
||||||
implementation_name_builder << ")";
|
implementation_name_builder << ")";
|
||||||
encoder_info.implementation_name += implementation_name_builder.Release();
|
encoder_info.implementation_name += implementation_name_builder.Release();
|
||||||
|
|||||||
@ -158,7 +158,7 @@ DcSctpTransport::DcSctpTransport(
|
|||||||
}) {
|
}) {
|
||||||
RTC_DCHECK_RUN_ON(network_thread_);
|
RTC_DCHECK_RUN_ON(network_thread_);
|
||||||
static std::atomic<int> instance_count = 0;
|
static std::atomic<int> instance_count = 0;
|
||||||
rtc::StringBuilder sb;
|
StringBuilder sb;
|
||||||
sb << debug_name_ << instance_count++;
|
sb << debug_name_ << instance_count++;
|
||||||
debug_name_ = sb.Release();
|
debug_name_ = sb.Release();
|
||||||
ConnectTransportSignals();
|
ConnectTransportSignals();
|
||||||
|
|||||||
@ -31,7 +31,7 @@ TEST(BufferLevelFilter, ConvergenceTest) {
|
|||||||
for (int value = 100; value <= 200; value += 10) {
|
for (int value = 100; value <= 200; value += 10) {
|
||||||
filter.Reset();
|
filter.Reset();
|
||||||
filter.SetTargetBufferLevel(20); // Makes filter coefficient 251/256.
|
filter.SetTargetBufferLevel(20); // Makes filter coefficient 251/256.
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "times = " << times << ", value = " << value;
|
ss << "times = " << times << ", value = " << value;
|
||||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||||
for (int i = 0; i < times; ++i) {
|
for (int i = 0; i < times; ++i) {
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class DtmfToneGeneratorTest : public ::testing::Test {
|
|||||||
AudioMultiVector signal(channels);
|
AudioMultiVector signal(channels);
|
||||||
|
|
||||||
for (int event = 0; event <= 15; ++event) {
|
for (int event = 0; event <= 15; ++event) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Checking event " << event << " at sample rate " << fs_hz;
|
ss << "Checking event " << event << " at sample rate " << fs_hz;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
const int kAttenuation = 0;
|
const int kAttenuation = 0;
|
||||||
@ -73,7 +73,7 @@ class DtmfToneGeneratorTest : public ::testing::Test {
|
|||||||
EXPECT_EQ(kNumSamples, tone_gen_.Generate(kNumSamples, &ref_signal));
|
EXPECT_EQ(kNumSamples, tone_gen_.Generate(kNumSamples, &ref_signal));
|
||||||
// Test every 5 steps (to save time).
|
// Test every 5 steps (to save time).
|
||||||
for (int attenuation = 1; attenuation <= 63; attenuation += 5) {
|
for (int attenuation = 1; attenuation <= 63; attenuation += 5) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Checking event " << event << " at sample rate " << fs_hz;
|
ss << "Checking event " << event << " at sample rate " << fs_hz;
|
||||||
ss << "; attenuation " << attenuation;
|
ss << "; attenuation " << attenuation;
|
||||||
SCOPED_TRACE(ss.str());
|
SCOPED_TRACE(ss.str());
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class NetEqStereoTest : public ::testing::TestWithParam<TestParameters> {
|
|||||||
EXPECT_EQ(num_channels_, output_multi_channel_.num_channels_);
|
EXPECT_EQ(num_channels_, output_multi_channel_.num_channels_);
|
||||||
EXPECT_EQ(output_size_samples_,
|
EXPECT_EQ(output_size_samples_,
|
||||||
output_multi_channel_.samples_per_channel_);
|
output_multi_channel_.samples_per_channel_);
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Lap number " << k << ".";
|
ss << "Lap number " << k << ".";
|
||||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||||
// Compare mono and multi-channel.
|
// Compare mono and multi-channel.
|
||||||
|
|||||||
@ -261,7 +261,7 @@ TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
|
|||||||
static const int kExpectedOutputLength = 160; // 10 ms at 16 kHz sample rate.
|
static const int kExpectedOutputLength = 160; // 10 ms at 16 kHz sample rate.
|
||||||
const int16_t* const_out_frame_data = out_frame_.data();
|
const int16_t* const_out_frame_data = out_frame_.data();
|
||||||
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "i = " << i;
|
ss << "i = " << i;
|
||||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||||
EXPECT_EQ(0, const_out_frame_data[i]);
|
EXPECT_EQ(0, const_out_frame_data[i]);
|
||||||
@ -283,7 +283,7 @@ TEST_F(NetEqDecodingTest, GetAudioBeforeInsertPacket) {
|
|||||||
kInitSampleRateHz / 100; // 10 ms at initial sample rate.
|
kInitSampleRateHz / 100; // 10 ms at initial sample rate.
|
||||||
const int16_t* const_out_frame_data = out_frame_.data();
|
const int16_t* const_out_frame_data = out_frame_.data();
|
||||||
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "i = " << i;
|
ss << "i = " << i;
|
||||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||||
EXPECT_EQ(0, const_out_frame_data[i]);
|
EXPECT_EQ(0, const_out_frame_data[i]);
|
||||||
@ -799,7 +799,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
|||||||
AudioFrame out_frame1, out_frame2;
|
AudioFrame out_frame1, out_frame2;
|
||||||
bool muted;
|
bool muted;
|
||||||
for (int i = 0; i < 1000; ++i) {
|
for (int i = 0; i < 1000; ++i) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "i = " << i;
|
ss << "i = " << i;
|
||||||
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
||||||
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
||||||
@ -825,7 +825,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
|||||||
int counter = 0;
|
int counter = 0;
|
||||||
while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {
|
while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {
|
||||||
ASSERT_LT(counter++, 1000) << "Test timed out";
|
ASSERT_LT(counter++, 1000) << "Test timed out";
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "counter = " << counter;
|
ss << "counter = " << counter;
|
||||||
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
||||||
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
||||||
|
|||||||
@ -154,7 +154,7 @@ void NetEqDecodingTest::DecodeAndCompare(
|
|||||||
uint64_t last_concealed_samples = 0;
|
uint64_t last_concealed_samples = 0;
|
||||||
uint64_t last_total_samples_received = 0;
|
uint64_t last_total_samples_received = 0;
|
||||||
while (packet_) {
|
while (packet_) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Lap number " << i++ << " in DecodeAndCompare while loop";
|
ss << "Lap number " << i++ << " in DecodeAndCompare while loop";
|
||||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||||
ASSERT_NO_FATAL_FAILURE(Process());
|
ASSERT_NO_FATAL_FAILURE(Process());
|
||||||
|
|||||||
@ -19,7 +19,7 @@ NetEqInput::PacketData::PacketData() = default;
|
|||||||
NetEqInput::PacketData::~PacketData() = default;
|
NetEqInput::PacketData::~PacketData() = default;
|
||||||
|
|
||||||
std::string NetEqInput::PacketData::ToString() const {
|
std::string NetEqInput::PacketData::ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "{"
|
ss << "{"
|
||||||
"time_ms: "
|
"time_ms: "
|
||||||
<< static_cast<int64_t>(time_ms)
|
<< static_cast<int64_t>(time_ms)
|
||||||
|
|||||||
@ -285,13 +285,13 @@ std::optional<std::string> CreateOptionalOutputFileName(
|
|||||||
}
|
}
|
||||||
if (!basename.empty()) {
|
if (!basename.empty()) {
|
||||||
// Override the automatic assignment.
|
// Override the automatic assignment.
|
||||||
rtc::StringBuilder sb(basename);
|
webrtc::StringBuilder sb(basename);
|
||||||
sb << suffix;
|
sb << suffix;
|
||||||
return sb.str();
|
return sb.str();
|
||||||
}
|
}
|
||||||
if (!output_audio_filename.empty()) {
|
if (!output_audio_filename.empty()) {
|
||||||
// Automatically assign name.
|
// Automatically assign name.
|
||||||
rtc::StringBuilder sb(output_audio_filename);
|
webrtc::StringBuilder sb(output_audio_filename);
|
||||||
sb << suffix;
|
sb << suffix;
|
||||||
return sb.str();
|
return sb.str();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace test {
|
|||||||
|
|
||||||
std::string NetEqStatsGetter::ConcealmentEvent::ToString() const {
|
std::string NetEqStatsGetter::ConcealmentEvent::ToString() const {
|
||||||
char ss_buf[256];
|
char ss_buf[256];
|
||||||
rtc::SimpleStringBuilder ss(ss_buf);
|
SimpleStringBuilder ss(ss_buf);
|
||||||
ss << "ConcealmentEvent duration_ms:" << duration_ms
|
ss << "ConcealmentEvent duration_ms:" << duration_ms
|
||||||
<< " event_number:" << concealment_event_number
|
<< " event_number:" << concealment_event_number
|
||||||
<< " time_from_previous_event_end_ms:" << time_from_previous_event_end_ms;
|
<< " time_from_previous_event_end_ms:" << time_from_previous_event_end_ms;
|
||||||
|
|||||||
@ -219,7 +219,7 @@ Channel::Channel(int16_t chID)
|
|||||||
}
|
}
|
||||||
if (chID >= 0) {
|
if (chID >= 0) {
|
||||||
_saveBitStream = true;
|
_saveBitStream = true;
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss.AppendFormat("bitStream_%d.dat", chID);
|
ss.AppendFormat("bitStream_%d.dat", chID);
|
||||||
_bitStreamFile = fopen(ss.str().c_str(), "wb");
|
_bitStreamFile = fopen(ss.str().c_str(), "wb");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -136,7 +136,7 @@ void Receiver::Setup(NetEq* neteq,
|
|||||||
|
|
||||||
int playSampFreq;
|
int playSampFreq;
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
rtc::StringBuilder file_stream;
|
StringBuilder file_stream;
|
||||||
file_stream << webrtc::test::OutputPath() << out_file_name << file_num
|
file_stream << webrtc::test::OutputPath() << out_file_name << file_num
|
||||||
<< ".pcm";
|
<< ".pcm";
|
||||||
file_name = file_stream.str();
|
file_name = file_stream.str();
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void ReceiverWithPacketLoss::Setup(NetEq* neteq,
|
|||||||
loss_rate_ = loss_rate;
|
loss_rate_ = loss_rate;
|
||||||
burst_length_ = burst_length;
|
burst_length_ = burst_length;
|
||||||
burst_lost_counter_ = burst_length_; // To prevent first packet gets lost.
|
burst_lost_counter_ = burst_length_; // To prevent first packet gets lost.
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << out_file_name << "_" << loss_rate_ << "_" << burst_length_ << "_";
|
ss << out_file_name << "_" << loss_rate_ << "_" << burst_length_ << "_";
|
||||||
Receiver::Setup(neteq, rtpStream, ss.str(), channels, file_num);
|
Receiver::Setup(neteq, rtpStream, ss.str(), channels, file_num);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -373,7 +373,7 @@ void TestAllCodecs::Run(TestPack* channel) {
|
|||||||
|
|
||||||
void TestAllCodecs::OpenOutFile(int test_number) {
|
void TestAllCodecs::OpenOutFile(int test_number) {
|
||||||
std::string filename = webrtc::test::OutputPath();
|
std::string filename = webrtc::test::OutputPath();
|
||||||
rtc::StringBuilder test_number_str;
|
StringBuilder test_number_str;
|
||||||
test_number_str << test_number;
|
test_number_str << test_number;
|
||||||
filename += "testallcodecs_out_";
|
filename += "testallcodecs_out_";
|
||||||
filename += test_number_str.str();
|
filename += test_number_str.str();
|
||||||
|
|||||||
@ -192,7 +192,7 @@ void TestRedFec::Run() {
|
|||||||
|
|
||||||
void TestRedFec::OpenOutFile(int16_t test_number) {
|
void TestRedFec::OpenOutFile(int16_t test_number) {
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
rtc::StringBuilder file_stream;
|
StringBuilder file_stream;
|
||||||
file_stream << webrtc::test::OutputPath();
|
file_stream << webrtc::test::OutputPath();
|
||||||
file_stream << "TestRedFec_outFile_";
|
file_stream << "TestRedFec_outFile_";
|
||||||
file_stream << test_number << ".pcm";
|
file_stream << test_number << ".pcm";
|
||||||
|
|||||||
@ -603,7 +603,7 @@ void TestStereo::Run(TestPackStereo* channel,
|
|||||||
|
|
||||||
void TestStereo::OpenOutFile(int16_t test_number) {
|
void TestStereo::OpenOutFile(int16_t test_number) {
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
rtc::StringBuilder file_stream;
|
StringBuilder file_stream;
|
||||||
file_stream << webrtc::test::OutputPath() << "teststereo_out_" << test_number
|
file_stream << webrtc::test::OutputPath() << "teststereo_out_" << test_number
|
||||||
<< ".pcm";
|
<< ".pcm";
|
||||||
file_name = file_stream.str();
|
file_name = file_stream.str();
|
||||||
|
|||||||
@ -205,7 +205,7 @@ void TestWebRtcVadDtx::Test(bool new_outfile, bool expect_dtx_enabled) {
|
|||||||
if (new_outfile) {
|
if (new_outfile) {
|
||||||
output_file_num_++;
|
output_file_num_++;
|
||||||
}
|
}
|
||||||
rtc::StringBuilder out_filename;
|
StringBuilder out_filename;
|
||||||
out_filename << webrtc::test::OutputPath() << "testWebRtcVadDtx_outFile_"
|
out_filename << webrtc::test::OutputPath() << "testWebRtcVadDtx_outFile_"
|
||||||
<< output_file_num_ << ".pcm";
|
<< output_file_num_ << ".pcm";
|
||||||
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), 32000, 1,
|
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), 32000, 1,
|
||||||
|
|||||||
@ -61,7 +61,7 @@ void ResetFrame(AudioFrame* frame) {
|
|||||||
std::string ProduceDebugText(int sample_rate_hz,
|
std::string ProduceDebugText(int sample_rate_hz,
|
||||||
int number_of_channels,
|
int number_of_channels,
|
||||||
int number_of_sources) {
|
int number_of_sources) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz << " ";
|
ss << "Sample rate: " << sample_rate_hz << " ";
|
||||||
ss << "Number of channels: " << number_of_channels << " ";
|
ss << "Number of channels: " << number_of_channels << " ";
|
||||||
ss << "Number of sources: " << number_of_sources;
|
ss << "Number of sources: " << number_of_sources;
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class FilePlayingSource : public AudioMixer::Source {
|
|||||||
bool FileHasEnded() const { return file_has_ended_; }
|
bool FileHasEnded() const { return file_has_ended_; }
|
||||||
|
|
||||||
std::string ToString() const {
|
std::string ToString() const {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "{rate: " << sample_rate_hz_ << ", channels: " << number_of_channels_
|
ss << "{rate: " << sample_rate_hz_ << ", channels: " << number_of_channels_
|
||||||
<< ", samples_tot: " << wav_reader_->num_samples() << "}";
|
<< ", samples_tot: " << wav_reader_->num_samples() << "}";
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -48,7 +48,7 @@ struct FrameCombinerConfig {
|
|||||||
std::string ProduceDebugText(int sample_rate_hz,
|
std::string ProduceDebugText(int sample_rate_hz,
|
||||||
int number_of_channels,
|
int number_of_channels,
|
||||||
int number_of_sources) {
|
int number_of_sources) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz << " ,";
|
ss << "Sample rate: " << sample_rate_hz << " ,";
|
||||||
ss << "number of channels: " << number_of_channels << " ,";
|
ss << "number of channels: " << number_of_channels << " ,";
|
||||||
ss << "number of sources: " << number_of_sources;
|
ss << "number of sources: " << number_of_sources;
|
||||||
@ -56,7 +56,7 @@ std::string ProduceDebugText(int sample_rate_hz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(const FrameCombinerConfig& config) {
|
std::string ProduceDebugText(const FrameCombinerConfig& config) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << config.sample_rate_hz << " ,";
|
ss << "Sample rate: " << config.sample_rate_hz << " ,";
|
||||||
ss << "number of channels: " << config.number_of_channels << " ,";
|
ss << "number of channels: " << config.number_of_channels << " ,";
|
||||||
ss << "limiter active: " << (config.use_limiter ? "on" : "off") << " ,";
|
ss << "limiter active: " << (config.use_limiter ? "on" : "off") << " ,";
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace aec3 {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t num_render_channels, size_t delay) {
|
std::string ProduceDebugText(size_t num_render_channels, size_t delay) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "delay: " << delay << ", ";
|
ss << "delay: " << delay << ", ";
|
||||||
ss << "num_render_channels:" << num_render_channels;
|
ss << "num_render_channels:" << num_render_channels;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -28,7 +28,7 @@ std::string ProduceDebugText(bool initial_silence,
|
|||||||
bool prefer_first_two_channels,
|
bool prefer_first_two_channels,
|
||||||
int num_channels,
|
int num_channels,
|
||||||
int strongest_ch) {
|
int strongest_ch) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << ", Initial silence: " << initial_silence;
|
ss << ", Initial silence: " << initial_silence;
|
||||||
ss << ", Huge activity threshold: " << huge_activity_threshold;
|
ss << ", Huge activity threshold: " << huge_activity_threshold;
|
||||||
ss << ", Prefer first two channels: " << prefer_first_two_channels;
|
ss << ", Prefer first two channels: " << prefer_first_two_channels;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ void PopulateInputFrame(size_t frame_length,
|
|||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz, size_t delay) {
|
std::string ProduceDebugText(int sample_rate_hz, size_t delay) {
|
||||||
char log_stream_buffer[8 * 1024];
|
char log_stream_buffer[8 * 1024];
|
||||||
rtc::SimpleStringBuilder ss(log_stream_buffer);
|
SimpleStringBuilder ss(log_stream_buffer);
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
ss << ", Delay: " << delay;
|
ss << ", Delay: " << delay;
|
||||||
return ss.str();
|
return ss.str();
|
||||||
|
|||||||
@ -188,7 +188,7 @@ void RunWronglyInsertOrderTest(int sample_rate_hz,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
|
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
ss << ", number of channels: " << num_channels;
|
ss << ", number of channels: " << num_channels;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -104,7 +104,7 @@ void RunCaptureNumBandsVerificationTest(const Environment& env,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,13 +118,13 @@ void RunFilterUpdateTest(int num_blocks_to_process,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(int filter_length_blocks) {
|
std::string ProduceDebugText(int filter_length_blocks) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Length: " << filter_length_blocks;
|
ss << "Length: " << filter_length_blocks;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Delay: " << delay << ", ";
|
ss << "Delay: " << delay << ", ";
|
||||||
ss << ProduceDebugText(filter_length_blocks);
|
ss << ProduceDebugText(filter_length_blocks);
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -29,7 +29,7 @@ namespace webrtc {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,13 +176,13 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz, int variant) {
|
std::string ProduceDebugText(int sample_rate_hz, int variant) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz << ", variant: " << variant;
|
ss << "Sample rate: " << sample_rate_hz << ", variant: " << variant;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ namespace webrtc {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Delay: " << delay;
|
ss << "Delay: " << delay;
|
||||||
ss << ", Down sampling factor: " << down_sampling_factor;
|
ss << ", Down sampling factor: " << down_sampling_factor;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -29,13 +29,13 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz, int delay) {
|
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;
|
ss << ", Delay: " << delay;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace webrtc {
|
|||||||
namespace {
|
namespace {
|
||||||
std::string ProduceDebugText(size_t num_render_channels,
|
std::string ProduceDebugText(size_t num_render_channels,
|
||||||
size_t num_capture_channels) {
|
size_t num_capture_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Render channels: " << num_render_channels;
|
ss << "Render channels: " << num_render_channels;
|
||||||
ss << ", Capture channels: " << num_capture_channels;
|
ss << ", Capture channels: " << num_capture_channels;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -260,7 +260,7 @@ void RunWrongExtractOrderTest(int sample_rate_hz,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
|
std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
ss << ", number of channels: " << num_channels;
|
ss << ", number of channels: " << num_channels;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -35,7 +35,7 @@ namespace aec3 {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Delay: " << delay;
|
ss << "Delay: " << delay;
|
||||||
ss << ", Down sampling factor: " << down_sampling_factor;
|
ss << ", Down sampling factor: " << down_sampling_factor;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -219,13 +219,13 @@ void RunFilterUpdateTest(const Environment& env,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(int filter_length_blocks) {
|
std::string ProduceDebugText(int filter_length_blocks) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Length: " << filter_length_blocks;
|
ss << "Length: " << filter_length_blocks;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Delay: " << delay << ", ";
|
ss << "Delay: " << delay << ", ";
|
||||||
ss << ProduceDebugText(filter_length_blocks);
|
ss << ProduceDebugText(filter_length_blocks);
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace webrtc {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ namespace webrtc {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string ProduceDebugText(int sample_rate_hz) {
|
std::string ProduceDebugText(int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz;
|
ss << "Sample rate: " << sample_rate_hz;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ std::string ProduceDebugText(int sample_rate_hz,
|
|||||||
size_t delay,
|
size_t delay,
|
||||||
size_t num_render_channels,
|
size_t num_render_channels,
|
||||||
size_t num_capture_channels) {
|
size_t num_capture_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << ProduceDebugText(sample_rate_hz) << ", Delay: " << delay
|
ss << ProduceDebugText(sample_rate_hz) << ", Delay: " << delay
|
||||||
<< ", Num render channels: " << num_render_channels
|
<< ", Num render channels: " << num_render_channels
|
||||||
<< ", Num capture channels: " << num_capture_channels;
|
<< ", Num capture channels: " << num_capture_channels;
|
||||||
|
|||||||
@ -107,7 +107,7 @@ void RunNarrowBandDetectionTest(size_t num_channels) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ProduceDebugText(size_t num_channels) {
|
std::string ProduceDebugText(size_t num_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "number of channels: " << num_channels;
|
ss << "number of channels: " << num_channels;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -179,7 +179,7 @@ std::string ProduceDebugText(size_t num_render_channels,
|
|||||||
size_t num_capture_channels,
|
size_t num_capture_channels,
|
||||||
size_t delay,
|
size_t delay,
|
||||||
int filter_length_blocks) {
|
int filter_length_blocks) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "delay: " << delay << ", ";
|
ss << "delay: " << delay << ", ";
|
||||||
ss << "filter_length_blocks:" << filter_length_blocks << ", ";
|
ss << "filter_length_blocks:" << filter_length_blocks << ", ";
|
||||||
ss << "num_render_channels:" << num_render_channels << ", ";
|
ss << "num_render_channels:" << num_render_channels << ", ";
|
||||||
|
|||||||
@ -152,7 +152,7 @@ constexpr char kMinMicLevelFieldTrial[] =
|
|||||||
|
|
||||||
std::string GetAgcMinMicLevelExperimentFieldTrial(const std::string& value) {
|
std::string GetAgcMinMicLevelExperimentFieldTrial(const std::string& value) {
|
||||||
char field_trial_buffer[64];
|
char field_trial_buffer[64];
|
||||||
rtc::SimpleStringBuilder builder(field_trial_buffer);
|
SimpleStringBuilder builder(field_trial_buffer);
|
||||||
builder << kMinMicLevelFieldTrial << "/" << value << "/";
|
builder << kMinMicLevelFieldTrial << "/" << value << "/";
|
||||||
return builder.str();
|
return builder.str();
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ std::string GetAgcMinMicLevelExperimentFieldTrialEnabled(
|
|||||||
RTC_DCHECK_GE(enabled_value, 0);
|
RTC_DCHECK_GE(enabled_value, 0);
|
||||||
RTC_DCHECK_LE(enabled_value, 255);
|
RTC_DCHECK_LE(enabled_value, 255);
|
||||||
char field_trial_buffer[64];
|
char field_trial_buffer[64];
|
||||||
rtc::SimpleStringBuilder builder(field_trial_buffer);
|
SimpleStringBuilder builder(field_trial_buffer);
|
||||||
builder << kMinMicLevelFieldTrial << "/Enabled-" << enabled_value << suffix
|
builder << kMinMicLevelFieldTrial << "/Enabled-" << enabled_value << suffix
|
||||||
<< "/";
|
<< "/";
|
||||||
return builder.str();
|
return builder.str();
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
std::string AvailableCpuFeatures::ToString() const {
|
std::string AvailableCpuFeatures::ToString() const {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
rtc::SimpleStringBuilder builder(buf);
|
SimpleStringBuilder builder(buf);
|
||||||
bool first = true;
|
bool first = true;
|
||||||
if (sse2) {
|
if (sse2) {
|
||||||
builder << (first ? "SSE2" : "_SSE2");
|
builder << (first ? "SSE2" : "_SSE2");
|
||||||
|
|||||||
@ -52,7 +52,7 @@ constexpr absl::string_view MetricNamePrefix(
|
|||||||
|
|
||||||
metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
|
metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
rtc::SimpleStringBuilder builder(buffer);
|
SimpleStringBuilder builder(buffer);
|
||||||
builder << MetricNamePrefix(input_volume_type) << "OnChange";
|
builder << MetricNamePrefix(input_volume_type) << "OnChange";
|
||||||
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
||||||
/*min=*/1,
|
/*min=*/1,
|
||||||
@ -63,7 +63,7 @@ metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
|
|||||||
metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
|
metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
|
||||||
absl::string_view name) {
|
absl::string_view name) {
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
rtc::SimpleStringBuilder builder(buffer);
|
SimpleStringBuilder builder(buffer);
|
||||||
builder << MetricNamePrefix(input_volume_type) << name;
|
builder << MetricNamePrefix(input_volume_type) << name;
|
||||||
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
||||||
/*min=*/1,
|
/*min=*/1,
|
||||||
@ -74,7 +74,7 @@ metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
|
|||||||
metrics::Histogram* CreateAverageHistogram(InputVolumeType input_volume_type,
|
metrics::Histogram* CreateAverageHistogram(InputVolumeType input_volume_type,
|
||||||
absl::string_view name) {
|
absl::string_view name) {
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
rtc::SimpleStringBuilder builder(buffer);
|
SimpleStringBuilder builder(buffer);
|
||||||
builder << MetricNamePrefix(input_volume_type) << name;
|
builder << MetricNamePrefix(input_volume_type) << name;
|
||||||
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
return metrics::HistogramFactoryGetCountsLinear(/*name=*/builder.str(),
|
||||||
/*min=*/1,
|
/*min=*/1,
|
||||||
|
|||||||
@ -32,37 +32,33 @@ class InputVolumeStatsReporterTest
|
|||||||
protected:
|
protected:
|
||||||
InputVolumeType InputVolumeType() const { return GetParam(); }
|
InputVolumeType InputVolumeType() const { return GetParam(); }
|
||||||
std::string VolumeLabel() const {
|
std::string VolumeLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "OnChange")
|
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "OnChange")
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string DecreaseRateLabel() const {
|
std::string DecreaseRateLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "DecreaseRate")
|
||||||
<< VolumeTypeLabel() << "DecreaseRate")
|
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string DecreaseAverageLabel() const {
|
std::string DecreaseAverageLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix)
|
||||||
<< VolumeTypeLabel() << "DecreaseAverage")
|
<< VolumeTypeLabel() << "DecreaseAverage")
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string IncreaseRateLabel() const {
|
std::string IncreaseRateLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "IncreaseRate")
|
||||||
<< VolumeTypeLabel() << "IncreaseRate")
|
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string IncreaseAverageLabel() const {
|
std::string IncreaseAverageLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix)
|
||||||
<< VolumeTypeLabel() << "IncreaseAverage")
|
<< VolumeTypeLabel() << "IncreaseAverage")
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string UpdateRateLabel() const {
|
std::string UpdateRateLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "UpdateRate")
|
||||||
<< VolumeTypeLabel() << "UpdateRate")
|
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
std::string UpdateAverageLabel() const {
|
std::string UpdateAverageLabel() const {
|
||||||
return (rtc::StringBuilder(kLabelPrefix)
|
return (StringBuilder(kLabelPrefix) << VolumeTypeLabel() << "UpdateAverage")
|
||||||
<< VolumeTypeLabel() << "UpdateAverage")
|
|
||||||
.str();
|
.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,16 +34,16 @@ InterpolatedGainCurve::InterpolatedGainCurve(
|
|||||||
ApmDataDumper* apm_data_dumper,
|
ApmDataDumper* apm_data_dumper,
|
||||||
absl::string_view histogram_name_prefix)
|
absl::string_view histogram_name_prefix)
|
||||||
: region_logger_(
|
: region_logger_(
|
||||||
(rtc::StringBuilder("WebRTC.Audio.")
|
(StringBuilder("WebRTC.Audio.")
|
||||||
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Identity")
|
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Identity")
|
||||||
.str(),
|
.str(),
|
||||||
(rtc::StringBuilder("WebRTC.Audio.")
|
(StringBuilder("WebRTC.Audio.")
|
||||||
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Knee")
|
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Knee")
|
||||||
.str(),
|
.str(),
|
||||||
(rtc::StringBuilder("WebRTC.Audio.")
|
(StringBuilder("WebRTC.Audio.")
|
||||||
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Limiter")
|
<< histogram_name_prefix << ".FixedDigitalGainCurveRegion.Limiter")
|
||||||
.str(),
|
.str(),
|
||||||
(rtc::StringBuilder("WebRTC.Audio.")
|
(StringBuilder("WebRTC.Audio.")
|
||||||
<< histogram_name_prefix
|
<< histogram_name_prefix
|
||||||
<< ".FixedDigitalGainCurveRegion.Saturation")
|
<< ".FixedDigitalGainCurveRegion.Saturation")
|
||||||
.str()),
|
.str()),
|
||||||
|
|||||||
@ -33,7 +33,7 @@ constexpr float kTestPitchStrengthHigh = 0.75f;
|
|||||||
template <class T>
|
template <class T>
|
||||||
std::string PrintTestIndexAndCpuFeatures(
|
std::string PrintTestIndexAndCpuFeatures(
|
||||||
const ::testing::TestParamInfo<T>& info) {
|
const ::testing::TestParamInfo<T>& info) {
|
||||||
rtc::StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder << info.index << "_" << info.param.cpu_features.ToString();
|
builder << info.index << "_" << info.param.cpu_features.ToString();
|
||||||
return builder.str();
|
return builder.str();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,7 +172,7 @@ void OpenFileAndWriteMessage(absl::string_view filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ResourceFilePath(absl::string_view name, int sample_rate_hz) {
|
std::string ResourceFilePath(absl::string_view name, int sample_rate_hz) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
// Resource files are all stereo.
|
// Resource files are all stereo.
|
||||||
ss << name << sample_rate_hz / 1000 << "_stereo";
|
ss << name << sample_rate_hz / 1000 << "_stereo";
|
||||||
return test::ResourcePath(ss.str(), "pcm");
|
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_input_channels,
|
||||||
size_t num_reverse_output_channels,
|
size_t num_reverse_output_channels,
|
||||||
StreamDirection file_direction) {
|
StreamDirection file_direction) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << name << "_i" << num_input_channels << "_" << input_rate / 1000 << "_ir"
|
ss << name << "_i" << num_input_channels << "_" << input_rate / 1000 << "_ir"
|
||||||
<< num_reverse_input_channels << "_" << reverse_input_rate / 1000 << "_";
|
<< num_reverse_input_channels << "_" << reverse_input_rate / 1000 << "_";
|
||||||
if (num_output_channels == 1) {
|
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 render_output_num_channels,
|
||||||
size_t capture_input_num_channels,
|
size_t capture_input_num_channels,
|
||||||
size_t capture_output_num_channels) {
|
size_t capture_output_num_channels) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rates:"
|
ss << "Sample rates:"
|
||||||
"\n Render input: "
|
"\n Render input: "
|
||||||
<< render_input_sample_rate_hz
|
<< render_input_sample_rate_hz
|
||||||
|
|||||||
@ -26,7 +26,7 @@ namespace {
|
|||||||
std::string ProduceDebugText(int sample_rate_hz,
|
std::string ProduceDebugText(int sample_rate_hz,
|
||||||
size_t num_channels,
|
size_t num_channels,
|
||||||
NsConfig::SuppressionLevel level) {
|
NsConfig::SuppressionLevel level) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "Sample rate: " << sample_rate_hz << ", num_channels: " << num_channels
|
ss << "Sample rate: " << sample_rate_hz << ", num_channels: " << num_channels
|
||||||
<< ", level: " << static_cast<int>(level);
|
<< ", level: " << static_cast<int>(level);
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace {
|
|||||||
|
|
||||||
std::string GetIndexedOutputWavFilename(absl::string_view wav_name,
|
std::string GetIndexedOutputWavFilename(absl::string_view wav_name,
|
||||||
int counter) {
|
int counter) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << wav_name.substr(0, wav_name.size() - 4) << "_" << counter
|
ss << wav_name.substr(0, wav_name.size() - 4) << "_" << counter
|
||||||
<< wav_name.substr(wav_name.size() - 4);
|
<< wav_name.substr(wav_name.size() - 4);
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
|
|||||||
@ -430,7 +430,7 @@ void Aec3ConfigFromJsonString(absl::string_view json_string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) {
|
std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) {
|
||||||
rtc::StringBuilder ost;
|
StringBuilder ost;
|
||||||
ost << "{";
|
ost << "{";
|
||||||
ost << "\"aec3\": {";
|
ost << "\"aec3\": {";
|
||||||
ost << "\"buffering\": {";
|
ost << "\"buffering\": {";
|
||||||
|
|||||||
@ -98,13 +98,13 @@ void CheckSameSign(const ChannelBuffer<float>* src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string FakeRecordingDeviceKindToString(int fake_rec_device_kind) {
|
std::string FakeRecordingDeviceKindToString(int fake_rec_device_kind) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "fake recording device: " << fake_rec_device_kind;
|
ss << "fake recording device: " << fake_rec_device_kind;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string AnalogLevelToString(int level) {
|
std::string AnalogLevelToString(int level) {
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "analog level: " << level;
|
ss << "analog level: " << level;
|
||||||
return ss.Release();
|
return ss.Release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class LossBasedBweV2Test : public ::testing::TestWithParam<bool> {
|
|||||||
protected:
|
protected:
|
||||||
std::string Config(bool enabled, bool valid) {
|
std::string Config(bool enabled, bool valid) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
rtc::SimpleStringBuilder config_string(buffer);
|
SimpleStringBuilder config_string(buffer);
|
||||||
|
|
||||||
config_string << "WebRTC-Bwe-LossBasedBweV2/";
|
config_string << "WebRTC-Bwe-LossBasedBweV2/";
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class LossBasedBweV2Test : public ::testing::TestWithParam<bool> {
|
|||||||
|
|
||||||
std::string ShortObservationConfig(std::string custom_config) {
|
std::string ShortObservationConfig(std::string custom_config) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
rtc::SimpleStringBuilder config_string(buffer);
|
SimpleStringBuilder config_string(buffer);
|
||||||
|
|
||||||
config_string << "WebRTC-Bwe-LossBasedBweV2/"
|
config_string << "WebRTC-Bwe-LossBasedBweV2/"
|
||||||
"MinNumObservations:1,ObservationWindowSize:2,";
|
"MinNumObservations:1,ObservationWindowSize:2,";
|
||||||
|
|||||||
@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
|
|||||||
toffset != 0)
|
toffset != 0)
|
||||||
++non_zero_ts_offsets;
|
++non_zero_ts_offsets;
|
||||||
if (arrival_time_only) {
|
if (arrival_time_only) {
|
||||||
rtc::StringBuilder ss;
|
webrtc::StringBuilder ss;
|
||||||
ss << static_cast<int64_t>(packet.time_ms) * 1000000;
|
ss << static_cast<int64_t>(packet.time_ms) * 1000000;
|
||||||
fprintf(stdout, "%s\n", ss.str().c_str());
|
fprintf(stdout, "%s\n", ss.str().c_str());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -75,7 +75,7 @@ TEST(RtcpPacketSdesTest, CreateWithTooManyChunks) {
|
|||||||
Sdes sdes;
|
Sdes sdes;
|
||||||
for (size_t i = 0; i < kMaxChunks; ++i) {
|
for (size_t i = 0; i < kMaxChunks; ++i) {
|
||||||
uint32_t ssrc = kSenderSsrc + i;
|
uint32_t ssrc = kSenderSsrc + i;
|
||||||
rtc::StringBuilder oss;
|
StringBuilder oss;
|
||||||
oss << "cname" << i;
|
oss << "cname" << i;
|
||||||
EXPECT_TRUE(sdes.AddCName(ssrc, oss.str()));
|
EXPECT_TRUE(sdes.AddCName(ssrc, oss.str()));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -693,7 +693,7 @@ bool RtpPacket::RemoveExtension(ExtensionType type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string RtpPacket::ToString() const {
|
std::string RtpPacket::ToString() const {
|
||||||
rtc::StringBuilder result;
|
StringBuilder result;
|
||||||
result << "{payload_type=" << payload_type_ << ", marker=" << marker_
|
result << "{payload_type=" << payload_type_ << ", marker=" << marker_
|
||||||
<< ", sequence_number=" << sequence_number_
|
<< ", sequence_number=" << sequence_number_
|
||||||
<< ", padding_size=" << padding_size_ << ", timestamp=" << timestamp_
|
<< ", padding_size=" << padding_size_ << ", timestamp=" << timestamp_
|
||||||
|
|||||||
@ -42,7 +42,7 @@ int GetLimitedNumSpatialLayers(int width, int height) {
|
|||||||
std::optional<ScalabilityMode> BuildScalabilityMode(int num_temporal_layers,
|
std::optional<ScalabilityMode> BuildScalabilityMode(int num_temporal_layers,
|
||||||
int num_spatial_layers) {
|
int num_spatial_layers) {
|
||||||
char name[20];
|
char name[20];
|
||||||
rtc::SimpleStringBuilder ss(name);
|
SimpleStringBuilder ss(name);
|
||||||
ss << "L" << num_spatial_layers << "T" << num_temporal_layers;
|
ss << "L" << num_spatial_layers << "T" << num_temporal_layers;
|
||||||
if (num_spatial_layers > 1) {
|
if (num_spatial_layers > 1) {
|
||||||
ss << "_KEY";
|
ss << "_KEY";
|
||||||
|
|||||||
@ -172,7 +172,7 @@ std::string TestName() {
|
|||||||
|
|
||||||
std::string TestOutputPath() {
|
std::string TestOutputPath() {
|
||||||
std::string output_path =
|
std::string output_path =
|
||||||
(rtc::StringBuilder() << OutputPath() << TestName()).str();
|
(StringBuilder() << OutputPath() << TestName()).str();
|
||||||
std::string output_dir = DirName(output_path);
|
std::string output_dir = DirName(output_path);
|
||||||
bool result = CreateDir(output_dir);
|
bool result = CreateDir(output_dir);
|
||||||
RTC_CHECK(result) << "Cannot create " << 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 sidx = 0; sidx < num_spatial_layers; ++sidx) {
|
||||||
for (int tidx = 0; tidx < num_temporal_layers; ++tidx) {
|
for (int tidx = 0; tidx < num_temporal_layers; ++tidx) {
|
||||||
std::string metric_name_prefix =
|
std::string metric_name_prefix =
|
||||||
(rtc::StringBuilder() << "s" << sidx << "t" << tidx << "_").str();
|
(StringBuilder() << "s" << sidx << "t" << tidx << "_").str();
|
||||||
stream = stats->Aggregate(
|
stream = stats->Aggregate(
|
||||||
{.layer_id = {{.spatial_idx = sidx, .temporal_idx = tidx}}});
|
{.layer_id = {{.spatial_idx = sidx, .temporal_idx = tidx}}});
|
||||||
stream.LogMetrics(GetGlobalMetricsLogger(), TestName(),
|
stream.LogMetrics(GetGlobalMetricsLogger(), TestName(),
|
||||||
@ -628,10 +628,9 @@ TEST(VideoCodecTest, DISABLED_EncodeDecode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (absl::GetFlag(FLAGS_write_csv)) {
|
if (absl::GetFlag(FLAGS_write_csv)) {
|
||||||
stats->LogMetrics(
|
stats->LogMetrics((StringBuilder() << TestOutputPath() << ".csv").str(),
|
||||||
(rtc::StringBuilder() << TestOutputPath() << ".csv").str(),
|
stats->Slice(Filter{}, /*merge=*/false), /*metadata=*/
|
||||||
stats->Slice(Filter{}, /*merge=*/false), /*metadata=*/
|
{{"test_name", TestName()}});
|
||||||
{{"test_name", TestName()}});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,7 @@ void ConfigureSvc(VideoCodec* codec_settings) {
|
|||||||
|
|
||||||
std::string CodecSpecificToString(const VideoCodec& codec) {
|
std::string CodecSpecificToString(const VideoCodec& codec) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder ss(buf);
|
SimpleStringBuilder ss(buf);
|
||||||
switch (codec.codecType) {
|
switch (codec.codecType) {
|
||||||
case kVideoCodecVP8:
|
case kVideoCodecVP8:
|
||||||
ss << "\nnum_temporal_layers: "
|
ss << "\nnum_temporal_layers: "
|
||||||
@ -309,7 +309,7 @@ size_t VideoCodecTestFixtureImpl::Config::NumberOfSimulcastStreams() const {
|
|||||||
|
|
||||||
std::string VideoCodecTestFixtureImpl::Config::ToString() const {
|
std::string VideoCodecTestFixtureImpl::Config::ToString() const {
|
||||||
std::string codec_type = CodecTypeToPayloadString(codec_settings.codecType);
|
std::string codec_type = CodecTypeToPayloadString(codec_settings.codecType);
|
||||||
rtc::StringBuilder ss;
|
StringBuilder ss;
|
||||||
ss << "test_name: " << test_name;
|
ss << "test_name: " << test_name;
|
||||||
ss << "\nfilename: " << filename;
|
ss << "\nfilename: " << filename;
|
||||||
ss << "\nnum_frames: " << num_frames;
|
ss << "\nnum_frames: " << num_frames;
|
||||||
@ -563,7 +563,7 @@ void VideoCodecTestFixtureImpl::AnalyzeAllFrames(
|
|||||||
|
|
||||||
// For perf dashboard.
|
// For perf dashboard.
|
||||||
char modifier_buf[256];
|
char modifier_buf[256];
|
||||||
rtc::SimpleStringBuilder modifier(modifier_buf);
|
SimpleStringBuilder modifier(modifier_buf);
|
||||||
modifier << "_r" << rate_profile_idx << "_sl" << layer_stat.spatial_idx;
|
modifier << "_r" << rate_profile_idx << "_sl" << layer_stat.spatial_idx;
|
||||||
|
|
||||||
auto PrintResultHelper = [&modifier, this](
|
auto PrintResultHelper = [&modifier, this](
|
||||||
|
|||||||
@ -128,7 +128,7 @@ std::unique_ptr<ScalableVideoController> CreateVp9ScalabilityStructure(
|
|||||||
}
|
}
|
||||||
|
|
||||||
char name[20];
|
char name[20];
|
||||||
rtc::SimpleStringBuilder ss(name);
|
SimpleStringBuilder ss(name);
|
||||||
if (codec.mode == VideoCodecMode::kScreensharing) {
|
if (codec.mode == VideoCodecMode::kScreensharing) {
|
||||||
// TODO(bugs.webrtc.org/11999): Compose names of the structures when they
|
// TODO(bugs.webrtc.org/11999): Compose names of the structures when they
|
||||||
// are implemented.
|
// are implemented.
|
||||||
|
|||||||
@ -45,7 +45,7 @@ using ::testing::TestWithParam;
|
|||||||
using ::testing::Values;
|
using ::testing::Values;
|
||||||
|
|
||||||
std::string FrameDependencyTemplateToString(const FrameDependencyTemplate& t) {
|
std::string FrameDependencyTemplateToString(const FrameDependencyTemplate& t) {
|
||||||
rtc::StringBuilder sb;
|
StringBuilder sb;
|
||||||
sb << "S" << t.spatial_id << "T" << t.temporal_id;
|
sb << "S" << t.spatial_id << "T" << t.temporal_id;
|
||||||
sb << ": dtis = ";
|
sb << ": dtis = ";
|
||||||
for (const auto dtis : t.decode_target_indications) {
|
for (const auto dtis : t.decode_target_indications) {
|
||||||
|
|||||||
@ -252,7 +252,7 @@ const Vp9InterpolationFilter kLiteralToType[4] = {
|
|||||||
|
|
||||||
std::string Vp9UncompressedHeader::ToString() const {
|
std::string Vp9UncompressedHeader::ToString() const {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
rtc::SimpleStringBuilder oss(buf);
|
SimpleStringBuilder oss(buf);
|
||||||
|
|
||||||
oss << "Vp9UncompressedHeader { " << "profile = " << profile;
|
oss << "Vp9UncompressedHeader { " << "profile = " << profile;
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace dcsctp {
|
|||||||
template <class Chunk>
|
template <class Chunk>
|
||||||
bool ParseAndPrint(uint8_t chunk_type,
|
bool ParseAndPrint(uint8_t chunk_type,
|
||||||
rtc::ArrayView<const uint8_t> data,
|
rtc::ArrayView<const uint8_t> data,
|
||||||
rtc::StringBuilder& sb) {
|
webrtc::StringBuilder& sb) {
|
||||||
if (chunk_type == Chunk::kType) {
|
if (chunk_type == Chunk::kType) {
|
||||||
std::optional<Chunk> c = Chunk::Parse(data);
|
std::optional<Chunk> c = Chunk::Parse(data);
|
||||||
if (c.has_value()) {
|
if (c.has_value()) {
|
||||||
@ -54,7 +54,7 @@ bool ParseAndPrint(uint8_t chunk_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string DebugConvertChunkToString(rtc::ArrayView<const uint8_t> data) {
|
std::string DebugConvertChunkToString(rtc::ArrayView<const uint8_t> data) {
|
||||||
rtc::StringBuilder sb;
|
webrtc::StringBuilder sb;
|
||||||
|
|
||||||
if (data.empty()) {
|
if (data.empty()) {
|
||||||
sb << "Failed to parse chunk due to empty data";
|
sb << "Failed to parse chunk due to empty data";
|
||||||
|
|||||||
@ -86,7 +86,7 @@ void DataChunk::SerializeTo(std::vector<uint8_t>& out) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string DataChunk::ToString() const {
|
std::string DataChunk::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
webrtc::StringBuilder sb;
|
||||||
sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
||||||
<< "::"
|
<< "::"
|
||||||
<< (*options().is_beginning && *options().is_end ? "complete"
|
<< (*options().is_beginning && *options().is_end ? "complete"
|
||||||
|
|||||||
@ -85,7 +85,7 @@ void ForwardTsnChunk::SerializeTo(std::vector<uint8_t>& out) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ForwardTsnChunk::ToString() const {
|
std::string ForwardTsnChunk::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
webrtc::StringBuilder sb;
|
||||||
sb << "FORWARD-TSN, new_cumulative_tsn=" << *new_cumulative_tsn();
|
sb << "FORWARD-TSN, new_cumulative_tsn=" << *new_cumulative_tsn();
|
||||||
for (const auto& skipped : skipped_streams()) {
|
for (const auto& skipped : skipped_streams()) {
|
||||||
sb << ", skip " << skipped.stream_id.value() << ":" << *skipped.ssn;
|
sb << ", skip " << skipped.stream_id.value() << ":" << *skipped.ssn;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ void IDataChunk::SerializeTo(std::vector<uint8_t>& out) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string IDataChunk::ToString() const {
|
std::string IDataChunk::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
webrtc::StringBuilder sb;
|
||||||
sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
||||||
<< "::"
|
<< "::"
|
||||||
<< (*options().is_beginning && *options().is_end ? "complete"
|
<< (*options().is_beginning && *options().is_end ? "complete"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user