mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Make fewer copies when using StringBuilder.
Replace calls to .str() which copies with .Release which moves in cases where that's safe. This CL was generated by this command: git grep -l 'StringBuilder' | xargs perl -i -0 -pe "s/(rtc::StringBuilder (\S+);.*?return )\\g2.str\(\)/\$1\$2.Release\(\)/sg" Bug: webrtc:8982 Change-Id: If4dadbeb039df010aaaa9e58da81c1971a84fe8f Reviewed-on: https://webrtc-review.googlesource.com/100307 Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24790}
This commit is contained in:
parent
4e5342f06a
commit
84df1c724e
46 changed files with 65 additions and 65 deletions
|
@ -78,7 +78,7 @@ std::string Candidate::ToStringInternal(bool sensitive) const {
|
|||
<< ":" << related_address_.ToString() << ":" << username_ << ":"
|
||||
<< password_ << ":" << network_id_ << ":" << network_cost_ << ":"
|
||||
<< generation_ << "]";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
uint32_t Candidate::GetPriority(uint32_t type_preference,
|
||||
|
|
|
@ -36,7 +36,7 @@ std::string VideoCodecTestStats::FrameStatistics::ToString() const {
|
|||
ss << " decode_time_us " << decode_time_us;
|
||||
ss << " rtp_timestamp " << rtp_timestamp;
|
||||
ss << " target_bitrate_kbps " << target_bitrate_kbps;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
VideoCodecTestStats::VideoStatistics::VideoStatistics() = default;
|
||||
|
@ -83,7 +83,7 @@ std::string VideoCodecTestStats::VideoStatistics::ToString(
|
|||
ss << "\n" << prefix << "num_key_frames: " << num_key_frames;
|
||||
ss << "\n" << prefix << "num_spatial_resizes: " << num_spatial_resizes;
|
||||
ss << "\n" << prefix << "max_nalu_size_bytes: " << max_nalu_size_bytes;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
VideoCodecTestStats::FrameStatistics::FrameStatistics(size_t frame_number,
|
||||
|
|
|
@ -88,7 +88,7 @@ static std::string VectorToString(const std::vector<T>& vals) {
|
|||
ost << vals[i].ToString();
|
||||
}
|
||||
ost << "]";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
// Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
|
||||
|
@ -120,7 +120,7 @@ struct VideoOptions {
|
|||
screencast_min_bitrate_kbps);
|
||||
ost << ToStringIfSet("is_screencast ", is_screencast);
|
||||
ost << "}";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
// Enable denoising? This flag comes from the getUserMedia
|
||||
|
@ -157,7 +157,7 @@ struct RtpHeaderExtension {
|
|||
ost << "uri: " << uri;
|
||||
ost << ", id: " << id;
|
||||
ost << "}";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
std::string uri;
|
||||
|
@ -626,7 +626,7 @@ struct RtpParameters {
|
|||
separator = ", ";
|
||||
}
|
||||
ost << "}";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -190,7 +190,7 @@ static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) {
|
|||
}
|
||||
}
|
||||
out << "}";
|
||||
return out.str();
|
||||
return out.Release();
|
||||
}
|
||||
|
||||
static bool ValidateCodecFormats(const std::vector<VideoCodec>& codecs) {
|
||||
|
@ -962,7 +962,7 @@ std::string WebRtcVideoChannel::CodecSettingsVectorToString(
|
|||
}
|
||||
}
|
||||
out << "}";
|
||||
return out.str();
|
||||
return out.Release();
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel::GetSendCodec(VideoCodec* codec) {
|
||||
|
|
|
@ -106,7 +106,7 @@ std::string ToString(const AudioCodec& codec) {
|
|||
ss << " }";
|
||||
}
|
||||
ss << " (" << codec.id << ")";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
bool IsCodec(const AudioCodec& codec, const char* ref_name) {
|
||||
|
|
|
@ -28,7 +28,7 @@ std::string NetEqInput::PacketData::ToString() const {
|
|||
<< "ts: " << header.timestamp << ", "
|
||||
<< "ssrc: " << header.ssrc << "}, "
|
||||
<< "payload bytes: " << payload.size() << "}";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
TimeLimitedNetEqInput::TimeLimitedNetEqInput(std::unique_ptr<NetEqInput> input,
|
||||
|
|
|
@ -54,7 +54,7 @@ std::string ProduceDebugText(int sample_rate_hz,
|
|||
ss << "Sample rate: " << sample_rate_hz << " ";
|
||||
ss << "Number of channels: " << number_of_channels << " ";
|
||||
ss << "Number of sources: " << number_of_sources;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
AudioFrame frame_for_mixing;
|
||||
|
|
|
@ -78,7 +78,7 @@ class FilePlayingSource : public AudioMixer::Source {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "{rate: " << sample_rate_hz_ << ", channels: " << number_of_channels_
|
||||
<< ", samples_tot: " << wav_reader_->num_samples() << "}";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -38,7 +38,7 @@ std::string ProduceDebugText(int sample_rate_hz,
|
|||
ss << "Sample rate: " << sample_rate_hz << " ,";
|
||||
ss << "number of channels: " << number_of_channels << " ,";
|
||||
ss << "number of sources: " << number_of_sources;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(const FrameCombinerConfig& config) {
|
||||
|
@ -47,7 +47,7 @@ std::string ProduceDebugText(const FrameCombinerConfig& config) {
|
|||
ss << "number of channels: " << config.number_of_channels << " ,";
|
||||
ss << "limiter active: " << (config.use_limiter ? "on" : "off") << " ,";
|
||||
ss << "wave frequency: " << config.wave_frequency << " ,";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
AudioFrame frame1;
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace {
|
|||
std::string ProduceDebugText(size_t delay) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << ", Delay: " << delay;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -161,7 +161,7 @@ void RunWronglyInsertOrderTest(int sample_rate_hz,
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -95,7 +95,7 @@ void RunCaptureNumBandsVerificationTest(int sample_rate_hz) {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
constexpr size_t kDownSamplingFactors[] = {2, 4, 8};
|
||||
|
|
|
@ -606,13 +606,13 @@ class EchoCanceller3Tester {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(int sample_rate_hz, int variant) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz << ", variant: " << variant;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -29,7 +29,7 @@ std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "Delay: " << delay;
|
||||
ss << ", Down sampling factor: " << down_sampling_factor;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -30,13 +30,13 @@ namespace {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(int sample_rate_hz, int delay) {
|
||||
rtc::StringBuilder ss(ProduceDebugText(sample_rate_hz));
|
||||
ss << ", Delay: " << delay;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -230,7 +230,7 @@ void RunWrongExtractOrderTest(int sample_rate_hz,
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -177,14 +177,14 @@ void RunFilterUpdateTest(int num_blocks_to_process,
|
|||
std::string ProduceDebugText(int filter_length_blocks) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Length: " << filter_length_blocks;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Delay: " << delay << ", ";
|
||||
ss << ProduceDebugText(filter_length_blocks);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -37,7 +37,7 @@ std::string ProduceDebugText(size_t delay, size_t down_sampling_factor) {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "Delay: " << delay;
|
||||
ss << ", Down sampling factor: " << down_sampling_factor;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
constexpr size_t kNumMatchedFilters = 10;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -31,13 +31,13 @@ namespace {
|
|||
std::string ProduceDebugText(int sample_rate_hz) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Sample rate: " << sample_rate_hz;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(int sample_rate_hz, size_t delay) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << ProduceDebugText(sample_rate_hz) << ", Delay: " << delay;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
constexpr size_t kDownSamplingFactors[] = {2, 4, 8};
|
||||
|
|
|
@ -118,14 +118,14 @@ void RunFilterUpdateTest(int num_blocks_to_process,
|
|||
std::string ProduceDebugText(int filter_length_blocks) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Length: " << filter_length_blocks;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Delay: " << delay << ", ";
|
||||
ss << ProduceDebugText(filter_length_blocks);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -106,7 +106,7 @@ std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "Delay: " << delay << ", ";
|
||||
ss << "Length: " << filter_length_blocks;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -73,7 +73,7 @@ std::string GainController2::ToString(
|
|||
rtc::StringBuilder ss;
|
||||
ss << "{enabled: " << (config.enabled ? "true" : "false") << ", "
|
||||
<< "fixed_gain_dB: " << config.fixed_gain_db << "}";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -644,7 +644,7 @@ std::string GetIndexedOutputWavFilename(const std::string& wav_name,
|
|||
rtc::StringBuilder ss;
|
||||
ss << wav_name.substr(0, wav_name.size() - 4) << "_" << counter
|
||||
<< wav_name.substr(wav_name.size() - 4);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
void WriteEchoLikelihoodGraphFileHeader(std::ofstream* output_file) {
|
||||
|
|
|
@ -100,13 +100,13 @@ void CheckSameSign(const ChannelBuffer<float>* src,
|
|||
std::string FakeRecordingDeviceKindToString(int fake_rec_device_kind) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "fake recording device: " << fake_rec_device_kind;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string AnalogLevelToString(int level) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "analog level: " << level;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -131,7 +131,7 @@ class Stats {
|
|||
rtc::StringBuilder ss;
|
||||
ss << (GetMean() >= 0 ? GetMean() : -1) << ", "
|
||||
<< (GetStdDev() >= 0 ? GetStdDev() : -1);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
void Log(const std::string& units) {
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace bwe {
|
|||
static std::string ToString(uint32_t v) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << v;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
Logging::ThreadState::ThreadState() = default;
|
||||
|
|
|
@ -279,7 +279,7 @@ std::string VideoCodecTestFixtureImpl::Config::ToString() const {
|
|||
}
|
||||
}
|
||||
ss << "\n";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string VideoCodecTestFixtureImpl::Config::CodecName() const {
|
||||
|
|
|
@ -186,7 +186,7 @@ class DtlsTransport : public DtlsTransportInternal {
|
|||
rtc::StringBuilder sb;
|
||||
sb << "DtlsTransport[" << transport_name_ << "|" << component_ << "|"
|
||||
<< RECEIVING_ABBREV[receiving()] << WRITABLE_ABBREV[writable()] << "]";
|
||||
return sb.str();
|
||||
return sb.Release();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -177,7 +177,7 @@ class P2PTransportChannel : public IceTransportInternal {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "Channel[" << transport_name_ << "|" << component_ << "|"
|
||||
<< RECEIVING_ABBREV[receiving_] << WRITABLE_ABBREV[writable_] << "]";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -909,7 +909,7 @@ std::string Port::ToString() const {
|
|||
ss << "Port[" << rtc::ToHex(reinterpret_cast<uintptr_t>(this)) << ":"
|
||||
<< content_name_ << ":" << component_ << ":" << generation_ << ":" << type_
|
||||
<< ":" << network_->ToString() << "]";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
// TODO(honghaiz): Make the network cost configurable from user setting.
|
||||
|
@ -1612,7 +1612,7 @@ std::string Connection::ToString() const {
|
|||
} else {
|
||||
ss << "-]";
|
||||
}
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string Connection::ToSensitiveString() const {
|
||||
|
|
|
@ -1240,7 +1240,7 @@ std::string TurnPort::ReconstructedServerUrl() {
|
|||
rtc::StringBuilder url;
|
||||
url << scheme << ":" << server_address_.address.ipaddr().ToString() << ":"
|
||||
<< server_address_.address.port() << "?transport=" << transport;
|
||||
return url.str();
|
||||
return url.Release();
|
||||
}
|
||||
|
||||
void TurnPort::TurnCustomizerMaybeModifyOutgoingStunMessage(
|
||||
|
|
|
@ -600,7 +600,7 @@ std::string TurnServerConnection::ToString() const {
|
|||
};
|
||||
rtc::StringBuilder ost;
|
||||
ost << src_.ToString() << "-" << dst_.ToString() << ":"<< kProtos[proto_];
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
TurnServerAllocation::TurnServerAllocation(TurnServer* server,
|
||||
|
@ -633,7 +633,7 @@ TurnServerAllocation::~TurnServerAllocation() {
|
|||
std::string TurnServerAllocation::ToString() const {
|
||||
rtc::StringBuilder ost;
|
||||
ost << "Alloc[" << conn_.ToString() << "]";
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
|
||||
void TurnServerAllocation::HandleTurnMessage(const TurnMessage* msg) {
|
||||
|
|
|
@ -3711,7 +3711,7 @@ void TestAudioCodecsAnswer(RtpTransceiverDirection offer_direction,
|
|||
first = false;
|
||||
}
|
||||
os << " }";
|
||||
return os.str();
|
||||
return os.Release();
|
||||
};
|
||||
|
||||
EXPECT_TRUE(acd->codecs() == target_codecs)
|
||||
|
|
|
@ -607,7 +607,7 @@ std::string GetSetDescriptionErrorMessage(cricket::ContentSource source,
|
|||
rtc::StringBuilder oss;
|
||||
oss << "Failed to set " << (source == cricket::CS_LOCAL ? "local" : "remote")
|
||||
<< " " << SdpTypeToString(type) << " sdp: " << error.message();
|
||||
return oss.str();
|
||||
return oss.Release();
|
||||
}
|
||||
|
||||
std::string GetStreamIdsString(rtc::ArrayView<const std::string> stream_ids) {
|
||||
|
@ -5847,7 +5847,7 @@ std::string PeerConnection::GetSessionErrorMsg() {
|
|||
rtc::StringBuilder desc;
|
||||
desc << kSessionError << SessionErrorToString(session_error()) << ". ";
|
||||
desc << kSessionErrorDesc << session_error_desc() << ".";
|
||||
return desc.str();
|
||||
return desc.Release();
|
||||
}
|
||||
|
||||
void PeerConnection::ReportSdpFormatReceived(
|
||||
|
|
|
@ -184,7 +184,7 @@ std::string MakeNetworkKey(const std::string& name,
|
|||
int prefix_length) {
|
||||
rtc::StringBuilder ost;
|
||||
ost << name << "%" << prefix.ToString() << "/" << prefix_length;
|
||||
return ost.str();
|
||||
return ost.Release();
|
||||
}
|
||||
// Test if the network name matches the type<number> pattern, e.g. eth0. The
|
||||
// matching is case-sensitive.
|
||||
|
@ -1075,7 +1075,7 @@ std::string Network::ToString() const {
|
|||
ss << "/" << AdapterTypeToString(underlying_type_for_vpn_);
|
||||
}
|
||||
ss << ":id=" << id_ << "]";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -136,7 +136,7 @@ std::string SSLIdentity::DerToPem(const std::string& pem_type,
|
|||
|
||||
result << "-----END " << pem_type << "-----\n";
|
||||
|
||||
return result.str();
|
||||
return result.Release();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -157,8 +157,8 @@ class StringBuilder {
|
|||
size_t size() const { return str_.size(); }
|
||||
|
||||
std::string Release() {
|
||||
std::string ret;
|
||||
std::swap(str_, ret);
|
||||
std::string ret = std::move(str_);
|
||||
str_.clear();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ class IntervalRange {
|
|||
std::string ToString() const {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "[" << min_ << "," << max_ << "]";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
bool operator==(const IntervalRange& o) const {
|
||||
|
|
|
@ -78,7 +78,7 @@ void SortPacketFeedbackVector(std::vector<PacketFeedback>* vec) {
|
|||
std::string SsrcToString(uint32_t ssrc) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "SSRC " << ssrc;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
// Checks whether an SSRC is contained in the list of desired SSRCs.
|
||||
|
@ -424,7 +424,7 @@ std::string GetCandidatePairLogDescriptionAsString(
|
|||
<< remote_candidate_type << ":"
|
||||
<< GetAddressFamilyAsString(config.remote_address_family) << "@"
|
||||
<< GetProtocolAsString(config.candidate_pair_protocol);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string GetDirectionAsString(PacketDirection direction) {
|
||||
|
|
|
@ -164,7 +164,7 @@ std::string NetworkInformation::ToString() const {
|
|||
ss << " " << address.ToString();
|
||||
}
|
||||
ss << "]";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
AndroidNetworkMonitor::AndroidNetworkMonitor(
|
||||
|
|
|
@ -218,7 +218,7 @@ TEST_F(StatsEndToEndTest, GetStats) {
|
|||
std::string CompoundKey(const char* name, uint32_t ssrc) {
|
||||
rtc::StringBuilder oss;
|
||||
oss << name << "_" << ssrc;
|
||||
return oss.str();
|
||||
return oss.Release();
|
||||
}
|
||||
|
||||
bool AllStatsFilled(const std::map<std::string, bool>& stats_map) {
|
||||
|
|
|
@ -36,7 +36,7 @@ std::string AggregatedStats::ToStringWithMultiplier(int multiplier) const {
|
|||
ss << "min:" << (min * multiplier) << ", ";
|
||||
ss << "avg:" << (average * multiplier) << ", ";
|
||||
ss << "max:" << (max * multiplier) << "}";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
// Class holding periodically computed metrics.
|
||||
|
|
|
@ -250,7 +250,7 @@ std::string VideoQualityTest::GenerateGraphTitle() const {
|
|||
if (params_.ss[0].num_spatial_layers > 1)
|
||||
ss << ", Layer #" << params_.ss[0].selected_sl;
|
||||
ss << ")";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
void VideoQualityTest::CheckParamsAndInjectionComponents() {
|
||||
|
|
|
@ -1267,7 +1267,7 @@ std::string VideoStreamEncoder::AdaptCounter::ToString() const {
|
|||
rtc::StringBuilder ss;
|
||||
ss << "Downgrade counts: fps: {" << ToString(fps_counters_);
|
||||
ss << "}, resolution: {" << ToString(resolution_counters_) << "}";
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
VideoStreamEncoderObserver::AdaptationSteps
|
||||
|
@ -1361,7 +1361,7 @@ std::string VideoStreamEncoder::AdaptCounter::ToString(
|
|||
for (size_t reason = 0; reason < kScaleReasonSize; ++reason) {
|
||||
ss << (reason ? " cpu" : "quality") << ":" << counters[reason];
|
||||
}
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
Loading…
Reference in a new issue