diff --git a/api/rtp_headers.h b/api/rtp_headers.h index c5496b64ea..e82d121040 100644 --- a/api/rtp_headers.h +++ b/api/rtp_headers.h @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/api/rtpparameters.cc b/api/rtpparameters.cc index cb9c1cf21c..ed48091b92 100644 --- a/api/rtpparameters.cc +++ b/api/rtpparameters.cc @@ -10,10 +10,10 @@ #include "api/rtpparameters.h" #include -#include #include #include "rtc_base/checks.h" +#include "rtc_base/strings/string_builder.h" namespace webrtc { @@ -69,14 +69,15 @@ RtpParameters::RtpParameters() {} RtpParameters::~RtpParameters() {} std::string RtpExtension::ToString() const { - std::stringstream ss; - ss << "{uri: " << uri; - ss << ", id: " << id; + char buf[256]; + rtc::SimpleStringBuilder sb(buf); + sb << "{uri: " << uri; + sb << ", id: " << id; if (encrypt) { - ss << ", encrypt"; + sb << ", encrypt"; } - ss << '}'; - return ss.str(); + sb << '}'; + return sb.str(); } const char RtpExtension::kAudioLevelUri[] = diff --git a/api/video/video_timing.cc b/api/video/video_timing.cc index 3ccbe4eae5..3ed9501f7d 100644 --- a/api/video/video_timing.cc +++ b/api/video/video_timing.cc @@ -10,7 +10,7 @@ #include "api/video/video_timing.h" -#include +#include "rtc_base/strings/string_builder.h" namespace webrtc { @@ -60,19 +60,22 @@ bool TimingFrameInfo::IsInvalid() const { } std::string TimingFrameInfo::ToString() const { - std::stringstream out; if (IsInvalid()) { - out << ""; - } else { - out << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms - << ',' << encode_finish_ms << ',' << packetization_finish_ms << ',' - << pacer_exit_ms << ',' << network_timestamp_ms << ',' - << network2_timestamp_ms << ',' << receive_start_ms << ',' - << receive_finish_ms << ',' << decode_start_ms << ',' - << decode_finish_ms << ',' << render_time_ms << ',' - << IsOutlier() << ',' << IsTimerTriggered(); + return ""; } - return out.str(); + + char buf[1024]; + rtc::SimpleStringBuilder sb(buf); + + sb << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms << ',' + << encode_finish_ms << ',' << packetization_finish_ms << ',' + << pacer_exit_ms << ',' << network_timestamp_ms << ',' + << network2_timestamp_ms << ',' << receive_start_ms << ',' + << receive_finish_ms << ',' << decode_start_ms << ',' << decode_finish_ms + << ',' << render_time_ms << ',' << IsOutlier() << ',' + << IsTimerTriggered(); + + return sb.str(); } } // namespace webrtc